From 4af5b97526d99ecb9e232b1933c804858a298876 Mon Sep 17 00:00:00 2001 From: Patrick Williams Date: Mon, 20 Aug 2012 12:02:55 -0500 Subject: 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 --- src/sys/prof/idletask.C | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/sys') 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(); -- cgit v1.2.3