Skip to content

Commit 7ef1b70

Browse files
adopt to renaming from active_thread to sched_active_thread
1 parent 127ef3b commit 7ef1b70

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

stm32f103rey6/cpu.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,9 @@ void ctx_switch(void)
128128
asm("mov r12, sp");
129129
asm("stmfd r12!, {r4-r11}");
130130

131-
/* save user mode stack pointer in *active_thread */
132-
asm("ldr r1, =active_thread"); /* r1 = &active_thread */
133-
asm("ldr r1, [r1]"); /* r1 = *r1 = active_thread */
131+
/* save user mode stack pointer in *sched_active_thread */
132+
asm("ldr r1, =sched_active_thread"); /* r1 = &sched_active_thread */
133+
asm("ldr r1, [r1]"); /* r1 = *r1 = sched_active_thread */
134134
asm("str r12, [r1]"); /* store stack pointer in tasks pdc*/
135135

136136
sched_task_return();
@@ -145,8 +145,8 @@ void sched_task_return(void)
145145
mode.b.nPRIV = 0; // privilege
146146
__set_CONTROL(mode.w);
147147
/* load pdc->stackpointer in r0 */
148-
asm("ldr r0, =active_thread"); /* r0 = &active_thread */
149-
asm("ldr r0, [r0]"); /* r0 = *r0 = active_thread */
148+
asm("ldr r0, =sched_active_thread"); /* r0 = &sched_active_thread */
149+
asm("ldr r0, [r0]"); /* r0 = *r0 = sched_active_thread */
150150
asm("ldr sp, [r0]"); /* sp = r0 restore stack pointer*/
151151
asm("pop {r4}"); /* skip exception return */
152152
asm("pop {r4-r11}");

stm32f103rey6/include/cpu.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ __attribute__((always_inline)) __INLINE void save_context(void)
7373
asm("stmdb r0!,{lr}" ); // exception return value
7474
// asm("vstmdb sp!, {s16-s31}" ); // FIXME save fpu registers if needed
7575
/* load address of currend pdc */
76-
asm("ldr r1, =active_thread" ); /* load address of currend tcb */
76+
asm("ldr r1, =sched_active_thread" );/* load address of currend tcb */
7777
/* deref pdc */
7878
asm("ldr r1, [r1]" ); /* deref pdc */
7979
/* write r0 to pdc->sp means current threads stack pointer */
@@ -82,7 +82,7 @@ __attribute__((always_inline)) __INLINE void save_context(void)
8282

8383
__attribute__((always_inline)) __INLINE void restore_context(void)
8484
{
85-
asm("ldr r0, =active_thread" ); /* load address of currend tcb */
85+
asm("ldr r0, =sched_active_thread" );/* load address of currend tcb */
8686
asm("ldr r0, [r0]" ); /* deref tcb */
8787
asm("ldr r1, [r0]" ); /* load tcb->sp to register 1 */
8888
asm("ldmia r1!, {r0}" ); /* restore exception retrun value from stack */

stm32f103rey6/syscalls.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ void _exit(int n)
314314
/*---------------------------------------------------------------------------*/
315315
int _getpid(void)
316316
{
317-
return active_thread->pid;
317+
return sched_active_thread->pid;
318318
}
319319
/*---------------------------------------------------------------------------*/
320320
int _kill_r(struct _reent *r, int pid, int sig)

0 commit comments

Comments
 (0)