diff options
author | Patrick Williams <iawillia@us.ibm.com> | 2011-03-05 13:33:08 -0600 |
---|---|---|
committer | Patrick Williams <iawillia@us.ibm.com> | 2011-03-05 13:33:08 -0600 |
commit | 4e28e35a01099ebe75a0e69b1fdf32a842fe13d5 (patch) | |
tree | 26448d230da3eb87f04977eb9e8c0732e82f0345 /src | |
parent | ee7fcf307d92f5ac77847394e718b10d231004e6 (diff) | |
download | talos-hostboot-4e28e35a01099ebe75a0e69b1fdf32a842fe13d5.tar.gz talos-hostboot-4e28e35a01099ebe75a0e69b1fdf32a842fe13d5.zip |
Thread priorities in idle and init spinlock.
Diffstat (limited to 'src')
-rw-r--r-- | src/kernel/start.S | 10 | ||||
-rw-r--r-- | src/kernel/taskmgr.C | 1 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/kernel/start.S b/src/kernel/start.S index 785d86ac4..9ff40b841 100644 --- a/src/kernel/start.S +++ b/src/kernel/start.S @@ -4,6 +4,9 @@ .global _start _start: + ;// Set thread priority high. + or 3,3,3 + ;// Check if first thread. mfspr r1, PIR li r2, 0x0003 @@ -68,11 +71,13 @@ finished_relocate: #define UNIMPL_INTERRUPT(name, address) \ .org _start + address; \ intvect_##name: \ + or 1,1,1; /* Drop thread priority while in loop. */ \ b intvect_##name #define STD_INTERRUPT(name, address) \ .org _start + address; \ intvect_##name: \ + or 3,3,3; /* Ensure thread priority is high. */ \ mtsprg1 r1; /* Save GPR1 */ \ ;/* Retrieve processing address for interrupt. */ \ lis r1, intvect_##name##_finish_save@h; \ @@ -149,14 +154,17 @@ _other_thread_spinlock: ;// Read spinlock value. lis r2, kernel_other_thread_spinlock@h ori r2, r2, kernel_other_thread_spinlock@l +1: ld r3, 0(r2) ;// Loop until value is not 0... li r4, 0 cmp cr0, r3, r4 bne _other_thread_spinlock_complete - b _other_thread_spinlock + or 1,1,1 ;// Lower thread priority. + b 1b ;// Now released by primary thread. _other_thread_spinlock_complete: + or 3,3,3 ;// Raise thread priority. ;// Get CPU object from thread ID. lis r2, _ZN10CpuManager7cv_cpusE@h ori r2, r2, _ZN10CpuManager7cv_cpusE@l diff --git a/src/kernel/taskmgr.C b/src/kernel/taskmgr.C index 866a00eae..f5aa62ceb 100644 --- a/src/kernel/taskmgr.C +++ b/src/kernel/taskmgr.C @@ -8,6 +8,7 @@ void TaskManager::idleTaskLoop(void* unused) { while(1) { + setThreadPriorityLow(); } } |