diff options
Diffstat (limited to 'arch/um/include/asm')
31 files changed, 144 insertions, 221 deletions
diff --git a/arch/um/include/asm/Kbuild b/arch/um/include/asm/Kbuild new file mode 100644 index 000000000000..451f4517b334 --- /dev/null +++ b/arch/um/include/asm/Kbuild | |||
@@ -0,0 +1,3 @@ | |||
1 | generic-y += bug.h cputime.h device.h emergency-restart.h futex.h hardirq.h | ||
2 | generic-y += hw_irq.h irq_regs.h kdebug.h percpu.h sections.h topology.h xor.h | ||
3 | generic-y += ftrace.h | ||
diff --git a/arch/um/include/asm/apic.h b/arch/um/include/asm/apic.h deleted file mode 100644 index 876dee84ab11..000000000000 --- a/arch/um/include/asm/apic.h +++ /dev/null | |||
@@ -1,4 +0,0 @@ | |||
1 | #ifndef __UM_APIC_H | ||
2 | #define __UM_APIC_H | ||
3 | |||
4 | #endif | ||
diff --git a/arch/um/include/asm/arch_hweight.h b/arch/um/include/asm/arch_hweight.h deleted file mode 100644 index c656cf443f4a..000000000000 --- a/arch/um/include/asm/arch_hweight.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef _ASM_UM_HWEIGHT_H | ||
2 | #define _ASM_UM_HWEIGHT_H | ||
3 | |||
4 | #include <asm-generic/bitops/arch_hweight.h> | ||
5 | |||
6 | #endif | ||
diff --git a/arch/um/include/asm/bug.h b/arch/um/include/asm/bug.h deleted file mode 100644 index 9e33b864c359..000000000000 --- a/arch/um/include/asm/bug.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef __UM_BUG_H | ||
2 | #define __UM_BUG_H | ||
3 | |||
4 | #include <asm-generic/bug.h> | ||
5 | |||
6 | #endif | ||
diff --git a/arch/um/include/asm/checksum.h b/arch/um/include/asm/checksum.h deleted file mode 100644 index 5b501361e361..000000000000 --- a/arch/um/include/asm/checksum.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef __UM_CHECKSUM_H | ||
2 | #define __UM_CHECKSUM_H | ||
3 | |||
4 | #include "sysdep/checksum.h" | ||
5 | |||
6 | #endif | ||
diff --git a/arch/um/include/asm/cputime.h b/arch/um/include/asm/cputime.h deleted file mode 100644 index c84acbadfa2f..000000000000 --- a/arch/um/include/asm/cputime.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef __UM_CPUTIME_H | ||
2 | #define __UM_CPUTIME_H | ||
3 | |||
4 | #include <asm-generic/cputime.h> | ||
5 | |||
6 | #endif /* __UM_CPUTIME_H */ | ||
diff --git a/arch/um/include/asm/desc.h b/arch/um/include/asm/desc.h deleted file mode 100644 index 4ec34a51b62c..000000000000 --- a/arch/um/include/asm/desc.h +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | #ifndef __UM_DESC_H | ||
2 | #define __UM_DESC_H | ||
3 | |||
4 | /* Taken from asm-i386/desc.h, it's the only thing we need. The rest wouldn't | ||
5 | * compile, and has never been used. */ | ||
6 | #define LDT_empty(info) (\ | ||
7 | (info)->base_addr == 0 && \ | ||
8 | (info)->limit == 0 && \ | ||
9 | (info)->contents == 0 && \ | ||
10 | (info)->read_exec_only == 1 && \ | ||
11 | (info)->seg_32bit == 0 && \ | ||
12 | (info)->limit_in_pages == 0 && \ | ||
13 | (info)->seg_not_present == 1 && \ | ||
14 | (info)->useable == 0 ) | ||
15 | |||
16 | #endif | ||
diff --git a/arch/um/include/asm/device.h b/arch/um/include/asm/device.h deleted file mode 100644 index d8f9872b0e2d..000000000000 --- a/arch/um/include/asm/device.h +++ /dev/null | |||
@@ -1,7 +0,0 @@ | |||
1 | /* | ||
2 | * Arch specific extensions to struct device | ||
3 | * | ||
4 | * This file is released under the GPLv2 | ||
5 | */ | ||
6 | #include <asm-generic/device.h> | ||
7 | |||
diff --git a/arch/um/include/asm/emergency-restart.h b/arch/um/include/asm/emergency-restart.h deleted file mode 100644 index 108d8c48e42e..000000000000 --- a/arch/um/include/asm/emergency-restart.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef _ASM_EMERGENCY_RESTART_H | ||
2 | #define _ASM_EMERGENCY_RESTART_H | ||
3 | |||
4 | #include <asm-generic/emergency-restart.h> | ||
5 | |||
6 | #endif /* _ASM_EMERGENCY_RESTART_H */ | ||
diff --git a/arch/um/include/asm/ftrace.h b/arch/um/include/asm/ftrace.h deleted file mode 100644 index 40a8c178f10d..000000000000 --- a/arch/um/include/asm/ftrace.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | /* empty */ | ||
diff --git a/arch/um/include/asm/futex.h b/arch/um/include/asm/futex.h deleted file mode 100644 index 6a332a9f099c..000000000000 --- a/arch/um/include/asm/futex.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef _ASM_FUTEX_H | ||
2 | #define _ASM_FUTEX_H | ||
3 | |||
4 | #include <asm-generic/futex.h> | ||
5 | |||
6 | #endif | ||
diff --git a/arch/um/include/asm/hardirq.h b/arch/um/include/asm/hardirq.h deleted file mode 100644 index fb3c05a0cbbf..000000000000 --- a/arch/um/include/asm/hardirq.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | #include <asm-generic/hardirq.h> | ||
diff --git a/arch/um/include/asm/hw_irq.h b/arch/um/include/asm/hw_irq.h deleted file mode 100644 index 1cf84cf5f21a..000000000000 --- a/arch/um/include/asm/hw_irq.h +++ /dev/null | |||
@@ -1,7 +0,0 @@ | |||
1 | #ifndef _ASM_UM_HW_IRQ_H | ||
2 | #define _ASM_UM_HW_IRQ_H | ||
3 | |||
4 | #include "asm/irq.h" | ||
5 | #include "asm/archparam.h" | ||
6 | |||
7 | #endif | ||
diff --git a/arch/um/include/asm/irq_regs.h b/arch/um/include/asm/irq_regs.h deleted file mode 100644 index 3dd9c0b70270..000000000000 --- a/arch/um/include/asm/irq_regs.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | #include <asm-generic/irq_regs.h> | ||
diff --git a/arch/um/include/asm/irq_vectors.h b/arch/um/include/asm/irq_vectors.h deleted file mode 100644 index 272a81e0ce14..000000000000 --- a/arch/um/include/asm/irq_vectors.h +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) | ||
3 | * Licensed under the GPL | ||
4 | */ | ||
5 | |||
6 | #ifndef __UM_IRQ_VECTORS_H | ||
7 | #define __UM_IRQ_VECTORS_H | ||
8 | |||
9 | #endif | ||
10 | |||
diff --git a/arch/um/include/asm/irqflags.h b/arch/um/include/asm/irqflags.h index 659b9abdfdba..c780d8a16773 100644 --- a/arch/um/include/asm/irqflags.h +++ b/arch/um/include/asm/irqflags.h | |||
@@ -1,6 +1,42 @@ | |||
1 | #ifndef __UM_IRQFLAGS_H | 1 | #ifndef __UM_IRQFLAGS_H |
2 | #define __UM_IRQFLAGS_H | 2 | #define __UM_IRQFLAGS_H |
3 | 3 | ||
4 | /* Empty for now */ | 4 | extern int get_signals(void); |
5 | extern int set_signals(int enable); | ||
6 | extern void block_signals(void); | ||
7 | extern void unblock_signals(void); | ||
8 | |||
9 | static inline unsigned long arch_local_save_flags(void) | ||
10 | { | ||
11 | return get_signals(); | ||
12 | } | ||
13 | |||
14 | static inline void arch_local_irq_restore(unsigned long flags) | ||
15 | { | ||
16 | set_signals(flags); | ||
17 | } | ||
18 | |||
19 | static inline void arch_local_irq_enable(void) | ||
20 | { | ||
21 | unblock_signals(); | ||
22 | } | ||
23 | |||
24 | static inline void arch_local_irq_disable(void) | ||
25 | { | ||
26 | block_signals(); | ||
27 | } | ||
28 | |||
29 | static inline unsigned long arch_local_irq_save(void) | ||
30 | { | ||
31 | unsigned long flags; | ||
32 | flags = arch_local_save_flags(); | ||
33 | arch_local_irq_disable(); | ||
34 | return flags; | ||
35 | } | ||
36 | |||
37 | static inline bool arch_irqs_disabled(void) | ||
38 | { | ||
39 | return arch_local_save_flags() == 0; | ||
40 | } | ||
5 | 41 | ||
6 | #endif | 42 | #endif |
diff --git a/arch/um/include/asm/kdebug.h b/arch/um/include/asm/kdebug.h deleted file mode 100644 index 6ece1b037665..000000000000 --- a/arch/um/include/asm/kdebug.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | #include <asm-generic/kdebug.h> | ||
diff --git a/arch/um/include/asm/mmu.h b/arch/um/include/asm/mmu.h index cf259de51531..30509b9f37fd 100644 --- a/arch/um/include/asm/mmu.h +++ b/arch/um/include/asm/mmu.h | |||
@@ -1,12 +1,24 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) | 2 | * Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) |
3 | * Licensed under the GPL | 3 | * Licensed under the GPL |
4 | */ | 4 | */ |
5 | 5 | ||
6 | #ifndef __MMU_H | 6 | #ifndef __ARCH_UM_MMU_H |
7 | #define __MMU_H | 7 | #define __ARCH_UM_MMU_H |
8 | 8 | ||
9 | #include "um_mmu.h" | 9 | #include "mm_id.h" |
10 | #include <asm/mm_context.h> | ||
10 | 11 | ||
11 | #endif | 12 | typedef struct mm_context { |
13 | struct mm_id id; | ||
14 | struct uml_arch_mm_context arch; | ||
15 | struct page **stub_pages; | ||
16 | } mm_context_t; | ||
17 | |||
18 | extern void __switch_mm(struct mm_id * mm_idp); | ||
12 | 19 | ||
20 | /* Avoid tangled inclusion with asm/ldt.h */ | ||
21 | extern long init_new_ldt(struct mm_context *to_mm, struct mm_context *from_mm); | ||
22 | extern void free_ldt(struct mm_context *mm); | ||
23 | |||
24 | #endif | ||
diff --git a/arch/um/include/asm/mmu_context.h b/arch/um/include/asm/mmu_context.h index 34d813011b7a..591b3d8d7614 100644 --- a/arch/um/include/asm/mmu_context.h +++ b/arch/um/include/asm/mmu_context.h | |||
@@ -6,15 +6,12 @@ | |||
6 | #ifndef __UM_MMU_CONTEXT_H | 6 | #ifndef __UM_MMU_CONTEXT_H |
7 | #define __UM_MMU_CONTEXT_H | 7 | #define __UM_MMU_CONTEXT_H |
8 | 8 | ||
9 | #include "linux/sched.h" | 9 | #include <linux/sched.h> |
10 | #include "um_mmu.h" | 10 | #include <asm/mmu.h> |
11 | 11 | ||
12 | extern void arch_dup_mmap(struct mm_struct *oldmm, struct mm_struct *mm); | 12 | extern void arch_dup_mmap(struct mm_struct *oldmm, struct mm_struct *mm); |
13 | extern void arch_exit_mmap(struct mm_struct *mm); | 13 | extern void arch_exit_mmap(struct mm_struct *mm); |
14 | 14 | ||
15 | #define get_mmu_context(task) do ; while(0) | ||
16 | #define activate_context(tsk) do ; while(0) | ||
17 | |||
18 | #define deactivate_mm(tsk,mm) do { } while (0) | 15 | #define deactivate_mm(tsk,mm) do { } while (0) |
19 | 16 | ||
20 | extern void force_flush_all(void); | 17 | extern void force_flush_all(void); |
diff --git a/arch/um/include/asm/page.h b/arch/um/include/asm/page.h index 4cc9b6cf480a..7cfc3cedce84 100644 --- a/arch/um/include/asm/page.h +++ b/arch/um/include/asm/page.h | |||
@@ -19,7 +19,7 @@ | |||
19 | struct page; | 19 | struct page; |
20 | 20 | ||
21 | #include <linux/types.h> | 21 | #include <linux/types.h> |
22 | #include <sysdep/vm-flags.h> | 22 | #include <asm/vm-flags.h> |
23 | 23 | ||
24 | /* | 24 | /* |
25 | * These are used to make use of C type-checking.. | 25 | * These are used to make use of C type-checking.. |
diff --git a/arch/um/include/asm/page_offset.h b/arch/um/include/asm/page_offset.h deleted file mode 100644 index 1c168dfbf359..000000000000 --- a/arch/um/include/asm/page_offset.h +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | #define PAGE_OFFSET_RAW (uml_physmem) | ||
diff --git a/arch/um/include/asm/pda.h b/arch/um/include/asm/pda.h deleted file mode 100644 index ddcd774fc2a0..000000000000 --- a/arch/um/include/asm/pda.h +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright 2003 PathScale, Inc. | ||
3 | * | ||
4 | * Licensed under the GPL | ||
5 | */ | ||
6 | |||
7 | #ifndef __UM_PDA_X86_64_H | ||
8 | #define __UM_PDA_X86_64_H | ||
9 | |||
10 | /* XXX */ | ||
11 | struct foo { | ||
12 | unsigned int __softirq_pending; | ||
13 | unsigned int __nmi_count; | ||
14 | }; | ||
15 | |||
16 | extern struct foo me; | ||
17 | |||
18 | #define read_pda(me) (&me) | ||
19 | |||
20 | #endif | ||
21 | |||
diff --git a/arch/um/include/asm/percpu.h b/arch/um/include/asm/percpu.h deleted file mode 100644 index efe7508d8abd..000000000000 --- a/arch/um/include/asm/percpu.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef __UM_PERCPU_H | ||
2 | #define __UM_PERCPU_H | ||
3 | |||
4 | #include <asm-generic/percpu.h> | ||
5 | |||
6 | #endif /* __UM_PERCPU_H */ | ||
diff --git a/arch/um/include/asm/ptrace-generic.h b/arch/um/include/asm/ptrace-generic.h index 1a7d2757fe05..f605d3c4844c 100644 --- a/arch/um/include/asm/ptrace-generic.h +++ b/arch/um/include/asm/ptrace-generic.h | |||
@@ -23,17 +23,10 @@ struct pt_regs { | |||
23 | #define PT_REGS_IP(r) UPT_IP(&(r)->regs) | 23 | #define PT_REGS_IP(r) UPT_IP(&(r)->regs) |
24 | #define PT_REGS_SP(r) UPT_SP(&(r)->regs) | 24 | #define PT_REGS_SP(r) UPT_SP(&(r)->regs) |
25 | 25 | ||
26 | #define PT_REG(r, reg) UPT_REG(&(r)->regs, reg) | ||
27 | #define PT_REGS_SET(r, reg, val) UPT_SET(&(r)->regs, reg, val) | ||
28 | |||
29 | #define PT_REGS_SET_SYSCALL_RETURN(r, res) \ | ||
30 | UPT_SET_SYSCALL_RETURN(&(r)->regs, res) | ||
31 | #define PT_REGS_RESTART_SYSCALL(r) UPT_RESTART_SYSCALL(&(r)->regs) | 26 | #define PT_REGS_RESTART_SYSCALL(r) UPT_RESTART_SYSCALL(&(r)->regs) |
32 | 27 | ||
33 | #define PT_REGS_SYSCALL_NR(r) UPT_SYSCALL_NR(&(r)->regs) | 28 | #define PT_REGS_SYSCALL_NR(r) UPT_SYSCALL_NR(&(r)->regs) |
34 | 29 | ||
35 | #define PT_REGS_SC(r) UPT_SC(&(r)->regs) | ||
36 | |||
37 | #define instruction_pointer(regs) PT_REGS_IP(regs) | 30 | #define instruction_pointer(regs) PT_REGS_IP(regs) |
38 | 31 | ||
39 | struct task_struct; | 32 | struct task_struct; |
diff --git a/arch/um/include/asm/required-features.h b/arch/um/include/asm/required-features.h deleted file mode 100644 index dfb967b2d2f3..000000000000 --- a/arch/um/include/asm/required-features.h +++ /dev/null | |||
@@ -1,9 +0,0 @@ | |||
1 | #ifndef __UM_REQUIRED_FEATURES_H | ||
2 | #define __UM_REQUIRED_FEATURES_H | ||
3 | |||
4 | /* | ||
5 | * Nothing to see, just need something for the i386 and x86_64 asm | ||
6 | * headers to include. | ||
7 | */ | ||
8 | |||
9 | #endif | ||
diff --git a/arch/um/include/asm/sections.h b/arch/um/include/asm/sections.h deleted file mode 100644 index 6b0231eefea8..000000000000 --- a/arch/um/include/asm/sections.h +++ /dev/null | |||
@@ -1,7 +0,0 @@ | |||
1 | #ifndef _UM_SECTIONS_H | ||
2 | #define _UM_SECTIONS_H | ||
3 | |||
4 | /* nothing to see, move along */ | ||
5 | #include <asm-generic/sections.h> | ||
6 | |||
7 | #endif | ||
diff --git a/arch/um/include/asm/segment.h b/arch/um/include/asm/segment.h deleted file mode 100644 index 45183fcd10b6..000000000000 --- a/arch/um/include/asm/segment.h +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | #ifndef __UM_SEGMENT_H | ||
2 | #define __UM_SEGMENT_H | ||
3 | |||
4 | extern int host_gdt_entry_tls_min; | ||
5 | |||
6 | #define GDT_ENTRY_TLS_ENTRIES 3 | ||
7 | #define GDT_ENTRY_TLS_MIN host_gdt_entry_tls_min | ||
8 | #define GDT_ENTRY_TLS_MAX (GDT_ENTRY_TLS_MIN + GDT_ENTRY_TLS_ENTRIES - 1) | ||
9 | |||
10 | #endif | ||
diff --git a/arch/um/include/asm/system.h b/arch/um/include/asm/system.h deleted file mode 100644 index 68a90ecd1450..000000000000 --- a/arch/um/include/asm/system.h +++ /dev/null | |||
@@ -1,47 +0,0 @@ | |||
1 | #ifndef __UM_SYSTEM_GENERIC_H | ||
2 | #define __UM_SYSTEM_GENERIC_H | ||
3 | |||
4 | #include "sysdep/system.h" | ||
5 | |||
6 | extern int get_signals(void); | ||
7 | extern int set_signals(int enable); | ||
8 | extern void block_signals(void); | ||
9 | extern void unblock_signals(void); | ||
10 | |||
11 | static inline unsigned long arch_local_save_flags(void) | ||
12 | { | ||
13 | return get_signals(); | ||
14 | } | ||
15 | |||
16 | static inline void arch_local_irq_restore(unsigned long flags) | ||
17 | { | ||
18 | set_signals(flags); | ||
19 | } | ||
20 | |||
21 | static inline void arch_local_irq_enable(void) | ||
22 | { | ||
23 | unblock_signals(); | ||
24 | } | ||
25 | |||
26 | static inline void arch_local_irq_disable(void) | ||
27 | { | ||
28 | block_signals(); | ||
29 | } | ||
30 | |||
31 | static inline unsigned long arch_local_irq_save(void) | ||
32 | { | ||
33 | unsigned long flags; | ||
34 | flags = arch_local_save_flags(); | ||
35 | arch_local_irq_disable(); | ||
36 | return flags; | ||
37 | } | ||
38 | |||
39 | static inline bool arch_irqs_disabled(void) | ||
40 | { | ||
41 | return arch_local_save_flags() == 0; | ||
42 | } | ||
43 | |||
44 | extern void *_switch_to(void *prev, void *next, void *last); | ||
45 | #define switch_to(prev, next, last) prev = _switch_to(prev, next, last) | ||
46 | |||
47 | #endif | ||
diff --git a/arch/um/include/asm/topology.h b/arch/um/include/asm/topology.h deleted file mode 100644 index 0905e4f21d42..000000000000 --- a/arch/um/include/asm/topology.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef _ASM_UM_TOPOLOGY_H | ||
2 | #define _ASM_UM_TOPOLOGY_H | ||
3 | |||
4 | #include <asm-generic/topology.h> | ||
5 | |||
6 | #endif | ||
diff --git a/arch/um/include/asm/uaccess.h b/arch/um/include/asm/uaccess.h index b9a895d6fa1d..3f22fbf7ca1d 100644 --- a/arch/um/include/asm/uaccess.h +++ b/arch/um/include/asm/uaccess.h | |||
@@ -6,15 +6,15 @@ | |||
6 | #ifndef __UM_UACCESS_H | 6 | #ifndef __UM_UACCESS_H |
7 | #define __UM_UACCESS_H | 7 | #define __UM_UACCESS_H |
8 | 8 | ||
9 | #include <asm/errno.h> | ||
10 | #include <asm/processor.h> | ||
11 | |||
12 | /* thread_info has a mm_segment_t in it, so put the definition up here */ | 9 | /* thread_info has a mm_segment_t in it, so put the definition up here */ |
13 | typedef struct { | 10 | typedef struct { |
14 | unsigned long seg; | 11 | unsigned long seg; |
15 | } mm_segment_t; | 12 | } mm_segment_t; |
16 | 13 | ||
17 | #include "linux/thread_info.h" | 14 | #include <linux/thread_info.h> |
15 | #include <linux/errno.h> | ||
16 | #include <asm/processor.h> | ||
17 | #include <asm/elf.h> | ||
18 | 18 | ||
19 | #define VERIFY_READ 0 | 19 | #define VERIFY_READ 0 |
20 | #define VERIFY_WRITE 1 | 20 | #define VERIFY_WRITE 1 |
@@ -38,7 +38,86 @@ typedef struct { | |||
38 | 38 | ||
39 | #define segment_eq(a, b) ((a).seg == (b).seg) | 39 | #define segment_eq(a, b) ((a).seg == (b).seg) |
40 | 40 | ||
41 | #include "um_uaccess.h" | 41 | #define __under_task_size(addr, size) \ |
42 | (((unsigned long) (addr) < TASK_SIZE) && \ | ||
43 | (((unsigned long) (addr) + (size)) < TASK_SIZE)) | ||
44 | |||
45 | #define __access_ok_vsyscall(type, addr, size) \ | ||
46 | ((type == VERIFY_READ) && \ | ||
47 | ((unsigned long) (addr) >= FIXADDR_USER_START) && \ | ||
48 | ((unsigned long) (addr) + (size) <= FIXADDR_USER_END) && \ | ||
49 | ((unsigned long) (addr) + (size) >= (unsigned long)(addr))) | ||
50 | |||
51 | #define __addr_range_nowrap(addr, size) \ | ||
52 | ((unsigned long) (addr) <= ((unsigned long) (addr) + (size))) | ||
53 | |||
54 | #define access_ok(type, addr, size) \ | ||
55 | (__addr_range_nowrap(addr, size) && \ | ||
56 | (__under_task_size(addr, size) || \ | ||
57 | __access_ok_vsyscall(type, addr, size) || \ | ||
58 | segment_eq(get_fs(), KERNEL_DS))) | ||
59 | |||
60 | extern int copy_from_user(void *to, const void __user *from, int n); | ||
61 | extern int copy_to_user(void __user *to, const void *from, int n); | ||
62 | |||
63 | /* | ||
64 | * strncpy_from_user: - Copy a NUL terminated string from userspace. | ||
65 | * @dst: Destination address, in kernel space. This buffer must be at | ||
66 | * least @count bytes long. | ||
67 | * @src: Source address, in user space. | ||
68 | * @count: Maximum number of bytes to copy, including the trailing NUL. | ||
69 | * | ||
70 | * Copies a NUL-terminated string from userspace to kernel space. | ||
71 | * | ||
72 | * On success, returns the length of the string (not including the trailing | ||
73 | * NUL). | ||
74 | * | ||
75 | * If access to userspace fails, returns -EFAULT (some data may have been | ||
76 | * copied). | ||
77 | * | ||
78 | * If @count is smaller than the length of the string, copies @count bytes | ||
79 | * and returns @count. | ||
80 | */ | ||
81 | |||
82 | extern int strncpy_from_user(char *dst, const char __user *src, int count); | ||
83 | |||
84 | /* | ||
85 | * __clear_user: - Zero a block of memory in user space, with less checking. | ||
86 | * @to: Destination address, in user space. | ||
87 | * @n: Number of bytes to zero. | ||
88 | * | ||
89 | * Zero a block of memory in user space. Caller must check | ||
90 | * the specified block with access_ok() before calling this function. | ||
91 | * | ||
92 | * Returns number of bytes that could not be cleared. | ||
93 | * On success, this will be zero. | ||
94 | */ | ||
95 | extern int __clear_user(void __user *mem, int len); | ||
96 | |||
97 | /* | ||
98 | * clear_user: - Zero a block of memory in user space. | ||
99 | * @to: Destination address, in user space. | ||
100 | * @n: Number of bytes to zero. | ||
101 | * | ||
102 | * Zero a block of memory in user space. | ||
103 | * | ||
104 | * Returns number of bytes that could not be cleared. | ||
105 | * On success, this will be zero. | ||
106 | */ | ||
107 | extern int clear_user(void __user *mem, int len); | ||
108 | |||
109 | /* | ||
110 | * strlen_user: - Get the size of a string in user space. | ||
111 | * @str: The string to measure. | ||
112 | * @n: The maximum valid length | ||
113 | * | ||
114 | * Get the size of a NUL-terminated string in user space. | ||
115 | * | ||
116 | * Returns the size of the string INCLUDING the terminating NUL. | ||
117 | * On exception, returns 0. | ||
118 | * If the string is too long, returns a value greater than @n. | ||
119 | */ | ||
120 | extern int strnlen_user(const void __user *str, int len); | ||
42 | 121 | ||
43 | #define __copy_from_user(to, from, n) copy_from_user(to, from, n) | 122 | #define __copy_from_user(to, from, n) copy_from_user(to, from, n) |
44 | 123 | ||
diff --git a/arch/um/include/asm/xor.h b/arch/um/include/asm/xor.h deleted file mode 100644 index a19db3e17241..000000000000 --- a/arch/um/include/asm/xor.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef __UM_XOR_H | ||
2 | #define __UM_XOR_H | ||
3 | |||
4 | #include "asm-generic/xor.h" | ||
5 | |||
6 | #endif | ||