[PATCH] current ( was RE: cat /proc/acpi/events bad for your system's health!)

From: Yu, Luming <luming.yu_at_intel.com>
Date: 2004-03-17 23:48:00
> The main difference with 2.4 is signal_pending. From ACPI log, I also
> noticed that
> the thread waiting on acpi_bus_event_queue didn't resume proberly,
> because there
> is no exit message of acpi_bus_receive_event in ACPI log  as 
> expected if
> you turn on
> full debug flag of acpi.

After comparing the disassembly code of acpi_bus_receive_event() , I
find the following difference
introduced by my workaround:

155c155
<     12d0:     00 00 00 1a b8 11       [MII]       st8.rel [r13]=r0
---
>     12d0:     00 40 00 1a b8 15       [MII]       st8.rel [r13]=r0,8


Perhaps, gcc did something wrong with set_current_state(TASK_RUNNING).
Because r13 intend for pointer to the current task.

The following is my patch, which can fix this issue.

--Luming

diff -Bru 2.6.new/include/asm-ia64/gcc_intrin.h
patched/include/asm-ia64/gcc_intrin.h
--- 2.6.new/include/asm-ia64/gcc_intrin.h	2004-03-17
11:57:34.000000000 +0800
+++ patched/include/asm-ia64/gcc_intrin.h	2004-03-17
20:39:44.000000000 +0800
@@ -67,10 +67,7 @@
 		asm volatile ("mov %0=psr" : "=r"(ia64_intri_res));
\
 		break;
\
 	case _IA64_REG_TP:	/* for current() */
\
-		{
\
-			register __u64 ia64_r13 asm ("r13");
\
-			ia64_intri_res = ia64_r13;
\
-		}
\
+		asm volatile ("mov %0=r13" : "=r"(ia64_intri_res));
\
 		break;
\
 	case _IA64_REG_AR_KR0 ... _IA64_REG_AR_EC:
\
 		asm volatile ("mov %0=ar%1" : "=r" (ia64_intri_res)
\
-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Wed Mar 17 07:48:29 2004

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:24 EST