diff options
author | Patrick Williams <iawillia@us.ibm.com> | 2012-08-20 12:02:55 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2012-09-06 08:30:05 -0500 |
commit | 4af5b97526d99ecb9e232b1933c804858a298876 (patch) | |
tree | 2156b6d6c8e4961acf5cb6e4c662add8af8c8f29 /src/sys/prof | |
parent | 8fc9c877be31195fcd7ca4f9c28c78acf61b0937 (diff) | |
download | talos-hostboot-4af5b97526d99ecb9e232b1933c804858a298876.tar.gz talos-hostboot-4af5b97526d99ecb9e232b1933c804858a298876.zip |
Nap instruction sometimes executed with wrong permissions.
When executing the nap instruction, all thread state can be
lost. This was causing r0 to be lost, which contained the
system-call number for the idle thread to request permission
to execute nap and as a result 'task-yield' was executed
instead of 'cpu-nap' after the idle thread took its first
nap.
Re-arranged the sreset code that handles nap-wakeup to deal
with thread-state being lost when entering nap and instead
using the previously saved task-state from the 'cpu-nap'
system call.
Change-Id: Id7468a8577c4d7b273b23bc97e7dd040555e7b67
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/1567
Tested-by: Jenkins Server
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/sys/prof')
-rw-r--r-- | src/sys/prof/idletask.C | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/sys/prof/idletask.C b/src/sys/prof/idletask.C index 1c38835ce..8f79b94f7 100644 --- a/src/sys/prof/idletask.C +++ b/src/sys/prof/idletask.C @@ -43,8 +43,7 @@ void TaskManager::idleTaskLoop(void* unused) setThreadPriorityLow(); // Request privilege escalation for nap. - register uint64_t syscall = MISC_CPUNAP; - asm volatile("or 3, %0, %0; sc" :: "r" (syscall) : "r3", "cc"); + asm volatile("li 3, %0; sc" :: "K" (MISC_CPUNAP) : "r3", "cc"); // Execute nap. nap(); |