Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: 9326/1: make <linux/uaccess.h> self-contained for ARM

When I compiled the following code for ARM, I encountered numerous
errors.

[Test Code]

#include <linux/compiler.h>
#include <linux/uaccess.h>

int foo(int *x, int __user *ptr)
{
return get_user(*x, ptr);
}

To fix the errors, make some asm headers self-contained:

1. In arch/arm/include/asm/domain.h, include <linux/thread_info.h>
for current_thread_info().

2. In arch/arm/include/asm/traps.h, remove unneeded __init, and
include <linux/linkage.h> for asmlinkage.

3. In arch/arm/include/asm/uaccess.h, include <linux/kernel.h> for
might_fault().

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

authored by

Masahiro Yamada and committed by
Russell King (Oracle)
c7368ddb 24d3ba0a

+4 -2
+1 -1
arch/arm/include/asm/domain.h
··· 8 8 #define __ASM_PROC_DOMAIN_H 9 9 10 10 #ifndef __ASSEMBLY__ 11 + #include <linux/thread_info.h> 11 12 #include <asm/barrier.h> 12 - #include <asm/thread_info.h> 13 13 #endif 14 14 15 15 /*
+2 -1
arch/arm/include/asm/traps.h
··· 2 2 #ifndef _ASMARM_TRAP_H 3 3 #define _ASMARM_TRAP_H 4 4 5 + #include <linux/linkage.h> 5 6 #include <linux/list.h> 6 7 7 8 struct pt_regs; ··· 29 28 ptr < (unsigned long)&__irqentry_text_end; 30 29 } 31 30 32 - extern void __init early_trap_init(void *); 31 + extern void early_trap_init(void *); 33 32 extern void dump_backtrace_entry(unsigned long where, unsigned long from, 34 33 unsigned long frame, const char *loglvl); 35 34 extern void ptrace_break(struct pt_regs *regs);
+1
arch/arm/include/asm/uaccess.h
··· 8 8 /* 9 9 * User space memory access functions 10 10 */ 11 + #include <linux/kernel.h> 11 12 #include <linux/string.h> 12 13 #include <asm/page.h> 13 14 #include <asm/domain.h>