Hi,
What do you think about this? The new file (vm86_mask.h) could actually be
embedded completely in processor-flags.h, but I went for what I believe is
the safer approach.This has been compile tested on x86_32 and x86_64 defconfig.
Vegard
From: Vegard Nossum <vegard.nossum@gmail.com>
Date: Tue, 27 May 2008 21:38:35 +0200
Subject: [PATCH] x86: break mutual header inclusionThis breaks up the mutual inclusion between headers ptrace.h and vm86.h
by moving what's needed by both files into a new (minimal) file
vm86_mask.h.We also move #include lines to the top.
Signed-off-by: Vegard Nossum <vegard.nossum@gmail.com>
---
include/asm-x86/ptrace.h | 10 +++-------
include/asm-x86/vm86.h | 9 ++-------
include/asm-x86/vm86_mask.h | 12 ++++++++++++
3 files changed, 17 insertions(+), 14 deletions(-)
create mode 100644 include/asm-x86/vm86_mask.hdiff --git a/include/asm-x86/ptrace.h b/include/asm-x86/ptrace.h
index 9f922b0..7ba799d 100644
--- a/include/asm-x86/ptrace.h
+++ b/include/asm-x86/ptrace.h
@@ -2,8 +2,10 @@
#define _ASM_X86_PTRACE_H#include <linux/compiler.h> /* For __user */
+#include <asm/ds.h> /* the DS BTS struct is used for ptrace too */
+#include <asm/segment.h>
#include <asm/ptrace-abi.h>
-
+#include <asm/vm86_mask.h>#ifndef __ASSEMBLY__
@@ -55,9 +57,6 @@ struct pt_regs {
unsigned long ss;
};-#include <asm/vm86.h>
-#include <asm/segment.h>
-
#endif /* __KERNEL__ */#else /* __i386__ */
@@ -127,9 +126,6 @@ struct pt_regs {#ifdef __KERNEL__
-/* the DS BTS struct is used for ptrace as well */
-#include <asm/ds.h>
-
struct task_struct;extern void ptrace_bts_take_timestamp(struct task_struct *, enum bts_qualifier);
diff --git a/include/asm-x86/vm86.h b/include/asm-x86/vm86.h
index 074b357..ad8d143 100644
--- a/include/asm-x86/vm86.h
+++ b/include/asm-x86/vm86.h
@@ -13,12 +13,8 @@
*/#include <asm/processor-flag...
Breaking the mutual header inclusion is appreciated, but some comments
Moving #include's out of an #ifdef __KERNEL__ can (and does here) break
our userspace headers.Running "make headers_check" after touching anything under include/ is
Do we need a new header for this or can it go into processor-flags.h ?
cu
Adrian--
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed--
Hi!
Ah, that's true. My mistake.
CHECK include/asm/ptrace.h
[...]/usr/include/asm/ptrace.h requires asm/ds.h, which does not exist
in exported headersWhat do you reckon is better here, to put #ifdef __KERNEL__ around the
whole of ds.h and export it, or put #ifdef __KERNEL__ around the
#include in ptrace.h? It feels wasteful to put it around the whole
ds.h, since what is the point in exporting an empty file? On the other
hand, it makes much more sense to put it there than in the "caller" in
order to avoid the duplication of #ifdef __KERNEL__. So unless you
prefer otherwise, I will choose the former (to export ds.h as well).I hope you agree with the idea of moving the #include line to the top
of the file, however?Thanks for the tip, that is very useful. I didn't realize I should use
It can go in there, yes. I will do that in the re-worked (hopefully
correct) patch.This business of breaking cycles is a bit nasty. There are very many
traps to fall into, very many setups to break, and very little support
from the tools to help you get it right (though with 'make
headers_check' I am a little better off).Thanks for the help :-)
Vegard
--
"The animistic metaphor of the bug that maliciously sneaked in while
the programmer was not looking is intellectually dishonest as it
disguises that the error is the programmer's own creation."
-- E. W. Dijkstra, EWD1036
--
Our userspace headers are an API, and offering empty previsously
unexported headers to userspace sounds like the worse choice to me.cu
Adrian--
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed--
| Greg Kroah-Hartman | [PATCH 008/196] Chinese: add translation of volatile-considered-harmful.txt |
| Tarkan Erimer | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Greg KH | Re: [Patch v2] Make PCI extended config space (MMCONFIG) a driver opt-in |
| Andrew Morton | -mm merge plans for 2.6.23 |
git: | |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| Herbert Xu | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| David Miller | [GIT]: Networking |
| Rémi Denis-Courmont | [PATCH 01/14] Phonet global definitions |
