@@ -93,13 +93,11 @@ __KERNEL__ k_stack_t *cpu_task_stk_init(void *entry,
|
||||
|
||||
regs = (cpu_context_t*) sp;
|
||||
|
||||
#if 1
|
||||
for(int i=0; i<(sizeof(cpu_context_t)/sizeof(cpu_data_t)); i++) {
|
||||
#define _V(v) ((unsigned int)((v/10) << 4 | (v % 10)))
|
||||
*(sp + i) = (_V(i) << 24) | (_V(i) << 16) | (_V(i) << 8) | _V(i);
|
||||
#undef _V
|
||||
}
|
||||
#endif
|
||||
|
||||
regs->a0 = (cpu_data_t)arg; // a0: argument
|
||||
regs->ra = (cpu_data_t)0xACE00ACE; // ra: return address
|
||||
@@ -128,23 +126,11 @@ void SysTick_IRQHandler() {
|
||||
|
||||
void cpu_irq_entry(cpu_data_t irq, cpu_context_t *regs)
|
||||
{
|
||||
#if 1
|
||||
if (irq != 7) {
|
||||
return;
|
||||
}
|
||||
|
||||
SysTick_IRQHandler();
|
||||
#else
|
||||
void (*irq_handler)();
|
||||
extern void (*handler_vector_table[])();
|
||||
|
||||
irq_handler = handler_vector_table[irq];
|
||||
if((*irq_handler) == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
(*irq_handler)();
|
||||
#endif
|
||||
}
|
||||
|
||||
__API__ uint32_t tos_cpu_clz(uint32_t val)
|
||||
|
Reference in New Issue
Block a user