diff options
Diffstat (limited to 'arch/um/include')
| -rw-r--r-- | arch/um/include/chan_kern.h | 6 | ||||
| -rw-r--r-- | arch/um/include/chan_user.h | 6 | ||||
| -rw-r--r-- | arch/um/include/kern_util.h | 3 | ||||
| -rw-r--r-- | arch/um/include/line.h | 4 | ||||
| -rw-r--r-- | arch/um/include/longjmp.h | 5 | ||||
| -rw-r--r-- | arch/um/include/net_kern.h | 4 | ||||
| -rw-r--r-- | arch/um/include/net_user.h | 1 | ||||
| -rw-r--r-- | arch/um/include/os.h | 18 | ||||
| -rw-r--r-- | arch/um/include/registers.h | 3 | ||||
| -rw-r--r-- | arch/um/include/skas/skas.h | 3 | ||||
| -rw-r--r-- | arch/um/include/sysdep-i386/archsetjmp.h | 22 | ||||
| -rw-r--r-- | arch/um/include/sysdep-i386/signal.h | 27 | ||||
| -rw-r--r-- | arch/um/include/sysdep-x86_64/archsetjmp.h | 24 | ||||
| -rw-r--r-- | arch/um/include/sysdep-x86_64/ptrace.h | 43 | ||||
| -rw-r--r-- | arch/um/include/sysdep-x86_64/sc.h | 2 | ||||
| -rw-r--r-- | arch/um/include/sysdep-x86_64/signal.h | 29 |
16 files changed, 115 insertions, 85 deletions
diff --git a/arch/um/include/chan_kern.h b/arch/um/include/chan_kern.h index 1bb5e9d94270..572d286ed2c6 100644 --- a/arch/um/include/chan_kern.h +++ b/arch/um/include/chan_kern.h | |||
| @@ -23,21 +23,21 @@ struct chan { | |||
| 23 | unsigned int opened:1; | 23 | unsigned int opened:1; |
| 24 | unsigned int enabled:1; | 24 | unsigned int enabled:1; |
| 25 | int fd; | 25 | int fd; |
| 26 | struct chan_ops *ops; | 26 | const struct chan_ops *ops; |
| 27 | void *data; | 27 | void *data; |
| 28 | }; | 28 | }; |
| 29 | 29 | ||
| 30 | extern void chan_interrupt(struct list_head *chans, struct work_struct *task, | 30 | extern void chan_interrupt(struct list_head *chans, struct work_struct *task, |
| 31 | struct tty_struct *tty, int irq); | 31 | struct tty_struct *tty, int irq); |
| 32 | extern int parse_chan_pair(char *str, struct line *line, int device, | 32 | extern int parse_chan_pair(char *str, struct line *line, int device, |
| 33 | struct chan_opts *opts); | 33 | const struct chan_opts *opts); |
| 34 | extern int open_chan(struct list_head *chans); | 34 | extern int open_chan(struct list_head *chans); |
| 35 | extern int write_chan(struct list_head *chans, const char *buf, int len, | 35 | extern int write_chan(struct list_head *chans, const char *buf, int len, |
| 36 | int write_irq); | 36 | int write_irq); |
| 37 | extern int console_write_chan(struct list_head *chans, const char *buf, | 37 | extern int console_write_chan(struct list_head *chans, const char *buf, |
| 38 | int len); | 38 | int len); |
| 39 | extern int console_open_chan(struct line *line, struct console *co, | 39 | extern int console_open_chan(struct line *line, struct console *co, |
| 40 | struct chan_opts *opts); | 40 | const struct chan_opts *opts); |
| 41 | extern void deactivate_chan(struct list_head *chans, int irq); | 41 | extern void deactivate_chan(struct list_head *chans, int irq); |
| 42 | extern void reactivate_chan(struct list_head *chans, int irq); | 42 | extern void reactivate_chan(struct list_head *chans, int irq); |
| 43 | extern void chan_enable_winch(struct list_head *chans, struct tty_struct *tty); | 43 | extern void chan_enable_winch(struct list_head *chans, struct tty_struct *tty); |
diff --git a/arch/um/include/chan_user.h b/arch/um/include/chan_user.h index 659bb3cac32f..a795547a1dbd 100644 --- a/arch/um/include/chan_user.h +++ b/arch/um/include/chan_user.h | |||
| @@ -20,7 +20,7 @@ enum chan_init_pri { INIT_STATIC, INIT_ALL, INIT_ONE }; | |||
| 20 | 20 | ||
| 21 | struct chan_ops { | 21 | struct chan_ops { |
| 22 | char *type; | 22 | char *type; |
| 23 | void *(*init)(char *, int, struct chan_opts *); | 23 | void *(*init)(char *, int, const struct chan_opts *); |
| 24 | int (*open)(int, int, int, void *, char **); | 24 | int (*open)(int, int, int, void *, char **); |
| 25 | void (*close)(int, void *); | 25 | void (*close)(int, void *); |
| 26 | int (*read)(int, char *, void *); | 26 | int (*read)(int, char *, void *); |
| @@ -31,8 +31,8 @@ struct chan_ops { | |||
| 31 | int winch; | 31 | int winch; |
| 32 | }; | 32 | }; |
| 33 | 33 | ||
| 34 | extern struct chan_ops fd_ops, null_ops, port_ops, pts_ops, pty_ops, tty_ops, | 34 | extern const struct chan_ops fd_ops, null_ops, port_ops, pts_ops, pty_ops, |
| 35 | xterm_ops; | 35 | tty_ops, xterm_ops; |
| 36 | 36 | ||
| 37 | extern void generic_close(int fd, void *unused); | 37 | extern void generic_close(int fd, void *unused); |
| 38 | extern int generic_read(int fd, char *c_out, void *unused); | 38 | extern int generic_read(int fd, char *c_out, void *unused); |
diff --git a/arch/um/include/kern_util.h b/arch/um/include/kern_util.h index b98bdd8e052a..59cfa9e0cad0 100644 --- a/arch/um/include/kern_util.h +++ b/arch/um/include/kern_util.h | |||
| @@ -21,13 +21,12 @@ struct kern_handlers { | |||
| 21 | kern_hndl timer_handler; | 21 | kern_hndl timer_handler; |
| 22 | }; | 22 | }; |
| 23 | 23 | ||
| 24 | extern struct kern_handlers handlinfo_kern; | 24 | extern const struct kern_handlers handlinfo_kern; |
| 25 | 25 | ||
| 26 | extern int ncpus; | 26 | extern int ncpus; |
| 27 | extern char *linux_prog; | 27 | extern char *linux_prog; |
| 28 | extern char *gdb_init; | 28 | extern char *gdb_init; |
| 29 | extern int kmalloc_ok; | 29 | extern int kmalloc_ok; |
| 30 | extern int timer_irq_inited; | ||
| 31 | extern int jail; | 30 | extern int jail; |
| 32 | extern int nsyscalls; | 31 | extern int nsyscalls; |
| 33 | 32 | ||
diff --git a/arch/um/include/line.h b/arch/um/include/line.h index 27bf2f6fbc05..642c9a0320f9 100644 --- a/arch/um/include/line.h +++ b/arch/um/include/line.h | |||
| @@ -52,7 +52,7 @@ struct line { | |||
| 52 | 52 | ||
| 53 | int sigio; | 53 | int sigio; |
| 54 | struct work_struct task; | 54 | struct work_struct task; |
| 55 | struct line_driver *driver; | 55 | const struct line_driver *driver; |
| 56 | int have_irq; | 56 | int have_irq; |
| 57 | }; | 57 | }; |
| 58 | 58 | ||
| @@ -99,7 +99,7 @@ extern void lines_init(struct line *lines, int nlines, struct chan_opts *opts); | |||
| 99 | extern void close_lines(struct line *lines, int nlines); | 99 | extern void close_lines(struct line *lines, int nlines); |
| 100 | 100 | ||
| 101 | extern int line_config(struct line *lines, unsigned int sizeof_lines, | 101 | extern int line_config(struct line *lines, unsigned int sizeof_lines, |
| 102 | char *str, struct chan_opts *opts); | 102 | char *str, const struct chan_opts *opts); |
| 103 | extern int line_id(char **str, int *start_out, int *end_out); | 103 | extern int line_id(char **str, int *start_out, int *end_out); |
| 104 | extern int line_remove(struct line *lines, unsigned int sizeof_lines, int n); | 104 | extern int line_remove(struct line *lines, unsigned int sizeof_lines, int n); |
| 105 | extern int line_get_config(char *dev, struct line *lines, | 105 | extern int line_get_config(char *dev, struct line *lines, |
diff --git a/arch/um/include/longjmp.h b/arch/um/include/longjmp.h index 1b5c0131a12e..e93c6d3e893b 100644 --- a/arch/um/include/longjmp.h +++ b/arch/um/include/longjmp.h | |||
| @@ -1,9 +1,12 @@ | |||
| 1 | #ifndef __UML_LONGJMP_H | 1 | #ifndef __UML_LONGJMP_H |
| 2 | #define __UML_LONGJMP_H | 2 | #define __UML_LONGJMP_H |
| 3 | 3 | ||
| 4 | #include <setjmp.h> | 4 | #include "sysdep/archsetjmp.h" |
| 5 | #include "os.h" | 5 | #include "os.h" |
| 6 | 6 | ||
| 7 | extern int setjmp(jmp_buf); | ||
| 8 | extern void longjmp(jmp_buf, int); | ||
| 9 | |||
| 7 | #define UML_LONGJMP(buf, val) do { \ | 10 | #define UML_LONGJMP(buf, val) do { \ |
| 8 | longjmp(*buf, val); \ | 11 | longjmp(*buf, val); \ |
| 9 | } while(0) | 12 | } while(0) |
diff --git a/arch/um/include/net_kern.h b/arch/um/include/net_kern.h index f7de6df60dd7..769fba43ee03 100644 --- a/arch/um/include/net_kern.h +++ b/arch/um/include/net_kern.h | |||
| @@ -54,8 +54,8 @@ struct transport { | |||
| 54 | struct list_head list; | 54 | struct list_head list; |
| 55 | char *name; | 55 | char *name; |
| 56 | int (*setup)(char *, char **, void *); | 56 | int (*setup)(char *, char **, void *); |
| 57 | struct net_user_info *user; | 57 | const struct net_user_info *user; |
| 58 | struct net_kern_info *kern; | 58 | const struct net_kern_info *kern; |
| 59 | int private_size; | 59 | int private_size; |
| 60 | int setup_size; | 60 | int setup_size; |
| 61 | }; | 61 | }; |
diff --git a/arch/um/include/net_user.h b/arch/um/include/net_user.h index 800c403920bc..47ef7cb49a8e 100644 --- a/arch/um/include/net_user.h +++ b/arch/um/include/net_user.h | |||
| @@ -26,7 +26,6 @@ struct net_user_info { | |||
| 26 | 26 | ||
| 27 | extern void ether_user_init(void *data, void *dev); | 27 | extern void ether_user_init(void *data, void *dev); |
| 28 | extern void dev_ip_addr(void *d, unsigned char *bin_buf); | 28 | extern void dev_ip_addr(void *d, unsigned char *bin_buf); |
| 29 | extern void set_ether_mac(void *d, unsigned char *addr); | ||
| 30 | extern void iter_addresses(void *d, void (*cb)(unsigned char *, | 29 | extern void iter_addresses(void *d, void (*cb)(unsigned char *, |
| 31 | unsigned char *, void *), | 30 | unsigned char *, void *), |
| 32 | void *arg); | 31 | void *arg); |
diff --git a/arch/um/include/os.h b/arch/um/include/os.h index 5316e8a4a4fd..120ca21a513a 100644 --- a/arch/um/include/os.h +++ b/arch/um/include/os.h | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | #include "skas/mm_id.h" | 14 | #include "skas/mm_id.h" |
| 15 | #include "irq_user.h" | 15 | #include "irq_user.h" |
| 16 | #include "sysdep/tls.h" | 16 | #include "sysdep/tls.h" |
| 17 | #include "sysdep/archsetjmp.h" | ||
| 17 | 18 | ||
| 18 | #define OS_TYPE_FILE 1 | 19 | #define OS_TYPE_FILE 1 |
| 19 | #define OS_TYPE_DIR 2 | 20 | #define OS_TYPE_DIR 2 |
| @@ -198,7 +199,9 @@ extern long os_ptrace_ldt(long pid, long addr, long data); | |||
| 198 | extern int os_getpid(void); | 199 | extern int os_getpid(void); |
| 199 | extern int os_getpgrp(void); | 200 | extern int os_getpgrp(void); |
| 200 | 201 | ||
| 202 | #ifdef UML_CONFIG_MODE_TT | ||
| 201 | extern void init_new_thread_stack(void *sig_stack, void (*usr1_handler)(int)); | 203 | extern void init_new_thread_stack(void *sig_stack, void (*usr1_handler)(int)); |
| 204 | #endif | ||
| 202 | extern void init_new_thread_signals(void); | 205 | extern void init_new_thread_signals(void); |
| 203 | extern int run_kernel_thread(int (*fn)(void *), void *arg, void **jmp_ptr); | 206 | extern int run_kernel_thread(int (*fn)(void *), void *arg, void **jmp_ptr); |
| 204 | 207 | ||
| @@ -216,7 +219,6 @@ extern void os_flush_stdout(void); | |||
| 216 | */ | 219 | */ |
| 217 | extern void forward_ipi(int fd, int pid); | 220 | extern void forward_ipi(int fd, int pid); |
| 218 | extern void kill_child_dead(int pid); | 221 | extern void kill_child_dead(int pid); |
| 219 | extern void stop(void); | ||
| 220 | extern int wait_for_stop(int pid, int sig, int cont_type, void *relay); | 222 | extern int wait_for_stop(int pid, int sig, int cont_type, void *relay); |
| 221 | extern int protect_memory(unsigned long addr, unsigned long len, | 223 | extern int protect_memory(unsigned long addr, unsigned long len, |
| 222 | int r, int w, int x, int must_succeed); | 224 | int r, int w, int x, int must_succeed); |
| @@ -276,9 +278,11 @@ extern int setjmp_wrapper(void (*proc)(void *, void *), ...); | |||
| 276 | 278 | ||
| 277 | extern void switch_timers(int to_real); | 279 | extern void switch_timers(int to_real); |
| 278 | extern void idle_sleep(int secs); | 280 | extern void idle_sleep(int secs); |
| 281 | extern int set_interval(int is_virtual); | ||
| 282 | #ifdef CONFIG_MODE_TT | ||
| 279 | extern void enable_timer(void); | 283 | extern void enable_timer(void); |
| 284 | #endif | ||
| 280 | extern void disable_timer(void); | 285 | extern void disable_timer(void); |
| 281 | extern void user_time_init(void); | ||
| 282 | extern void uml_idle_timer(void); | 286 | extern void uml_idle_timer(void); |
| 283 | extern unsigned long long os_nsecs(void); | 287 | extern unsigned long long os_nsecs(void); |
| 284 | 288 | ||
| @@ -305,12 +309,9 @@ extern int copy_context_skas0(unsigned long stack, int pid); | |||
| 305 | extern void userspace(union uml_pt_regs *regs); | 309 | extern void userspace(union uml_pt_regs *regs); |
| 306 | extern void map_stub_pages(int fd, unsigned long code, | 310 | extern void map_stub_pages(int fd, unsigned long code, |
| 307 | unsigned long data, unsigned long stack); | 311 | unsigned long data, unsigned long stack); |
| 308 | extern void new_thread(void *stack, void **switch_buf_ptr, | 312 | extern void new_thread(void *stack, jmp_buf *buf, void (*handler)(void)); |
| 309 | void **fork_buf_ptr, void (*handler)(int)); | 313 | extern void switch_threads(jmp_buf *me, jmp_buf *you); |
| 310 | extern void thread_wait(void *sw, void *fb); | 314 | extern int start_idle_thread(void *stack, jmp_buf *switch_buf); |
| 311 | extern void switch_threads(void *me, void *next); | ||
| 312 | extern int start_idle_thread(void *stack, void *switch_buf_ptr, | ||
| 313 | void **fork_buf_ptr); | ||
| 314 | extern void initial_thread_cb_skas(void (*proc)(void *), | 315 | extern void initial_thread_cb_skas(void (*proc)(void *), |
| 315 | void *arg); | 316 | void *arg); |
| 316 | extern void halt_skas(void); | 317 | extern void halt_skas(void); |
| @@ -329,6 +330,7 @@ extern void os_set_ioignore(void); | |||
| 329 | extern void init_irq_signals(int on_sigstack); | 330 | extern void init_irq_signals(int on_sigstack); |
| 330 | 331 | ||
| 331 | /* sigio.c */ | 332 | /* sigio.c */ |
| 333 | extern int add_sigio_fd(int fd); | ||
| 332 | extern int ignore_sigio_fd(int fd); | 334 | extern int ignore_sigio_fd(int fd); |
| 333 | extern void maybe_sigio_broken(int fd, int read); | 335 | extern void maybe_sigio_broken(int fd, int read); |
| 334 | 336 | ||
diff --git a/arch/um/include/registers.h b/arch/um/include/registers.h index 83b688ca198f..f845b3629a6d 100644 --- a/arch/um/include/registers.h +++ b/arch/um/include/registers.h | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | #define __REGISTERS_H | 7 | #define __REGISTERS_H |
| 8 | 8 | ||
| 9 | #include "sysdep/ptrace.h" | 9 | #include "sysdep/ptrace.h" |
| 10 | #include "sysdep/archsetjmp.h" | ||
| 10 | 11 | ||
| 11 | extern void init_thread_registers(union uml_pt_regs *to); | 12 | extern void init_thread_registers(union uml_pt_regs *to); |
| 12 | extern int save_fp_registers(int pid, unsigned long *fp_regs); | 13 | extern int save_fp_registers(int pid, unsigned long *fp_regs); |
| @@ -15,6 +16,6 @@ extern void save_registers(int pid, union uml_pt_regs *regs); | |||
| 15 | extern void restore_registers(int pid, union uml_pt_regs *regs); | 16 | extern void restore_registers(int pid, union uml_pt_regs *regs); |
| 16 | extern void init_registers(int pid); | 17 | extern void init_registers(int pid); |
| 17 | extern void get_safe_registers(unsigned long * regs, unsigned long * fp_regs); | 18 | extern void get_safe_registers(unsigned long * regs, unsigned long * fp_regs); |
| 18 | extern void get_thread_regs(union uml_pt_regs *uml_regs, void *buffer); | 19 | extern unsigned long get_thread_reg(int reg, jmp_buf *buf); |
| 19 | 20 | ||
| 20 | #endif | 21 | #endif |
diff --git a/arch/um/include/skas/skas.h b/arch/um/include/skas/skas.h index 853b26f148c5..e88926b16072 100644 --- a/arch/um/include/skas/skas.h +++ b/arch/um/include/skas/skas.h | |||
| @@ -14,8 +14,7 @@ extern int proc_mm, ptrace_faultinfo, ptrace_ldt; | |||
| 14 | extern int skas_needs_stub; | 14 | 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_proc(void *stack, void (*handler)(int sig)); | 17 | extern void new_thread_handler(void); |
| 18 | extern void new_thread_handler(int sig); | ||
| 19 | extern void handle_syscall(union uml_pt_regs *regs); | 18 | extern void handle_syscall(union uml_pt_regs *regs); |
| 20 | extern int new_mm(unsigned long stack); | 19 | extern int new_mm(unsigned long stack); |
| 21 | extern void get_skas_faultinfo(int pid, struct faultinfo * fi); | 20 | extern void get_skas_faultinfo(int pid, struct faultinfo * fi); |
diff --git a/arch/um/include/sysdep-i386/archsetjmp.h b/arch/um/include/sysdep-i386/archsetjmp.h new file mode 100644 index 000000000000..11bafab669e9 --- /dev/null +++ b/arch/um/include/sysdep-i386/archsetjmp.h | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | /* | ||
| 2 | * arch/i386/include/klibc/archsetjmp.h | ||
| 3 | */ | ||
| 4 | |||
| 5 | #ifndef _KLIBC_ARCHSETJMP_H | ||
| 6 | #define _KLIBC_ARCHSETJMP_H | ||
| 7 | |||
| 8 | struct __jmp_buf { | ||
| 9 | unsigned int __ebx; | ||
| 10 | unsigned int __esp; | ||
| 11 | unsigned int __ebp; | ||
| 12 | unsigned int __esi; | ||
| 13 | unsigned int __edi; | ||
| 14 | unsigned int __eip; | ||
| 15 | }; | ||
| 16 | |||
| 17 | typedef struct __jmp_buf jmp_buf[1]; | ||
| 18 | |||
| 19 | #define JB_IP __eip | ||
| 20 | #define JB_SP __esp | ||
| 21 | |||
| 22 | #endif /* _SETJMP_H */ | ||
diff --git a/arch/um/include/sysdep-i386/signal.h b/arch/um/include/sysdep-i386/signal.h deleted file mode 100644 index 07518b162136..000000000000 --- a/arch/um/include/sysdep-i386/signal.h +++ /dev/null | |||
| @@ -1,27 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2004 PathScale, Inc | ||
| 3 | * Licensed under the GPL | ||
| 4 | */ | ||
| 5 | |||
| 6 | #ifndef __I386_SIGNAL_H_ | ||
| 7 | #define __I386_SIGNAL_H_ | ||
| 8 | |||
| 9 | #include <signal.h> | ||
| 10 | |||
| 11 | #define ARCH_SIGHDLR_PARAM int sig | ||
| 12 | |||
| 13 | #define ARCH_GET_SIGCONTEXT(sc, sig) \ | ||
| 14 | do sc = (struct sigcontext *) (&sig + 1); while(0) | ||
| 15 | |||
| 16 | #endif | ||
| 17 | |||
| 18 | /* | ||
| 19 | * Overrides for Emacs so that we follow Linus's tabbing style. | ||
| 20 | * Emacs will notice this stuff at the end of the file and automatically | ||
| 21 | * adjust the settings for this buffer only. This must remain at the end | ||
| 22 | * of the file. | ||
| 23 | * --------------------------------------------------------------------------- | ||
| 24 | * Local variables: | ||
| 25 | * c-file-style: "linux" | ||
| 26 | * End: | ||
| 27 | */ | ||
diff --git a/arch/um/include/sysdep-x86_64/archsetjmp.h b/arch/um/include/sysdep-x86_64/archsetjmp.h new file mode 100644 index 000000000000..9a5e1a6ec800 --- /dev/null +++ b/arch/um/include/sysdep-x86_64/archsetjmp.h | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | /* | ||
| 2 | * arch/x86_64/include/klibc/archsetjmp.h | ||
| 3 | */ | ||
| 4 | |||
| 5 | #ifndef _KLIBC_ARCHSETJMP_H | ||
| 6 | #define _KLIBC_ARCHSETJMP_H | ||
| 7 | |||
| 8 | struct __jmp_buf { | ||
| 9 | unsigned long __rbx; | ||
| 10 | unsigned long __rsp; | ||
| 11 | unsigned long __rbp; | ||
| 12 | unsigned long __r12; | ||
| 13 | unsigned long __r13; | ||
| 14 | unsigned long __r14; | ||
| 15 | unsigned long __r15; | ||
| 16 | unsigned long __rip; | ||
| 17 | }; | ||
| 18 | |||
| 19 | typedef struct __jmp_buf jmp_buf[1]; | ||
| 20 | |||
| 21 | #define JB_IP __rip | ||
| 22 | #define JB_SP __rsp | ||
| 23 | |||
| 24 | #endif /* _SETJMP_H */ | ||
diff --git a/arch/um/include/sysdep-x86_64/ptrace.h b/arch/um/include/sysdep-x86_64/ptrace.h index 8d353f0feec1..617bb9efc934 100644 --- a/arch/um/include/sysdep-x86_64/ptrace.h +++ b/arch/um/include/sysdep-x86_64/ptrace.h | |||
| @@ -50,6 +50,21 @@ | |||
| 50 | #define HOST_FS 25 | 50 | #define HOST_FS 25 |
| 51 | #define HOST_GS 26 | 51 | #define HOST_GS 26 |
| 52 | 52 | ||
| 53 | /* Also defined in asm/ptrace-x86_64.h, but not in libc headers. So, these | ||
| 54 | * are already defined for kernel code, but not for userspace code. | ||
| 55 | */ | ||
| 56 | #ifndef FS_BASE | ||
| 57 | /* These aren't defined in ptrace.h, but exist in struct user_regs_struct, | ||
| 58 | * which is what x86_64 ptrace actually uses. | ||
| 59 | */ | ||
| 60 | #define FS_BASE (HOST_FS_BASE * sizeof(long)) | ||
| 61 | #define GS_BASE (HOST_GS_BASE * sizeof(long)) | ||
| 62 | #define DS (HOST_DS * sizeof(long)) | ||
| 63 | #define ES (HOST_ES * sizeof(long)) | ||
| 64 | #define FS (HOST_FS * sizeof(long)) | ||
| 65 | #define GS (HOST_GS * sizeof(long)) | ||
| 66 | #endif | ||
| 67 | |||
| 53 | #define REGS_FS_BASE(r) ((r)[HOST_FS_BASE]) | 68 | #define REGS_FS_BASE(r) ((r)[HOST_FS_BASE]) |
| 54 | #define REGS_GS_BASE(r) ((r)[HOST_GS_BASE]) | 69 | #define REGS_GS_BASE(r) ((r)[HOST_GS_BASE]) |
| 55 | #define REGS_DS(r) ((r)[HOST_DS]) | 70 | #define REGS_DS(r) ((r)[HOST_DS]) |
| @@ -89,9 +104,12 @@ union uml_pt_regs { | |||
| 89 | #endif | 104 | #endif |
| 90 | #ifdef UML_CONFIG_MODE_SKAS | 105 | #ifdef UML_CONFIG_MODE_SKAS |
| 91 | struct skas_regs { | 106 | struct skas_regs { |
| 92 | /* XXX */ | 107 | /* x86_64 ptrace uses sizeof(user_regs_struct) as its register |
| 93 | unsigned long regs[27]; | 108 | * file size, while i386 uses FRAME_SIZE. Therefore, we need |
| 94 | unsigned long fp[65]; | 109 | * to use UM_FRAME_SIZE here instead of HOST_FRAME_SIZE. |
| 110 | */ | ||
| 111 | unsigned long regs[UM_FRAME_SIZE]; | ||
| 112 | unsigned long fp[HOST_FP_SIZE]; | ||
| 95 | struct faultinfo faultinfo; | 113 | struct faultinfo faultinfo; |
| 96 | long syscall; | 114 | long syscall; |
| 97 | int is_user; | 115 | int is_user; |
| @@ -120,11 +138,16 @@ extern int mode_tt; | |||
| 120 | #define UPT_R14(r) __CHOOSE_MODE(SC_R14(UPT_SC(r)), REGS_R14((r)->skas.regs)) | 138 | #define UPT_R14(r) __CHOOSE_MODE(SC_R14(UPT_SC(r)), REGS_R14((r)->skas.regs)) |
| 121 | #define UPT_R15(r) __CHOOSE_MODE(SC_R15(UPT_SC(r)), REGS_R15((r)->skas.regs)) | 139 | #define UPT_R15(r) __CHOOSE_MODE(SC_R15(UPT_SC(r)), REGS_R15((r)->skas.regs)) |
| 122 | #define UPT_CS(r) __CHOOSE_MODE(SC_CS(UPT_SC(r)), REGS_CS((r)->skas.regs)) | 140 | #define UPT_CS(r) __CHOOSE_MODE(SC_CS(UPT_SC(r)), REGS_CS((r)->skas.regs)) |
| 141 | #define UPT_FS_BASE(r) \ | ||
| 142 | __CHOOSE_MODE(SC_FS_BASE(UPT_SC(r)), REGS_FS_BASE((r)->skas.regs)) | ||
| 123 | #define UPT_FS(r) __CHOOSE_MODE(SC_FS(UPT_SC(r)), REGS_FS((r)->skas.regs)) | 143 | #define UPT_FS(r) __CHOOSE_MODE(SC_FS(UPT_SC(r)), REGS_FS((r)->skas.regs)) |
| 144 | #define UPT_GS_BASE(r) \ | ||
| 145 | __CHOOSE_MODE(SC_GS_BASE(UPT_SC(r)), REGS_GS_BASE((r)->skas.regs)) | ||
| 124 | #define UPT_GS(r) __CHOOSE_MODE(SC_GS(UPT_SC(r)), REGS_GS((r)->skas.regs)) | 146 | #define UPT_GS(r) __CHOOSE_MODE(SC_GS(UPT_SC(r)), REGS_GS((r)->skas.regs)) |
| 125 | #define UPT_DS(r) __CHOOSE_MODE(SC_DS(UPT_SC(r)), REGS_DS((r)->skas.regs)) | 147 | #define UPT_DS(r) __CHOOSE_MODE(SC_DS(UPT_SC(r)), REGS_DS((r)->skas.regs)) |
| 126 | #define UPT_ES(r) __CHOOSE_MODE(SC_ES(UPT_SC(r)), REGS_ES((r)->skas.regs)) | 148 | #define UPT_ES(r) __CHOOSE_MODE(SC_ES(UPT_SC(r)), REGS_ES((r)->skas.regs)) |
| 127 | #define UPT_CS(r) __CHOOSE_MODE(SC_CS(UPT_SC(r)), REGS_CS((r)->skas.regs)) | 149 | #define UPT_CS(r) __CHOOSE_MODE(SC_CS(UPT_SC(r)), REGS_CS((r)->skas.regs)) |
| 150 | #define UPT_SS(r) __CHOOSE_MODE(SC_SS(UPT_SC(r)), REGS_SS((r)->skas.regs)) | ||
| 128 | #define UPT_ORIG_RAX(r) \ | 151 | #define UPT_ORIG_RAX(r) \ |
| 129 | __CHOOSE_MODE((r)->tt.orig_rax, REGS_ORIG_RAX((r)->skas.regs)) | 152 | __CHOOSE_MODE((r)->tt.orig_rax, REGS_ORIG_RAX((r)->skas.regs)) |
| 130 | 153 | ||
| @@ -183,6 +206,13 @@ struct syscall_args { | |||
| 183 | case RBP: val = UPT_RBP(regs); break; \ | 206 | case RBP: val = UPT_RBP(regs); break; \ |
| 184 | case ORIG_RAX: val = UPT_ORIG_RAX(regs); break; \ | 207 | case ORIG_RAX: val = UPT_ORIG_RAX(regs); break; \ |
| 185 | case CS: val = UPT_CS(regs); break; \ | 208 | case CS: val = UPT_CS(regs); break; \ |
| 209 | case SS: val = UPT_SS(regs); break; \ | ||
| 210 | case FS_BASE: val = UPT_FS_BASE(regs); break; \ | ||
| 211 | case GS_BASE: val = UPT_GS_BASE(regs); break; \ | ||
| 212 | case DS: val = UPT_DS(regs); break; \ | ||
| 213 | case ES: val = UPT_ES(regs); break; \ | ||
| 214 | case FS : val = UPT_FS (regs); break; \ | ||
| 215 | case GS: val = UPT_GS(regs); break; \ | ||
| 186 | case EFLAGS: val = UPT_EFLAGS(regs); break; \ | 216 | case EFLAGS: val = UPT_EFLAGS(regs); break; \ |
| 187 | default : \ | 217 | default : \ |
| 188 | panic("Bad register in UPT_REG : %d\n", reg); \ | 218 | panic("Bad register in UPT_REG : %d\n", reg); \ |
| @@ -214,6 +244,13 @@ struct syscall_args { | |||
| 214 | case RBP: UPT_RBP(regs) = __upt_val; break; \ | 244 | case RBP: UPT_RBP(regs) = __upt_val; break; \ |
| 215 | case ORIG_RAX: UPT_ORIG_RAX(regs) = __upt_val; break; \ | 245 | case ORIG_RAX: UPT_ORIG_RAX(regs) = __upt_val; break; \ |
| 216 | case CS: UPT_CS(regs) = __upt_val; break; \ | 246 | case CS: UPT_CS(regs) = __upt_val; break; \ |
| 247 | case SS: UPT_SS(regs) = __upt_val; break; \ | ||
| 248 | case FS_BASE: UPT_FS_BASE(regs) = __upt_val; break; \ | ||
| 249 | case GS_BASE: UPT_GS_BASE(regs) = __upt_val; break; \ | ||
| 250 | case DS: UPT_DS(regs) = __upt_val; break; \ | ||
| 251 | case ES: UPT_ES(regs) = __upt_val; break; \ | ||
| 252 | case FS: UPT_FS(regs) = __upt_val; break; \ | ||
| 253 | case GS: UPT_GS(regs) = __upt_val; break; \ | ||
| 217 | case EFLAGS: UPT_EFLAGS(regs) = __upt_val; break; \ | 254 | case EFLAGS: UPT_EFLAGS(regs) = __upt_val; break; \ |
| 218 | default : \ | 255 | default : \ |
| 219 | panic("Bad register in UPT_SET : %d\n", reg); \ | 256 | panic("Bad register in UPT_SET : %d\n", reg); \ |
diff --git a/arch/um/include/sysdep-x86_64/sc.h b/arch/um/include/sysdep-x86_64/sc.h index a160d9fcc596..8aee45b07434 100644 --- a/arch/um/include/sysdep-x86_64/sc.h +++ b/arch/um/include/sysdep-x86_64/sc.h | |||
| @@ -35,11 +35,11 @@ | |||
| 35 | #define SC_GS(sc) SC_OFFSET(sc, SC_GS) | 35 | #define SC_GS(sc) SC_OFFSET(sc, SC_GS) |
| 36 | #define SC_EFLAGS(sc) SC_OFFSET(sc, SC_EFLAGS) | 36 | #define SC_EFLAGS(sc) SC_OFFSET(sc, SC_EFLAGS) |
| 37 | #define SC_SIGMASK(sc) SC_OFFSET(sc, SC_SIGMASK) | 37 | #define SC_SIGMASK(sc) SC_OFFSET(sc, SC_SIGMASK) |
| 38 | #define SC_SS(sc) SC_OFFSET(sc, SC_SS) | ||
| 38 | #if 0 | 39 | #if 0 |
| 39 | #define SC_ORIG_RAX(sc) SC_OFFSET(sc, SC_ORIG_RAX) | 40 | #define SC_ORIG_RAX(sc) SC_OFFSET(sc, SC_ORIG_RAX) |
| 40 | #define SC_DS(sc) SC_OFFSET(sc, SC_DS) | 41 | #define SC_DS(sc) SC_OFFSET(sc, SC_DS) |
| 41 | #define SC_ES(sc) SC_OFFSET(sc, SC_ES) | 42 | #define SC_ES(sc) SC_OFFSET(sc, SC_ES) |
| 42 | #define SC_SS(sc) SC_OFFSET(sc, SC_SS) | ||
| 43 | #endif | 43 | #endif |
| 44 | 44 | ||
| 45 | #endif | 45 | #endif |
diff --git a/arch/um/include/sysdep-x86_64/signal.h b/arch/um/include/sysdep-x86_64/signal.h deleted file mode 100644 index 6142897af3d1..000000000000 --- a/arch/um/include/sysdep-x86_64/signal.h +++ /dev/null | |||
| @@ -1,29 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2004 PathScale, Inc | ||
| 3 | * Licensed under the GPL | ||
| 4 | */ | ||
| 5 | |||
| 6 | #ifndef __X86_64_SIGNAL_H_ | ||
| 7 | #define __X86_64_SIGNAL_H_ | ||
| 8 | |||
| 9 | #define ARCH_SIGHDLR_PARAM int sig | ||
| 10 | |||
| 11 | #define ARCH_GET_SIGCONTEXT(sc, sig_addr) \ | ||
| 12 | do { \ | ||
| 13 | struct ucontext *__uc; \ | ||
| 14 | asm("movq %%rdx, %0" : "=r" (__uc)); \ | ||
| 15 | sc = (struct sigcontext *) &__uc->uc_mcontext; \ | ||
| 16 | } while(0) | ||
| 17 | |||
| 18 | #endif | ||
| 19 | |||
| 20 | /* | ||
| 21 | * Overrides for Emacs so that we follow Linus's tabbing style. | ||
| 22 | * Emacs will notice this stuff at the end of the file and automatically | ||
| 23 | * adjust the settings for this buffer only. This must remain at the end | ||
| 24 | * of the file. | ||
| 25 | * --------------------------------------------------------------------------- | ||
| 26 | * Local variables: | ||
| 27 | * c-file-style: "linux" | ||
| 28 | * End: | ||
| 29 | */ | ||
