2021-09-22 17:57:45 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2006-2021, RT-Thread Development Team
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*
|
|
|
|
* Change Logs:
|
|
|
|
* Date Author Notes
|
|
|
|
*/
|
|
|
|
|
2022-12-20 17:49:37 +08:00
|
|
|
#ifndef CPUPORT_H__
|
|
|
|
#define CPUPORT_H__
|
2021-09-22 17:57:45 +08:00
|
|
|
|
2022-12-20 17:49:37 +08:00
|
|
|
#include <armv8.h>
|
2023-01-09 10:08:55 +08:00
|
|
|
#include <rtdef.h>
|
2022-01-07 13:49:06 +08:00
|
|
|
|
2022-12-03 12:07:44 +08:00
|
|
|
#ifdef RT_USING_SMP
|
|
|
|
typedef union {
|
|
|
|
unsigned long slock;
|
|
|
|
struct __arch_tickets {
|
|
|
|
unsigned short owner;
|
|
|
|
unsigned short next;
|
|
|
|
} tickets;
|
|
|
|
} rt_hw_spinlock_t;
|
|
|
|
#endif
|
|
|
|
|
2021-09-22 17:57:45 +08:00
|
|
|
rt_inline void rt_hw_isb(void)
|
|
|
|
{
|
2023-02-20 13:48:00 +08:00
|
|
|
__asm__ volatile ("isb":::"memory");
|
2021-09-22 17:57:45 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
rt_inline void rt_hw_dmb(void)
|
|
|
|
{
|
2023-02-20 13:48:00 +08:00
|
|
|
__asm__ volatile ("dmb ish":::"memory");
|
2023-01-09 10:08:55 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
rt_inline void rt_hw_wmb(void)
|
|
|
|
{
|
2023-02-20 13:48:00 +08:00
|
|
|
__asm__ volatile ("dmb ishst":::"memory");
|
2023-01-09 10:08:55 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
rt_inline void rt_hw_rmb(void)
|
|
|
|
{
|
2023-02-20 13:48:00 +08:00
|
|
|
__asm__ volatile ("dmb ishld":::"memory");
|
2021-09-22 17:57:45 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
rt_inline void rt_hw_dsb(void)
|
|
|
|
{
|
2023-02-20 13:48:00 +08:00
|
|
|
__asm__ volatile ("dsb ish":::"memory");
|
2021-09-22 17:57:45 +08:00
|
|
|
}
|
|
|
|
|
2022-12-20 17:49:37 +08:00
|
|
|
#endif /*CPUPORT_H__*/
|