diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/asm-sparc/unistd.h | 11 | ||||
| -rw-r--r-- | include/asm-sparc64/kdebug.h | 49 | ||||
| -rw-r--r-- | include/asm-sparc64/kprobes.h | 24 | ||||
| -rw-r--r-- | include/asm-sparc64/siginfo.h | 54 | ||||
| -rw-r--r-- | include/asm-sparc64/ttable.h | 6 | ||||
| -rw-r--r-- | include/asm-sparc64/unistd.h | 12 |
6 files changed, 92 insertions, 64 deletions
diff --git a/include/asm-sparc/unistd.h b/include/asm-sparc/unistd.h index 62eaacd9fe2f..f73f7e660190 100644 --- a/include/asm-sparc/unistd.h +++ b/include/asm-sparc/unistd.h @@ -290,11 +290,12 @@ #define __NR_io_cancel 271 #define __NR_io_getevents 272 #define __NR_mq_open 273 -#define __NR_mq_unlink (__NR_mq_open+1) -#define __NR_mq_timedsend (__NR_mq_open+2) -#define __NR_mq_timedreceive (__NR_mq_open+3) -#define __NR_mq_notify (__NR_mq_open+4) -#define __NR_mq_getsetattr (__NR_mq_open+5) +#define __NR_mq_unlink 274 +#define __NR_mq_timedsend 275 +#define __NR_mq_timedreceive 276 +#define __NR_mq_notify 277 +#define __NR_mq_getsetattr 278 +#define __NR_waitid 279 /* WARNING: You MAY NOT add syscall numbers larger than 282, since * all of the syscall tables in the Sparc kernel are diff --git a/include/asm-sparc64/kdebug.h b/include/asm-sparc64/kdebug.h index 65862f7c4dc3..f70d3dad01f9 100644 --- a/include/asm-sparc64/kdebug.h +++ b/include/asm-sparc64/kdebug.h @@ -1,9 +1,52 @@ #ifndef _SPARC64_KDEBUG_H #define _SPARC64_KDEBUG_H -/* - * No kernel debugger on sparc64. Kept here because drivers/sbus/char/ - * includes it for sparc32 sake. +/* Nearly identical to x86_64/i386 code. */ + +#include <linux/notifier.h> + +struct pt_regs; + +struct die_args { + struct pt_regs *regs; + const char *str; + long err; + int trapnr; + int signr; +}; + +/* Note - you should never unregister because that can race with NMIs. + * If you really want to do it first unregister - then synchronize_kernel + * - then free. */ +int register_die_notifier(struct notifier_block *nb); +extern struct notifier_block *sparc64die_chain; + +extern void bad_trap(struct pt_regs *, long); + +/* Grossly misnamed. */ +enum die_val { + DIE_OOPS = 1, + DIE_DEBUG, /* ta 0x70 */ + DIE_DEBUG_2, /* ta 0x71 */ + DIE_DIE, + DIE_TRAP, + DIE_TRAP_TL1, + DIE_GPF, + DIE_CALL, + DIE_PAGE_FAULT, +}; + +static inline int notify_die(enum die_val val,char *str, struct pt_regs *regs, + long err, int trap, int sig) +{ + struct die_args args = { .regs = regs, + .str = str, + .err = err, + .trapnr = trap, + .signr = sig }; + + return notifier_call_chain(&sparc64die_chain, val, &args); +} #endif diff --git a/include/asm-sparc64/kprobes.h b/include/asm-sparc64/kprobes.h new file mode 100644 index 000000000000..42b4cc6e424f --- /dev/null +++ b/include/asm-sparc64/kprobes.h @@ -0,0 +1,24 @@ +#ifndef _SPARC64_KPROBES_H +#define _SPARC64_KPROBES_H + +#include <linux/config.h> +#include <linux/types.h> + +typedef u32 kprobe_opcode_t; + +#define BREAKPOINT_INSTRUCTION 0x91d02070 /* ta 0x70 */ +#define BREAKPOINT_INSTRUCTION_2 0x91d02071 /* ta 0x71 */ +#define MAX_INSN_SIZE 2 + +#ifdef CONFIG_KPROBES +extern int kprobe_exceptions_notify(struct notifier_block *self, + unsigned long val, void *data); +#else /* !CONFIG_KPROBES */ +static inline int kprobe_exceptions_notify(struct notifier_block *self, + unsigned long val, void *data) +{ + return 0; +} +#endif + +#endif /* _SPARC64_KPROBES_H */ diff --git a/include/asm-sparc64/siginfo.h b/include/asm-sparc64/siginfo.h index fde85211a008..94b272f5d1b3 100644 --- a/include/asm-sparc64/siginfo.h +++ b/include/asm-sparc64/siginfo.h @@ -24,57 +24,8 @@ typedef union sigval32 { u32 sival_ptr; } sigval_t32; -typedef struct siginfo32 { - int si_signo; - int si_errno; - int si_code; +struct siginfo32; - union { - int _pad[SI_PAD_SIZE32]; - - /* kill() */ - struct { - compat_pid_t _pid; /* sender's pid */ - unsigned int _uid; /* sender's uid */ - } _kill; - - /* POSIX.1b timers */ - struct { - timer_t _tid; /* timer id */ - int _overrun; /* overrun count */ - sigval_t32 _sigval; /* same as below */ - int _sys_private; /* not to be passed to user */ - } _timer; - - /* POSIX.1b signals */ - struct { - compat_pid_t _pid; /* sender's pid */ - unsigned int _uid; /* sender's uid */ - sigval_t32 _sigval; - } _rt; - - /* SIGCHLD */ - struct { - compat_pid_t _pid; /* which child */ - unsigned int _uid; /* sender's uid */ - int _status; /* exit code */ - compat_clock_t _utime; - compat_clock_t _stime; - } _sigchld; - - /* SIGILL, SIGFPE, SIGSEGV, SIGBUS, SIGEMT */ - struct { - u32 _addr; /* faulting insn/memory ref. */ - int _trapno; - } _sigfault; - - /* SIGPOLL */ - struct { - int _band; /* POLL_IN, POLL_OUT, POLL_MSG */ - int _fd; - } _sigpoll; - } _sifields; -} siginfo_t32; #endif /* CONFIG_COMPAT */ #endif /* __KERNEL__ */ @@ -105,7 +56,8 @@ typedef struct sigevent32 { } _sigev_un; } sigevent_t32; -extern int copy_siginfo_to_user32(siginfo_t32 __user *to, siginfo_t *from); +extern int copy_siginfo_to_user32(struct siginfo32 __user *to, siginfo_t *from); +extern int copy_siginfo_to_kernel32(siginfo_t *to, struct siginfo32 __user *from); #endif /* CONFIG_COMPAT */ diff --git a/include/asm-sparc64/ttable.h b/include/asm-sparc64/ttable.h index 2b454ef67782..2784f80094c3 100644 --- a/include/asm-sparc64/ttable.h +++ b/include/asm-sparc64/ttable.h @@ -176,6 +176,12 @@ ba,pt %xcc, rtrap_clr_l6; \ stx %l2, [%sp + PTREGS_OFF + PT_V9_TNPC]; +#ifdef CONFIG_KPROBES +#define KPROBES_TRAP(lvl) TRAP_IRQ(kprobe_trap, lvl) +#else +#define KPROBES_TRAP(lvl) TRAP_ARG(bad_trap, lvl) +#endif + /* Before touching these macros, you owe it to yourself to go and * see how arch/sparc64/kernel/winfixup.S works... -DaveM * diff --git a/include/asm-sparc64/unistd.h b/include/asm-sparc64/unistd.h index 0ce57c1b46e9..645cf7208e8e 100644 --- a/include/asm-sparc64/unistd.h +++ b/include/asm-sparc64/unistd.h @@ -292,11 +292,13 @@ #define __NR_io_cancel 271 #define __NR_io_getevents 272 #define __NR_mq_open 273 -#define __NR_mq_unlink (__NR_mq_open+1) -#define __NR_mq_timedsend (__NR_mq_open+2) -#define __NR_mq_timedreceive (__NR_mq_open+3) -#define __NR_mq_notify (__NR_mq_open+4) -#define __NR_mq_getsetattr (__NR_mq_open+5) +#define __NR_mq_unlink 274 +#define __NR_mq_timedsend 275 +#define __NR_mq_timedreceive 276 +#define __NR_mq_notify 277 +#define __NR_mq_getsetattr 278 +#define __NR_waitid 279 + /* WARNING: You MAY NOT add syscall numbers larger than 282, since * all of the syscall tables in the Sparc kernel are * sized to have 283 entries (starting at zero). Therefore |
