diff options
Diffstat (limited to 'arch/um/include')
55 files changed, 153 insertions, 885 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 | ||
diff --git a/arch/um/include/shared/as-layout.h b/arch/um/include/shared/as-layout.h index a92b678503cf..896e16602176 100644 --- a/arch/um/include/shared/as-layout.h +++ b/arch/um/include/shared/as-layout.h | |||
@@ -6,7 +6,7 @@ | |||
6 | #ifndef __START_H__ | 6 | #ifndef __START_H__ |
7 | #define __START_H__ | 7 | #define __START_H__ |
8 | 8 | ||
9 | #include "kern_constants.h" | 9 | #include <generated/asm-offsets.h> |
10 | 10 | ||
11 | /* | 11 | /* |
12 | * Stolen from linux/const.h, which can't be directly included since | 12 | * Stolen from linux/const.h, which can't be directly included since |
diff --git a/arch/um/include/shared/chan_kern.h b/arch/um/include/shared/chan_kern.h deleted file mode 100644 index 1e651457e049..000000000000 --- a/arch/um/include/shared/chan_kern.h +++ /dev/null | |||
@@ -1,50 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2000, 2001 Jeff Dike (jdike@karaya.com) | ||
3 | * Licensed under the GPL | ||
4 | */ | ||
5 | |||
6 | #ifndef __CHAN_KERN_H__ | ||
7 | #define __CHAN_KERN_H__ | ||
8 | |||
9 | #include "linux/tty.h" | ||
10 | #include "linux/list.h" | ||
11 | #include "linux/console.h" | ||
12 | #include "chan_user.h" | ||
13 | #include "line.h" | ||
14 | |||
15 | struct chan { | ||
16 | struct list_head list; | ||
17 | struct list_head free_list; | ||
18 | struct line *line; | ||
19 | char *dev; | ||
20 | unsigned int primary:1; | ||
21 | unsigned int input:1; | ||
22 | unsigned int output:1; | ||
23 | unsigned int opened:1; | ||
24 | unsigned int enabled:1; | ||
25 | int fd; | ||
26 | const struct chan_ops *ops; | ||
27 | void *data; | ||
28 | }; | ||
29 | |||
30 | extern void chan_interrupt(struct list_head *chans, struct delayed_work *task, | ||
31 | struct tty_struct *tty, int irq); | ||
32 | extern int parse_chan_pair(char *str, struct line *line, int device, | ||
33 | const struct chan_opts *opts, char **error_out); | ||
34 | extern int write_chan(struct list_head *chans, const char *buf, int len, | ||
35 | int write_irq); | ||
36 | extern int console_write_chan(struct list_head *chans, const char *buf, | ||
37 | int len); | ||
38 | extern int console_open_chan(struct line *line, struct console *co); | ||
39 | extern void deactivate_chan(struct list_head *chans, int irq); | ||
40 | extern void reactivate_chan(struct list_head *chans, int irq); | ||
41 | extern void chan_enable_winch(struct list_head *chans, struct tty_struct *tty); | ||
42 | extern int enable_chan(struct line *line); | ||
43 | extern void close_chan(struct list_head *chans, int delay_free_irq); | ||
44 | extern int chan_window_size(struct list_head *chans, | ||
45 | unsigned short *rows_out, | ||
46 | unsigned short *cols_out); | ||
47 | extern int chan_config_string(struct list_head *chans, char *str, int size, | ||
48 | char **error_out); | ||
49 | |||
50 | #endif | ||
diff --git a/arch/um/include/shared/chan_user.h b/arch/um/include/shared/chan_user.h deleted file mode 100644 index 9b9ced85b703..000000000000 --- a/arch/um/include/shared/chan_user.h +++ /dev/null | |||
@@ -1,55 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2000, 2001 Jeff Dike (jdike@karaya.com) | ||
3 | * Licensed under the GPL | ||
4 | */ | ||
5 | |||
6 | #ifndef __CHAN_USER_H__ | ||
7 | #define __CHAN_USER_H__ | ||
8 | |||
9 | #include "init.h" | ||
10 | |||
11 | struct chan_opts { | ||
12 | void (*const announce)(char *dev_name, int dev); | ||
13 | char *xterm_title; | ||
14 | const int raw; | ||
15 | }; | ||
16 | |||
17 | enum chan_init_pri { INIT_STATIC, INIT_ALL, INIT_ONE }; | ||
18 | |||
19 | struct chan_ops { | ||
20 | char *type; | ||
21 | void *(*init)(char *, int, const struct chan_opts *); | ||
22 | int (*open)(int, int, int, void *, char **); | ||
23 | void (*close)(int, void *); | ||
24 | int (*read)(int, char *, void *); | ||
25 | int (*write)(int, const char *, int, void *); | ||
26 | int (*console_write)(int, const char *, int); | ||
27 | int (*window_size)(int, void *, unsigned short *, unsigned short *); | ||
28 | void (*free)(void *); | ||
29 | int winch; | ||
30 | }; | ||
31 | |||
32 | extern const struct chan_ops fd_ops, null_ops, port_ops, pts_ops, pty_ops, | ||
33 | tty_ops, xterm_ops; | ||
34 | |||
35 | extern void generic_close(int fd, void *unused); | ||
36 | extern int generic_read(int fd, char *c_out, void *unused); | ||
37 | extern int generic_write(int fd, const char *buf, int n, void *unused); | ||
38 | extern int generic_console_write(int fd, const char *buf, int n); | ||
39 | extern int generic_window_size(int fd, void *unused, unsigned short *rows_out, | ||
40 | unsigned short *cols_out); | ||
41 | extern void generic_free(void *data); | ||
42 | |||
43 | struct tty_struct; | ||
44 | extern void register_winch(int fd, struct tty_struct *tty); | ||
45 | extern void register_winch_irq(int fd, int tty_fd, int pid, | ||
46 | struct tty_struct *tty, unsigned long stack); | ||
47 | |||
48 | #define __channel_help(fn, prefix) \ | ||
49 | __uml_help(fn, prefix "[0-9]*=<channel description>\n" \ | ||
50 | " Attach a console or serial line to a host channel. See\n" \ | ||
51 | " http://user-mode-linux.sourceforge.net/old/input.html for a complete\n" \ | ||
52 | " description of this switch.\n\n" \ | ||
53 | ); | ||
54 | |||
55 | #endif | ||
diff --git a/arch/um/include/shared/common-offsets.h b/arch/um/include/shared/common-offsets.h index 72009c7e3210..d7fe563aa7e7 100644 --- a/arch/um/include/shared/common-offsets.h +++ b/arch/um/include/shared/common-offsets.h | |||
@@ -2,7 +2,6 @@ | |||
2 | 2 | ||
3 | DEFINE(KERNEL_MADV_REMOVE, MADV_REMOVE); | 3 | DEFINE(KERNEL_MADV_REMOVE, MADV_REMOVE); |
4 | 4 | ||
5 | OFFSET(HOST_TASK_REGS, task_struct, thread.regs); | ||
6 | OFFSET(HOST_TASK_PID, task_struct, pid); | 5 | OFFSET(HOST_TASK_PID, task_struct, pid); |
7 | 6 | ||
8 | DEFINE(UM_KERN_PAGE_SIZE, PAGE_SIZE); | 7 | DEFINE(UM_KERN_PAGE_SIZE, PAGE_SIZE); |
diff --git a/arch/um/include/shared/initrd.h b/arch/um/include/shared/initrd.h deleted file mode 100644 index 22673bcc273d..000000000000 --- a/arch/um/include/shared/initrd.h +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2000 Jeff Dike (jdike@karaya.com) | ||
3 | * Licensed under the GPL | ||
4 | */ | ||
5 | |||
6 | #ifndef __INITRD_USER_H__ | ||
7 | #define __INITRD_USER_H__ | ||
8 | |||
9 | extern int load_initrd(char *filename, void *buf, int size); | ||
10 | |||
11 | #endif | ||
12 | |||
diff --git a/arch/um/include/shared/kern.h b/arch/um/include/shared/kern.h index 4ce3fc650e57..6cd01240bbf0 100644 --- a/arch/um/include/shared/kern.h +++ b/arch/um/include/shared/kern.h | |||
@@ -13,28 +13,10 @@ | |||
13 | * includes. | 13 | * includes. |
14 | */ | 14 | */ |
15 | 15 | ||
16 | extern int errno; | ||
17 | |||
18 | extern int clone(int (*proc)(void *), void *sp, int flags, void *data); | ||
19 | extern int sleep(int); | ||
20 | extern int printf(const char *fmt, ...); | 16 | extern int printf(const char *fmt, ...); |
21 | extern char *strerror(int errnum); | ||
22 | extern char *ptsname(int __fd); | ||
23 | extern int munmap(void *, int); | ||
24 | extern void *sbrk(int increment); | 17 | extern void *sbrk(int increment); |
25 | extern void *malloc(int size); | ||
26 | extern void perror(char *err); | ||
27 | extern int kill(int pid, int sig); | ||
28 | extern int getuid(void); | ||
29 | extern int getgid(void); | ||
30 | extern int pause(void); | 18 | extern int pause(void); |
31 | extern int write(int, const void *, int); | ||
32 | extern void exit(int); | 19 | extern void exit(int); |
33 | extern int close(int); | ||
34 | extern int read(unsigned int, char *, int); | ||
35 | extern int pipe(int *); | ||
36 | extern int sched_yield(void); | ||
37 | extern int ptrace(int op, int pid, long addr, long data); | ||
38 | 20 | ||
39 | #endif | 21 | #endif |
40 | 22 | ||
diff --git a/arch/um/include/shared/kern_util.h b/arch/um/include/shared/kern_util.h index 3c341222d252..0f1483852460 100644 --- a/arch/um/include/shared/kern_util.h +++ b/arch/um/include/shared/kern_util.h | |||
@@ -21,7 +21,6 @@ extern unsigned long alloc_stack(int order, int atomic); | |||
21 | extern void free_stack(unsigned long stack, int order); | 21 | extern void free_stack(unsigned long stack, int order); |
22 | 22 | ||
23 | extern int do_signal(void); | 23 | extern int do_signal(void); |
24 | extern void copy_sc(struct uml_pt_regs *regs, void *from); | ||
25 | extern void interrupt_end(void); | 24 | extern void interrupt_end(void); |
26 | extern void relay_signal(int sig, struct uml_pt_regs *regs); | 25 | extern void relay_signal(int sig, struct uml_pt_regs *regs); |
27 | 26 | ||
diff --git a/arch/um/include/shared/ldt.h b/arch/um/include/shared/ldt.h deleted file mode 100644 index a7f999a58774..000000000000 --- a/arch/um/include/shared/ldt.h +++ /dev/null | |||
@@ -1,37 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2004 Fujitsu Siemens Computers GmbH | ||
3 | * Licensed under the GPL | ||
4 | * | ||
5 | * Author: Bodo Stroesser <bstroesser@fujitsu-siemens.com> | ||
6 | */ | ||
7 | |||
8 | #ifndef __ASM_LDT_H | ||
9 | #define __ASM_LDT_H | ||
10 | |||
11 | #include <linux/mutex.h> | ||
12 | #include <sysdep/host_ldt.h> | ||
13 | |||
14 | extern void ldt_host_info(void); | ||
15 | |||
16 | #define LDT_PAGES_MAX \ | ||
17 | ((LDT_ENTRIES * LDT_ENTRY_SIZE)/PAGE_SIZE) | ||
18 | #define LDT_ENTRIES_PER_PAGE \ | ||
19 | (PAGE_SIZE/LDT_ENTRY_SIZE) | ||
20 | #define LDT_DIRECT_ENTRIES \ | ||
21 | ((LDT_PAGES_MAX*sizeof(void *))/LDT_ENTRY_SIZE) | ||
22 | |||
23 | struct ldt_entry { | ||
24 | __u32 a; | ||
25 | __u32 b; | ||
26 | }; | ||
27 | |||
28 | typedef struct uml_ldt { | ||
29 | int entry_count; | ||
30 | struct mutex lock; | ||
31 | union { | ||
32 | struct ldt_entry * pages[LDT_PAGES_MAX]; | ||
33 | struct ldt_entry entries[LDT_DIRECT_ENTRIES]; | ||
34 | } u; | ||
35 | } uml_ldt_t; | ||
36 | |||
37 | #endif | ||
diff --git a/arch/um/include/shared/line.h b/arch/um/include/shared/line.h deleted file mode 100644 index 63df3ca02ac2..000000000000 --- a/arch/um/include/shared/line.h +++ /dev/null | |||
@@ -1,106 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2001, 2002 Jeff Dike (jdike@karaya.com) | ||
3 | * Licensed under the GPL | ||
4 | */ | ||
5 | |||
6 | #ifndef __LINE_H__ | ||
7 | #define __LINE_H__ | ||
8 | |||
9 | #include "linux/list.h" | ||
10 | #include "linux/workqueue.h" | ||
11 | #include "linux/tty.h" | ||
12 | #include "linux/interrupt.h" | ||
13 | #include "linux/spinlock.h" | ||
14 | #include "linux/mutex.h" | ||
15 | #include "chan_user.h" | ||
16 | #include "mconsole_kern.h" | ||
17 | |||
18 | /* There's only one modifiable field in this - .mc.list */ | ||
19 | struct line_driver { | ||
20 | const char *name; | ||
21 | const char *device_name; | ||
22 | const short major; | ||
23 | const short minor_start; | ||
24 | const short type; | ||
25 | const short subtype; | ||
26 | const int read_irq; | ||
27 | const char *read_irq_name; | ||
28 | const int write_irq; | ||
29 | const char *write_irq_name; | ||
30 | struct mc_device mc; | ||
31 | }; | ||
32 | |||
33 | struct line { | ||
34 | struct tty_struct *tty; | ||
35 | spinlock_t count_lock; | ||
36 | unsigned long count; | ||
37 | int valid; | ||
38 | |||
39 | char *init_str; | ||
40 | int init_pri; | ||
41 | struct list_head chan_list; | ||
42 | |||
43 | /*This lock is actually, mostly, local to*/ | ||
44 | spinlock_t lock; | ||
45 | int throttled; | ||
46 | /* Yes, this is a real circular buffer. | ||
47 | * XXX: And this should become a struct kfifo! | ||
48 | * | ||
49 | * buffer points to a buffer allocated on demand, of length | ||
50 | * LINE_BUFSIZE, head to the start of the ring, tail to the end.*/ | ||
51 | char *buffer; | ||
52 | char *head; | ||
53 | char *tail; | ||
54 | |||
55 | int sigio; | ||
56 | struct delayed_work task; | ||
57 | const struct line_driver *driver; | ||
58 | int have_irq; | ||
59 | }; | ||
60 | |||
61 | #define LINE_INIT(str, d) \ | ||
62 | { .count_lock = __SPIN_LOCK_UNLOCKED((str).count_lock), \ | ||
63 | .init_str = str, \ | ||
64 | .init_pri = INIT_STATIC, \ | ||
65 | .valid = 1, \ | ||
66 | .lock = __SPIN_LOCK_UNLOCKED((str).lock), \ | ||
67 | .driver = d } | ||
68 | |||
69 | extern void line_close(struct tty_struct *tty, struct file * filp); | ||
70 | extern int line_open(struct line *lines, struct tty_struct *tty); | ||
71 | extern int line_setup(struct line *lines, unsigned int sizeof_lines, | ||
72 | char *init, char **error_out); | ||
73 | extern int line_write(struct tty_struct *tty, const unsigned char *buf, | ||
74 | int len); | ||
75 | extern int line_put_char(struct tty_struct *tty, unsigned char ch); | ||
76 | extern void line_set_termios(struct tty_struct *tty, struct ktermios * old); | ||
77 | extern int line_chars_in_buffer(struct tty_struct *tty); | ||
78 | extern void line_flush_buffer(struct tty_struct *tty); | ||
79 | extern void line_flush_chars(struct tty_struct *tty); | ||
80 | extern int line_write_room(struct tty_struct *tty); | ||
81 | extern int line_ioctl(struct tty_struct *tty, unsigned int cmd, | ||
82 | unsigned long arg); | ||
83 | extern void line_throttle(struct tty_struct *tty); | ||
84 | extern void line_unthrottle(struct tty_struct *tty); | ||
85 | |||
86 | extern char *add_xterm_umid(char *base); | ||
87 | extern int line_setup_irq(int fd, int input, int output, struct line *line, | ||
88 | void *data); | ||
89 | extern void line_close_chan(struct line *line); | ||
90 | extern struct tty_driver *register_lines(struct line_driver *line_driver, | ||
91 | const struct tty_operations *driver, | ||
92 | struct line *lines, int nlines); | ||
93 | extern void lines_init(struct line *lines, int nlines, struct chan_opts *opts); | ||
94 | extern void close_lines(struct line *lines, int nlines); | ||
95 | |||
96 | extern int line_config(struct line *lines, unsigned int sizeof_lines, | ||
97 | char *str, const struct chan_opts *opts, | ||
98 | char **error_out); | ||
99 | extern int line_id(char **str, int *start_out, int *end_out); | ||
100 | extern int line_remove(struct line *lines, unsigned int sizeof_lines, int n, | ||
101 | char **error_out); | ||
102 | extern int line_get_config(char *dev, struct line *lines, | ||
103 | unsigned int sizeof_lines, char *str, | ||
104 | int size, char **error_out); | ||
105 | |||
106 | #endif | ||
diff --git a/arch/um/include/shared/mconsole.h b/arch/um/include/shared/mconsole.h deleted file mode 100644 index c139ae1d6826..000000000000 --- a/arch/um/include/shared/mconsole.h +++ /dev/null | |||
@@ -1,98 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2001 Lennert Buytenhek (buytenh@gnu.org) | ||
3 | * Copyright (C) 2001 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) | ||
4 | * Licensed under the GPL | ||
5 | */ | ||
6 | |||
7 | #ifndef __MCONSOLE_H__ | ||
8 | #define __MCONSOLE_H__ | ||
9 | |||
10 | #ifndef __KERNEL__ | ||
11 | #include <stdint.h> | ||
12 | #define u32 uint32_t | ||
13 | #endif | ||
14 | |||
15 | #include "sysdep/ptrace.h" | ||
16 | |||
17 | #define MCONSOLE_MAGIC (0xcafebabe) | ||
18 | #define MCONSOLE_MAX_DATA (512) | ||
19 | #define MCONSOLE_VERSION 2 | ||
20 | |||
21 | struct mconsole_request { | ||
22 | u32 magic; | ||
23 | u32 version; | ||
24 | u32 len; | ||
25 | char data[MCONSOLE_MAX_DATA]; | ||
26 | }; | ||
27 | |||
28 | struct mconsole_reply { | ||
29 | u32 err; | ||
30 | u32 more; | ||
31 | u32 len; | ||
32 | char data[MCONSOLE_MAX_DATA]; | ||
33 | }; | ||
34 | |||
35 | struct mconsole_notify { | ||
36 | u32 magic; | ||
37 | u32 version; | ||
38 | enum { MCONSOLE_SOCKET, MCONSOLE_PANIC, MCONSOLE_HANG, | ||
39 | MCONSOLE_USER_NOTIFY } type; | ||
40 | u32 len; | ||
41 | char data[MCONSOLE_MAX_DATA]; | ||
42 | }; | ||
43 | |||
44 | struct mc_request; | ||
45 | |||
46 | enum mc_context { MCONSOLE_INTR, MCONSOLE_PROC }; | ||
47 | |||
48 | struct mconsole_command | ||
49 | { | ||
50 | char *command; | ||
51 | void (*handler)(struct mc_request *req); | ||
52 | enum mc_context context; | ||
53 | }; | ||
54 | |||
55 | struct mc_request | ||
56 | { | ||
57 | int len; | ||
58 | int as_interrupt; | ||
59 | |||
60 | int originating_fd; | ||
61 | unsigned int originlen; | ||
62 | unsigned char origin[128]; /* sockaddr_un */ | ||
63 | |||
64 | struct mconsole_request request; | ||
65 | struct mconsole_command *cmd; | ||
66 | struct uml_pt_regs regs; | ||
67 | }; | ||
68 | |||
69 | extern char mconsole_socket_name[]; | ||
70 | |||
71 | extern int mconsole_unlink_socket(void); | ||
72 | extern int mconsole_reply_len(struct mc_request *req, const char *reply, | ||
73 | int len, int err, int more); | ||
74 | extern int mconsole_reply(struct mc_request *req, const char *str, int err, | ||
75 | int more); | ||
76 | |||
77 | extern void mconsole_version(struct mc_request *req); | ||
78 | extern void mconsole_help(struct mc_request *req); | ||
79 | extern void mconsole_halt(struct mc_request *req); | ||
80 | extern void mconsole_reboot(struct mc_request *req); | ||
81 | extern void mconsole_config(struct mc_request *req); | ||
82 | extern void mconsole_remove(struct mc_request *req); | ||
83 | extern void mconsole_sysrq(struct mc_request *req); | ||
84 | extern void mconsole_cad(struct mc_request *req); | ||
85 | extern void mconsole_stop(struct mc_request *req); | ||
86 | extern void mconsole_go(struct mc_request *req); | ||
87 | extern void mconsole_log(struct mc_request *req); | ||
88 | extern void mconsole_proc(struct mc_request *req); | ||
89 | extern void mconsole_stack(struct mc_request *req); | ||
90 | |||
91 | extern int mconsole_get_request(int fd, struct mc_request *req); | ||
92 | extern int mconsole_notify(char *sock_name, int type, const void *data, | ||
93 | int len); | ||
94 | extern char *mconsole_notify_socket(void); | ||
95 | extern void lock_notify(void); | ||
96 | extern void unlock_notify(void); | ||
97 | |||
98 | #endif | ||
diff --git a/arch/um/include/shared/mconsole_kern.h b/arch/um/include/shared/mconsole_kern.h deleted file mode 100644 index d2fe07e78958..000000000000 --- a/arch/um/include/shared/mconsole_kern.h +++ /dev/null | |||
@@ -1,52 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2001, 2002 Jeff Dike (jdike@karaya.com) | ||
3 | * Licensed under the GPL | ||
4 | */ | ||
5 | |||
6 | #ifndef __MCONSOLE_KERN_H__ | ||
7 | #define __MCONSOLE_KERN_H__ | ||
8 | |||
9 | #include "linux/list.h" | ||
10 | #include "mconsole.h" | ||
11 | |||
12 | struct mconsole_entry { | ||
13 | struct list_head list; | ||
14 | struct mc_request request; | ||
15 | }; | ||
16 | |||
17 | /* All these methods are called in process context. */ | ||
18 | struct mc_device { | ||
19 | struct list_head list; | ||
20 | char *name; | ||
21 | int (*config)(char *, char **); | ||
22 | int (*get_config)(char *, char *, int, char **); | ||
23 | int (*id)(char **, int *, int *); | ||
24 | int (*remove)(int, char **); | ||
25 | }; | ||
26 | |||
27 | #define CONFIG_CHUNK(str, size, current, chunk, end) \ | ||
28 | do { \ | ||
29 | current += strlen(chunk); \ | ||
30 | if(current >= size) \ | ||
31 | str = NULL; \ | ||
32 | if(str != NULL){ \ | ||
33 | strcpy(str, chunk); \ | ||
34 | str += strlen(chunk); \ | ||
35 | } \ | ||
36 | if(end) \ | ||
37 | current++; \ | ||
38 | } while(0) | ||
39 | |||
40 | #ifdef CONFIG_MCONSOLE | ||
41 | |||
42 | extern void mconsole_register_dev(struct mc_device *new); | ||
43 | |||
44 | #else | ||
45 | |||
46 | static inline void mconsole_register_dev(struct mc_device *new) | ||
47 | { | ||
48 | } | ||
49 | |||
50 | #endif | ||
51 | |||
52 | #endif | ||
diff --git a/arch/um/include/shared/mem_kern.h b/arch/um/include/shared/mem_kern.h deleted file mode 100644 index 69be0fd0ce4b..000000000000 --- a/arch/um/include/shared/mem_kern.h +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2003 Jeff Dike (jdike@addtoit.com) | ||
3 | * Licensed under the GPL | ||
4 | */ | ||
5 | |||
6 | #ifndef __MEM_KERN_H__ | ||
7 | #define __MEM_KERN_H__ | ||
8 | |||
9 | #include "linux/list.h" | ||
10 | #include "linux/types.h" | ||
11 | |||
12 | struct remapper { | ||
13 | struct list_head list; | ||
14 | int (*proc)(int, unsigned long, int, __u64); | ||
15 | }; | ||
16 | |||
17 | extern void register_remapper(struct remapper *info); | ||
18 | |||
19 | #endif | ||
20 | |||
diff --git a/arch/um/include/shared/os.h b/arch/um/include/shared/os.h index 83c7c2ecd614..89b686c1a3ea 100644 --- a/arch/um/include/shared/os.h +++ b/arch/um/include/shared/os.h | |||
@@ -10,7 +10,6 @@ | |||
10 | #include "irq_user.h" | 10 | #include "irq_user.h" |
11 | #include "longjmp.h" | 11 | #include "longjmp.h" |
12 | #include "mm_id.h" | 12 | #include "mm_id.h" |
13 | #include "sysdep/tls.h" | ||
14 | 13 | ||
15 | #define CATCH_EINTR(expr) while ((errno = 0, ((expr) < 0)) && (errno == EINTR)) | 14 | #define CATCH_EINTR(expr) while ((errno = 0, ((expr) < 0)) && (errno == EINTR)) |
16 | 15 | ||
@@ -203,12 +202,6 @@ extern int os_drop_memory(void *addr, int length); | |||
203 | extern int can_drop_memory(void); | 202 | extern int can_drop_memory(void); |
204 | extern void os_flush_stdout(void); | 203 | extern void os_flush_stdout(void); |
205 | 204 | ||
206 | /* uaccess.c */ | ||
207 | extern unsigned long __do_user_copy(void *to, const void *from, int n, | ||
208 | void **fault_addr, jmp_buf **fault_catcher, | ||
209 | void (*op)(void *to, const void *from, | ||
210 | int n), int *faulted_out); | ||
211 | |||
212 | /* execvp.c */ | 205 | /* execvp.c */ |
213 | extern int execvp_noalloc(char *buf, const char *file, char *const argv[]); | 206 | extern int execvp_noalloc(char *buf, const char *file, char *const argv[]); |
214 | /* helper.c */ | 207 | /* helper.c */ |
@@ -218,10 +211,6 @@ extern int run_helper_thread(int (*proc)(void *), void *arg, | |||
218 | extern int helper_wait(int pid); | 211 | extern int helper_wait(int pid); |
219 | 212 | ||
220 | 213 | ||
221 | /* tls.c */ | ||
222 | extern int os_set_thread_area(user_desc_t *info, int pid); | ||
223 | extern int os_get_thread_area(user_desc_t *info, int pid); | ||
224 | |||
225 | /* umid.c */ | 214 | /* umid.c */ |
226 | extern int umid_file_name(char *name, char *buf, int len); | 215 | extern int umid_file_name(char *name, char *buf, int len); |
227 | extern int set_umid(char *name); | 216 | extern int set_umid(char *name); |
@@ -231,7 +220,7 @@ extern char *get_umid(void); | |||
231 | extern void timer_init(void); | 220 | extern void timer_init(void); |
232 | extern void set_sigstack(void *sig_stack, int size); | 221 | extern void set_sigstack(void *sig_stack, int size); |
233 | extern void remove_sigstack(void); | 222 | extern void remove_sigstack(void); |
234 | extern void set_handler(int sig, void (*handler)(int), int flags, ...); | 223 | extern void set_handler(int sig); |
235 | extern int change_sig(int signal, int on); | 224 | extern int change_sig(int signal, int on); |
236 | extern void block_signals(void); | 225 | extern void block_signals(void); |
237 | extern void unblock_signals(void); | 226 | extern void unblock_signals(void); |
diff --git a/arch/um/include/shared/process.h b/arch/um/include/shared/process.h deleted file mode 100644 index bb873a51262e..000000000000 --- a/arch/um/include/shared/process.h +++ /dev/null | |||
@@ -1,17 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2000 - 2008 Jeff Dike (jdike@{addtoit,linux.intel}.com) | ||
3 | * Licensed under the GPL | ||
4 | */ | ||
5 | |||
6 | #ifndef __PROCESS_H__ | ||
7 | #define __PROCESS_H__ | ||
8 | |||
9 | #include <signal.h> | ||
10 | |||
11 | /* Copied from linux/compiler-gcc.h since we can't include it directly */ | ||
12 | #define barrier() __asm__ __volatile__("": : :"memory") | ||
13 | |||
14 | extern void sig_handler(int sig, struct sigcontext *sc); | ||
15 | extern void alarm_handler(int sig, struct sigcontext *sc); | ||
16 | |||
17 | #endif | ||
diff --git a/arch/um/include/shared/ptrace_user.h b/arch/um/include/shared/ptrace_user.h index 7fd8539bc19a..56b2f284b108 100644 --- a/arch/um/include/shared/ptrace_user.h +++ b/arch/um/include/shared/ptrace_user.h | |||
@@ -6,7 +6,8 @@ | |||
6 | #ifndef __PTRACE_USER_H__ | 6 | #ifndef __PTRACE_USER_H__ |
7 | #define __PTRACE_USER_H__ | 7 | #define __PTRACE_USER_H__ |
8 | 8 | ||
9 | #include "sysdep/ptrace_user.h" | 9 | #include <sys/ptrace.h> |
10 | #include <sysdep/ptrace_user.h> | ||
10 | 11 | ||
11 | extern int ptrace_getregs(long pid, unsigned long *regs_out); | 12 | extern int ptrace_getregs(long pid, unsigned long *regs_out); |
12 | extern int ptrace_setregs(long pid, unsigned long *regs_in); | 13 | extern int ptrace_setregs(long pid, unsigned long *regs_in); |
diff --git a/arch/um/include/shared/skas_ptregs.h b/arch/um/include/shared/skas_ptregs.h deleted file mode 100644 index 73db19e9c077..000000000000 --- a/arch/um/include/shared/skas_ptregs.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef __SKAS_PT_REGS_ | ||
2 | #define __SKAS_PT_REGS_ | ||
3 | |||
4 | #include <user_constants.h> | ||
5 | |||
6 | #endif | ||
diff --git a/arch/um/include/shared/syscall.h b/arch/um/include/shared/syscall.h deleted file mode 100644 index dda1df901a08..000000000000 --- a/arch/um/include/shared/syscall.h +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) | ||
3 | * Licensed under the GPL | ||
4 | */ | ||
5 | |||
6 | #ifndef __SYSCALL_USER_H | ||
7 | #define __SYSCALL_USER_H | ||
8 | |||
9 | extern int record_syscall_start(int syscall); | ||
10 | extern void record_syscall_end(int index, long result); | ||
11 | |||
12 | #endif | ||
diff --git a/arch/um/include/shared/task.h b/arch/um/include/shared/task.h deleted file mode 100644 index 3fe726b3cf48..000000000000 --- a/arch/um/include/shared/task.h +++ /dev/null | |||
@@ -1,9 +0,0 @@ | |||
1 | #ifndef __TASK_H | ||
2 | #define __TASK_H | ||
3 | |||
4 | #include <kern_constants.h> | ||
5 | |||
6 | #define TASK_REGS(task) ((struct uml_pt_regs *) &(((char *) (task))[HOST_TASK_REGS])) | ||
7 | #define TASK_PID(task) *((int *) &(((char *) (task))[HOST_TASK_PID])) | ||
8 | |||
9 | #endif | ||
diff --git a/arch/um/include/shared/tlb.h b/arch/um/include/shared/tlb.h deleted file mode 100644 index ecd2265b301b..000000000000 --- a/arch/um/include/shared/tlb.h +++ /dev/null | |||
@@ -1,15 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) | ||
3 | * Licensed under the GPL | ||
4 | */ | ||
5 | |||
6 | #ifndef __TLB_H__ | ||
7 | #define __TLB_H__ | ||
8 | |||
9 | #include "um_mmu.h" | ||
10 | |||
11 | extern void force_flush_all(void); | ||
12 | extern int flush_tlb_kernel_range_common(unsigned long start, | ||
13 | unsigned long end); | ||
14 | |||
15 | #endif | ||
diff --git a/arch/um/include/shared/ubd_user.h b/arch/um/include/shared/ubd_user.h deleted file mode 100644 index 3845051f1b10..000000000000 --- a/arch/um/include/shared/ubd_user.h +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2000 Jeff Dike (jdike@karaya.com) | ||
3 | * Copyright (C) 2001 RidgeRun, Inc (glonnon@ridgerun.com) | ||
4 | * Licensed under the GPL | ||
5 | */ | ||
6 | |||
7 | #ifndef __UM_UBD_USER_H | ||
8 | #define __UM_UBD_USER_H | ||
9 | |||
10 | extern void ignore_sigwinch_sig(void); | ||
11 | extern int start_io_thread(unsigned long sp, int *fds_out); | ||
12 | extern int io_thread(void *arg); | ||
13 | extern int kernel_fd; | ||
14 | |||
15 | #endif | ||
16 | |||
diff --git a/arch/um/include/shared/um_malloc.h b/arch/um/include/shared/um_malloc.h index c554d706d106..6395fef6b69b 100644 --- a/arch/um/include/shared/um_malloc.h +++ b/arch/um/include/shared/um_malloc.h | |||
@@ -6,7 +6,7 @@ | |||
6 | #ifndef __UM_MALLOC_H__ | 6 | #ifndef __UM_MALLOC_H__ |
7 | #define __UM_MALLOC_H__ | 7 | #define __UM_MALLOC_H__ |
8 | 8 | ||
9 | #include "kern_constants.h" | 9 | #include <generated/asm-offsets.h> |
10 | 10 | ||
11 | extern void *uml_kmalloc(int size, int flags); | 11 | extern void *uml_kmalloc(int size, int flags); |
12 | extern void kfree(const void *ptr); | 12 | extern void kfree(const void *ptr); |
diff --git a/arch/um/include/shared/um_mmu.h b/arch/um/include/shared/um_mmu.h deleted file mode 100644 index b1a7e47d1027..000000000000 --- a/arch/um/include/shared/um_mmu.h +++ /dev/null | |||
@@ -1,24 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) | ||
3 | * Licensed under the GPL | ||
4 | */ | ||
5 | |||
6 | #ifndef __ARCH_UM_MMU_H | ||
7 | #define __ARCH_UM_MMU_H | ||
8 | |||
9 | #include "mm_id.h" | ||
10 | #include "ldt.h" | ||
11 | |||
12 | typedef struct mm_context { | ||
13 | struct mm_id id; | ||
14 | struct uml_ldt ldt; | ||
15 | struct page **stub_pages; | ||
16 | } mm_context_t; | ||
17 | |||
18 | extern void __switch_mm(struct mm_id * mm_idp); | ||
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/shared/um_uaccess.h b/arch/um/include/shared/um_uaccess.h deleted file mode 100644 index 45c04999d670..000000000000 --- a/arch/um/include/shared/um_uaccess.h +++ /dev/null | |||
@@ -1,97 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) | ||
3 | * Licensed under the GPL | ||
4 | */ | ||
5 | |||
6 | #ifndef __ARCH_UM_UACCESS_H | ||
7 | #define __ARCH_UM_UACCESS_H | ||
8 | |||
9 | #include <asm/elf.h> | ||
10 | #include <asm/fixmap.h> | ||
11 | #include "sysdep/archsetjmp.h" | ||
12 | |||
13 | #define __under_task_size(addr, size) \ | ||
14 | (((unsigned long) (addr) < TASK_SIZE) && \ | ||
15 | (((unsigned long) (addr) + (size)) < TASK_SIZE)) | ||
16 | |||
17 | #define __access_ok_vsyscall(type, addr, size) \ | ||
18 | ((type == VERIFY_READ) && \ | ||
19 | ((unsigned long) (addr) >= FIXADDR_USER_START) && \ | ||
20 | ((unsigned long) (addr) + (size) <= FIXADDR_USER_END) && \ | ||
21 | ((unsigned long) (addr) + (size) >= (unsigned long)(addr))) | ||
22 | |||
23 | #define __addr_range_nowrap(addr, size) \ | ||
24 | ((unsigned long) (addr) <= ((unsigned long) (addr) + (size))) | ||
25 | |||
26 | #define access_ok(type, addr, size) \ | ||
27 | (__addr_range_nowrap(addr, size) && \ | ||
28 | (__under_task_size(addr, size) || \ | ||
29 | __access_ok_vsyscall(type, addr, size) || \ | ||
30 | segment_eq(get_fs(), KERNEL_DS))) | ||
31 | |||
32 | extern int copy_from_user(void *to, const void __user *from, int n); | ||
33 | extern int copy_to_user(void __user *to, const void *from, int n); | ||
34 | |||
35 | extern int __do_copy_to_user(void *to, const void *from, int n, | ||
36 | void **fault_addr, jmp_buf **fault_catcher); | ||
37 | |||
38 | /* | ||
39 | * strncpy_from_user: - Copy a NUL terminated string from userspace. | ||
40 | * @dst: Destination address, in kernel space. This buffer must be at | ||
41 | * least @count bytes long. | ||
42 | * @src: Source address, in user space. | ||
43 | * @count: Maximum number of bytes to copy, including the trailing NUL. | ||
44 | * | ||
45 | * Copies a NUL-terminated string from userspace to kernel space. | ||
46 | * | ||
47 | * On success, returns the length of the string (not including the trailing | ||
48 | * NUL). | ||
49 | * | ||
50 | * If access to userspace fails, returns -EFAULT (some data may have been | ||
51 | * copied). | ||
52 | * | ||
53 | * If @count is smaller than the length of the string, copies @count bytes | ||
54 | * and returns @count. | ||
55 | */ | ||
56 | |||
57 | extern int strncpy_from_user(char *dst, const char __user *src, int count); | ||
58 | |||
59 | /* | ||
60 | * __clear_user: - Zero a block of memory in user space, with less checking. | ||
61 | * @to: Destination address, in user space. | ||
62 | * @n: Number of bytes to zero. | ||
63 | * | ||
64 | * Zero a block of memory in user space. Caller must check | ||
65 | * the specified block with access_ok() before calling this function. | ||
66 | * | ||
67 | * Returns number of bytes that could not be cleared. | ||
68 | * On success, this will be zero. | ||
69 | */ | ||
70 | extern int __clear_user(void __user *mem, int len); | ||
71 | |||
72 | /* | ||
73 | * clear_user: - Zero a block of memory in user space. | ||
74 | * @to: Destination address, in user space. | ||
75 | * @n: Number of bytes to zero. | ||
76 | * | ||
77 | * Zero a block of memory in user space. | ||
78 | * | ||
79 | * Returns number of bytes that could not be cleared. | ||
80 | * On success, this will be zero. | ||
81 | */ | ||
82 | extern int clear_user(void __user *mem, int len); | ||
83 | |||
84 | /* | ||
85 | * strlen_user: - Get the size of a string in user space. | ||
86 | * @str: The string to measure. | ||
87 | * @n: The maximum valid length | ||
88 | * | ||
89 | * Get the size of a NUL-terminated string in user space. | ||
90 | * | ||
91 | * Returns the size of the string INCLUDING the terminating NUL. | ||
92 | * On exception, returns 0. | ||
93 | * If the string is too long, returns a value greater than @n. | ||
94 | */ | ||
95 | extern int strnlen_user(const void __user *str, int len); | ||
96 | |||
97 | #endif | ||
diff --git a/arch/um/include/shared/user.h b/arch/um/include/shared/user.h index 293f7c794faa..4fa82c055aab 100644 --- a/arch/um/include/shared/user.h +++ b/arch/um/include/shared/user.h | |||
@@ -6,7 +6,7 @@ | |||
6 | #ifndef __USER_H__ | 6 | #ifndef __USER_H__ |
7 | #define __USER_H__ | 7 | #define __USER_H__ |
8 | 8 | ||
9 | #include "kern_constants.h" | 9 | #include <generated/asm-offsets.h> |
10 | 10 | ||
11 | /* | 11 | /* |
12 | * The usual definition - copied here because the kernel provides its own, | 12 | * The usual definition - copied here because the kernel provides its own, |
@@ -36,10 +36,11 @@ static inline int printk(const char *fmt, ...) | |||
36 | } | 36 | } |
37 | #endif | 37 | #endif |
38 | 38 | ||
39 | extern void schedule(void); | ||
40 | extern int in_aton(char *str); | 39 | extern int in_aton(char *str); |
41 | extern int open_gdb_chan(void); | ||
42 | extern size_t strlcpy(char *, const char *, size_t); | 40 | extern size_t strlcpy(char *, const char *, size_t); |
43 | extern size_t strlcat(char *, const char *, size_t); | 41 | extern size_t strlcat(char *, const char *, size_t); |
44 | 42 | ||
43 | /* Copied from linux/compiler-gcc.h since we can't include it directly */ | ||
44 | #define barrier() __asm__ __volatile__("": : :"memory") | ||
45 | |||
45 | #endif | 46 | #endif |