The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Vegard Nossum <vegard.nossum@gmail.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] x86: break mutual header inclusion
Date: Tue, 27 May 2008 22:49:26 +0200	[thread overview]
Message-ID: <20080527204926.GA15020@damson.getinternet.no> (raw)

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 inclusion

This 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.h

diff --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-flags.h>
-
-#ifdef CONFIG_VM86
-#define X86_VM_MASK	X86_EFLAGS_VM
-#else
-#define X86_VM_MASK	0 /* No VM86 support */
-#endif
+#include <asm/ptrace.h>
+#include <asm/vm86_mask.h>
 
 #define BIOSSEG		0x0f000
 
@@ -141,7 +137,6 @@ struct vm86plus_struct {
  * at the end of the structure. Look at ptrace.h to see the "normal"
  * setup. For user space layout see 'struct vm86_regs' above.
  */
-#include <asm/ptrace.h>
 
 struct kernel_vm86_regs {
 /*
diff --git a/include/asm-x86/vm86_mask.h b/include/asm-x86/vm86_mask.h
new file mode 100644
index 0000000..5f18288
--- /dev/null
+++ b/include/asm-x86/vm86_mask.h
@@ -0,0 +1,12 @@
+#ifndef ASM_X86_VM86_MASK
+#define ASM_X86_VM86_MASK
+
+#include <asm/processor-flags.h>
+
+#ifdef CONFIG_VM86
+#define X86_VM_MASK	X86_EFLAGS_VM
+#else
+#define X86_VM_MASK	0 /* No VM86 support */
+#endif
+
+#endif
-- 
1.5.4.1


             reply	other threads:[~2008-05-27 20:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-27 20:49 Vegard Nossum [this message]
2008-05-27 21:38 ` [PATCH] x86: break mutual header inclusion Adrian Bunk
2008-05-27 22:01   ` Vegard Nossum
2008-05-27 22:27     ` Adrian Bunk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080527204926.GA15020@damson.getinternet.no \
    --to=vegard.nossum@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox