diff options
Diffstat (limited to 'arch/um/include')
-rw-r--r-- | arch/um/include/arch.h | 4 | ||||
-rw-r--r-- | arch/um/include/as-layout.h | 2 | ||||
-rw-r--r-- | arch/um/include/irq_user.h | 2 | ||||
-rw-r--r-- | arch/um/include/kern_util.h | 22 | ||||
-rw-r--r-- | arch/um/include/mconsole.h | 2 | ||||
-rw-r--r-- | arch/um/include/mode.h | 11 | ||||
-rw-r--r-- | arch/um/include/mode_kern.h | 11 | ||||
-rw-r--r-- | arch/um/include/os.h | 6 | ||||
-rw-r--r-- | arch/um/include/registers.h | 6 | ||||
-rw-r--r-- | arch/um/include/skas/mmu-skas.h | 2 | ||||
-rw-r--r-- | arch/um/include/skas/mode_kern_skas.h | 42 | ||||
-rw-r--r-- | arch/um/include/skas/skas.h | 2 | ||||
-rw-r--r-- | arch/um/include/sysdep-i386/ptrace.h | 59 | ||||
-rw-r--r-- | arch/um/include/sysdep-x86_64/ptrace.h | 88 | ||||
-rw-r--r-- | arch/um/include/task.h | 2 |
15 files changed, 93 insertions, 168 deletions
diff --git a/arch/um/include/arch.h b/arch/um/include/arch.h index 10ad52daa8c5..49c601ff2bac 100644 --- a/arch/um/include/arch.h +++ b/arch/um/include/arch.h | |||
@@ -9,7 +9,7 @@ | |||
9 | #include "sysdep/ptrace.h" | 9 | #include "sysdep/ptrace.h" |
10 | 10 | ||
11 | extern void arch_check_bugs(void); | 11 | extern void arch_check_bugs(void); |
12 | extern int arch_fixup(unsigned long address, union uml_pt_regs *regs); | 12 | extern int arch_fixup(unsigned long address, struct uml_pt_regs *regs); |
13 | extern int arch_handle_signal(int sig, union uml_pt_regs *regs); | 13 | extern int arch_handle_signal(int sig, struct uml_pt_regs *regs); |
14 | 14 | ||
15 | #endif | 15 | #endif |
diff --git a/arch/um/include/as-layout.h b/arch/um/include/as-layout.h index e44f32940f8a..2f16a1c7d616 100644 --- a/arch/um/include/as-layout.h +++ b/arch/um/include/as-layout.h | |||
@@ -29,6 +29,6 @@ extern unsigned long brk_start; | |||
29 | 29 | ||
30 | extern int linux_main(int argc, char **argv); | 30 | extern int linux_main(int argc, char **argv); |
31 | 31 | ||
32 | extern void (*sig_info[])(int, union uml_pt_regs *); | 32 | extern void (*sig_info[])(int, struct uml_pt_regs *); |
33 | 33 | ||
34 | #endif | 34 | #endif |
diff --git a/arch/um/include/irq_user.h b/arch/um/include/irq_user.h index 741cb7d6f859..e16ebce1290d 100644 --- a/arch/um/include/irq_user.h +++ b/arch/um/include/irq_user.h | |||
@@ -21,7 +21,7 @@ struct irq_fd { | |||
21 | 21 | ||
22 | enum { IRQ_READ, IRQ_WRITE }; | 22 | enum { IRQ_READ, IRQ_WRITE }; |
23 | 23 | ||
24 | extern void sigio_handler(int sig, union uml_pt_regs *regs); | 24 | extern void sigio_handler(int sig, struct uml_pt_regs *regs); |
25 | extern int activate_fd(int irq, int fd, int type, void *dev_id); | 25 | extern int activate_fd(int irq, int fd, int type, void *dev_id); |
26 | extern void free_irq_by_irq_and_dev(unsigned int irq, void *dev_id); | 26 | extern void free_irq_by_irq_and_dev(unsigned int irq, void *dev_id); |
27 | extern void free_irq_by_fd(int fd); | 27 | extern void free_irq_by_fd(int fd); |
diff --git a/arch/um/include/kern_util.h b/arch/um/include/kern_util.h index 578156db3039..9d3110f41ddb 100644 --- a/arch/um/include/kern_util.h +++ b/arch/um/include/kern_util.h | |||
@@ -10,7 +10,7 @@ | |||
10 | #include "sysdep/faultinfo.h" | 10 | #include "sysdep/faultinfo.h" |
11 | #include "uml-config.h" | 11 | #include "uml-config.h" |
12 | 12 | ||
13 | typedef void (*kern_hndl)(int, union uml_pt_regs *); | 13 | typedef void (*kern_hndl)(int, struct uml_pt_regs *); |
14 | 14 | ||
15 | struct kern_handlers { | 15 | struct kern_handlers { |
16 | kern_hndl relay_signal; | 16 | kern_hndl relay_signal; |
@@ -41,7 +41,7 @@ extern unsigned long alloc_stack(int order, int atomic); | |||
41 | extern int do_signal(void); | 41 | extern int do_signal(void); |
42 | extern int is_stack_fault(unsigned long sp); | 42 | extern int is_stack_fault(unsigned long sp); |
43 | extern unsigned long segv(struct faultinfo fi, unsigned long ip, | 43 | extern unsigned long segv(struct faultinfo fi, unsigned long ip, |
44 | int is_user, union uml_pt_regs *regs); | 44 | int is_user, struct uml_pt_regs *regs); |
45 | extern int handle_page_fault(unsigned long address, unsigned long ip, | 45 | extern int handle_page_fault(unsigned long address, unsigned long ip, |
46 | int is_write, int is_user, int *code_out); | 46 | int is_write, int is_user, int *code_out); |
47 | extern void syscall_ready(void); | 47 | extern void syscall_ready(void); |
@@ -54,7 +54,7 @@ extern int need_finish_fork(void); | |||
54 | extern void free_stack(unsigned long stack, int order); | 54 | extern void free_stack(unsigned long stack, int order); |
55 | extern void add_input_request(int op, void (*proc)(int), void *arg); | 55 | extern void add_input_request(int op, void (*proc)(int), void *arg); |
56 | extern char *current_cmd(void); | 56 | extern char *current_cmd(void); |
57 | extern void timer_handler(int sig, union uml_pt_regs *regs); | 57 | extern void timer_handler(int sig, struct uml_pt_regs *regs); |
58 | extern int set_signals(int enable); | 58 | extern int set_signals(int enable); |
59 | extern int pid_to_processor_id(int pid); | 59 | extern int pid_to_processor_id(int pid); |
60 | extern void deliver_signals(void *t); | 60 | extern void deliver_signals(void *t); |
@@ -64,9 +64,9 @@ extern void finish_fork(void); | |||
64 | extern void paging_init(void); | 64 | extern void paging_init(void); |
65 | extern void init_flush_vm(void); | 65 | extern void init_flush_vm(void); |
66 | extern void *syscall_sp(void *t); | 66 | extern void *syscall_sp(void *t); |
67 | extern void syscall_trace(union uml_pt_regs *regs, int entryexit); | 67 | extern void syscall_trace(struct uml_pt_regs *regs, int entryexit); |
68 | extern int hz(void); | 68 | extern int hz(void); |
69 | extern unsigned int do_IRQ(int irq, union uml_pt_regs *regs); | 69 | extern unsigned int do_IRQ(int irq, struct uml_pt_regs *regs); |
70 | extern void interrupt_end(void); | 70 | extern void interrupt_end(void); |
71 | extern void initial_thread_cb(void (*proc)(void *), void *arg); | 71 | extern void initial_thread_cb(void (*proc)(void *), void *arg); |
72 | extern int debugger_signal(int status, int pid); | 72 | extern int debugger_signal(int status, int pid); |
@@ -76,9 +76,9 @@ extern int init_ptrace_proxy(int idle_pid, int startup, int stop); | |||
76 | extern int init_parent_proxy(int pid); | 76 | extern int init_parent_proxy(int pid); |
77 | extern int singlestepping(void *t); | 77 | extern int singlestepping(void *t); |
78 | extern void check_stack_overflow(void *ptr); | 78 | extern void check_stack_overflow(void *ptr); |
79 | extern void relay_signal(int sig, union uml_pt_regs *regs); | 79 | extern void relay_signal(int sig, struct uml_pt_regs *regs); |
80 | extern int user_context(unsigned long sp); | 80 | extern int user_context(unsigned long sp); |
81 | extern void timer_irq(union uml_pt_regs *regs); | 81 | extern void timer_irq(struct uml_pt_regs *regs); |
82 | extern void do_uml_exitcalls(void); | 82 | extern void do_uml_exitcalls(void); |
83 | extern int attach_debugger(int idle_pid, int pid, int stop); | 83 | extern int attach_debugger(int idle_pid, int pid, int stop); |
84 | extern int config_gdb(char *str); | 84 | extern int config_gdb(char *str); |
@@ -109,11 +109,9 @@ extern void time_init_kern(void); | |||
109 | 109 | ||
110 | /* Are we disallowed to sleep? Used to choose between GFP_KERNEL and GFP_ATOMIC. */ | 110 | /* Are we disallowed to sleep? Used to choose between GFP_KERNEL and GFP_ATOMIC. */ |
111 | extern int __cant_sleep(void); | 111 | extern int __cant_sleep(void); |
112 | extern void sigio_handler(int sig, union uml_pt_regs *regs); | 112 | extern void sigio_handler(int sig, struct uml_pt_regs *regs); |
113 | 113 | extern void copy_sc(struct uml_pt_regs *regs, void *from); | |
114 | extern void copy_sc(union uml_pt_regs *regs, void *from); | ||
115 | |||
116 | extern unsigned long to_irq_stack(unsigned long *mask_out); | 114 | extern unsigned long to_irq_stack(unsigned long *mask_out); |
117 | unsigned long from_irq_stack(int nested); | 115 | unsigned long from_irq_stack(int nested); |
118 | 116 | extern int start_uml(void); | |
119 | #endif | 117 | #endif |
diff --git a/arch/um/include/mconsole.h b/arch/um/include/mconsole.h index b282839c1625..a2c35fecd1f5 100644 --- a/arch/um/include/mconsole.h +++ b/arch/um/include/mconsole.h | |||
@@ -63,7 +63,7 @@ struct mc_request | |||
63 | 63 | ||
64 | struct mconsole_request request; | 64 | struct mconsole_request request; |
65 | struct mconsole_command *cmd; | 65 | struct mconsole_command *cmd; |
66 | union uml_pt_regs regs; | 66 | struct uml_pt_regs regs; |
67 | }; | 67 | }; |
68 | 68 | ||
69 | extern char mconsole_socket_name[]; | 69 | extern char mconsole_socket_name[]; |
diff --git a/arch/um/include/mode.h b/arch/um/include/mode.h deleted file mode 100644 index fcce95cbc16a..000000000000 --- a/arch/um/include/mode.h +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) | ||
3 | * Licensed under the GPL | ||
4 | */ | ||
5 | |||
6 | #ifndef __MODE_H__ | ||
7 | #define __MODE_H__ | ||
8 | |||
9 | #include "mode-skas.h" | ||
10 | |||
11 | #endif | ||
diff --git a/arch/um/include/mode_kern.h b/arch/um/include/mode_kern.h deleted file mode 100644 index b2a44c0dcd00..000000000000 --- a/arch/um/include/mode_kern.h +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) | ||
3 | * Licensed under the GPL | ||
4 | */ | ||
5 | |||
6 | #ifndef __MODE_KERN_H__ | ||
7 | #define __MODE_KERN_H__ | ||
8 | |||
9 | #include "mode_kern_skas.h" | ||
10 | |||
11 | #endif | ||
diff --git a/arch/um/include/os.h b/arch/um/include/os.h index 208d9b91fc93..daf188843a94 100644 --- a/arch/um/include/os.h +++ b/arch/um/include/os.h | |||
@@ -281,9 +281,9 @@ extern int protect(struct mm_id * mm_idp, unsigned long addr, | |||
281 | extern int is_skas_winch(int pid, int fd, void *data); | 281 | extern int is_skas_winch(int pid, int fd, void *data); |
282 | extern int start_userspace(unsigned long stub_stack); | 282 | extern int start_userspace(unsigned long stub_stack); |
283 | extern int copy_context_skas0(unsigned long stack, int pid); | 283 | extern int copy_context_skas0(unsigned long stack, int pid); |
284 | extern void save_registers(int pid, union uml_pt_regs *regs); | 284 | extern void save_registers(int pid, struct uml_pt_regs *regs); |
285 | extern void restore_registers(int pid, union uml_pt_regs *regs); | 285 | extern void restore_registers(int pid, struct uml_pt_regs *regs); |
286 | extern void userspace(union uml_pt_regs *regs); | 286 | extern void userspace(struct uml_pt_regs *regs); |
287 | extern void map_stub_pages(int fd, unsigned long code, | 287 | extern void map_stub_pages(int fd, unsigned long code, |
288 | unsigned long data, unsigned long stack); | 288 | unsigned long data, unsigned long stack); |
289 | extern void new_thread(void *stack, jmp_buf *buf, void (*handler)(void)); | 289 | extern void new_thread(void *stack, jmp_buf *buf, void (*handler)(void)); |
diff --git a/arch/um/include/registers.h b/arch/um/include/registers.h index b7d2c4e2c613..8e8ea9651189 100644 --- a/arch/um/include/registers.h +++ b/arch/um/include/registers.h | |||
@@ -9,11 +9,11 @@ | |||
9 | #include "sysdep/ptrace.h" | 9 | #include "sysdep/ptrace.h" |
10 | #include "sysdep/archsetjmp.h" | 10 | #include "sysdep/archsetjmp.h" |
11 | 11 | ||
12 | extern void init_thread_registers(union uml_pt_regs *to); | 12 | extern void init_thread_registers(struct uml_pt_regs *to); |
13 | extern int save_fp_registers(int pid, unsigned long *fp_regs); | 13 | extern int save_fp_registers(int pid, unsigned long *fp_regs); |
14 | extern int restore_fp_registers(int pid, unsigned long *fp_regs); | 14 | extern int restore_fp_registers(int pid, unsigned long *fp_regs); |
15 | extern void save_registers(int pid, union uml_pt_regs *regs); | 15 | extern void save_registers(int pid, struct uml_pt_regs *regs); |
16 | extern void restore_registers(int pid, union uml_pt_regs *regs); | 16 | extern void restore_registers(int pid, struct uml_pt_regs *regs); |
17 | extern void init_registers(int pid); | 17 | extern void init_registers(int pid); |
18 | extern void get_safe_registers(unsigned long *regs); | 18 | extern void get_safe_registers(unsigned long *regs); |
19 | extern unsigned long get_thread_reg(int reg, jmp_buf *buf); | 19 | extern unsigned long get_thread_reg(int reg, jmp_buf *buf); |
diff --git a/arch/um/include/skas/mmu-skas.h b/arch/um/include/skas/mmu-skas.h index b26986c0c3d2..838dfd75e2aa 100644 --- a/arch/um/include/skas/mmu-skas.h +++ b/arch/um/include/skas/mmu-skas.h | |||
@@ -18,6 +18,6 @@ struct mmu_context_skas { | |||
18 | uml_ldt_t ldt; | 18 | uml_ldt_t ldt; |
19 | }; | 19 | }; |
20 | 20 | ||
21 | extern void switch_mm_skas(struct mm_id * mm_idp); | 21 | extern void __switch_mm(struct mm_id * mm_idp); |
22 | 22 | ||
23 | #endif | 23 | #endif |
diff --git a/arch/um/include/skas/mode_kern_skas.h b/arch/um/include/skas/mode_kern_skas.h deleted file mode 100644 index c29485109a9a..000000000000 --- a/arch/um/include/skas/mode_kern_skas.h +++ /dev/null | |||
@@ -1,42 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2002 - 2007 Jeff Dike (jdike@{linux.intel,addtoit}.com) | ||
3 | * Licensed under the GPL | ||
4 | */ | ||
5 | |||
6 | #ifndef __SKAS_MODE_KERN_H__ | ||
7 | #define __SKAS_MODE_KERN_H__ | ||
8 | |||
9 | #include "linux/sched.h" | ||
10 | #include "asm/page.h" | ||
11 | #include "asm/ptrace.h" | ||
12 | #include "mem_user.h" | ||
13 | |||
14 | extern void flush_thread_skas(void); | ||
15 | extern void switch_to_skas(void *prev, void *next); | ||
16 | extern void start_thread_skas(struct pt_regs *regs, unsigned long eip, | ||
17 | unsigned long esp); | ||
18 | extern int copy_thread_skas(int nr, unsigned long clone_flags, | ||
19 | unsigned long sp, unsigned long stack_top, | ||
20 | struct task_struct *p, struct pt_regs *regs); | ||
21 | extern void release_thread_skas(struct task_struct *task); | ||
22 | extern void init_idle_skas(void); | ||
23 | extern void flush_tlb_kernel_range_skas(unsigned long start, | ||
24 | unsigned long end); | ||
25 | extern void flush_tlb_kernel_vm_skas(void); | ||
26 | extern void __flush_tlb_one_skas(unsigned long addr); | ||
27 | extern void flush_tlb_range_skas(struct vm_area_struct *vma, | ||
28 | unsigned long start, unsigned long end); | ||
29 | extern void flush_tlb_mm_skas(struct mm_struct *mm); | ||
30 | extern void force_flush_all_skas(void); | ||
31 | extern long execute_syscall_skas(void *r); | ||
32 | extern void before_mem_skas(unsigned long unused); | ||
33 | extern unsigned long set_task_sizes_skas(unsigned long *task_size_out); | ||
34 | extern int start_uml_skas(void); | ||
35 | extern int external_pid_skas(struct task_struct *task); | ||
36 | extern int thread_pid_skas(struct task_struct *task); | ||
37 | extern void flush_tlb_page_skas(struct vm_area_struct *vma, | ||
38 | unsigned long address); | ||
39 | |||
40 | #define kmem_end_skas (host_task_size - 1024 * 1024) | ||
41 | |||
42 | #endif | ||
diff --git a/arch/um/include/skas/skas.h b/arch/um/include/skas/skas.h index e88926b16072..b4a95e485929 100644 --- a/arch/um/include/skas/skas.h +++ b/arch/um/include/skas/skas.h | |||
@@ -15,7 +15,7 @@ extern int skas_needs_stub; | |||
15 | 15 | ||
16 | extern int user_thread(unsigned long stack, int flags); | 16 | extern int user_thread(unsigned long stack, int flags); |
17 | extern void new_thread_handler(void); | 17 | extern void new_thread_handler(void); |
18 | extern void handle_syscall(union uml_pt_regs *regs); | 18 | extern void handle_syscall(struct uml_pt_regs *regs); |
19 | extern int new_mm(unsigned long stack); | 19 | extern int new_mm(unsigned long stack); |
20 | extern void get_skas_faultinfo(int pid, struct faultinfo * fi); | 20 | extern void get_skas_faultinfo(int pid, struct faultinfo * fi); |
21 | extern long execute_syscall_skas(void *r); | 21 | extern long execute_syscall_skas(void *r); |
diff --git a/arch/um/include/sysdep-i386/ptrace.h b/arch/um/include/sysdep-i386/ptrace.h index 45573088864c..d765175d42be 100644 --- a/arch/um/include/sysdep-i386/ptrace.h +++ b/arch/um/include/sysdep-i386/ptrace.h | |||
@@ -52,37 +52,34 @@ extern int sysemu_supported; | |||
52 | #define PTRACE_SYSEMU_SINGLESTEP 32 | 52 | #define PTRACE_SYSEMU_SINGLESTEP 32 |
53 | #endif | 53 | #endif |
54 | 54 | ||
55 | union uml_pt_regs { | 55 | struct uml_pt_regs { |
56 | struct skas_regs { | 56 | unsigned long regs[MAX_REG_NR]; |
57 | unsigned long regs[MAX_REG_NR]; | 57 | unsigned long fp[HOST_FP_SIZE]; |
58 | unsigned long fp[HOST_FP_SIZE]; | 58 | unsigned long xfp[HOST_XFP_SIZE]; |
59 | unsigned long xfp[HOST_XFP_SIZE]; | 59 | struct faultinfo faultinfo; |
60 | struct faultinfo faultinfo; | 60 | long syscall; |
61 | long syscall; | 61 | int is_user; |
62 | int is_user; | ||
63 | } skas; | ||
64 | }; | 62 | }; |
65 | 63 | ||
66 | #define EMPTY_UML_PT_REGS { } | 64 | #define EMPTY_UML_PT_REGS { } |
67 | 65 | ||
68 | #define UPT_SC(r) ((r)->tt.sc) | 66 | #define UPT_IP(r) REGS_IP((r)->regs) |
69 | #define UPT_IP(r) REGS_IP((r)->skas.regs) | 67 | #define UPT_SP(r) REGS_SP((r)->regs) |
70 | #define UPT_SP(r) REGS_SP((r)->skas.regs) | 68 | #define UPT_EFLAGS(r) REGS_EFLAGS((r)->regs) |
71 | #define UPT_EFLAGS(r) REGS_EFLAGS((r)->skas.regs) | 69 | #define UPT_EAX(r) REGS_EAX((r)->regs) |
72 | #define UPT_EAX(r) REGS_EAX((r)->skas.regs) | 70 | #define UPT_EBX(r) REGS_EBX((r)->regs) |
73 | #define UPT_EBX(r) REGS_EBX((r)->skas.regs) | 71 | #define UPT_ECX(r) REGS_ECX((r)->regs) |
74 | #define UPT_ECX(r) REGS_ECX((r)->skas.regs) | 72 | #define UPT_EDX(r) REGS_EDX((r)->regs) |
75 | #define UPT_EDX(r) REGS_EDX((r)->skas.regs) | 73 | #define UPT_ESI(r) REGS_ESI((r)->regs) |
76 | #define UPT_ESI(r) REGS_ESI((r)->skas.regs) | 74 | #define UPT_EDI(r) REGS_EDI((r)->regs) |
77 | #define UPT_EDI(r) REGS_EDI((r)->skas.regs) | 75 | #define UPT_EBP(r) REGS_EBP((r)->regs) |
78 | #define UPT_EBP(r) REGS_EBP((r)->skas.regs) | 76 | #define UPT_ORIG_EAX(r) ((r)->syscall) |
79 | #define UPT_ORIG_EAX(r) ((r)->skas.syscall) | 77 | #define UPT_CS(r) REGS_CS((r)->regs) |
80 | #define UPT_CS(r) REGS_CS((r)->skas.regs) | 78 | #define UPT_SS(r) REGS_SS((r)->regs) |
81 | #define UPT_SS(r) REGS_SS((r)->skas.regs) | 79 | #define UPT_DS(r) REGS_DS((r)->regs) |
82 | #define UPT_DS(r) REGS_DS((r)->skas.regs) | 80 | #define UPT_ES(r) REGS_ES((r)->regs) |
83 | #define UPT_ES(r) REGS_ES((r)->skas.regs) | 81 | #define UPT_FS(r) REGS_FS((r)->regs) |
84 | #define UPT_FS(r) REGS_FS((r)->skas.regs) | 82 | #define UPT_GS(r) REGS_GS((r)->regs) |
85 | #define UPT_GS(r) REGS_GS((r)->skas.regs) | ||
86 | 83 | ||
87 | #define UPT_SYSCALL_ARG1(r) UPT_EBX(r) | 84 | #define UPT_SYSCALL_ARG1(r) UPT_EBX(r) |
88 | #define UPT_SYSCALL_ARG2(r) UPT_ECX(r) | 85 | #define UPT_SYSCALL_ARG2(r) UPT_ECX(r) |
@@ -93,7 +90,7 @@ union uml_pt_regs { | |||
93 | 90 | ||
94 | extern int user_context(unsigned long sp); | 91 | extern int user_context(unsigned long sp); |
95 | 92 | ||
96 | #define UPT_IS_USER(r) ((r)->skas.is_user) | 93 | #define UPT_IS_USER(r) ((r)->is_user) |
97 | 94 | ||
98 | struct syscall_args { | 95 | struct syscall_args { |
99 | unsigned long args[6]; | 96 | unsigned long args[6]; |
@@ -162,14 +159,14 @@ struct syscall_args { | |||
162 | } while (0) | 159 | } while (0) |
163 | 160 | ||
164 | #define UPT_SET_SYSCALL_RETURN(r, res) \ | 161 | #define UPT_SET_SYSCALL_RETURN(r, res) \ |
165 | REGS_SET_SYSCALL_RETURN((r)->skas.regs, (res)) | 162 | REGS_SET_SYSCALL_RETURN((r)->regs, (res)) |
166 | 163 | ||
167 | #define UPT_RESTART_SYSCALL(r) REGS_RESTART_SYSCALL((r)->skas.regs) | 164 | #define UPT_RESTART_SYSCALL(r) REGS_RESTART_SYSCALL((r)->regs) |
168 | 165 | ||
169 | #define UPT_ORIG_SYSCALL(r) UPT_EAX(r) | 166 | #define UPT_ORIG_SYSCALL(r) UPT_EAX(r) |
170 | #define UPT_SYSCALL_NR(r) UPT_ORIG_EAX(r) | 167 | #define UPT_SYSCALL_NR(r) UPT_ORIG_EAX(r) |
171 | #define UPT_SYSCALL_RET(r) UPT_EAX(r) | 168 | #define UPT_SYSCALL_RET(r) UPT_EAX(r) |
172 | 169 | ||
173 | #define UPT_FAULTINFO(r) (&(r)->skas.faultinfo) | 170 | #define UPT_FAULTINFO(r) (&(r)->faultinfo) |
174 | 171 | ||
175 | #endif | 172 | #endif |
diff --git a/arch/um/include/sysdep-x86_64/ptrace.h b/arch/um/include/sysdep-x86_64/ptrace.h index b3412b64cbea..ea4afdce59c1 100644 --- a/arch/um/include/sysdep-x86_64/ptrace.h +++ b/arch/um/include/sysdep-x86_64/ptrace.h | |||
@@ -84,58 +84,52 @@ | |||
84 | 84 | ||
85 | #define REGS_ERR(r) ((r)->fault_type) | 85 | #define REGS_ERR(r) ((r)->fault_type) |
86 | 86 | ||
87 | /* XXX */ | 87 | struct uml_pt_regs { |
88 | union uml_pt_regs { | 88 | unsigned long regs[MAX_REG_NR]; |
89 | struct skas_regs { | 89 | unsigned long fp[HOST_FP_SIZE]; |
90 | unsigned long regs[MAX_REG_NR]; | 90 | struct faultinfo faultinfo; |
91 | unsigned long fp[HOST_FP_SIZE]; | 91 | long syscall; |
92 | struct faultinfo faultinfo; | 92 | int is_user; |
93 | long syscall; | ||
94 | int is_user; | ||
95 | } skas; | ||
96 | }; | 93 | }; |
97 | 94 | ||
98 | #define EMPTY_UML_PT_REGS { } | 95 | #define EMPTY_UML_PT_REGS { } |
99 | 96 | ||
100 | #define UPT_RBX(r) REGS_RBX((r)->skas.regs) | 97 | #define UPT_RBX(r) REGS_RBX((r)->regs) |
101 | #define UPT_RCX(r) REGS_RCX((r)->skas.regs) | 98 | #define UPT_RCX(r) REGS_RCX((r)->regs) |
102 | #define UPT_RDX(r) REGS_RDX((r)->skas.regs) | 99 | #define UPT_RDX(r) REGS_RDX((r)->regs) |
103 | #define UPT_RSI(r) REGS_RSI((r)->skas.regs) | 100 | #define UPT_RSI(r) REGS_RSI((r)->regs) |
104 | #define UPT_RDI(r) REGS_RDI((r)->skas.regs) | 101 | #define UPT_RDI(r) REGS_RDI((r)->regs) |
105 | #define UPT_RBP(r) REGS_RBP((r)->skas.regs) | 102 | #define UPT_RBP(r) REGS_RBP((r)->regs) |
106 | #define UPT_RAX(r) REGS_RAX((r)->skas.regs) | 103 | #define UPT_RAX(r) REGS_RAX((r)->regs) |
107 | #define UPT_R8(r) REGS_R8((r)->skas.regs) | 104 | #define UPT_R8(r) REGS_R8((r)->regs) |
108 | #define UPT_R9(r) REGS_R9((r)->skas.regs) | 105 | #define UPT_R9(r) REGS_R9((r)->regs) |
109 | #define UPT_R10(r) REGS_R10((r)->skas.regs) | 106 | #define UPT_R10(r) REGS_R10((r)->regs) |
110 | #define UPT_R11(r) REGS_R11((r)->skas.regs) | 107 | #define UPT_R11(r) REGS_R11((r)->regs) |
111 | #define UPT_R12(r) REGS_R12((r)->skas.regs) | 108 | #define UPT_R12(r) REGS_R12((r)->regs) |
112 | #define UPT_R13(r) REGS_R13((r)->skas.regs) | 109 | #define UPT_R13(r) REGS_R13((r)->regs) |
113 | #define UPT_R14(r) REGS_R14((r)->skas.regs) | 110 | #define UPT_R14(r) REGS_R14((r)->regs) |
114 | #define UPT_R15(r) REGS_R15((r)->skas.regs) | 111 | #define UPT_R15(r) REGS_R15((r)->regs) |
115 | #define UPT_CS(r) REGS_CS((r)->skas.regs) | 112 | #define UPT_CS(r) REGS_CS((r)->regs) |
116 | #define UPT_FS_BASE(r) \ | 113 | #define UPT_FS_BASE(r) REGS_FS_BASE((r)->regs) |
117 | REGS_FS_BASE((r)->skas.regs) | 114 | #define UPT_FS(r) REGS_FS((r)->regs) |
118 | #define UPT_FS(r) REGS_FS((r)->skas.regs) | 115 | #define UPT_GS_BASE(r) REGS_GS_BASE((r)->regs) |
119 | #define UPT_GS_BASE(r) \ | 116 | #define UPT_GS(r) REGS_GS((r)->regs) |
120 | REGS_GS_BASE((r)->skas.regs) | 117 | #define UPT_DS(r) REGS_DS((r)->regs) |
121 | #define UPT_GS(r) REGS_GS((r)->skas.regs) | 118 | #define UPT_ES(r) REGS_ES((r)->regs) |
122 | #define UPT_DS(r) REGS_DS((r)->skas.regs) | 119 | #define UPT_CS(r) REGS_CS((r)->regs) |
123 | #define UPT_ES(r) REGS_ES((r)->skas.regs) | 120 | #define UPT_SS(r) REGS_SS((r)->regs) |
124 | #define UPT_CS(r) REGS_CS((r)->skas.regs) | 121 | #define UPT_ORIG_RAX(r) REGS_ORIG_RAX((r)->regs) |
125 | #define UPT_SS(r) REGS_SS((r)->skas.regs) | 122 | |
126 | #define UPT_ORIG_RAX(r) REGS_ORIG_RAX((r)->skas.regs) | 123 | #define UPT_IP(r) REGS_IP((r)->regs) |
127 | 124 | #define UPT_SP(r) REGS_SP((r)->regs) | |
128 | #define UPT_IP(r) REGS_IP((r)->skas.regs) | 125 | |
129 | #define UPT_SP(r) REGS_SP((r)->skas.regs) | 126 | #define UPT_EFLAGS(r) REGS_EFLAGS((r)->regs) |
130 | 127 | #define UPT_SYSCALL_NR(r) ((r)->syscall) | |
131 | #define UPT_EFLAGS(r) REGS_EFLAGS((r)->skas.regs) | ||
132 | #define UPT_SC(r) ((r)->tt.sc) | ||
133 | #define UPT_SYSCALL_NR(r) ((r)->skas.syscall) | ||
134 | #define UPT_SYSCALL_RET(r) UPT_RAX(r) | 128 | #define UPT_SYSCALL_RET(r) UPT_RAX(r) |
135 | 129 | ||
136 | extern int user_context(unsigned long sp); | 130 | extern int user_context(unsigned long sp); |
137 | 131 | ||
138 | #define UPT_IS_USER(r) ((r)->skas.is_user) | 132 | #define UPT_IS_USER(r) ((r)->is_user) |
139 | 133 | ||
140 | #define UPT_SYSCALL_ARG1(r) UPT_RDI(r) | 134 | #define UPT_SYSCALL_ARG1(r) UPT_RDI(r) |
141 | #define UPT_SYSCALL_ARG2(r) UPT_RSI(r) | 135 | #define UPT_SYSCALL_ARG2(r) UPT_RSI(r) |
@@ -232,12 +226,12 @@ struct syscall_args { | |||
232 | }) | 226 | }) |
233 | 227 | ||
234 | #define UPT_SET_SYSCALL_RETURN(r, res) \ | 228 | #define UPT_SET_SYSCALL_RETURN(r, res) \ |
235 | REGS_SET_SYSCALL_RETURN((r)->skas.regs, (res)) | 229 | REGS_SET_SYSCALL_RETURN((r)->regs, (res)) |
236 | 230 | ||
237 | #define UPT_RESTART_SYSCALL(r) REGS_RESTART_SYSCALL((r)->skas.regs) | 231 | #define UPT_RESTART_SYSCALL(r) REGS_RESTART_SYSCALL((r)->regs) |
238 | 232 | ||
239 | #define UPT_SEGV_IS_FIXABLE(r) REGS_SEGV_IS_FIXABLE(&r->skas) | 233 | #define UPT_SEGV_IS_FIXABLE(r) REGS_SEGV_IS_FIXABLE(&r->skas) |
240 | 234 | ||
241 | #define UPT_FAULTINFO(r) (&(r)->skas.faultinfo) | 235 | #define UPT_FAULTINFO(r) (&(r)->faultinfo) |
242 | 236 | ||
243 | #endif | 237 | #endif |
diff --git a/arch/um/include/task.h b/arch/um/include/task.h index 6375ba7203c9..3fe726b3cf48 100644 --- a/arch/um/include/task.h +++ b/arch/um/include/task.h | |||
@@ -3,7 +3,7 @@ | |||
3 | 3 | ||
4 | #include <kern_constants.h> | 4 | #include <kern_constants.h> |
5 | 5 | ||
6 | #define TASK_REGS(task) ((union uml_pt_regs *) &(((char *) (task))[HOST_TASK_REGS])) | 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])) | 7 | #define TASK_PID(task) *((int *) &(((char *) (task))[HOST_TASK_PID])) |
8 | 8 | ||
9 | #endif | 9 | #endif |