增加自动测试框架&优化多arch支持
This commit is contained in:
@@ -6,17 +6,19 @@
|
||||
#include <util.h>
|
||||
/**
|
||||
* @brief 调度函数
|
||||
*
|
||||
* @param usp
|
||||
* @param ksp
|
||||
* @param sp_type
|
||||
* @return sp_info_t*
|
||||
*
|
||||
* @param usp
|
||||
* @param ksp
|
||||
* @param sp_type
|
||||
* @return sp_info_t*
|
||||
*/
|
||||
sp_info_t *schde_to(void *usp, void *ksp, umword_t sp_type)
|
||||
{
|
||||
// printk("cur_th:0x%lx\n", thread_get_current());
|
||||
scheduler_t *sche = scheduler_get_current();
|
||||
|
||||
sched_t *next = sche->cur_sche;
|
||||
assert(next);
|
||||
thread_t *next_th = container_of(next, thread_t, sche);
|
||||
|
||||
assert(next_th->magic == THREAD_MAGIC);
|
||||
|
||||
@@ -39,7 +39,8 @@ typedef struct sp_info
|
||||
} sp_info_t;
|
||||
|
||||
#define _dmb(ins)
|
||||
|
||||
#define PAGE_SHIFT CONFIG_PAGE_SHIFT
|
||||
#define cpu_sleep() asm volatile("wfi" : : : "memory")
|
||||
#define read_reg(addr) (*((volatile umword_t *)(addr)))
|
||||
#define write_reg(addr, data) \
|
||||
do \
|
||||
|
||||
@@ -38,8 +38,10 @@ typedef struct sp_info
|
||||
void *knl_sp; //!< 内核sp
|
||||
mword_t sp_type; //!< 使用的栈类型
|
||||
} sp_info_t;
|
||||
#define _dmb(ins)
|
||||
|
||||
#define _dmb(ins) asm volatile("dmb" : : : "memory")
|
||||
#define _dsb(ins) asm volatile("dsb" : : : "memory")
|
||||
#define PAGE_SHIFT CONFIG_PAGE_SHIFT
|
||||
#define cpu_sleep() asm volatile("wfi" : : : "memory")
|
||||
#define read_reg(addr) (*((volatile umword_t *)(addr)))
|
||||
#define write_reg(addr, data) \
|
||||
do \
|
||||
@@ -122,11 +124,10 @@ static inline int arch_get_current_cpu_id(void)
|
||||
{ \
|
||||
write_sysreg(0, PRIMASK); \
|
||||
} while (0)
|
||||
#define cli() \
|
||||
do \
|
||||
{ \
|
||||
__asm__ __volatile__("CPSID I\n" :: \
|
||||
:); \
|
||||
#define cli() \
|
||||
do \
|
||||
{ \
|
||||
write_sysreg(1, PRIMASK); \
|
||||
} while (0)
|
||||
|
||||
static inline __attribute__((optimize(0))) void preemption(void)
|
||||
|
||||
@@ -2,7 +2,7 @@ ENTRY(Reset_Handler)
|
||||
MEMORY
|
||||
{
|
||||
RAM (arw) : ORIGIN = 0x20000000, LENGTH = 0x10000
|
||||
FLASH (arx) : ORIGIN = 0x00000000 + 0x2000, LENGTH = 0x10000 - 0x2000
|
||||
FLASH (arx) : ORIGIN = 0x00000000 + 0x3000, LENGTH = 0x1a000 - 0x3000
|
||||
}
|
||||
SECTIONS
|
||||
{
|
||||
|
||||
@@ -38,7 +38,8 @@ typedef struct sp_info
|
||||
mword_t sp_type; //!< 使用的栈类型
|
||||
} sp_info_t;
|
||||
#define _dmb(ins)
|
||||
|
||||
#define PAGE_SHIFT CONFIG_PAGE_SHIFT
|
||||
#define cpu_sleep() asm volatile("wfi" : : : "memory")
|
||||
#define read_reg(addr) (*((volatile umword_t *)(addr)))
|
||||
#define write_reg(addr, data) \
|
||||
do \
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
ENTRY(Reset_Handler)
|
||||
MEMORY
|
||||
{
|
||||
RAM (arw) : ORIGIN = 0x20000000, LENGTH = 0x2000000
|
||||
RAM (arw) : ORIGIN = 0x20000000, LENGTH = 0x800000
|
||||
FLASH (arx) : ORIGIN = 0x8000000 + 0x2000, LENGTH = 0x10000 - 0x2000
|
||||
}
|
||||
SECTIONS
|
||||
|
||||
@@ -38,7 +38,8 @@ typedef struct sp_info
|
||||
mword_t sp_type; //!< 使用的栈类型
|
||||
} sp_info_t;
|
||||
#define _dmb(ins)
|
||||
|
||||
#define PAGE_SHIFT CONFIG_PAGE_SHIFT
|
||||
#define cpu_sleep() asm volatile("wfi" : : : "memory")
|
||||
#define read_reg(addr) (*((volatile umword_t *)(addr)))
|
||||
#define write_reg(addr, data) \
|
||||
do \
|
||||
|
||||
Reference in New Issue
Block a user