diff options
Diffstat (limited to 'firmware/thread.c')
-rw-r--r-- | firmware/thread.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/firmware/thread.c b/firmware/thread.c index c9ce049ea1..6ba99dd325 100644 --- a/firmware/thread.c +++ b/firmware/thread.c | |||
@@ -387,6 +387,13 @@ void corelock_unlock(struct corelock *cl) | |||
387 | 387 | ||
388 | #endif /* CONFIG_CORELOCK == SW_CORELOCK */ | 388 | #endif /* CONFIG_CORELOCK == SW_CORELOCK */ |
389 | 389 | ||
390 | #ifdef CPU_PP502x | ||
391 | /* Some code relies on timing */ | ||
392 | void switch_thread(struct thread_entry *old) ICODE_ATTR; | ||
393 | void core_wake(IF_COP_VOID(unsigned int othercore)) ICODE_ATTR; | ||
394 | void core_idle(void) ICODE_ATTR; | ||
395 | #endif | ||
396 | |||
390 | /*--------------------------------------------------------------------------- | 397 | /*--------------------------------------------------------------------------- |
391 | * Put core in a power-saving state if waking list wasn't repopulated and if | 398 | * Put core in a power-saving state if waking list wasn't repopulated and if |
392 | * no other core requested a wakeup for it to perform a task. | 399 | * no other core requested a wakeup for it to perform a task. |
@@ -405,7 +412,7 @@ static inline void core_sleep(IF_COP(unsigned int core,) struct thread_entry **w | |||
405 | "ldr r0, [%[w]] \n" /* Check *waking */ | 412 | "ldr r0, [%[w]] \n" /* Check *waking */ |
406 | "cmp r0, #0 \n" /* != NULL -> exit */ | 413 | "cmp r0, #0 \n" /* != NULL -> exit */ |
407 | "bne 1f \n" | 414 | "bne 1f \n" |
408 | /* ------ fixed-time sequence ----- */ | 415 | /* ------ fixed-time sequence ----- */ /* Can this be relied upon? */ |
409 | "ldr r0, [%[ms], %[oc], lsl #2] \n" /* Stay-awake requested? */ | 416 | "ldr r0, [%[ms], %[oc], lsl #2] \n" /* Stay-awake requested? */ |
410 | "mov r1, #0x80000000 \n" | 417 | "mov r1, #0x80000000 \n" |
411 | "tst r0, #1 \n" | 418 | "tst r0, #1 \n" |
@@ -453,7 +460,7 @@ void core_wake(IF_COP_VOID(unsigned int othercore)) | |||
453 | "orr r1, r2, #0xc0 \n" | 460 | "orr r1, r2, #0xc0 \n" |
454 | "msr cpsr_c, r1 \n" | 461 | "msr cpsr_c, r1 \n" |
455 | "mov r1, #1 \n" | 462 | "mov r1, #1 \n" |
456 | /* ------ fixed-time sequence ----- */ | 463 | /* ------ fixed-time sequence ----- */ /* Can this be relied upon? */ |
457 | "str r1, [%[ms], %[oc], lsl #2] \n" /* Send stay-awake message */ | 464 | "str r1, [%[ms], %[oc], lsl #2] \n" /* Send stay-awake message */ |
458 | "nop \n" | 465 | "nop \n" |
459 | "nop \n" | 466 | "nop \n" |