diff options
Diffstat (limited to 'include/asm-x86')
-rw-r--r-- | include/asm-x86/apic.h | 5 | ||||
-rw-r--r-- | include/asm-x86/e820.h | 1 | ||||
-rw-r--r-- | include/asm-x86/hw_irq.h | 20 | ||||
-rw-r--r-- | include/asm-x86/i387.h | 1 | ||||
-rw-r--r-- | include/asm-x86/io.h | 2 | ||||
-rw-r--r-- | include/asm-x86/io_64.h | 1 | ||||
-rw-r--r-- | include/asm-x86/kvm_host.h | 2 | ||||
-rw-r--r-- | include/asm-x86/page_32.h | 1 | ||||
-rw-r--r-- | include/asm-x86/page_64.h | 1 | ||||
-rw-r--r-- | include/asm-x86/pgtable.h | 2 | ||||
-rw-r--r-- | include/asm-x86/pgtable_32.h | 1 | ||||
-rw-r--r-- | include/asm-x86/processor.h | 4 | ||||
-rw-r--r-- | include/asm-x86/ptrace.h | 8 | ||||
-rw-r--r-- | include/asm-x86/setup.h | 1 | ||||
-rw-r--r-- | include/asm-x86/signal.h | 3 | ||||
-rw-r--r-- | include/asm-x86/smp.h | 4 | ||||
-rw-r--r-- | include/asm-x86/syscall.h | 211 | ||||
-rw-r--r-- | include/asm-x86/syscalls.h | 93 | ||||
-rw-r--r-- | include/asm-x86/thread_info.h | 4 | ||||
-rw-r--r-- | include/asm-x86/time.h | 2 | ||||
-rw-r--r-- | include/asm-x86/timer.h | 5 | ||||
-rw-r--r-- | include/asm-x86/traps.h | 4 |
22 files changed, 371 insertions, 5 deletions
diff --git a/include/asm-x86/apic.h b/include/asm-x86/apic.h index bc2e364bdb10..1311c82b165b 100644 --- a/include/asm-x86/apic.h +++ b/include/asm-x86/apic.h | |||
@@ -54,6 +54,11 @@ extern int disable_apic; | |||
54 | #endif | 54 | #endif |
55 | 55 | ||
56 | extern int is_vsmp_box(void); | 56 | extern int is_vsmp_box(void); |
57 | extern void xapic_wait_icr_idle(void); | ||
58 | extern u32 safe_xapic_wait_icr_idle(void); | ||
59 | extern u64 xapic_icr_read(void); | ||
60 | extern void xapic_icr_write(u32, u32); | ||
61 | extern int setup_profiling_timer(unsigned int); | ||
57 | 62 | ||
58 | static inline void native_apic_mem_write(u32 reg, u32 v) | 63 | static inline void native_apic_mem_write(u32 reg, u32 v) |
59 | { | 64 | { |
diff --git a/include/asm-x86/e820.h b/include/asm-x86/e820.h index 38741ac76908..f52daf176bcb 100644 --- a/include/asm-x86/e820.h +++ b/include/asm-x86/e820.h | |||
@@ -64,6 +64,7 @@ struct e820map { | |||
64 | extern struct e820map e820; | 64 | extern struct e820map e820; |
65 | extern struct e820map e820_saved; | 65 | extern struct e820map e820_saved; |
66 | 66 | ||
67 | extern unsigned long pci_mem_start; | ||
67 | extern int e820_any_mapped(u64 start, u64 end, unsigned type); | 68 | extern int e820_any_mapped(u64 start, u64 end, unsigned type); |
68 | extern int e820_all_mapped(u64 start, u64 end, unsigned type); | 69 | extern int e820_all_mapped(u64 start, u64 end, unsigned type); |
69 | extern void e820_add_region(u64 start, u64 size, int type); | 70 | extern void e820_add_region(u64 start, u64 size, int type); |
diff --git a/include/asm-x86/hw_irq.h b/include/asm-x86/hw_irq.h index 2905e93ff959..278571a64c0e 100644 --- a/include/asm-x86/hw_irq.h +++ b/include/asm-x86/hw_irq.h | |||
@@ -95,6 +95,26 @@ extern asmlinkage void qic_reschedule_interrupt(void); | |||
95 | extern asmlinkage void qic_enable_irq_interrupt(void); | 95 | extern asmlinkage void qic_enable_irq_interrupt(void); |
96 | extern asmlinkage void qic_call_function_interrupt(void); | 96 | extern asmlinkage void qic_call_function_interrupt(void); |
97 | 97 | ||
98 | /* SMP */ | ||
99 | extern void smp_apic_timer_interrupt(struct pt_regs *); | ||
100 | #ifdef CONFIG_X86_32 | ||
101 | extern void smp_spurious_interrupt(struct pt_regs *); | ||
102 | extern void smp_error_interrupt(struct pt_regs *); | ||
103 | #else | ||
104 | extern asmlinkage void smp_spurious_interrupt(void); | ||
105 | extern asmlinkage void smp_error_interrupt(void); | ||
106 | #endif | ||
107 | #ifdef CONFIG_X86_SMP | ||
108 | extern void smp_reschedule_interrupt(struct pt_regs *); | ||
109 | extern void smp_call_function_interrupt(struct pt_regs *); | ||
110 | extern void smp_call_function_single_interrupt(struct pt_regs *); | ||
111 | #ifdef CONFIG_X86_32 | ||
112 | extern void smp_invalidate_interrupt(struct pt_regs *); | ||
113 | #else | ||
114 | extern asmlinkage void smp_invalidate_interrupt(struct pt_regs *); | ||
115 | #endif | ||
116 | #endif | ||
117 | |||
98 | #ifdef CONFIG_X86_32 | 118 | #ifdef CONFIG_X86_32 |
99 | extern void (*const interrupt[NR_IRQS])(void); | 119 | extern void (*const interrupt[NR_IRQS])(void); |
100 | #else | 120 | #else |
diff --git a/include/asm-x86/i387.h b/include/asm-x86/i387.h index 2e63efd58814..9ba862a4eac0 100644 --- a/include/asm-x86/i387.h +++ b/include/asm-x86/i387.h | |||
@@ -27,6 +27,7 @@ extern void mxcsr_feature_mask_init(void); | |||
27 | extern int init_fpu(struct task_struct *child); | 27 | extern int init_fpu(struct task_struct *child); |
28 | extern asmlinkage void math_state_restore(void); | 28 | extern asmlinkage void math_state_restore(void); |
29 | extern void init_thread_xstate(void); | 29 | extern void init_thread_xstate(void); |
30 | extern int dump_fpu(struct pt_regs *, struct user_i387_struct *); | ||
30 | 31 | ||
31 | extern user_regset_active_fn fpregs_active, xfpregs_active; | 32 | extern user_regset_active_fn fpregs_active, xfpregs_active; |
32 | extern user_regset_get_fn fpregs_get, xfpregs_get, fpregs_soft_get; | 33 | extern user_regset_get_fn fpregs_get, xfpregs_get, fpregs_soft_get; |
diff --git a/include/asm-x86/io.h b/include/asm-x86/io.h index 688f8a4085a4..72b7719523bf 100644 --- a/include/asm-x86/io.h +++ b/include/asm-x86/io.h | |||
@@ -73,6 +73,8 @@ build_mmio_write(__writeq, "q", unsigned long, "r", ) | |||
73 | #define writeq writeq | 73 | #define writeq writeq |
74 | #endif | 74 | #endif |
75 | 75 | ||
76 | extern int iommu_bio_merge; | ||
77 | |||
76 | #ifdef CONFIG_X86_32 | 78 | #ifdef CONFIG_X86_32 |
77 | # include "io_32.h" | 79 | # include "io_32.h" |
78 | #else | 80 | #else |
diff --git a/include/asm-x86/io_64.h b/include/asm-x86/io_64.h index f436532f1935..64429e9431a8 100644 --- a/include/asm-x86/io_64.h +++ b/include/asm-x86/io_64.h | |||
@@ -235,7 +235,6 @@ void memset_io(volatile void __iomem *a, int b, size_t c); | |||
235 | 235 | ||
236 | #define flush_write_buffers() | 236 | #define flush_write_buffers() |
237 | 237 | ||
238 | extern int iommu_bio_merge; | ||
239 | #define BIO_VMERGE_BOUNDARY iommu_bio_merge | 238 | #define BIO_VMERGE_BOUNDARY iommu_bio_merge |
240 | 239 | ||
241 | /* | 240 | /* |
diff --git a/include/asm-x86/kvm_host.h b/include/asm-x86/kvm_host.h index 72e9a525f91a..69794547f514 100644 --- a/include/asm-x86/kvm_host.h +++ b/include/asm-x86/kvm_host.h | |||
@@ -722,7 +722,7 @@ asmlinkage void kvm_handle_fault_on_reboot(void); | |||
722 | 722 | ||
723 | #define __kvm_handle_fault_on_reboot(insn) \ | 723 | #define __kvm_handle_fault_on_reboot(insn) \ |
724 | "666: " insn "\n\t" \ | 724 | "666: " insn "\n\t" \ |
725 | ".pushsection .text.fixup, \"ax\" \n" \ | 725 | ".pushsection .fixup, \"ax\" \n" \ |
726 | "667: \n\t" \ | 726 | "667: \n\t" \ |
727 | KVM_EX_PUSH " $666b \n\t" \ | 727 | KVM_EX_PUSH " $666b \n\t" \ |
728 | "jmp kvm_handle_fault_on_reboot \n\t" \ | 728 | "jmp kvm_handle_fault_on_reboot \n\t" \ |
diff --git a/include/asm-x86/page_32.h b/include/asm-x86/page_32.h index 85ac2b8ec7c9..f32062a821c5 100644 --- a/include/asm-x86/page_32.h +++ b/include/asm-x86/page_32.h | |||
@@ -96,6 +96,7 @@ extern void find_low_pfn_range(void); | |||
96 | extern unsigned long init_memory_mapping(unsigned long start, | 96 | extern unsigned long init_memory_mapping(unsigned long start, |
97 | unsigned long end); | 97 | unsigned long end); |
98 | extern void initmem_init(unsigned long, unsigned long); | 98 | extern void initmem_init(unsigned long, unsigned long); |
99 | extern void free_initmem(void); | ||
99 | extern void setup_bootmem_allocator(void); | 100 | extern void setup_bootmem_allocator(void); |
100 | 101 | ||
101 | 102 | ||
diff --git a/include/asm-x86/page_64.h b/include/asm-x86/page_64.h index 87aef3c48b5f..5e64acfed0a4 100644 --- a/include/asm-x86/page_64.h +++ b/include/asm-x86/page_64.h | |||
@@ -91,6 +91,7 @@ extern unsigned long init_memory_mapping(unsigned long start, | |||
91 | unsigned long end); | 91 | unsigned long end); |
92 | 92 | ||
93 | extern void initmem_init(unsigned long start_pfn, unsigned long end_pfn); | 93 | extern void initmem_init(unsigned long start_pfn, unsigned long end_pfn); |
94 | extern void free_initmem(void); | ||
94 | 95 | ||
95 | extern void init_extra_mapping_uc(unsigned long phys, unsigned long size); | 96 | extern void init_extra_mapping_uc(unsigned long phys, unsigned long size); |
96 | extern void init_extra_mapping_wb(unsigned long phys, unsigned long size); | 97 | extern void init_extra_mapping_wb(unsigned long phys, unsigned long size); |
diff --git a/include/asm-x86/pgtable.h b/include/asm-x86/pgtable.h index 70fcb2adbb71..57d919a2d79d 100644 --- a/include/asm-x86/pgtable.h +++ b/include/asm-x86/pgtable.h | |||
@@ -313,6 +313,8 @@ static inline void native_pagetable_setup_start(pgd_t *base) {} | |||
313 | static inline void native_pagetable_setup_done(pgd_t *base) {} | 313 | static inline void native_pagetable_setup_done(pgd_t *base) {} |
314 | #endif | 314 | #endif |
315 | 315 | ||
316 | extern int arch_report_meminfo(char *page); | ||
317 | |||
316 | #ifdef CONFIG_PARAVIRT | 318 | #ifdef CONFIG_PARAVIRT |
317 | #include <asm/paravirt.h> | 319 | #include <asm/paravirt.h> |
318 | #else /* !CONFIG_PARAVIRT */ | 320 | #else /* !CONFIG_PARAVIRT */ |
diff --git a/include/asm-x86/pgtable_32.h b/include/asm-x86/pgtable_32.h index bbc136f3ac5f..45c8235400fe 100644 --- a/include/asm-x86/pgtable_32.h +++ b/include/asm-x86/pgtable_32.h | |||
@@ -31,6 +31,7 @@ static inline void pgtable_cache_init(void) { } | |||
31 | static inline void check_pgt_cache(void) { } | 31 | static inline void check_pgt_cache(void) { } |
32 | void paging_init(void); | 32 | void paging_init(void); |
33 | 33 | ||
34 | extern void set_pmd_pfn(unsigned long, unsigned long, pgprot_t); | ||
34 | 35 | ||
35 | /* | 36 | /* |
36 | * The Linux x86 paging architecture is 'compile-time dual-mode', it | 37 | * The Linux x86 paging architecture is 'compile-time dual-mode', it |
diff --git a/include/asm-x86/processor.h b/include/asm-x86/processor.h index 61c3d3005dc9..df03c98e38d4 100644 --- a/include/asm-x86/processor.h +++ b/include/asm-x86/processor.h | |||
@@ -140,6 +140,8 @@ DECLARE_PER_CPU(struct cpuinfo_x86, cpu_info); | |||
140 | #define current_cpu_data boot_cpu_data | 140 | #define current_cpu_data boot_cpu_data |
141 | #endif | 141 | #endif |
142 | 142 | ||
143 | extern const struct seq_operations cpuinfo_op; | ||
144 | |||
143 | static inline int hlt_works(int cpu) | 145 | static inline int hlt_works(int cpu) |
144 | { | 146 | { |
145 | #ifdef CONFIG_X86_32 | 147 | #ifdef CONFIG_X86_32 |
@@ -153,6 +155,8 @@ static inline int hlt_works(int cpu) | |||
153 | 155 | ||
154 | extern void cpu_detect(struct cpuinfo_x86 *c); | 156 | extern void cpu_detect(struct cpuinfo_x86 *c); |
155 | 157 | ||
158 | extern struct pt_regs *idle_regs(struct pt_regs *); | ||
159 | |||
156 | extern void early_cpu_init(void); | 160 | extern void early_cpu_init(void); |
157 | extern void identify_boot_cpu(void); | 161 | extern void identify_boot_cpu(void); |
158 | extern void identify_secondary_cpu(struct cpuinfo_x86 *); | 162 | extern void identify_secondary_cpu(struct cpuinfo_x86 *); |
diff --git a/include/asm-x86/ptrace.h b/include/asm-x86/ptrace.h index d464f252edc3..a33f027dbbea 100644 --- a/include/asm-x86/ptrace.h +++ b/include/asm-x86/ptrace.h | |||
@@ -148,6 +148,9 @@ extern void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs, | |||
148 | void signal_fault(struct pt_regs *regs, void __user *frame, char *where); | 148 | void signal_fault(struct pt_regs *regs, void __user *frame, char *where); |
149 | #endif | 149 | #endif |
150 | 150 | ||
151 | extern long syscall_trace_enter(struct pt_regs *); | ||
152 | extern void syscall_trace_leave(struct pt_regs *); | ||
153 | |||
151 | static inline unsigned long regs_return_value(struct pt_regs *regs) | 154 | static inline unsigned long regs_return_value(struct pt_regs *regs) |
152 | { | 155 | { |
153 | return regs->ax; | 156 | return regs->ax; |
@@ -213,6 +216,11 @@ static inline unsigned long frame_pointer(struct pt_regs *regs) | |||
213 | return regs->bp; | 216 | return regs->bp; |
214 | } | 217 | } |
215 | 218 | ||
219 | static inline unsigned long user_stack_pointer(struct pt_regs *regs) | ||
220 | { | ||
221 | return regs->sp; | ||
222 | } | ||
223 | |||
216 | /* | 224 | /* |
217 | * These are defined as per linux/ptrace.h, which see. | 225 | * These are defined as per linux/ptrace.h, which see. |
218 | */ | 226 | */ |
diff --git a/include/asm-x86/setup.h b/include/asm-x86/setup.h index 80fcc0de80be..11b6cc14b289 100644 --- a/include/asm-x86/setup.h +++ b/include/asm-x86/setup.h | |||
@@ -42,6 +42,7 @@ struct x86_quirks { | |||
42 | }; | 42 | }; |
43 | 43 | ||
44 | extern struct x86_quirks *x86_quirks; | 44 | extern struct x86_quirks *x86_quirks; |
45 | extern unsigned long saved_video_mode; | ||
45 | 46 | ||
46 | #ifndef CONFIG_PARAVIRT | 47 | #ifndef CONFIG_PARAVIRT |
47 | #define paravirt_post_allocator_init() do {} while (0) | 48 | #define paravirt_post_allocator_init() do {} while (0) |
diff --git a/include/asm-x86/signal.h b/include/asm-x86/signal.h index 6ee32822779a..65acc82d267a 100644 --- a/include/asm-x86/signal.h +++ b/include/asm-x86/signal.h | |||
@@ -140,6 +140,9 @@ struct sigaction { | |||
140 | struct k_sigaction { | 140 | struct k_sigaction { |
141 | struct sigaction sa; | 141 | struct sigaction sa; |
142 | }; | 142 | }; |
143 | |||
144 | extern void do_notify_resume(struct pt_regs *, void *, __u32); | ||
145 | |||
143 | # else /* __KERNEL__ */ | 146 | # else /* __KERNEL__ */ |
144 | /* Here we must cater to libcs that poke about in kernel headers. */ | 147 | /* Here we must cater to libcs that poke about in kernel headers. */ |
145 | 148 | ||
diff --git a/include/asm-x86/smp.h b/include/asm-x86/smp.h index 88b075c6fe8f..29324c103341 100644 --- a/include/asm-x86/smp.h +++ b/include/asm-x86/smp.h | |||
@@ -34,6 +34,9 @@ extern cpumask_t cpu_initialized; | |||
34 | DECLARE_PER_CPU(cpumask_t, cpu_sibling_map); | 34 | DECLARE_PER_CPU(cpumask_t, cpu_sibling_map); |
35 | DECLARE_PER_CPU(cpumask_t, cpu_core_map); | 35 | DECLARE_PER_CPU(cpumask_t, cpu_core_map); |
36 | DECLARE_PER_CPU(u16, cpu_llc_id); | 36 | DECLARE_PER_CPU(u16, cpu_llc_id); |
37 | #ifdef CONFIG_X86_32 | ||
38 | DECLARE_PER_CPU(int, cpu_number); | ||
39 | #endif | ||
37 | 40 | ||
38 | DECLARE_EARLY_PER_CPU(u16, x86_cpu_to_apicid); | 41 | DECLARE_EARLY_PER_CPU(u16, x86_cpu_to_apicid); |
39 | DECLARE_EARLY_PER_CPU(u16, x86_bios_cpu_apicid); | 42 | DECLARE_EARLY_PER_CPU(u16, x86_bios_cpu_apicid); |
@@ -142,7 +145,6 @@ extern unsigned disabled_cpus __cpuinitdata; | |||
142 | * from the initial startup. We map APIC_BASE very early in page_setup(), | 145 | * from the initial startup. We map APIC_BASE very early in page_setup(), |
143 | * so this is correct in the x86 case. | 146 | * so this is correct in the x86 case. |
144 | */ | 147 | */ |
145 | DECLARE_PER_CPU(int, cpu_number); | ||
146 | #define raw_smp_processor_id() (x86_read_percpu(cpu_number)) | 148 | #define raw_smp_processor_id() (x86_read_percpu(cpu_number)) |
147 | extern int safe_smp_processor_id(void); | 149 | extern int safe_smp_processor_id(void); |
148 | 150 | ||
diff --git a/include/asm-x86/syscall.h b/include/asm-x86/syscall.h new file mode 100644 index 000000000000..04c47dc5597c --- /dev/null +++ b/include/asm-x86/syscall.h | |||
@@ -0,0 +1,211 @@ | |||
1 | /* | ||
2 | * Access to user system call parameters and results | ||
3 | * | ||
4 | * Copyright (C) 2008 Red Hat, Inc. All rights reserved. | ||
5 | * | ||
6 | * This copyrighted material is made available to anyone wishing to use, | ||
7 | * modify, copy, or redistribute it subject to the terms and conditions | ||
8 | * of the GNU General Public License v.2. | ||
9 | * | ||
10 | * See asm-generic/syscall.h for descriptions of what we must do here. | ||
11 | */ | ||
12 | |||
13 | #ifndef _ASM_SYSCALL_H | ||
14 | #define _ASM_SYSCALL_H 1 | ||
15 | |||
16 | #include <linux/sched.h> | ||
17 | #include <linux/err.h> | ||
18 | |||
19 | static inline long syscall_get_nr(struct task_struct *task, | ||
20 | struct pt_regs *regs) | ||
21 | { | ||
22 | /* | ||
23 | * We always sign-extend a -1 value being set here, | ||
24 | * so this is always either -1L or a syscall number. | ||
25 | */ | ||
26 | return regs->orig_ax; | ||
27 | } | ||
28 | |||
29 | static inline void syscall_rollback(struct task_struct *task, | ||
30 | struct pt_regs *regs) | ||
31 | { | ||
32 | regs->ax = regs->orig_ax; | ||
33 | } | ||
34 | |||
35 | static inline long syscall_get_error(struct task_struct *task, | ||
36 | struct pt_regs *regs) | ||
37 | { | ||
38 | unsigned long error = regs->ax; | ||
39 | #ifdef CONFIG_IA32_EMULATION | ||
40 | /* | ||
41 | * TS_COMPAT is set for 32-bit syscall entries and then | ||
42 | * remains set until we return to user mode. | ||
43 | */ | ||
44 | if (task_thread_info(task)->status & TS_COMPAT) | ||
45 | /* | ||
46 | * Sign-extend the value so (int)-EFOO becomes (long)-EFOO | ||
47 | * and will match correctly in comparisons. | ||
48 | */ | ||
49 | error = (long) (int) error; | ||
50 | #endif | ||
51 | return IS_ERR_VALUE(error) ? error : 0; | ||
52 | } | ||
53 | |||
54 | static inline long syscall_get_return_value(struct task_struct *task, | ||
55 | struct pt_regs *regs) | ||
56 | { | ||
57 | return regs->ax; | ||
58 | } | ||
59 | |||
60 | static inline void syscall_set_return_value(struct task_struct *task, | ||
61 | struct pt_regs *regs, | ||
62 | int error, long val) | ||
63 | { | ||
64 | regs->ax = (long) error ?: val; | ||
65 | } | ||
66 | |||
67 | #ifdef CONFIG_X86_32 | ||
68 | |||
69 | static inline void syscall_get_arguments(struct task_struct *task, | ||
70 | struct pt_regs *regs, | ||
71 | unsigned int i, unsigned int n, | ||
72 | unsigned long *args) | ||
73 | { | ||
74 | BUG_ON(i + n > 6); | ||
75 | memcpy(args, ®s->bx + i, n * sizeof(args[0])); | ||
76 | } | ||
77 | |||
78 | static inline void syscall_set_arguments(struct task_struct *task, | ||
79 | struct pt_regs *regs, | ||
80 | unsigned int i, unsigned int n, | ||
81 | const unsigned long *args) | ||
82 | { | ||
83 | BUG_ON(i + n > 6); | ||
84 | memcpy(®s->bx + i, args, n * sizeof(args[0])); | ||
85 | } | ||
86 | |||
87 | #else /* CONFIG_X86_64 */ | ||
88 | |||
89 | static inline void syscall_get_arguments(struct task_struct *task, | ||
90 | struct pt_regs *regs, | ||
91 | unsigned int i, unsigned int n, | ||
92 | unsigned long *args) | ||
93 | { | ||
94 | # ifdef CONFIG_IA32_EMULATION | ||
95 | if (task_thread_info(task)->status & TS_COMPAT) | ||
96 | switch (i + n) { | ||
97 | case 6: | ||
98 | if (!n--) break; | ||
99 | *args++ = regs->bp; | ||
100 | case 5: | ||
101 | if (!n--) break; | ||
102 | *args++ = regs->di; | ||
103 | case 4: | ||
104 | if (!n--) break; | ||
105 | *args++ = regs->si; | ||
106 | case 3: | ||
107 | if (!n--) break; | ||
108 | *args++ = regs->dx; | ||
109 | case 2: | ||
110 | if (!n--) break; | ||
111 | *args++ = regs->cx; | ||
112 | case 1: | ||
113 | if (!n--) break; | ||
114 | *args++ = regs->bx; | ||
115 | case 0: | ||
116 | if (!n--) break; | ||
117 | default: | ||
118 | BUG(); | ||
119 | break; | ||
120 | } | ||
121 | else | ||
122 | # endif | ||
123 | switch (i + n) { | ||
124 | case 6: | ||
125 | if (!n--) break; | ||
126 | *args++ = regs->r9; | ||
127 | case 5: | ||
128 | if (!n--) break; | ||
129 | *args++ = regs->r8; | ||
130 | case 4: | ||
131 | if (!n--) break; | ||
132 | *args++ = regs->r10; | ||
133 | case 3: | ||
134 | if (!n--) break; | ||
135 | *args++ = regs->dx; | ||
136 | case 2: | ||
137 | if (!n--) break; | ||
138 | *args++ = regs->si; | ||
139 | case 1: | ||
140 | if (!n--) break; | ||
141 | *args++ = regs->di; | ||
142 | case 0: | ||
143 | if (!n--) break; | ||
144 | default: | ||
145 | BUG(); | ||
146 | break; | ||
147 | } | ||
148 | } | ||
149 | |||
150 | static inline void syscall_set_arguments(struct task_struct *task, | ||
151 | struct pt_regs *regs, | ||
152 | unsigned int i, unsigned int n, | ||
153 | const unsigned long *args) | ||
154 | { | ||
155 | # ifdef CONFIG_IA32_EMULATION | ||
156 | if (task_thread_info(task)->status & TS_COMPAT) | ||
157 | switch (i + n) { | ||
158 | case 6: | ||
159 | if (!n--) break; | ||
160 | regs->bp = *args++; | ||
161 | case 5: | ||
162 | if (!n--) break; | ||
163 | regs->di = *args++; | ||
164 | case 4: | ||
165 | if (!n--) break; | ||
166 | regs->si = *args++; | ||
167 | case 3: | ||
168 | if (!n--) break; | ||
169 | regs->dx = *args++; | ||
170 | case 2: | ||
171 | if (!n--) break; | ||
172 | regs->cx = *args++; | ||
173 | case 1: | ||
174 | if (!n--) break; | ||
175 | regs->bx = *args++; | ||
176 | case 0: | ||
177 | if (!n--) break; | ||
178 | default: | ||
179 | BUG(); | ||
180 | } | ||
181 | else | ||
182 | # endif | ||
183 | switch (i + n) { | ||
184 | case 6: | ||
185 | if (!n--) break; | ||
186 | regs->r9 = *args++; | ||
187 | case 5: | ||
188 | if (!n--) break; | ||
189 | regs->r8 = *args++; | ||
190 | case 4: | ||
191 | if (!n--) break; | ||
192 | regs->r10 = *args++; | ||
193 | case 3: | ||
194 | if (!n--) break; | ||
195 | regs->dx = *args++; | ||
196 | case 2: | ||
197 | if (!n--) break; | ||
198 | regs->si = *args++; | ||
199 | case 1: | ||
200 | if (!n--) break; | ||
201 | regs->di = *args++; | ||
202 | case 0: | ||
203 | if (!n--) break; | ||
204 | default: | ||
205 | BUG(); | ||
206 | } | ||
207 | } | ||
208 | |||
209 | #endif /* CONFIG_X86_32 */ | ||
210 | |||
211 | #endif /* _ASM_SYSCALL_H */ | ||
diff --git a/include/asm-x86/syscalls.h b/include/asm-x86/syscalls.h new file mode 100644 index 000000000000..87803da44010 --- /dev/null +++ b/include/asm-x86/syscalls.h | |||
@@ -0,0 +1,93 @@ | |||
1 | /* | ||
2 | * syscalls.h - Linux syscall interfaces (arch-specific) | ||
3 | * | ||
4 | * Copyright (c) 2008 Jaswinder Singh | ||
5 | * | ||
6 | * This file is released under the GPLv2. | ||
7 | * See the file COPYING for more details. | ||
8 | */ | ||
9 | |||
10 | #ifndef _ASM_X86_SYSCALLS_H | ||
11 | #define _ASM_X86_SYSCALLS_H | ||
12 | |||
13 | #include <linux/compiler.h> | ||
14 | #include <linux/linkage.h> | ||
15 | #include <linux/types.h> | ||
16 | #include <linux/signal.h> | ||
17 | |||
18 | /* Common in X86_32 and X86_64 */ | ||
19 | /* kernel/ioport.c */ | ||
20 | asmlinkage long sys_ioperm(unsigned long, unsigned long, int); | ||
21 | |||
22 | /* X86_32 only */ | ||
23 | #ifdef CONFIG_X86_32 | ||
24 | /* kernel/process_32.c */ | ||
25 | asmlinkage int sys_fork(struct pt_regs); | ||
26 | asmlinkage int sys_clone(struct pt_regs); | ||
27 | asmlinkage int sys_vfork(struct pt_regs); | ||
28 | asmlinkage int sys_execve(struct pt_regs); | ||
29 | |||
30 | /* kernel/signal_32.c */ | ||
31 | asmlinkage int sys_sigsuspend(int, int, old_sigset_t); | ||
32 | asmlinkage int sys_sigaction(int, const struct old_sigaction __user *, | ||
33 | struct old_sigaction __user *); | ||
34 | asmlinkage int sys_sigaltstack(unsigned long); | ||
35 | asmlinkage unsigned long sys_sigreturn(unsigned long); | ||
36 | asmlinkage int sys_rt_sigreturn(unsigned long); | ||
37 | |||
38 | /* kernel/ioport.c */ | ||
39 | asmlinkage long sys_iopl(unsigned long); | ||
40 | |||
41 | /* kernel/ldt.c */ | ||
42 | asmlinkage int sys_modify_ldt(int, void __user *, unsigned long); | ||
43 | |||
44 | /* kernel/sys_i386_32.c */ | ||
45 | asmlinkage long sys_mmap2(unsigned long, unsigned long, unsigned long, | ||
46 | unsigned long, unsigned long, unsigned long); | ||
47 | struct mmap_arg_struct; | ||
48 | asmlinkage int old_mmap(struct mmap_arg_struct __user *); | ||
49 | struct sel_arg_struct; | ||
50 | asmlinkage int old_select(struct sel_arg_struct __user *); | ||
51 | asmlinkage int sys_ipc(uint, int, int, int, void __user *, long); | ||
52 | struct old_utsname; | ||
53 | asmlinkage int sys_uname(struct old_utsname __user *); | ||
54 | struct oldold_utsname; | ||
55 | asmlinkage int sys_olduname(struct oldold_utsname __user *); | ||
56 | |||
57 | /* kernel/tls.c */ | ||
58 | asmlinkage int sys_set_thread_area(struct user_desc __user *); | ||
59 | asmlinkage int sys_get_thread_area(struct user_desc __user *); | ||
60 | |||
61 | /* kernel/vm86_32.c */ | ||
62 | asmlinkage int sys_vm86old(struct pt_regs); | ||
63 | asmlinkage int sys_vm86(struct pt_regs); | ||
64 | |||
65 | #else /* CONFIG_X86_32 */ | ||
66 | |||
67 | /* X86_64 only */ | ||
68 | /* kernel/process_64.c */ | ||
69 | asmlinkage long sys_fork(struct pt_regs *); | ||
70 | asmlinkage long sys_clone(unsigned long, unsigned long, | ||
71 | void __user *, void __user *, | ||
72 | struct pt_regs *); | ||
73 | asmlinkage long sys_vfork(struct pt_regs *); | ||
74 | asmlinkage long sys_execve(char __user *, char __user * __user *, | ||
75 | char __user * __user *, | ||
76 | struct pt_regs *); | ||
77 | |||
78 | /* kernel/ioport.c */ | ||
79 | asmlinkage long sys_iopl(unsigned int, struct pt_regs *); | ||
80 | |||
81 | /* kernel/signal_64.c */ | ||
82 | asmlinkage long sys_sigaltstack(const stack_t __user *, stack_t __user *, | ||
83 | struct pt_regs *); | ||
84 | asmlinkage long sys_rt_sigreturn(struct pt_regs *); | ||
85 | |||
86 | /* kernel/sys_x86_64.c */ | ||
87 | asmlinkage long sys_mmap(unsigned long, unsigned long, unsigned long, | ||
88 | unsigned long, unsigned long, unsigned long); | ||
89 | struct new_utsname; | ||
90 | asmlinkage long sys_uname(struct new_utsname __user *); | ||
91 | |||
92 | #endif /* CONFIG_X86_32 */ | ||
93 | #endif /* _ASM_X86_SYSCALLS_H */ | ||
diff --git a/include/asm-x86/thread_info.h b/include/asm-x86/thread_info.h index 30586f2ee558..3f4e52bb77f5 100644 --- a/include/asm-x86/thread_info.h +++ b/include/asm-x86/thread_info.h | |||
@@ -71,6 +71,7 @@ struct thread_info { | |||
71 | * Warning: layout of LSW is hardcoded in entry.S | 71 | * Warning: layout of LSW is hardcoded in entry.S |
72 | */ | 72 | */ |
73 | #define TIF_SYSCALL_TRACE 0 /* syscall trace active */ | 73 | #define TIF_SYSCALL_TRACE 0 /* syscall trace active */ |
74 | #define TIF_NOTIFY_RESUME 1 /* callback before returning to user */ | ||
74 | #define TIF_SIGPENDING 2 /* signal pending */ | 75 | #define TIF_SIGPENDING 2 /* signal pending */ |
75 | #define TIF_NEED_RESCHED 3 /* rescheduling necessary */ | 76 | #define TIF_NEED_RESCHED 3 /* rescheduling necessary */ |
76 | #define TIF_SINGLESTEP 4 /* reenable singlestep on user return*/ | 77 | #define TIF_SINGLESTEP 4 /* reenable singlestep on user return*/ |
@@ -93,6 +94,7 @@ struct thread_info { | |||
93 | #define TIF_BTS_TRACE_TS 27 /* record scheduling event timestamps */ | 94 | #define TIF_BTS_TRACE_TS 27 /* record scheduling event timestamps */ |
94 | 95 | ||
95 | #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) | 96 | #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) |
97 | #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) | ||
96 | #define _TIF_SIGPENDING (1 << TIF_SIGPENDING) | 98 | #define _TIF_SIGPENDING (1 << TIF_SIGPENDING) |
97 | #define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP) | 99 | #define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP) |
98 | #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) | 100 | #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) |
@@ -133,7 +135,7 @@ struct thread_info { | |||
133 | 135 | ||
134 | /* Only used for 64 bit */ | 136 | /* Only used for 64 bit */ |
135 | #define _TIF_DO_NOTIFY_MASK \ | 137 | #define _TIF_DO_NOTIFY_MASK \ |
136 | (_TIF_SIGPENDING|_TIF_MCE_NOTIFY) | 138 | (_TIF_SIGPENDING|_TIF_MCE_NOTIFY|_TIF_NOTIFY_RESUME) |
137 | 139 | ||
138 | /* flags to check in __switch_to() */ | 140 | /* flags to check in __switch_to() */ |
139 | #define _TIF_WORK_CTXSW \ | 141 | #define _TIF_WORK_CTXSW \ |
diff --git a/include/asm-x86/time.h b/include/asm-x86/time.h index 7457a5d7b4a1..3e724eef7ac4 100644 --- a/include/asm-x86/time.h +++ b/include/asm-x86/time.h | |||
@@ -46,6 +46,8 @@ static inline int native_set_wallclock(unsigned long nowtime) | |||
46 | 46 | ||
47 | #endif | 47 | #endif |
48 | 48 | ||
49 | extern void time_init(void); | ||
50 | |||
49 | #ifdef CONFIG_PARAVIRT | 51 | #ifdef CONFIG_PARAVIRT |
50 | #include <asm/paravirt.h> | 52 | #include <asm/paravirt.h> |
51 | #else /* !CONFIG_PARAVIRT */ | 53 | #else /* !CONFIG_PARAVIRT */ |
diff --git a/include/asm-x86/timer.h b/include/asm-x86/timer.h index b87123dec3d9..d0babce4b47a 100644 --- a/include/asm-x86/timer.h +++ b/include/asm-x86/timer.h | |||
@@ -9,9 +9,12 @@ | |||
9 | unsigned long long native_sched_clock(void); | 9 | unsigned long long native_sched_clock(void); |
10 | unsigned long native_calibrate_tsc(void); | 10 | unsigned long native_calibrate_tsc(void); |
11 | 11 | ||
12 | #ifdef CONFIG_X86_32 | ||
12 | extern int timer_ack; | 13 | extern int timer_ack; |
13 | extern int no_timer_check; | ||
14 | extern int recalibrate_cpu_khz(void); | 14 | extern int recalibrate_cpu_khz(void); |
15 | #endif /* CONFIG_X86_32 */ | ||
16 | |||
17 | extern int no_timer_check; | ||
15 | 18 | ||
16 | #ifndef CONFIG_PARAVIRT | 19 | #ifndef CONFIG_PARAVIRT |
17 | #define calibrate_tsc() native_calibrate_tsc() | 20 | #define calibrate_tsc() native_calibrate_tsc() |
diff --git a/include/asm-x86/traps.h b/include/asm-x86/traps.h index 2a891a704719..2ccebc6fb0b0 100644 --- a/include/asm-x86/traps.h +++ b/include/asm-x86/traps.h | |||
@@ -51,6 +51,8 @@ void do_spurious_interrupt_bug(struct pt_regs *, long); | |||
51 | unsigned long patch_espfix_desc(unsigned long, unsigned long); | 51 | unsigned long patch_espfix_desc(unsigned long, unsigned long); |
52 | asmlinkage void math_emulate(long); | 52 | asmlinkage void math_emulate(long); |
53 | 53 | ||
54 | void do_page_fault(struct pt_regs *regs, unsigned long error_code); | ||
55 | |||
54 | #else /* CONFIG_X86_32 */ | 56 | #else /* CONFIG_X86_32 */ |
55 | 57 | ||
56 | asmlinkage void double_fault(void); | 58 | asmlinkage void double_fault(void); |
@@ -62,5 +64,7 @@ asmlinkage void do_coprocessor_error(struct pt_regs *); | |||
62 | asmlinkage void do_simd_coprocessor_error(struct pt_regs *); | 64 | asmlinkage void do_simd_coprocessor_error(struct pt_regs *); |
63 | asmlinkage void do_spurious_interrupt_bug(struct pt_regs *); | 65 | asmlinkage void do_spurious_interrupt_bug(struct pt_regs *); |
64 | 66 | ||
67 | asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code); | ||
68 | |||
65 | #endif /* CONFIG_X86_32 */ | 69 | #endif /* CONFIG_X86_32 */ |
66 | #endif /* ASM_X86__TRAPS_H */ | 70 | #endif /* ASM_X86__TRAPS_H */ |