>From 2ed56eb2df107211b04aee6f6f4571ec993d38de Mon Sep 17 00:00:00 2001
From: HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
Date: Thu, 28 Apr 2011 07:50:12 +0900
Subject: [PATCH 3/5] x86: Handle _PAGE_PROTNONE as machine specific data

Same as on x86_64.
---
 defs.h |    3 ++-
 x86.c  |    6 ++++++
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/defs.h b/defs.h
index 6710f61..d16f13a 100755
--- a/defs.h
+++ b/defs.h
@@ -2254,7 +2254,7 @@ struct load_module {
 #define _PAGE_4M        0x080   /* 4 MB page, Pentium+, if present.. */
 #define _PAGE_PSE       0x080   /* 4 MB (or 2MB) page, Pentium+, if present.. */
 #define _PAGE_GLOBAL    0x100   /* Global TLB entry PPro+ */
-#define _PAGE_PROTNONE  0x080   /* If not present */
+#define _PAGE_PROTNONE  (machdep->machspec->page_protnone)
 #define _PAGE_NX        (0x8000000000000000ULL)
 
 #define NONPAE_PAGEBASE(X)   (((unsigned long)(X)) & (unsigned long)machdep->pagemask)
@@ -4195,6 +4195,7 @@ struct machine_specific {
 	physaddr_t entry_tramp_start_phys;
 	ulonglong last_pmd_read_PAE;
 	ulonglong last_ptbl_read_PAE;
+	ulong page_protnone;
 };
 
 struct syment *x86_is_entry_tramp_address(ulong, ulong *); 
diff --git a/x86.c b/x86.c
index c5cf010..20f9e11 100755
--- a/x86.c
+++ b/x86.c
@@ -1876,6 +1876,12 @@ x86_init(int when)
 			machdep->line_number_hooks = x86_line_number_hooks;
 
 		eframe_init();
+
+		if (THIS_KERNEL_VERSION >= LINUX(2,6,28))
+			machdep->machspec->page_protnone = _PAGE_GLOBAL;
+		else
+			machdep->machspec->page_protnone = _PAGE_PSE;
+
 		break;
 
 	case POST_INIT:
-- 
1.7.4.4

