Skip to contentSkip to conversation

UML - Fix build in 2.6.24-rc2-mm1

PATCH In review Jeff Dike 1 participant 1 message Nov 14, 2007 User-mode Linux (UML)

lore
Share & tools
lore

Jeff Dike

author
#0 lore raw

PATCH 1/4 UML - Fix build in 2.6.24-rc2-mm1

A small set of fixes to make UML build in 2.6.24-rc2-mm1.

A use of KERN_CONT was added to a userspace file, which needed to use UM_KERN_CONT instead, and a definition of it added to common-offsets.h.

The earlier pgtable.h tidying patch made things a bit too tidy. Add back a header which is needed in VMALLOC_START and friend. Also add back a definition of pmd_page_vaddr, which is needed on x86_64.

init.h started breaking now for some reason. It turns out that there wasn't a definition of __user. Fixed this by copying the relevant stuff from compiler.h in the userspace case, and including compiler.h in the kernel case.

---
 arch/um/include/common-offsets.h |    1 +
 arch/um/include/init.h           |    9 +++++++++
 arch/um/sys-i386/bugs.c          |    4 ++--
 include/asm-um/pgtable.h         |    2 ++
 4 files changed, 14 insertions(+), 2 deletions(-)
arch/um/include/common-offsets.h +1 -0
Index: linux-2.6.22/arch/um/include/common-offsets.h
===================================================================
@@ -18,6 +18,7 @@ DEFINE_STR(UM_KERN_WARNING, KERN_WARNING
 DEFINE_STR(UM_KERN_NOTICE, KERN_NOTICE);
 DEFINE_STR(UM_KERN_INFO, KERN_INFO);
 DEFINE_STR(UM_KERN_DEBUG, KERN_DEBUG);
+DEFINE_STR(UM_KERN_CONT, KERN_CONT);
 
 DEFINE(UM_ELF_CLASS, ELF_CLASS);
 DEFINE(UM_ELFCLASS32, ELFCLASS32);
arch/um/sys-i386/bugs.c +2 -2
Index: linux-2.6.22/arch/um/sys-i386/bugs.c
===================================================================
@@ -36,9 +36,9 @@ void arch_check_bugs(void)
 	if (setjmp(cmov_test_return) == 0) {
 		unsigned long foo = 0;
 		__asm__ __volatile__("cmovz %0, %1" : "=r" (foo) : "0" (foo));
-		printk(KERN_CONT "Yes\n");
+		printk(UM_KERN_CONT "Yes\n");
 	} else
-		printk(KERN_CONT "No\n");
+		printk(UM_KERN_CONT "No\n");
 
 	sigaction(SIGILL, &old, &new);
 }
include/asm-um/pgtable.h +2 -0
Index: linux-2.6.22/include/asm-um/pgtable.h
===================================================================
@@ -9,6 +9,7 @@
 #define __UM_PGTABLE_H
 
 #include "linux/sched.h"
+#include <asm/fixmap.h>
 
 #define _PAGE_PRESENT	0x001
 #define _PAGE_NEWPAGE	0x002
@@ -308,6 +309,7 @@ static inline pte_t pte_modify(pte_t pte
  * this macro returns the index of the entry in the pmd page which would
  * control the given virtual address
  */
+#define pmd_page_vaddr(pmd) ((unsigned long) __va(pmd_val(pmd) & PAGE_MASK))
 #define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1))
 
 /*
arch/um/include/init.h +9 -0
Index: linux-2.6.22/arch/um/include/init.h
===================================================================
@@ -40,6 +40,15 @@
 typedef int (*initcall_t)(void);
 typedef void (*exitcall_t)(void);
 
+#ifndef __KERNEL__
+#if __GNUC_MINOR__ >= 3
+# define __used			__attribute__((__used__))
+#else
+# define __used			__attribute__((__unused__))
+#endif
+#else
+#include <linux/compiler.h>
+#endif
 /* These are for everybody (although not all archs will actually
    discard it in modules) */
 #define __init		__attribute__ ((__section__ (".init.text")))

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel