summaryrefslogtreecommitdiff
path: root/firmware/thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/thread.c')
-rw-r--r--firmware/thread.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/firmware/thread.c b/firmware/thread.c
index 4e22c51689..399f6ef02b 100644
--- a/firmware/thread.c
+++ b/firmware/thread.c
@@ -989,7 +989,6 @@ static inline void core_sleep(void)
989void start_thread(void); /* Provide C access to ASM label */ 989void start_thread(void); /* Provide C access to ASM label */
990static void __attribute__((used)) _start_thread(void) 990static void __attribute__((used)) _start_thread(void)
991{ 991{
992
993 /* $t1 = context */ 992 /* $t1 = context */
994 asm volatile ( 993 asm volatile (
995 "start_thread: \n" 994 "start_thread: \n"
@@ -1004,7 +1003,6 @@ static void __attribute__((used)) _start_thread(void)
1004 ".set reorder \n" 1003 ".set reorder \n"
1005 ); 1004 );
1006 thread_exit(); 1005 thread_exit();
1007
1008} 1006}
1009 1007
1010/* Place context pointer in $s0 slot, function pointer in $s1 slot, and 1008/* Place context pointer in $s0 slot, function pointer in $s1 slot, and
@@ -1084,10 +1082,9 @@ static inline void load_context(const void* addr)
1084static inline void core_sleep(void) 1082static inline void core_sleep(void)
1085{ 1083{
1086#if CONFIG_CPU == JZ4732 1084#if CONFIG_CPU == JZ4732
1087 REG_CPM_LCR &= ~CPM_LCR_LPM_MASK; 1085 __cpm_idle_mode();
1088 REG_CPM_LCR |= CPM_LCR_LPM_SLEEP;
1089#endif 1086#endif
1090 asm volatile(".set mips32r2 \n" 1087 asm volatile(".set mips32r2 \n"
1091 "mfc0 $8, $12 \n" /* mfc $t0, $12 */ 1088 "mfc0 $8, $12 \n" /* mfc $t0, $12 */
1092 "move $9, $8 \n" /* move $t1, $t0 */ 1089 "move $9, $8 \n" /* move $t1, $t0 */
1093 "la $10, 0x8000000 \n" /* la $t2, 0x8000000 */ 1090 "la $10, 0x8000000 \n" /* la $t2, 0x8000000 */
@@ -1098,10 +1095,6 @@ static inline void core_sleep(void)
1098 ".set mips0 \n" 1095 ".set mips0 \n"
1099 ::: "t0", "t1", "t2" 1096 ::: "t0", "t1", "t2"
1100 ); 1097 );
1101#if CONFIG_CPU == JZ4732
1102 REG_CPM_LCR &= ~CPM_LCR_LPM_MASK;
1103 REG_CPM_LCR |= CPM_LCR_LPM_IDLE;
1104#endif
1105} 1098}
1106 1099
1107 1100