Skip to contentSkip to conversation

linux/preempt.h needs linux/thread_info.h

PATCH In review Horms 2 participants 3 messages Dec 27, 2006 Scheduler

lore
Share & tools
lore

Horms

author
#0 lore raw

PATCH 1/1 linux/preempt.h needs linux/thread_info.h

It seems that linux/preempt.h needs to include linux/thread_info.h in order to access current_thread_info(), which is used in preempt_count().

I guess that all callers of preempt_count() must include both linux/thread_info.h and linux/preempt.h directly or indirectly, as this does not cause a compile error. I noticed the problem while working on an unrelated issue in xen-land.

include/linux/preempt.h +1 -0
Index: linux-2.6/include/linux/preempt.h
===================================================================
@@ -8,6 +8,7 @@
 
 #include <linux/thread_info.h>
 #include <linux/linkage.h>
+#include <linux/thread_info.h>
 
 #ifdef CONFIG_DEBUG_PREEMPT
   extern void fastcall add_preempt_count(int val);
#1 lore raw
Quoted 16 lines · Horms

It seems that linux/preempt.h needs to include linux/thread_info.h in order to access current_thread_info(), which is used in preempt_count().

I guess that all callers of preempt_count() must include both linux/thread_info.h and linux/preempt.h directly or indirectly, as this does not cause a compile error. I noticed the problem while working on an unrelated issue in xen-land.

Index: linux-2.6/include/linux/preempt.h
===================================================================

include/linux/preempt.h line 11

Quoted 4 lines
include/linux/preempt.h +1 -0
@@ -8,6 +8,7 @@
 
 #include <linux/thread_info.h>
 #include <linux/linkage.h>
+#include <linux/thread_info.h>

Huh? It's just been included two lines above...

author
#2 lore raw
Quoted 18 lines · Al Viro
Quoted 17 lines · Horms

It seems that linux/preempt.h needs to include linux/thread_info.h in order to access current_thread_info(), which is used in preempt_count().

I guess that all callers of preempt_count() must include both linux/thread_info.h and linux/preempt.h directly or indirectly, as this does not cause a compile error. I noticed the problem while working on an unrelated issue in xen-land.

Index: linux-2.6/include/linux/preempt.h
===================================================================

include/linux/preempt.h +0 -0
@@ -8,6 +8,7 @@
 
Quoted 5 lines

include/linux/preempt.h line 11

Quoted 3 lines
include/linux/preempt.h +1 -0
 #include <linux/thread_info.h>
 #include <linux/linkage.h>
+#include <linux/thread_info.h>

Huh? It's just been included two lines above...

Sorry about that. I mucked around with this for a while and ended up missing the obvious when doing the forward-port.

Signature · 3 lines
Horms
  H: http://www.vergenet.net/~horms/
  W: http://www.valinux.co.jp/en/