diff options
author | Masahiro Yamada <masahiroy@kernel.org> | 2023-09-27 19:06:00 +0200 |
---|---|---|
committer | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2023-10-05 17:17:05 +0200 |
commit | c7368ddba2ffcc5d200122c5bb122c3825ecb976 (patch) | |
tree | fbf5020ddfd96c80d20c92aeadaadcb88df13743 /arch/arm | |
parent | ARM: 9324/1: fix get_user() broken with veneer (diff) | |
download | linux-c7368ddba2ffcc5d200122c5bb122c3825ecb976.tar.xz linux-c7368ddba2ffcc5d200122c5bb122c3825ecb976.zip |
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>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/include/asm/domain.h | 2 | ||||
-rw-r--r-- | arch/arm/include/asm/traps.h | 3 | ||||
-rw-r--r-- | arch/arm/include/asm/uaccess.h | 1 |
3 files changed, 4 insertions, 2 deletions
diff --git a/arch/arm/include/asm/domain.h b/arch/arm/include/asm/domain.h index 41536feb4392..d48859fdf32c 100644 --- a/arch/arm/include/asm/domain.h +++ b/arch/arm/include/asm/domain.h @@ -8,8 +8,8 @@ #define __ASM_PROC_DOMAIN_H #ifndef __ASSEMBLY__ +#include <linux/thread_info.h> #include <asm/barrier.h> -#include <asm/thread_info.h> #endif /* diff --git a/arch/arm/include/asm/traps.h b/arch/arm/include/asm/traps.h index 0aaefe3e1700..2621b9fb9b19 100644 --- a/arch/arm/include/asm/traps.h +++ b/arch/arm/include/asm/traps.h @@ -2,6 +2,7 @@ #ifndef _ASMARM_TRAP_H #define _ASMARM_TRAP_H +#include <linux/linkage.h> #include <linux/list.h> struct pt_regs; @@ -28,7 +29,7 @@ static inline int __in_irqentry_text(unsigned long ptr) ptr < (unsigned long)&__irqentry_text_end; } -extern void __init early_trap_init(void *); +extern void early_trap_init(void *); extern void dump_backtrace_entry(unsigned long where, unsigned long from, unsigned long frame, const char *loglvl); extern void ptrace_break(struct pt_regs *regs); diff --git a/arch/arm/include/asm/uaccess.h b/arch/arm/include/asm/uaccess.h index c28f5ec21e41..9556d04387f7 100644 --- a/arch/arm/include/asm/uaccess.h +++ b/arch/arm/include/asm/uaccess.h @@ -8,6 +8,7 @@ /* * User space memory access functions */ +#include <linux/kernel.h> #include <linux/string.h> #include <asm/page.h> #include <asm/domain.h> |