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
|
2023-10-25 20:31:25 +08:00
|
|
|
typedef struct {
|
|
|
|
volatile unsigned int lock;
|
2022-12-03 12:07:44 +08:00
|
|
|
} rt_hw_spinlock_t;
|
|
|
|
#endif
|
|
|
|
|
2023-08-02 12:48:24 +08:00
|
|
|
#define rt_hw_barrier(cmd, ...) \
|
|
|
|
__asm__ volatile (RT_STRINGIFY(cmd) " "RT_STRINGIFY(__VA_ARGS__):::"memory")
|
|
|
|
|
|
|
|
#define rt_hw_isb() rt_hw_barrier(isb)
|
|
|
|
#define rt_hw_dmb() rt_hw_barrier(dmb, ish)
|
|
|
|
#define rt_hw_wmb() rt_hw_barrier(dmb, ishst)
|
|
|
|
#define rt_hw_rmb() rt_hw_barrier(dmb, ishld)
|
|
|
|
#define rt_hw_dsb() rt_hw_barrier(dsb, ish)
|
|
|
|
|
|
|
|
#define rt_hw_wfi() rt_hw_barrier(wfi)
|
|
|
|
#define rt_hw_wfe() rt_hw_barrier(wfe)
|
|
|
|
#define rt_hw_sev() rt_hw_barrier(sev)
|
|
|
|
|
|
|
|
#define rt_hw_cpu_relax() rt_hw_barrier(yield)
|
2021-09-22 17:57:45 +08:00
|
|
|
|
2023-05-14 23:48:16 +08:00
|
|
|
void _thread_start(void);
|
2022-12-20 17:49:37 +08:00
|
|
|
#endif /*CPUPORT_H__*/
|