board: nsim: add nsim.props and fix libraries
Signed-off-by: Jingru <jingru@synopsys.com>
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
typedef struct cpu_context_st {
|
||||
cpu_data_t pc;
|
||||
cpu_data_t blink;
|
||||
cpu_data_t task;
|
||||
cpu_data_t status32;
|
||||
cpu_data_t r0;
|
||||
} cpu_context_t;
|
||||
|
@@ -188,7 +188,7 @@ __KNL__ void cpu_standby_mode_enter(void)
|
||||
}
|
||||
|
||||
#endif /* TOS_CFG_PWR_MGR_EN */
|
||||
|
||||
extern void start_r(void);
|
||||
__KNL__ k_stack_t *cpu_task_stk_init(void *entry,
|
||||
void *arg,
|
||||
void *exit,
|
||||
@@ -199,15 +199,16 @@ __KNL__ k_stack_t *cpu_task_stk_init(void *entry,
|
||||
cpu_context_t *regs = 0;
|
||||
|
||||
sp = (cpu_data_t *)&stk_base[stk_size];
|
||||
sp = (cpu_data_t *)((cpu_addr_t)sp & 0xFFFFFFFC);
|
||||
sp = (cpu_data_t *)((cpu_addr_t)sp & 0xFFFFFFC);
|
||||
sp -= (sizeof(cpu_context_t)/sizeof(cpu_data_t));
|
||||
regs = (cpu_context_t*) sp;
|
||||
|
||||
/* auto-saved on exception(pendSV) by hardware */
|
||||
regs->pc = (cpu_data_t)entry;
|
||||
regs->pc = (cpu_data_t)start_r;
|
||||
regs->blink = (cpu_data_t)exit;
|
||||
regs->r0 = (cpu_data_t)arg;
|
||||
regs->task = (cpu_data_t)entry;
|
||||
regs->status32 = (cpu_data_t)(AUX_STATUS_MASK_IE | ((-1 - INT_PRI_MIN) << 1) | STATUS32_RESET_VALUE);
|
||||
regs->r0 = (cpu_data_t)arg;
|
||||
|
||||
|
||||
return (k_stack_t *)sp;
|
||||
}
|
||||
|
@@ -7,6 +7,8 @@
|
||||
.global port_sched_start
|
||||
.global port_context_switch
|
||||
|
||||
.global start_r
|
||||
|
||||
|
||||
.extern k_curr_task
|
||||
.extern k_next_task
|
||||
@@ -40,18 +42,26 @@ port_cpsr_restore:
|
||||
|
||||
.type port_sched_start, %function
|
||||
port_sched_start:
|
||||
push_s blink
|
||||
clri
|
||||
mov r0, 0
|
||||
mov r0, k_curr_task
|
||||
mov r1, k_next_task
|
||||
ld r0, [k_curr_task]
|
||||
ld r1, [k_next_task]
|
||||
ld r2, [r1]
|
||||
st r2, [r0] /* k_curr_task = k_next_task*/
|
||||
ld sp, [r2]
|
||||
seti
|
||||
j [r0]
|
||||
st r2, [r0] /*k_curr_task=k_next_task*/
|
||||
ld r0, [r2]
|
||||
ld sp, [r0]
|
||||
pop r3
|
||||
j [r3]
|
||||
|
||||
|
||||
.type start_r, %function
|
||||
start_r:
|
||||
pop blink;
|
||||
pop r1
|
||||
pop r2
|
||||
pop r0
|
||||
|
||||
j_s.d [r1]
|
||||
kflag r2
|
||||
|
||||
.type port_context_switch, %function
|
||||
port_context_switch:
|
||||
pop r15
|
||||
@@ -94,4 +104,4 @@ dispatch_r:
|
||||
pop blink
|
||||
pop fp
|
||||
pop gp
|
||||
j [blink]
|
||||
j [blink]
|
||||
|
Reference in New Issue
Block a user