From 5d059ffcf9ca6541f00e42350cc96f3018c133a7 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Tue, 8 Oct 2002 04:37:55 -0700 Subject: Move syscall table out to new file. Prevent entSys constants from being out of sync with it. --- include/asm-alpha/unistd.h | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'include') diff --git a/include/asm-alpha/unistd.h b/include/asm-alpha/unistd.h index 363f1477ac16..e35f02b4713b 100644 --- a/include/asm-alpha/unistd.h +++ b/include/asm-alpha/unistd.h @@ -331,19 +331,19 @@ #define __NR_removexattr 391 #define __NR_lremovexattr 392 #define __NR_fremovexattr 393 -#define __NR_futex 394 -#define __NR_sched_setaffinity 395 -#define __NR_sched_getaffinity 396 -#define __NR_tuxcall 397 -#define __NR_io_setup 398 -#define __NR_io_destroy 399 -#define __NR_io_getevents 400 -#define __NR_io_submit 401 -#define __NR_io_cancel 402 -#define __NR_alloc_hugepages 403 -#define __NR_free_hugepages 404 -#define __NR_exit_group 405 - +#define __NR_futex 394 +#define __NR_sched_setaffinity 395 +#define __NR_sched_getaffinity 396 +#define __NR_tuxcall 397 +#define __NR_io_setup 398 +#define __NR_io_destroy 399 +#define __NR_io_getevents 400 +#define __NR_io_submit 401 +#define __NR_io_cancel 402 +#define __NR_alloc_hugepages 403 +#define __NR_free_hugepages 404 +#define __NR_exit_group 405 +#define NR_SYSCALLS 406 #if defined(__GNUC__) @@ -598,7 +598,7 @@ static inline pid_t waitpid(int pid, int * wait_stat, int flags) return sys_wait4(pid, wait_stat, flags, NULL); } -#endif +#endif /* __KERNEL_SYSCALLS__ */ /* * "Conditional" syscalls -- cgit v1.2.3 From c78164565d3360946d60fce562f94bc8f977700c Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Tue, 8 Oct 2002 04:42:57 -0700 Subject: Merge minor changes from entry_rewrite tree. --- arch/alpha/Config.help | 15 +++ arch/alpha/kernel/osf_sys.c | 230 ++++++++++++++++++++++------------------ arch/alpha/kernel/process.c | 23 +--- arch/alpha/lib/dbg_stackcheck.S | 27 +++++ arch/alpha/lib/dbg_stackkill.S | 35 ++++++ arch/alpha/lib/stackcheck.S | 27 ----- arch/alpha/lib/stackkill.S | 35 ------ arch/alpha/mm/fault.c | 52 ++++----- arch/alpha/vmlinux.lds.S | 9 +- include/asm-alpha/pal.h | 2 +- 10 files changed, 236 insertions(+), 219 deletions(-) create mode 100644 arch/alpha/lib/dbg_stackcheck.S create mode 100644 arch/alpha/lib/dbg_stackkill.S delete mode 100644 arch/alpha/lib/stackcheck.S delete mode 100644 arch/alpha/lib/stackkill.S (limited to 'include') diff --git a/arch/alpha/Config.help b/arch/alpha/Config.help index c530295a343d..ae1eb3c6bcc6 100644 --- a/arch/alpha/Config.help +++ b/arch/alpha/Config.help @@ -251,6 +251,10 @@ CONFIG_ALPHA_PRIMO CONFIG_ALPHA_GAMMA Say Y if you have an AS 2000 5/xxx or an AS 2100 5/xxx. +CONFIG_ALPHA_EV67 + Is this a machine based on the EV67 core? If in doubt, select N here + and the machine will be treated as an EV6. + CONFIG_ALPHA_SRM There are two different types of booting firmware on Alphas: SRM, which is command line driven, and ARC, which uses menus and arrow @@ -610,3 +614,14 @@ CONFIG_DEBUG_SPINLOCK best used in conjunction with the NMI watchdog so that spinlock deadlocks are also debuggable. +CONFIG_DEBUG_RWLOCK + If you say Y here then read-write lock processing will count how many + times it has tried to get the lock and issue an error message after + too many attempts. If you suspect a rwlock problem or a kernel + hacker asks for this option then say Y. Otherwise say N. + +CONFIG_DEBUG_SEMAPHORE + If you say Y here then semaphore processing will issue lots of + verbose debugging messages. If you suspect a semaphore problem or a + kernel hacker asks for this option then say Y. Otherwise say N. + diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c index 0e66b34b1d80..1ba5f94035c2 100644 --- a/arch/alpha/kernel/osf_sys.c +++ b/arch/alpha/kernel/osf_sys.c @@ -44,8 +44,9 @@ #include extern int do_pipe(int *); - extern asmlinkage unsigned long sys_brk(unsigned long); +extern int sys_getpriority(int, int); +extern asmlinkage unsigned long sys_create_module(char *, unsigned long); /* * Brk needs to return an error. Still support Linux's brk(0) query idiom, @@ -53,7 +54,8 @@ extern asmlinkage unsigned long sys_brk(unsigned long); * identical to OSF as we don't return 0 on success, but doing otherwise * would require changes to libc. Hopefully this is good enough. */ -asmlinkage unsigned long osf_brk(unsigned long brk) +asmlinkage unsigned long +osf_brk(unsigned long brk) { unsigned long retval = sys_brk(brk); if (brk && brk != retval) @@ -64,9 +66,9 @@ asmlinkage unsigned long osf_brk(unsigned long brk) /* * This is pure guess-work.. */ -asmlinkage int osf_set_program_attributes( - unsigned long text_start, unsigned long text_len, - unsigned long bss_start, unsigned long bss_len) +asmlinkage int +osf_set_program_attributes(unsigned long text_start, unsigned long text_len, + unsigned long bss_start, unsigned long bss_len) { struct mm_struct *mm; @@ -106,8 +108,9 @@ struct osf_dirent_callback { int error; }; -static int osf_filldir(void *__buf, const char *name, int namlen, loff_t offset, - ino_t ino, unsigned int d_type) +static int +osf_filldir(void *__buf, const char *name, int namlen, loff_t offset, + ino_t ino, unsigned int d_type) { struct osf_dirent *dirent; struct osf_dirent_callback *buf = (struct osf_dirent_callback *) __buf; @@ -134,8 +137,9 @@ static int osf_filldir(void *__buf, const char *name, int namlen, loff_t offset, return 0; } -asmlinkage int osf_getdirentries(unsigned int fd, struct osf_dirent *dirent, - unsigned int count, long *basep) +asmlinkage int +osf_getdirentries(unsigned int fd, struct osf_dirent *dirent, + unsigned int count, long *basep) { int error; struct file *file; @@ -159,9 +163,9 @@ asmlinkage int osf_getdirentries(unsigned int fd, struct osf_dirent *dirent, if (count != buf.count) error = count - buf.count; -out_putf: + out_putf: fput(file); -out: + out: return error; } @@ -172,8 +176,9 @@ out: * Alpha syscall convention has no problem returning negative * values: */ -asmlinkage int osf_getpriority(int which, int who, int a2, int a3, int a4, - int a5, struct pt_regs regs) +asmlinkage int +osf_getpriority(int which, int who, + int a2, int a3, int a4, int a5, struct pt_regs regs) { extern int sys_getpriority(int, int); int prio; @@ -194,24 +199,24 @@ asmlinkage int osf_getpriority(int which, int who, int a2, int a3, int a4, /* * No need to acquire the kernel lock, we're local.. */ -asmlinkage unsigned long sys_getxuid(int a0, int a1, int a2, int a3, int a4, - int a5, struct pt_regs regs) +asmlinkage unsigned long +sys_getxuid(int a0, int a1, int a2, int a3, int a4, int a5, struct pt_regs regs) { struct task_struct * tsk = current; (®s)->r20 = tsk->euid; return tsk->uid; } -asmlinkage unsigned long sys_getxgid(int a0, int a1, int a2, int a3, int a4, - int a5, struct pt_regs regs) +asmlinkage unsigned long +sys_getxgid(int a0, int a1, int a2, int a3, int a4, int a5, struct pt_regs regs) { struct task_struct * tsk = current; (®s)->r20 = tsk->egid; return tsk->gid; } -asmlinkage unsigned long sys_getxpid(int a0, int a1, int a2, int a3, int a4, - int a5, struct pt_regs regs) +asmlinkage unsigned long +sys_getxpid(int a0, int a1, int a2, int a3, int a4, int a5, struct pt_regs regs) { struct task_struct *tsk = current; @@ -226,9 +231,9 @@ asmlinkage unsigned long sys_getxpid(int a0, int a1, int a2, int a3, int a4, return tsk->tgid; } -asmlinkage unsigned long osf_mmap(unsigned long addr, unsigned long len, - unsigned long prot, unsigned long flags, unsigned long fd, - unsigned long off) +asmlinkage unsigned long +osf_mmap(unsigned long addr, unsigned long len, unsigned long prot, + unsigned long flags, unsigned long fd, unsigned long off) { struct file *file = NULL; unsigned long ret = -EBADF; @@ -249,7 +254,7 @@ asmlinkage unsigned long osf_mmap(unsigned long addr, unsigned long len, up_write(¤t->mm->mmap_sem); if (file) fput(file); -out: + out: return ret; } @@ -271,7 +276,9 @@ struct osf_statfs { __kernel_fsid_t f_fsid; } *osf_stat; -static int linux_to_osf_statfs(struct statfs *linux_stat, struct osf_statfs *osf_stat, unsigned long bufsiz) +static int +linux_to_osf_statfs(struct statfs *linux_stat, struct osf_statfs *osf_stat, + unsigned long bufsiz) { struct osf_statfs tmp_stat; @@ -291,7 +298,9 @@ static int linux_to_osf_statfs(struct statfs *linux_stat, struct osf_statfs *osf return copy_to_user(osf_stat, &tmp_stat, bufsiz) ? -EFAULT : 0; } -static int do_osf_statfs(struct dentry * dentry, struct osf_statfs *buffer, unsigned long bufsiz) +static int +do_osf_statfs(struct dentry * dentry, struct osf_statfs *buffer, + unsigned long bufsiz) { struct statfs linux_stat; int error = vfs_statfs(dentry->d_inode->i_sb, &linux_stat); @@ -300,7 +309,8 @@ static int do_osf_statfs(struct dentry * dentry, struct osf_statfs *buffer, unsi return error; } -asmlinkage int osf_statfs(char *path, struct osf_statfs *buffer, unsigned long bufsiz) +asmlinkage int +osf_statfs(char *path, struct osf_statfs *buffer, unsigned long bufsiz) { struct nameidata nd; int retval; @@ -313,7 +323,8 @@ asmlinkage int osf_statfs(char *path, struct osf_statfs *buffer, unsigned long b return retval; } -asmlinkage int osf_fstatfs(unsigned long fd, struct osf_statfs *buffer, unsigned long bufsiz) +asmlinkage int +osf_fstatfs(unsigned long fd, struct osf_statfs *buffer, unsigned long bufsiz) { struct file *file; int retval; @@ -342,10 +353,9 @@ struct cdfs_args { char *devname; int flags; uid_t exroot; -/* - * This has lots more here, which Linux handles with the option block - * but I'm too lazy to do the translation into ASCII. - */ + + /* This has lots more here, which Linux handles with the option block + but I'm too lazy to do the translation into ASCII. */ }; struct procfs_args { @@ -362,7 +372,8 @@ struct procfs_args { * Just how long ago was it written? OTOH our UFS driver may be still * unhappy with OSF UFS. [CHECKME] */ -static int osf_ufs_mount(char *dirname, struct ufs_args *args, int flags) +static int +osf_ufs_mount(char *dirname, struct ufs_args *args, int flags) { int retval; struct cdfs_args tmp; @@ -377,11 +388,12 @@ static int osf_ufs_mount(char *dirname, struct ufs_args *args, int flags) goto out; retval = do_mount(devname, dirname, "ext2", flags, NULL); putname(devname); -out: + out: return retval; } -static int osf_cdfs_mount(char *dirname, struct cdfs_args *args, int flags) +static int +osf_cdfs_mount(char *dirname, struct cdfs_args *args, int flags) { int retval; struct cdfs_args tmp; @@ -396,11 +408,12 @@ static int osf_cdfs_mount(char *dirname, struct cdfs_args *args, int flags) goto out; retval = do_mount(devname, dirname, "iso9660", flags, NULL); putname(devname); -out: + out: return retval; } -static int osf_procfs_mount(char *dirname, struct procfs_args *args, int flags) +static int +osf_procfs_mount(char *dirname, struct procfs_args *args, int flags) { struct procfs_args tmp; @@ -410,7 +423,8 @@ static int osf_procfs_mount(char *dirname, struct procfs_args *args, int flags) return do_mount("", dirname, "proc", flags, NULL); } -asmlinkage int osf_mount(unsigned long typenr, char *path, int flag, void *data) +asmlinkage int +osf_mount(unsigned long typenr, char *path, int flag, void *data) { int retval = -EINVAL; char *name; @@ -435,12 +449,13 @@ asmlinkage int osf_mount(unsigned long typenr, char *path, int flag, void *data) printk("osf_mount(%ld, %x)\n", typenr, flag); } putname(name); -out: + out: unlock_kernel(); return retval; } -asmlinkage int osf_utsname(char *name) +asmlinkage int +osf_utsname(char *name) { int error; @@ -458,12 +473,13 @@ asmlinkage int osf_utsname(char *name) goto out; error = 0; -out: + out: up_read(&uts_sem); return error; } -asmlinkage int osf_swapon(const char *path, int flags, int lowat, int hiwat) +asmlinkage int +osf_swapon(const char *path, int flags, int lowat, int hiwat) { int ret; @@ -474,35 +490,36 @@ asmlinkage int osf_swapon(const char *path, int flags, int lowat, int hiwat) return ret; } -asmlinkage unsigned long sys_getpagesize(void) +asmlinkage unsigned long +sys_getpagesize(void) { return PAGE_SIZE; } -asmlinkage unsigned long sys_getdtablesize(void) +asmlinkage unsigned long +sys_getdtablesize(void) { return NR_OPEN; } -asmlinkage int sys_pipe(int a0, int a1, int a2, int a3, int a4, int a5, - struct pt_regs regs) +asmlinkage int +sys_pipe(int a0, int a1, int a2, int a3, int a4, int a5, struct pt_regs regs) { - int fd[2]; - int error; + int fd[2], error; error = do_pipe(fd); - if (error) - goto out; - (®s)->r20 = fd[1]; - error = fd[0]; -out: + if (!error) { + regs.r20 = fd[1]; + error = fd[0]; + } return error; } /* * For compatibility with OSF/1 only. Use utsname(2) instead. */ -asmlinkage int osf_getdomainname(char *name, int namelen) +asmlinkage int +osf_getdomainname(char *name, int namelen) { unsigned len; int i, error; @@ -522,12 +539,12 @@ asmlinkage int osf_getdomainname(char *name, int namelen) break; } up_read(&uts_sem); -out: + out: return error; } - -asmlinkage long osf_shmat(int shmid, void *shmaddr, int shmflg) +asmlinkage long +osf_shmat(int shmid, void *shmaddr, int shmflg) { unsigned long raddr; long err; @@ -541,7 +558,7 @@ asmlinkage long osf_shmat(int shmid, void *shmaddr, int shmflg) * non-negative longs! */ err = raddr; -out: + out: unlock_kernel(); return err; } @@ -612,7 +629,8 @@ enum pl_code { PL_DEL = 5, PL_FDEL = 6 }; -asmlinkage long osf_proplist_syscall(enum pl_code code, union pl_args *args) +asmlinkage long +osf_proplist_syscall(enum pl_code code, union pl_args *args) { long error; int *min_buf_size_ptr; @@ -655,7 +673,8 @@ asmlinkage long osf_proplist_syscall(enum pl_code code, union pl_args *args) return error; } -asmlinkage int osf_sigstack(struct sigstack *uss, struct sigstack *uoss) +asmlinkage int +osf_sigstack(struct sigstack *uss, struct sigstack *uoss) { unsigned long usp = rdusp(); unsigned long oss_sp = current->sas_ss_sp + current->sas_ss_size; @@ -691,7 +710,7 @@ asmlinkage int osf_sigstack(struct sigstack *uss, struct sigstack *uoss) } error = 0; -out: + out: return error; } @@ -702,32 +721,28 @@ out: * create_module() because it's one of the few system calls * that return kernel addresses (which are negative). */ -asmlinkage unsigned long alpha_create_module(char *module_name, unsigned long size, - int a3, int a4, int a5, int a6, - struct pt_regs regs) + +asmlinkage unsigned long +alpha_create_module(char *module_name, unsigned long size, + int a3, int a4, int a5, int a6, struct pt_regs regs) { - asmlinkage unsigned long sys_create_module(char *, unsigned long); long retval; lock_kernel(); retval = sys_create_module(module_name, size); - /* - * we get either a module address or an error number, - * and we know the error number is a small negative - * number, while the address is always negative but - * much larger. - */ - if (retval + 1000 > 0) - goto out; - /* tell entry.S:syscall_error that this is NOT an error: */ - regs.r0 = 0; -out: - unlock_kernel(); + /* We get either a module address or an error number, and we know + the error number is a small negative number, while the address + is always negative but much larger. */ + if (retval + 1000 < 0) + regs.r0 = 0; + + unlock_kernel(); return retval; } -asmlinkage long osf_sysinfo(int command, char *buf, long count) +asmlinkage long +osf_sysinfo(int command, char *buf, long count) { static char * sysinfo_table[] = { system_utsname.sysname, @@ -761,13 +776,13 @@ asmlinkage long osf_sysinfo(int command, char *buf, long count) else err = 0; up_read(&uts_sem); -out: + out: return err; } -asmlinkage unsigned long osf_getsysinfo(unsigned long op, void *buffer, - unsigned long nbytes, - int *start, void *arg) +asmlinkage unsigned long +osf_getsysinfo(unsigned long op, void *buffer, unsigned long nbytes, + int *start, void *arg) { unsigned long w; struct percpu_struct *cpu; @@ -823,9 +838,9 @@ asmlinkage unsigned long osf_getsysinfo(unsigned long op, void *buffer, return -EOPNOTSUPP; } -asmlinkage unsigned long osf_setsysinfo(unsigned long op, void *buffer, - unsigned long nbytes, - int *start, void *arg) +asmlinkage unsigned long +osf_setsysinfo(unsigned long op, void *buffer, unsigned long nbytes, + int *start, void *arg) { switch (op) { case SSI_IEEE_FP_CONTROL: { @@ -925,21 +940,24 @@ struct itimerval32 struct timeval32 it_value; }; -static inline long get_tv32(struct timeval *o, struct timeval32 *i) +static inline long +get_tv32(struct timeval *o, struct timeval32 *i) { return (!access_ok(VERIFY_READ, i, sizeof(*i)) || (__get_user(o->tv_sec, &i->tv_sec) | __get_user(o->tv_usec, &i->tv_usec))); } -static inline long put_tv32(struct timeval32 *o, struct timeval *i) +static inline long +put_tv32(struct timeval32 *o, struct timeval *i) { return (!access_ok(VERIFY_WRITE, o, sizeof(*o)) || (__put_user(i->tv_sec, &o->tv_sec) | __put_user(i->tv_usec, &o->tv_usec))); } -static inline long get_it32(struct itimerval *o, struct itimerval32 *i) +static inline long +get_it32(struct itimerval *o, struct itimerval32 *i) { return (!access_ok(VERIFY_READ, i, sizeof(*i)) || (__get_user(o->it_interval.tv_sec, &i->it_interval.tv_sec) | @@ -948,7 +966,8 @@ static inline long get_it32(struct itimerval *o, struct itimerval32 *i) __get_user(o->it_value.tv_usec, &i->it_value.tv_usec))); } -static inline long put_it32(struct itimerval32 *o, struct itimerval *i) +static inline long +put_it32(struct itimerval32 *o, struct itimerval *i) { return (!access_ok(VERIFY_WRITE, o, sizeof(*o)) || (__put_user(i->it_interval.tv_sec, &o->it_interval.tv_sec) | @@ -964,7 +983,8 @@ jiffies_to_timeval32(unsigned long jiffies, struct timeval32 *value) value->tv_sec = jiffies / HZ; } -asmlinkage int osf_gettimeofday(struct timeval32 *tv, struct timezone *tz) +asmlinkage int +osf_gettimeofday(struct timeval32 *tv, struct timezone *tz) { if (tv) { struct timeval ktv; @@ -979,7 +999,8 @@ asmlinkage int osf_gettimeofday(struct timeval32 *tv, struct timezone *tz) return 0; } -asmlinkage int osf_settimeofday(struct timeval32 *tv, struct timezone *tz) +asmlinkage int +osf_settimeofday(struct timeval32 *tv, struct timezone *tz) { struct timeval ktv; struct timezone ktz; @@ -996,7 +1017,8 @@ asmlinkage int osf_settimeofday(struct timeval32 *tv, struct timezone *tz) return do_sys_settimeofday(tv ? &ktv : NULL, tz ? &ktz : NULL); } -asmlinkage int osf_getitimer(int which, struct itimerval32 *it) +asmlinkage int +osf_getitimer(int which, struct itimerval32 *it) { struct itimerval kit; int error; @@ -1008,8 +1030,8 @@ asmlinkage int osf_getitimer(int which, struct itimerval32 *it) return error; } -asmlinkage int osf_setitimer(int which, struct itimerval32 *in, - struct itimerval32 *out) +asmlinkage int +osf_setitimer(int which, struct itimerval32 *in, struct itimerval32 *out) { struct itimerval kin, kout; int error; @@ -1031,7 +1053,8 @@ asmlinkage int osf_setitimer(int which, struct itimerval32 *in, } -asmlinkage int osf_utimes(const char *filename, struct timeval32 *tvs) +asmlinkage int +osf_utimes(const char *filename, struct timeval32 *tvs) { char *kfilename; struct timeval ktvs[2]; @@ -1136,9 +1159,9 @@ osf_select(int n, fd_set *inp, fd_set *outp, fd_set *exp, set_fd_set(n, outp->fds_bits, fds.res_out); set_fd_set(n, exp->fds_bits, fds.res_ex); -out: + out: kfree(bits); -out_nofds: + out_nofds: return ret; } @@ -1161,7 +1184,8 @@ struct rusage32 { long ru_nivcsw; /* involuntary " */ }; -asmlinkage int osf_getrusage(int who, struct rusage32 *ru) +asmlinkage int +osf_getrusage(int who, struct rusage32 *ru) { struct rusage32 r; @@ -1198,8 +1222,8 @@ asmlinkage int osf_getrusage(int who, struct rusage32 *ru) return copy_to_user(ru, &r, sizeof(r)) ? -EFAULT : 0; } -asmlinkage int osf_wait4(pid_t pid, int *ustatus, int options, - struct rusage32 *ur) +asmlinkage int +osf_wait4(pid_t pid, int *ustatus, int options, struct rusage32 *ur) { if (!ur) { return sys_wait4(pid, ustatus, options, NULL); @@ -1245,7 +1269,8 @@ asmlinkage int osf_wait4(pid_t pid, int *ustatus, int options, * seems to be a timeval pointer, and I suspect the second * one is the time remaining.. Ho humm.. No documentation. */ -asmlinkage int osf_usleep_thread(struct timeval32 *sleep, struct timeval32 *remain) +asmlinkage int +osf_usleep_thread(struct timeval32 *sleep, struct timeval32 *remain) { struct timeval tmp; unsigned long ticks; @@ -1268,7 +1293,7 @@ asmlinkage int osf_usleep_thread(struct timeval32 *sleep, struct timeval32 *rema } return 0; -fault: + fault: return -EFAULT; } @@ -1302,7 +1327,8 @@ struct timex32 { int :32; int :32; int :32; int :32; }; -asmlinkage int sys_old_adjtimex(struct timex32 *txc_p) +asmlinkage int +sys_old_adjtimex(struct timex32 *txc_p) { struct timex txc; int ret; diff --git a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c index b0cd16ef9493..e3a608e79a6b 100644 --- a/arch/alpha/kernel/process.c +++ b/arch/alpha/kernel/process.c @@ -191,26 +191,13 @@ machine_power_off(void) common_shutdown(LINUX_REBOOT_CMD_POWER_OFF, NULL); } +/* Used by sysrq-p, among others. I don't believe r9-r15 are ever + saved in the context it's used. */ + void -show_regs(struct pt_regs * regs) +show_regs(struct pt_regs *regs) { - printk("\n"); - printk("Pid: %d, comm: %20s\n", current->pid, current->comm); - printk("ps: %04lx pc: [<%016lx>] CPU %d %s\n", - regs->ps, regs->pc, smp_processor_id(), print_tainted()); - printk("rp: [<%016lx>] sp: %p\n", regs->r26, regs+1); - printk(" r0: %016lx r1: %016lx r2: %016lx r3: %016lx\n", - regs->r0, regs->r1, regs->r2, regs->r3); - printk(" r4: %016lx r5: %016lx r6: %016lx r7: %016lx\n", - regs->r4, regs->r5, regs->r6, regs->r7); - printk(" r8: %016lx r16: %016lx r17: %016lx r18: %016lx\n", - regs->r8, regs->r16, regs->r17, regs->r18); - printk("r19: %016lx r20: %016lx r21: %016lx r22: %016lx\n", - regs->r19, regs->r20, regs->r21, regs->r22); - printk("r23: %016lx r24: %016lx r25: %016lx r26: %016lx\n", - regs->r23, regs->r24, regs->r25, regs->r26); - printk("r27: %016lx r28: %016lx r29: %016lx hae: %016lx\n", - regs->r27, regs->r28, regs->gp, regs->hae); + dik_show_regs(regs, 0); } /* diff --git a/arch/alpha/lib/dbg_stackcheck.S b/arch/alpha/lib/dbg_stackcheck.S new file mode 100644 index 000000000000..cc5ce3a5fcad --- /dev/null +++ b/arch/alpha/lib/dbg_stackcheck.S @@ -0,0 +1,27 @@ +/* + * arch/alpha/lib/stackcheck.S + * Contributed by Richard Henderson (rth@tamu.edu) + * + * Verify that we have not overflowed the stack. Oops if we have. + */ + +#include + + .text + .set noat + + .align 3 + .globl _mcount + .ent _mcount +_mcount: + .frame $30, 0, $28, 0 + .prologue 0 + + lda $0, TASK_SIZE($8) + cmpult $30, $0, $0 + bne $0, 1f + ret ($28) +1: stq $31, -8($31) # oops me, damn it. + br 1b + + .end _mcount diff --git a/arch/alpha/lib/dbg_stackkill.S b/arch/alpha/lib/dbg_stackkill.S new file mode 100644 index 000000000000..e09f2ae1e09e --- /dev/null +++ b/arch/alpha/lib/dbg_stackkill.S @@ -0,0 +1,35 @@ +/* + * arch/alpha/lib/killstack.S + * Contributed by Richard Henderson (rth@cygnus.com) + * + * Clobber the balance of the kernel stack, hoping to catch + * uninitialized local variables in the act. + */ + +#include + + .text + .set noat + + .align 5 + .globl _mcount + .ent _mcount +_mcount: + .frame $30, 0, $28, 0 + .prologue 0 + + ldi $0, 0xdeadbeef + lda $2, -STACK_SIZE + sll $0, 32, $1 + and $30, $2, $2 + or $0, $1, $0 + lda $2, TASK_SIZE($2) + cmpult $2, $30, $1 + beq $1, 2f +1: stq $0, 0($2) + addq $2, 8, $2 + cmpult $2, $30, $1 + bne $1, 1b +2: ret ($28) + + .end _mcount diff --git a/arch/alpha/lib/stackcheck.S b/arch/alpha/lib/stackcheck.S deleted file mode 100644 index cc5ce3a5fcad..000000000000 --- a/arch/alpha/lib/stackcheck.S +++ /dev/null @@ -1,27 +0,0 @@ -/* - * arch/alpha/lib/stackcheck.S - * Contributed by Richard Henderson (rth@tamu.edu) - * - * Verify that we have not overflowed the stack. Oops if we have. - */ - -#include - - .text - .set noat - - .align 3 - .globl _mcount - .ent _mcount -_mcount: - .frame $30, 0, $28, 0 - .prologue 0 - - lda $0, TASK_SIZE($8) - cmpult $30, $0, $0 - bne $0, 1f - ret ($28) -1: stq $31, -8($31) # oops me, damn it. - br 1b - - .end _mcount diff --git a/arch/alpha/lib/stackkill.S b/arch/alpha/lib/stackkill.S deleted file mode 100644 index e09f2ae1e09e..000000000000 --- a/arch/alpha/lib/stackkill.S +++ /dev/null @@ -1,35 +0,0 @@ -/* - * arch/alpha/lib/killstack.S - * Contributed by Richard Henderson (rth@cygnus.com) - * - * Clobber the balance of the kernel stack, hoping to catch - * uninitialized local variables in the act. - */ - -#include - - .text - .set noat - - .align 5 - .globl _mcount - .ent _mcount -_mcount: - .frame $30, 0, $28, 0 - .prologue 0 - - ldi $0, 0xdeadbeef - lda $2, -STACK_SIZE - sll $0, 32, $1 - and $30, $2, $2 - or $0, $1, $0 - lda $2, TASK_SIZE($2) - cmpult $2, $30, $1 - beq $1, 2f -1: stq $0, 0($2) - addq $2, 8, $2 - cmpult $2, $30, $1 - bne $1, 1b -2: ret ($28) - - .end _mcount diff --git a/arch/alpha/mm/fault.c b/arch/alpha/mm/fault.c index 77ca3cca1386..ea447440a1e6 100644 --- a/arch/alpha/mm/fault.c +++ b/arch/alpha/mm/fault.c @@ -125,11 +125,10 @@ do_page_fault(unsigned long address, unsigned long mmcsr, goto bad_area; if (expand_stack(vma, address)) goto bad_area; -/* - * Ok, we have a good vm_area for this memory access, so - * we can handle it.. - */ -good_area: + + /* Ok, we have a good vm_area for this memory access, so + we can handle it. */ + good_area: if (cause < 0) { if (!(vma->vm_flags & VM_EXEC)) goto bad_area; @@ -143,11 +142,9 @@ good_area: } survive: - /* - * If for any reason at all we couldn't handle the fault, - * make sure we exit gracefully rather than endlessly redo - * the fault. - */ + /* If for any reason at all we couldn't handle the fault, + make sure we exit gracefully rather than endlessly redo + the fault. */ fault = handle_mm_fault(mm, vma, address, cause > 0); up_read(&mm->mmap_sem); @@ -155,14 +152,11 @@ good_area: goto out_of_memory; if (fault == 0) goto do_sigbus; - return; -/* - * Something tried to access memory that isn't in our memory map.. - * Fix it, but check if it's kernel or user first.. - */ -bad_area: + /* Something tried to access memory that isn't in our memory map. + Fix it, but check if it's kernel or user first. */ + bad_area: up_read(&mm->mmap_sem); if (user_mode(regs)) { @@ -170,7 +164,7 @@ bad_area: return; } -no_context: + no_context: /* Are we prepared to handle this fault as an exception? */ if ((fixup = search_exception_table(regs->pc, regs->gp)) != 0) { unsigned long newpc; @@ -183,20 +177,16 @@ no_context: return; } -/* - * Oops. The kernel tried to access some bad page. We'll have to - * terminate things with extreme prejudice. - */ + /* Oops. The kernel tried to access some bad page. We'll have to + terminate things with extreme prejudice. */ printk(KERN_ALERT "Unable to handle kernel paging request at " "virtual address %016lx\n", address); die_if_kernel("Oops", regs, cause, (unsigned long*)regs - 16); do_exit(SIGKILL); -/* - * We ran out of memory, or some other thing happened to us that made - * us unable to handle the page fault gracefully. - */ -out_of_memory: + /* We ran out of memory, or some other thing happened to us that + made us unable to handle the page fault gracefully. */ + out_of_memory: if (current->pid == 1) { yield(); down_read(&mm->mmap_sem); @@ -208,18 +198,16 @@ out_of_memory: goto no_context; do_exit(SIGKILL); -do_sigbus: - /* - * Send a sigbus, regardless of whether we were in kernel - * or user mode. - */ + do_sigbus: + /* Send a sigbus, regardless of whether we were in kernel + or user mode. */ force_sig(SIGBUS, current); if (!user_mode(regs)) goto no_context; return; #ifdef CONFIG_ALPHA_LARGE_VMALLOC -vmalloc_fault: + vmalloc_fault: if (user_mode(regs)) { force_sig(SIGSEGV, current); return; diff --git a/arch/alpha/vmlinux.lds.S b/arch/alpha/vmlinux.lds.S index 852722876508..80e831700eda 100644 --- a/arch/alpha/vmlinux.lds.S +++ b/arch/alpha/vmlinux.lds.S @@ -58,10 +58,11 @@ SECTIONS __initcall_end = .; } - . = ALIGN(64); - __per_cpu_start = .; - .data.percpu : { *(.data.percpu) } - __per_cpu_end = .; + .data.percpu ALIGN(64): { + __per_cpu_start = .; + *(.data.percpu) + __per_cpu_end = .; + } /* The initial task and kernel stack */ .data.init_thread ALIGN(2*8192) : { diff --git a/include/asm-alpha/pal.h b/include/asm-alpha/pal.h index 510d13326de4..9b4ba0d6f00b 100644 --- a/include/asm-alpha/pal.h +++ b/include/asm-alpha/pal.h @@ -45,7 +45,7 @@ #define PAL_wrperfmon 57 #define PAL_rdusp 58 #define PAL_whami 60 -#define PAL_rtsys 61 +#define PAL_retsys 61 #define PAL_rti 63 #endif /* __ALPHA_PAL_H */ -- cgit v1.2.3 From ca0e5f35dcf8e3d84b0784e98a7a5f9334b0f997 Mon Sep 17 00:00:00 2001 From: Patrick Mochel Date: Tue, 8 Oct 2002 20:29:48 -0700 Subject: IDE: add struct device to ide_drive_t and use that for IDE drives ... instead of the one in struct gendisk. --- drivers/ide/ide-probe.c | 23 ++++++++++++++--------- include/linux/ide.h | 1 + 2 files changed, 15 insertions(+), 9 deletions(-) (limited to 'include') diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index 9caa96e00518..6277ce3cb1e0 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c @@ -998,15 +998,6 @@ static void init_gendisk (ide_hwif_t *hwif) sprintf(disk->disk_name,"hd%c",'a'+hwif->index*MAX_DRIVES+unit); disk->minor_shift = PARTN_BITS; disk->fops = ide_fops; - - snprintf(disk->disk_dev.bus_id,BUS_ID_SIZE,"%u.%u", - hwif->index,unit); - snprintf(disk->disk_dev.name,DEVICE_NAME_SIZE, - "%s","IDE Drive"); - disk->disk_dev.parent = &hwif->gendev; - disk->disk_dev.bus = &ide_bus_type; - if (hwif->drives[unit].present) - device_register(&disk->disk_dev); hwif->drives[unit].disk = disk; } @@ -1020,6 +1011,20 @@ static void init_gendisk (ide_hwif_t *hwif) if (hwif->drives[unit].present) hwif->drives[unit].de = devfs_mk_dir(ide_devfs_handle, name, NULL); } + + for (unit = 0; unit < units; ++unit) { + ide_drive_t * drive = &hwif->drives[unit]; + + snprintf(drive->gendev.bus_id,BUS_ID_SIZE,"%u.%u", + hwif->index,unit); + snprintf(drive->gendev.name,DEVICE_NAME_SIZE, + "%s","IDE Drive"); + drive->gendev.parent = &hwif->gendev; + drive->gendev.bus = &ide_bus_type; + if (drive->present) + device_register(&drive->gendev); + } + return; err_kmalloc_gd: diff --git a/include/linux/ide.h b/include/linux/ide.h index 0655a585300f..419b0c92f6f5 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -794,6 +794,7 @@ typedef struct ide_drive_s { int lun; /* logical unit */ int crc_count; /* crc counter to reduce drive speed */ struct list_head list; + struct device gendev; struct gendisk *disk; } ide_drive_t; -- cgit v1.2.3 From b134c4625b4450b95eaa6b067199a2bfec1976e4 Mon Sep 17 00:00:00 2001 From: Patrick Mochel Date: Tue, 8 Oct 2002 20:52:46 -0700 Subject: IDE: register ide driver for all ide drives; not just for disk drives. This adds struct device_driver gen_driver; to ide_driver_t, which is filled in with necessary fields when an ide driver calls ide_register_driver(). That then registers the driver with the driver model core. As a result, this gives us the following output in driverfs: # tree -d /sys/bus/ide/drivers/ /sys/bus/ide/drivers/ |-- ide-cdrom `-- ide-disk The suspend/resume callbacks in ide-disk.c have been temporarily disabled until the ide core implements generic methods which forward the calls to the drive drivers. --- drivers/ide/ide-disk.c | 17 +---------------- drivers/ide/ide.c | 4 +++- include/linux/ide.h | 1 + 3 files changed, 5 insertions(+), 17 deletions(-) (limited to 'include') diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c index 419ef498c151..b2f3b3c3b947 100644 --- a/drivers/ide/ide-disk.c +++ b/drivers/ide/ide-disk.c @@ -1664,14 +1664,6 @@ static int idedisk_resume(struct device *dev, u32 level) /* This is just a hook for the overall driver tree. */ -static struct device_driver idedisk_devdrv = { - .bus = &ide_bus_type, - .name = "IDE disk driver", - - .suspend = idedisk_suspend, - .resume = idedisk_resume, -}; - static int idedisk_ioctl (ide_drive_t *drive, struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { @@ -1717,12 +1709,6 @@ static void idedisk_setup (ide_drive_t *drive) drive->doorlocking = 1; } } - { - sprintf(drive->disk->disk_dev.name, "ide-disk"); - drive->disk->disk_dev.driver = &idedisk_devdrv; - drive->disk->disk_dev.driver_data = drive; - } - #if 1 (void) probe_lba_addressing(drive, 1); #else @@ -1806,7 +1792,7 @@ static int idedisk_cleanup (ide_drive_t *drive) { struct gendisk *g = drive->disk; - device_unregister(&drive->disk->disk_dev); + device_unregister(&drive->gendev); if ((drive->id->cfs_enable_2 & 0x3000) && drive->wcache) if (do_idedisk_flushcache(drive)) printk (KERN_INFO "%s: Write Cache FAILED Flushing!\n", @@ -1905,7 +1891,6 @@ static void __exit idedisk_exit (void) static int idedisk_init (void) { ide_register_driver(&idedisk_driver); - driver_register(&idedisk_devdrv); return 0; } diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index 13c58a36e550..d3b02956a8fb 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c @@ -3440,7 +3440,9 @@ int ide_register_driver(ide_driver_t *driver) list_del_init(&drive->list); ata_attach(drive); } - return 0; + driver->gen_driver.name = driver->name; + driver->gen_driver.bus = &ide_bus_type; + return driver_register(&driver->gen_driver); } EXPORT_SYMBOL(ide_register_driver); diff --git a/include/linux/ide.h b/include/linux/ide.h index 419b0c92f6f5..44cb38c00b96 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -1200,6 +1200,7 @@ typedef struct ide_driver_s { int (*attach)(ide_drive_t *); void (*ata_prebuilder)(ide_drive_t *); void (*atapi_prebuilder)(ide_drive_t *); + struct device_driver gen_driver; struct list_head drives; struct list_head drivers; } ide_driver_t; -- cgit v1.2.3 From 469d2810663a7084344107cd702dabeeb7e261ed Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Wed, 9 Oct 2002 06:06:36 -0700 Subject: [PATCH] fix __SI_CODE This small patch is extracted from George Anzinger's High-res-timer patches. --- include/asm-generic/siginfo.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/asm-generic/siginfo.h b/include/asm-generic/siginfo.h index dcca9fc715a8..8e6f81b7a524 100644 --- a/include/asm-generic/siginfo.h +++ b/include/asm-generic/siginfo.h @@ -91,7 +91,7 @@ typedef struct siginfo { #define __SI_FAULT (3 << 16) #define __SI_CHLD (4 << 16) #define __SI_RT (5 << 16) -#define __SI_CODE(T,N) ((T) << 16 | ((N) & 0xffff)) +#define __SI_CODE(T,N) ((T) | ((N) & 0xffff)) #else #define __SI_KILL 0 #define __SI_TIMER 0 -- cgit v1.2.3