ecf2d82159
* Synchronize the code of the rt mart branch to the master branch. * TTY device * Add lwP code from rt-smart * Add vnode in DFS, but DFS will be re-write for rt-smart * There are three libcpu for rt-smart: * arm/cortex-a, arm/aarch64 * riscv64 Co-authored-by: Rbb666 <zhangbingru@rt-thread.com> Co-authored-by: zhkag <zhkag@foxmail.com>
49 lines
1.0 KiB
C
49 lines
1.0 KiB
C
/*
|
|
* Copyright (c) 2006-2021, RT-Thread Development Team
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*
|
|
* Change Logs:
|
|
* Date Author Notes
|
|
* 2021-09-10 GuEe-GUI first version
|
|
*/
|
|
|
|
#ifndef __CPUPORT_H__
|
|
#define __CPUPORT_H__
|
|
|
|
#include <rtdef.h>
|
|
|
|
#define __WFI() __asm__ volatile ("wfi":::"memory")
|
|
#define __WFE() __asm__ volatile ("wfe":::"memory")
|
|
#define __SEV() __asm__ volatile ("sev")
|
|
#define __ISB() __asm__ volatile ("isb 0xf":::"memory")
|
|
#define __DSB() __asm__ volatile ("dsb 0xf":::"memory")
|
|
#define __DMB() __asm__ volatile ("dmb 0xf":::"memory")
|
|
|
|
#ifdef RT_USING_SMP
|
|
typedef union {
|
|
unsigned long slock;
|
|
struct __arch_tickets {
|
|
unsigned short owner;
|
|
unsigned short next;
|
|
} tickets;
|
|
} rt_hw_spinlock_t;
|
|
#endif
|
|
|
|
rt_inline void rt_hw_isb(void)
|
|
{
|
|
__asm__ volatile ("isb":::"memory");
|
|
}
|
|
|
|
rt_inline void rt_hw_dmb(void)
|
|
{
|
|
__asm__ volatile ("dmb sy":::"memory");
|
|
}
|
|
|
|
rt_inline void rt_hw_dsb(void)
|
|
{
|
|
__asm__ volatile ("dsb sy":::"memory");
|
|
}
|
|
|
|
#endif /* __CPUPORT_H__ */
|