You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(165) |
Sep
(240) |
Oct
(424) |
Nov
(526) |
Dec
(293) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(242) |
Feb
(149) |
Mar
(143) |
Apr
(143) |
May
(76) |
Jun
(59) |
Jul
(20) |
Aug
(2) |
Sep
(49) |
Oct
(1) |
Nov
(4) |
Dec
|
2003 |
Jan
(1) |
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2004 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(3) |
Nov
|
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
(72) |
Jul
(36) |
Aug
(9) |
Sep
(16) |
Oct
(23) |
Nov
(9) |
Dec
(3) |
2010 |
Jan
|
Feb
(1) |
Mar
(35) |
Apr
(44) |
May
(56) |
Jun
(71) |
Jul
(41) |
Aug
(41) |
Sep
(22) |
Oct
(3) |
Nov
(1) |
Dec
(1) |
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2014 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
(1) |
Nov
(1) |
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2017 |
Jan
|
Feb
|
Mar
(1) |
Apr
(1) |
May
(1) |
Jun
|
Jul
(1) |
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2021 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(1) |
Sep
(25) |
Oct
(105) |
Nov
(15) |
Dec
|
2025 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
(4) |
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: James S. <jsi...@us...> - 2001-10-12 17:49:19
|
Update of /cvsroot/linux-mips/linux/arch/mips/kernel In directory usw-pr-cvs1:/tmp/cvs-serv25931/arch/mips/kernel Modified Files: setup.c Log Message: Handle R5500. Index: setup.c =================================================================== RCS file: /cvsroot/linux-mips/linux/arch/mips/kernel/setup.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- setup.c 2001/10/09 21:37:55 1.18 +++ setup.c 2001/10/12 17:49:16 1.19 @@ -254,6 +254,12 @@ mips_cpu.options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR; mips_cpu.tlbsize = 48; break; + case PRID_IMP_R5500: + mips_cpu.cputype = CPU_R5500; + mips_cpu.isa_level = MIPS_CPU_ISA_IV; + mips_cpu.options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR; + mips_cpu.tlbsize = 48; + break; case PRID_IMP_NEVADA: mips_cpu.cputype = CPU_NEVADA; mips_cpu.isa_level = MIPS_CPU_ISA_IV; |
From: James S. <jsi...@us...> - 2001-10-12 17:33:59
|
Update of /cvsroot/linux-mips/linux/arch/mips/kernel In directory usw-pr-cvs1:/tmp/cvs-serv22366 Modified Files: irq.c Log Message: Include <linux/module.h>. Index: irq.c =================================================================== RCS file: /cvsroot/linux-mips/linux/arch/mips/kernel/irq.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- irq.c 2001/09/27 22:36:33 1.4 +++ irq.c 2001/10/12 17:33:56 1.5 @@ -13,6 +13,7 @@ #include <linux/init.h> #include <linux/interrupt.h> #include <linux/kernel_stat.h> +#include <linux/module.h> #include <linux/slab.h> #include <linux/mm.h> #include <linux/random.h> |
From: Dirk B. <dir...@de...> - 2001-10-12 06:32:57
|
Fran=E7ois, Fran=E7ois Leblanc wrote: >=20 > Humm, >=20 > I'm lost, > Does anyone known how to build for > casio E15-105-115, witch config should > I use for MACHINE SELECTION? I think the E15 uses a NEC VR4111, the E105 a VR4121 and the E115 uses a VR4121, too. The casio E125G and the casio EM500 are using a VR4122. The VR4121 and the VR4122 are very similar. The processor cores are the same, they differ only from their on chip peripherals. The main difference is the on chip PCI controller on the VR4122. For the VR4122 there is a tree in linux-mips (eagle is the VR4122 eval board from NEC). Because of this small difference it should be possible to generate a VR4121 tree from the VR4122 tree. For example a common and a e105/e115 directory. Perhaps the old sources accessible via the CVS web interface in http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/linux-mips/linux/arch/mips= /vr41xx/vr4121/Attic/ can help?=20 > Euh, I'm wondering while I write this e-mail > if Casio is supported by linux-mips? Regards Dirk --=20 dir...@de... |
From: James S. <jsi...@us...> - 2001-10-11 23:15:00
|
Update of /cvsroot/linux-mips/linux/include/asm-mips In directory usw-pr-cvs1:/tmp/cvs-serv27941 Added Files: pgalloc.h Log Message: flush_tlb changes. |
From: James S. <jsi...@us...> - 2001-10-11 23:08:02
|
Update of /cvsroot/linux-mips/linux/arch/mips64/sgi-ip22 In directory usw-pr-cvs1:/tmp/cvs-serv26328 Modified Files: ip22-berr.c Log Message: added dump_tlb* functions. Index: ip22-berr.c =================================================================== RCS file: /cvsroot/linux-mips/linux/arch/mips64/sgi-ip22/ip22-berr.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- ip22-berr.c 2001/09/09 20:17:15 1.5 +++ ip22-berr.c 2001/10/11 23:08:00 1.6 @@ -19,9 +19,6 @@ extern asmlinkage void handle_ibe(void); extern asmlinkage void handle_dbe(void); -extern void dump_tlb_addr(unsigned long addr); -extern void dump_tlb_all(void); - extern const struct exception_table_entry __start___dbe_table[]; extern const struct exception_table_entry __stop___dbe_table[]; |
From: James S. <jsi...@us...> - 2001-10-11 23:07:23
|
Update of /cvsroot/linux-mips/linux/arch/mips64/sgi-ip22 In directory usw-pr-cvs1:/tmp/cvs-serv26163 Added Files: Makefile Log Message: makefile cleanup. --- NEW FILE: Makefile --- # # Makefile for the SGI specific kernel interface routines # under Linux. # .S.s: $(CPP) $(CFLAGS) $< -o $*.s .S.o: $(CC) $(CFLAGS) -c $< -o $*.o L_TARGET = ip22.a obj-y += ip22-berr.o ip22-mc.o ip22-hpc.o ip22-int.o ip22-rtc.o \ ip22-setup.o system.o ip22-timer.o ip22-irq.o ip22-reset.o time.o obj-$(CONFIG_BOARD_SCACHE) += ip22-sc.o include $(TOPDIR)/Rules.make |
From: James S. <jsi...@us...> - 2001-10-11 23:06:16
|
Update of /cvsroot/linux-mips/linux/arch/mips64/mm In directory usw-pr-cvs1:/tmp/cvs-serv25759 Modified Files: r4xx0.c Log Message: flush_tlb changes. Index: r4xx0.c =================================================================== RCS file: /cvsroot/linux-mips/linux/arch/mips64/mm/r4xx0.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- r4xx0.c 2001/10/05 16:36:38 1.4 +++ r4xx0.c 2001/10/11 23:06:13 1.5 @@ -1858,7 +1858,7 @@ #define NTLB_ENTRIES_HALF 24 /* Fixed on all R4XX0 variants... */ -static inline void r4k_flush_tlb_all(void) +void local_flush_tlb_all(void) { unsigned long flags; unsigned long old_ctx; @@ -1891,7 +1891,7 @@ __restore_flags(flags); } -static void r4k_flush_tlb_mm(struct mm_struct *mm) +void local_flush_tlb_mm(struct mm_struct *mm) { if (CPU_CONTEXT(smp_processor_id(), mm) != 0) { unsigned long flags; @@ -1907,7 +1907,7 @@ } } -static void r4k_flush_tlb_range(struct mm_struct *mm, unsigned long start, +static void local_flush_tlb_range(struct mm_struct *mm, unsigned long start, unsigned long end) { if (CPU_CONTEXT(smp_processor_id(), mm) != 0) { @@ -1957,7 +1957,7 @@ } } -static void r4k_flush_tlb_page(struct vm_area_struct *vma, unsigned long page) +static void local_flush_tlb_page(struct vm_area_struct *vma, unsigned long page) { if (CPU_CONTEXT(smp_processor_id(), vma->vm_mm) != 0) { unsigned long flags; @@ -2385,10 +2385,6 @@ _flush_cache_sigtramp = r4600v20k_flush_cache_sigtramp; } - _flush_tlb_all = r4k_flush_tlb_all; - _flush_tlb_mm = r4k_flush_tlb_mm; - _flush_tlb_range = r4k_flush_tlb_range; - _flush_tlb_page = r4k_flush_tlb_page; _flush_cache_l2 = r4k_flush_cache_l2; update_mmu_cache = r4k_update_mmu_cache; @@ -2405,5 +2401,5 @@ * be set for 4kb pages. */ write_32bit_cp0_register(CP0_PAGEMASK, PM_4K); - _flush_tlb_all(); + local_flush_tlb_all(); } |
From: James S. <jsi...@us...> - 2001-10-11 23:05:56
|
Update of /cvsroot/linux-mips/linux/arch/mips64/mm In directory usw-pr-cvs1:/tmp/cvs-serv25642 Added Files: loadmmu.c Log Message: flush_tlb changes. --- NEW FILE: loadmmu.c --- /* * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (C) 1996 David S. Miller (dm...@en...) * Copyright (C) 1997, 1999 Ralf Baechle (ra...@gn...) * Copyright (C) 1999 Silicon Graphics, Inc. */ #include <linux/config.h> #include <linux/init.h> #include <linux/kernel.h> #include <linux/sched.h> #include <linux/mm.h> #include <asm/page.h> #include <asm/pgtable.h> #include <asm/system.h> #include <asm/bootinfo.h> #include <asm/sgialib.h> /* memory functions */ void (*_clear_page)(void * page); void (*_copy_page)(void * to, void * from); /* Cache operations. */ void (*_flush_cache_mm)(struct mm_struct *mm); void (*_flush_cache_range)(struct mm_struct *mm, unsigned long start, unsigned long end); void (*_flush_cache_page)(struct vm_area_struct *vma, unsigned long page); void (*_flush_page_to_ram)(struct page * page); /* MIPS specific cache operations */ void (*_flush_cache_sigtramp)(unsigned long addr); void (*_flush_cache_l2)(void); void (*_flush_cache_l1)(void); /* DMA cache operations. */ void (*_dma_cache_wback_inv)(unsigned long start, unsigned long size); void (*_dma_cache_wback)(unsigned long start, unsigned long size); void (*_dma_cache_inv)(unsigned long start, unsigned long size); /* Miscellaneous. */ void (*update_mmu_cache)(struct vm_area_struct * vma, unsigned long address, pte_t pte); void (*_show_regs)(struct pt_regs *); extern void ld_mmu_r4xx0(void); extern void ld_mmu_andes(void); void __init load_mmu(void) { switch(mips_cputype) { #if defined (CONFIG_CPU_R4300) \ || defined (CONFIG_CPU_R4X00) \ || defined (CONFIG_CPU_R5000) \ || defined (CONFIG_CPU_NEVADA) case CPU_R4000PC: case CPU_R4000SC: case CPU_R4000MC: case CPU_R4200: case CPU_R4300: case CPU_R4400PC: case CPU_R4400SC: case CPU_R4400MC: case CPU_R4600: case CPU_R4640: case CPU_R4650: case CPU_R4700: case CPU_R5000: case CPU_R5000A: case CPU_NEVADA: printk("Loading R4000 MMU routines.\n"); ld_mmu_r4xx0(); break; #endif #if defined (CONFIG_CPU_R10000) case CPU_R10000: printk("Loading R10000 MMU routines.\n"); ld_mmu_andes(); break; #endif default: /* XXX We need an generic routine in the MIPS port * XXX to jabber stuff onto the screen on all machines * XXX before the console is setup. The ARCS prom * XXX routines look good for this, but only the SGI * XXX code has a full library for that at this time. */ panic("Yeee, unsupported mmu/cache architecture or " "wrong compiletime kernel configuration."); } } |
From: James S. <jsi...@us...> - 2001-10-11 23:05:11
|
Update of /cvsroot/linux-mips/linux/arch/mips64/mm In directory usw-pr-cvs1:/tmp/cvs-serv25423 Modified Files: andes.c Log Message: flush_tlb changes. Index: andes.c =================================================================== RCS file: /cvsroot/linux-mips/linux/arch/mips64/mm/andes.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- andes.c 2001/10/05 16:35:35 1.3 +++ andes.c 2001/10/11 23:05:09 1.4 @@ -132,8 +132,7 @@ #define NTLB_ENTRIES 64 #define NTLB_ENTRIES_HALF 32 -static inline void -andes_flush_tlb_all(void) +void local_flush_tlb_all(void) { unsigned long flags; unsigned long old_ctx; @@ -162,7 +161,7 @@ __restore_flags(flags); } -static void andes_flush_tlb_mm(struct mm_struct *mm) +void local_flush_tlb_mm(struct mm_struct *mm) { if (CPU_CONTEXT(smp_processor_id(), mm) != 0) { unsigned long flags; @@ -178,9 +177,8 @@ } } -static void -andes_flush_tlb_range(struct mm_struct *mm, unsigned long start, - unsigned long end) +void local_flush_tlb_range(struct mm_struct *mm, unsigned long start, + unsigned long end) { if (CPU_CONTEXT(smp_processor_id(), mm) != 0) { unsigned long flags; @@ -225,8 +223,7 @@ } } -static void -andes_flush_tlb_page(struct vm_area_struct *vma, unsigned long page) +void local_flush_tlb_page(struct vm_area_struct *vma, unsigned long page) { if (CPU_CONTEXT(smp_processor_id(), vma->vm_mm) != 0) { unsigned long flags; @@ -350,11 +347,6 @@ _flush_cache_l2 = andes_flush_cache_l2; _flush_cache_sigtramp = andes_flush_cache_sigtramp; - _flush_tlb_all = andes_flush_tlb_all; - _flush_tlb_mm = andes_flush_tlb_mm; - _flush_tlb_range = andes_flush_tlb_range; - _flush_tlb_page = andes_flush_tlb_page; - switch (sc_lsize()) { case 64: scache_lsz64 = 1; @@ -383,7 +375,7 @@ write_32bit_cp0_register(CP0_PAGEMASK, PM_4K); /* From this point on the ARC firmware is dead. */ - _flush_tlb_all(); + local_flush_tlb_all(); /* Did I tell you that ARC SUCKS? */ } |
From: James S. <jsi...@us...> - 2001-10-11 23:03:27
|
Update of /cvsroot/linux-mips/linux/arch/mips64/lib In directory usw-pr-cvs1:/tmp/cvs-serv25047 Added Files: Makefile Log Message: Nice cleanup here. --- NEW FILE: Makefile --- # # Makefile for MIPS-specific library files.. # .S.s: $(CPP) $(CFLAGS) $< -o $*.s .S.o: $(CC) $(CFLAGS) -c $< -o $*.o L_TARGET = lib.a obj-y += csum_partial.o csum_partial_copy.o dump_tlb.o rtc-std.o \ rtc-no.o memset.o memcpy.o strlen_user.o strncpy_user.o \ strnlen_user.o watch.o obj-$(CONFIG_BLK_DEV_FD) += floppy-no.o floppy-std.o obj-$(CONFIG_IDE) += ide-std.o ide-no.o obj-$(CONFIG_PC_KEYB) += kbd-std.o kbd-no.o include $(TOPDIR)/Rules.make |
From: James S. <jsi...@us...> - 2001-10-11 23:02:22
|
Update of /cvsroot/linux-mips/linux/arch/mips64/kernel In directory usw-pr-cvs1:/tmp/cvs-serv24683 Modified Files: smp.c Log Message: More flush_tlb changes. Index: smp.c =================================================================== RCS file: /cvsroot/linux-mips/linux/arch/mips64/kernel/smp.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- smp.c 2001/10/08 16:14:57 1.5 +++ smp.c 2001/10/11 23:02:20 1.6 @@ -12,6 +12,7 @@ #include <linux/interrupt.h> #include <linux/spinlock.h> #include <linux/threads.h> +#include <linux/module.h> #include <linux/time.h> #include <linux/timex.h> #include <linux/sched.h> @@ -341,18 +342,18 @@ static void flush_tlb_all_ipi(void *info) { - _flush_tlb_all(); + local_flush_tlb_all(); } void flush_tlb_all(void) { smp_call_function(flush_tlb_all_ipi, 0, 1, 1); - _flush_tlb_all(); + local_flush_tlb_all(); } static void flush_tlb_mm_ipi(void *mm) { - _flush_tlb_mm((struct mm_struct *)mm); + local_flush_tlb_mm((struct mm_struct *)mm); } /* @@ -378,7 +379,7 @@ if (smp_processor_id() != i) CPU_CONTEXT(i, mm) = 0; } - _flush_tlb_mm(mm); + local_flush_tlb_mm(mm); } struct flush_tlb_data { @@ -392,7 +393,7 @@ { struct flush_tlb_data *fd = (struct flush_tlb_data *)info; - _flush_tlb_range(fd->mm, fd->addr1, fd->addr2); + local_flush_tlb_range(fd->mm, fd->addr1, fd->addr2); } void flush_tlb_range(struct mm_struct *mm, unsigned long start, unsigned long end) @@ -410,14 +411,14 @@ if (smp_processor_id() != i) CPU_CONTEXT(i, mm) = 0; } - _flush_tlb_range(mm, start, end); + local_flush_tlb_range(mm, start, end); } static void flush_tlb_page_ipi(void *info) { struct flush_tlb_data *fd = (struct flush_tlb_data *)info; - _flush_tlb_page(fd->vma, fd->addr1); + local_flush_tlb_page(fd->vma, fd->addr1); } void flush_tlb_page(struct vm_area_struct *vma, unsigned long page) @@ -434,5 +435,7 @@ if (smp_processor_id() != i) CPU_CONTEXT(i, vma->vm_mm) = 0; } - _flush_tlb_page(vma, page); + local_flush_tlb_page(vma, page); } + +EXPORT_SYMBOL(flush_tlb_page); |
From: James S. <jsi...@us...> - 2001-10-11 23:01:50
|
Update of /cvsroot/linux-mips/linux/arch/mips64/kernel In directory usw-pr-cvs1:/tmp/cvs-serv24566 Added Files: signal32.c Log Message: Move signal fix. --- NEW FILE: signal32.c --- /* * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (C) 1991, 1992 Linus Torvalds * Copyright (C) 1994 - 2000 Ralf Baechle * Copyright (C) 1999, 2000 Silicon Graphics, Inc. */ #include <linux/sched.h> #include <linux/mm.h> #include <linux/smp.h> #include <linux/smp_lock.h> #include <linux/kernel.h> #include <linux/signal.h> #include <linux/errno.h> #include <linux/wait.h> #include <linux/ptrace.h> #include <linux/unistd.h> #include <asm/asm.h> #include <asm/bitops.h> #include <asm/pgalloc.h> #include <asm/stackframe.h> #include <asm/uaccess.h> #include <asm/ucontext.h> #include <asm/system.h> #define DEBUG_SIG 0 #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) extern asmlinkage int do_signal32(sigset_t *oldset, struct pt_regs *regs); extern asmlinkage int save_fp_context(struct sigcontext *sc); extern asmlinkage int restore_fp_context(struct sigcontext *sc); extern asmlinkage void syscall_trace(void); /* 32-bit compatibility types */ #define _NSIG32_BPW 32 #define _NSIG32_WORDS (_NSIG / _NSIG32_BPW) typedef struct { unsigned int sig[_NSIG32_WORDS]; } sigset32_t; typedef unsigned int __sighandler32_t; typedef void (*vfptr_t)(void); struct sigaction32 { unsigned int sa_flags; __sighandler32_t sa_handler; sigset32_t sa_mask; unsigned int sa_restorer; int sa_resv[1]; /* reserved */ }; /* IRIX compatible stack_t */ typedef struct sigaltstack32 { s32 ss_sp; __kernel_size_t32 ss_size; int ss_flags; } stack32_t; static inline int store_fp_context(struct sigcontext *sc) { unsigned int fcr0; int err = 0; err |= __copy_to_user(&sc->sc_fpregs[0], ¤t->thread.fpu.hard.fp_regs[0], NUM_FPU_REGS * sizeof(unsigned long)); err |= __copy_to_user(&sc->sc_fpc_csr, ¤t->thread.fpu.hard.control, sizeof(unsigned int)); __asm__ __volatile__("cfc1 %0, $0\n\t" : "=r" (fcr0)); err |= __copy_to_user(&sc->sc_fpc_eir, &fcr0, sizeof(unsigned int)); return err; } static inline int refill_fp_context(struct sigcontext *sc) { int err = 0; if (verify_area(VERIFY_READ, sc, sizeof(*sc))) return -EFAULT; err |= __copy_from_user(¤t->thread.fpu.hard.fp_regs[0], &sc->sc_fpregs[0], NUM_FPU_REGS * sizeof(unsigned long)); err |= __copy_from_user(¤t->thread.fpu.hard.control, &sc->sc_fpc_csr, sizeof(unsigned int)); return err; } extern void __put_sigset_unknown_nsig(void); extern void __get_sigset_unknown_nsig(void); static inline int put_sigset(const sigset_t *kbuf, sigset32_t *ubuf) { int err = 0; if (!access_ok(VERIFY_WRITE, ubuf, sizeof(*ubuf))) return -EFAULT; switch (_NSIG_WORDS) { default: __put_sigset_unknown_nsig(); case 2: err |= __put_user (kbuf->sig[1] >> 32, &ubuf->sig[3]); err |= __put_user (kbuf->sig[1] & 0xffffffff, &ubuf->sig[2]); case 1: err |= __put_user (kbuf->sig[0] >> 32, &ubuf->sig[1]); err |= __put_user (kbuf->sig[0] & 0xffffffff, &ubuf->sig[0]); } return err; } static inline int get_sigset(sigset_t *kbuf, const sigset32_t *ubuf) { int err = 0; unsigned long sig[4]; if (!access_ok(VERIFY_READ, ubuf, sizeof(*ubuf))) return -EFAULT; switch (_NSIG_WORDS) { default: __get_sigset_unknown_nsig(); case 2: err |= __get_user (sig[3], &ubuf->sig[3]); err |= __get_user (sig[2], &ubuf->sig[2]); kbuf->sig[1] = sig[2] | (sig[3] << 32); case 1: err |= __get_user (sig[1], &ubuf->sig[1]); err |= __get_user (sig[0], &ubuf->sig[0]); kbuf->sig[0] = sig[0] | (sig[1] << 32); } return err; } /* * Atomically swap in the new signal mask, and wait for a signal. */ asmlinkage inline int sys32_sigsuspend(abi64_no_regargs, struct pt_regs regs) { sigset32_t *uset; sigset_t newset, saveset; save_static(®s); uset = (sigset32_t *) regs.regs[4]; if (get_sigset(&newset, uset)) return -EFAULT; sigdelsetmask(&newset, ~_BLOCKABLE); spin_lock_irq(¤t->sigmask_lock); saveset = current->blocked; current->blocked = newset; recalc_sigpending(current); spin_unlock_irq(¤t->sigmask_lock); regs.regs[2] = EINTR; regs.regs[7] = 1; while (1) { current->state = TASK_INTERRUPTIBLE; schedule(); if (do_signal32(&saveset, ®s)) return -EINTR; } } asmlinkage int sys32_rt_sigsuspend(abi64_no_regargs, struct pt_regs regs) { sigset32_t *uset; sigset_t newset, saveset; size_t sigsetsize; save_static(®s); /* XXX Don't preclude handling different sized sigset_t's. */ sigsetsize = regs.regs[5]; if (sigsetsize != sizeof(sigset32_t)) return -EINVAL; uset = (sigset32_t *) regs.regs[4]; if (get_sigset(&newset, uset)) return -EFAULT; sigdelsetmask(&newset, ~_BLOCKABLE); spin_lock_irq(¤t->sigmask_lock); saveset = current->blocked; current->blocked = newset; recalc_sigpending(current); spin_unlock_irq(¤t->sigmask_lock); regs.regs[2] = EINTR; regs.regs[7] = 1; while (1) { current->state = TASK_INTERRUPTIBLE; schedule(); if (do_signal32(&saveset, ®s)) return -EINTR; } } asmlinkage int sys32_sigaction(int sig, const struct sigaction32 *act, struct sigaction32 *oact) { struct k_sigaction new_ka, old_ka; int ret; int err = 0; if (act) { old_sigset_t mask; if (!access_ok(VERIFY_READ, act, sizeof(*act))) return -EFAULT; err |= __get_user((u32)(u64)new_ka.sa.sa_handler, &act->sa_handler); err |= __get_user(new_ka.sa.sa_flags, &act->sa_flags); err |= __get_user(mask, &act->sa_mask.sig[0]); err |= __get_user((u32)(u64)new_ka.sa.sa_restorer, &act->sa_restorer); if (err) return -EFAULT; siginitset(&new_ka.sa.sa_mask, mask); } ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); if (!ret && oact) { if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact))) return -EFAULT; err |= __put_user(old_ka.sa.sa_flags, &oact->sa_flags); err |= __put_user((u32)(u64)old_ka.sa.sa_handler, &oact->sa_handler); err |= __put_user(old_ka.sa.sa_mask.sig[0], oact->sa_mask.sig); err |= __put_user(0, &oact->sa_mask.sig[1]); err |= __put_user(0, &oact->sa_mask.sig[2]); err |= __put_user(0, &oact->sa_mask.sig[3]); err |= __put_user((u32)(u64)old_ka.sa.sa_restorer, &oact->sa_restorer); if (err) return -EFAULT; } return ret; } asmlinkage int sys32_sigaltstack(abi64_no_regargs, struct pt_regs regs) { const stack32_t *uss = (const stack32_t *) regs.regs[4]; stack32_t *uoss = (stack32_t *) regs.regs[5]; unsigned long usp = regs.regs[29]; stack_t kss, koss; int ret, err = 0; mm_segment_t old_fs = get_fs(); s32 sp; if (uss) { if (!access_ok(VERIFY_READ, uss, sizeof(*uss))) return -EFAULT; err |= __get_user(sp, &uss->ss_sp); kss.ss_size = (long) sp; err |= __get_user(kss.ss_size, &uss->ss_size); err |= __get_user(kss.ss_flags, &uss->ss_flags); if (err) return -EFAULT; } set_fs (KERNEL_DS); ret = do_sigaltstack(uss ? &kss : NULL , uoss ? &koss : NULL, usp); set_fs (old_fs); if (!ret && uoss) { if (!access_ok(VERIFY_WRITE, uoss, sizeof(*uoss))) return -EFAULT; sp = (int) (long) koss.ss_sp; err |= __put_user(sp, &uoss->ss_sp); err |= __put_user(koss.ss_size, &uoss->ss_size); err |= __put_user(koss.ss_flags, &uoss->ss_flags); if (err) return -EFAULT; } return ret; } static asmlinkage int restore_sigcontext(struct pt_regs *regs, struct sigcontext *sc) { int owned_fp; int err = 0; err |= __get_user(regs->cp0_epc, &sc->sc_pc); err |= __get_user(regs->hi, &sc->sc_mdhi); err |= __get_user(regs->lo, &sc->sc_mdlo); #define restore_gp_reg(i) do { \ err |= __get_user(regs->regs[i], &sc->sc_regs[i]); \ } while(0) restore_gp_reg( 1); restore_gp_reg( 2); restore_gp_reg( 3); restore_gp_reg( 4); restore_gp_reg( 5); restore_gp_reg( 6); restore_gp_reg( 7); restore_gp_reg( 8); restore_gp_reg( 9); restore_gp_reg(10); restore_gp_reg(11); restore_gp_reg(12); restore_gp_reg(13); restore_gp_reg(14); restore_gp_reg(15); restore_gp_reg(16); restore_gp_reg(17); restore_gp_reg(18); restore_gp_reg(19); restore_gp_reg(20); restore_gp_reg(21); restore_gp_reg(22); restore_gp_reg(23); restore_gp_reg(24); restore_gp_reg(25); restore_gp_reg(26); restore_gp_reg(27); restore_gp_reg(28); restore_gp_reg(29); restore_gp_reg(30); restore_gp_reg(31); #undef restore_gp_reg err |= __get_user(owned_fp, &sc->sc_ownedfp); if (owned_fp) { if (IS_FPU_OWNER()) { CLEAR_FPU_OWNER(); regs->cp0_status &= ~ST0_CU1; } current->used_math = 1; err |= refill_fp_context(sc); } return err; } struct sigframe { u32 sf_ass[4]; /* argument save space for o32 */ u32 sf_code[2]; /* signal trampoline */ struct sigcontext sf_sc; sigset_t sf_mask; }; struct rt_sigframe { u32 rs_ass[4]; /* argument save space for o32 */ u32 rs_code[2]; /* signal trampoline */ struct siginfo rs_info; struct ucontext rs_uc; }; asmlinkage void sys32_sigreturn(abi64_no_regargs, struct pt_regs regs) { struct sigframe *frame; sigset_t blocked; frame = (struct sigframe *) regs.regs[29]; if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) goto badframe; if (__copy_from_user(&blocked, &frame->sf_mask, sizeof(blocked))) goto badframe; sigdelsetmask(&blocked, ~_BLOCKABLE); spin_lock_irq(¤t->sigmask_lock); current->blocked = blocked; recalc_sigpending(current); spin_unlock_irq(¤t->sigmask_lock); if (restore_sigcontext(®s, &frame->sf_sc)) goto badframe; /* * Don't let your children do this ... */ if (current->ptrace & PT_TRACESYS) syscall_trace(); __asm__ __volatile__( "move\t$29, %0\n\t" "j\tret_from_sys_call" :/* no outputs */ :"r" (®s)); /* Unreached */ badframe: force_sig(SIGSEGV, current); } asmlinkage void sys32_rt_sigreturn(abi64_no_regargs, struct pt_regs regs) { struct rt_sigframe *frame; sigset_t set; stack_t st; frame = (struct rt_sigframe *) regs.regs[29]; if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) goto badframe; if (__copy_from_user(&set, &frame->rs_uc.uc_sigmask, sizeof(set))) goto badframe; sigdelsetmask(&set, ~_BLOCKABLE); spin_lock_irq(¤t->sigmask_lock); current->blocked = set; recalc_sigpending(current); spin_unlock_irq(¤t->sigmask_lock); if (restore_sigcontext(®s, &frame->rs_uc.uc_mcontext)) goto badframe; if (__copy_from_user(&st, &frame->rs_uc.uc_stack, sizeof(st))) goto badframe; /* It is more difficult to avoid calling this function than to call it and ignore errors. */ do_sigaltstack(&st, NULL, regs.regs[29]); /* * Don't let your children do this ... */ __asm__ __volatile__( "move\t$29, %0\n\t" "j\tret_from_sys_call" :/* no outputs */ :"r" (®s)); /* Unreached */ badframe: force_sig(SIGSEGV, current); } static int inline setup_sigcontext(struct pt_regs *regs, struct sigcontext *sc) { int err = 0; err |= __put_user(regs->cp0_epc, &sc->sc_pc); #define save_gp_reg(i) { \ err |= __put_user(regs->regs[i], &sc->sc_regs[i]); \ } while(0) __put_user(0, &sc->sc_regs[0]); save_gp_reg(1); save_gp_reg(2); save_gp_reg(3); save_gp_reg(4); save_gp_reg(5); save_gp_reg(6); save_gp_reg(7); save_gp_reg(8); save_gp_reg(9); save_gp_reg(10); save_gp_reg(11); save_gp_reg(12); save_gp_reg(13); save_gp_reg(14); save_gp_reg(15); save_gp_reg(16); save_gp_reg(17); save_gp_reg(18); save_gp_reg(19); save_gp_reg(20); save_gp_reg(21); save_gp_reg(22); save_gp_reg(23); save_gp_reg(24); save_gp_reg(25); save_gp_reg(26); save_gp_reg(27); save_gp_reg(28); save_gp_reg(29); save_gp_reg(30); save_gp_reg(31); #undef save_gp_reg err |= __put_user(regs->hi, &sc->sc_mdhi); err |= __put_user(regs->lo, &sc->sc_mdlo); err |= __put_user(regs->cp0_cause, &sc->sc_cause); err |= __put_user(regs->cp0_badvaddr, &sc->sc_badvaddr); if (current->used_math) { /* fp is active. */ if (IS_FPU_OWNER()) { lazy_fpu_switch(current, 0); CLEAR_FPU_OWNER(); regs->cp0_status &= ~ST0_CU1; } err |= __put_user(1, &sc->sc_ownedfp); err |= store_fp_context(sc); current->used_math = 0; } else { err |= __put_user(0, &sc->sc_ownedfp); } err |= __put_user(regs->cp0_status, &sc->sc_status); return err; } /* * Determine which stack to use.. */ static inline void * get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size) { unsigned long sp; /* Default to using normal stack */ sp = regs->regs[29]; /* This is the X/Open sanctioned signal stack switching. */ if ((ka->sa.sa_flags & SA_ONSTACK) && ! on_sig_stack(sp)) sp = current->sas_ss_sp + current->sas_ss_size; return (void *)((sp - frame_size) & ALMASK); } static void inline setup_frame(struct k_sigaction * ka, struct pt_regs *regs, int signr, sigset_t *set) { struct sigframe *frame; int err = 0; frame = get_sigframe(ka, regs, sizeof(*frame)); if (!access_ok(VERIFY_WRITE, frame, sizeof (*frame))) goto give_sigsegv; /* Set up to return from userspace. If provided, use a stub already in userspace. */ if (ka->sa.sa_flags & SA_RESTORER) regs->regs[31] = (unsigned long) ka->sa.sa_restorer; else { /* * Set up the return code ... * * li v0, __NR_Linux32_sigreturn * syscall */ err |= __put_user(0x24020000 + __NR_Linux32_sigreturn, frame->sf_code + 0); err |= __put_user(0x0000000c , frame->sf_code + 1); flush_cache_sigtramp((unsigned long) frame->sf_code); } err |= setup_sigcontext(regs, &frame->sf_sc); err |= __copy_to_user(&frame->sf_mask, set, sizeof(*set)); if (err) goto give_sigsegv; /* * Arguments to signal handler: * * a0 = signal number * a1 = 0 (should be cause) * a2 = pointer to struct sigcontext * * $25 and c0_epc point to the signal handler, $29 points to the * struct sigframe. */ regs->regs[ 4] = signr; regs->regs[ 5] = 0; regs->regs[ 6] = (unsigned long) &frame->sf_sc; regs->regs[29] = (unsigned long) frame; regs->regs[31] = (unsigned long) frame->sf_code; regs->cp0_epc = regs->regs[25] = (unsigned long) ka->sa.sa_handler; #if DEBUG_SIG printk("SIG deliver (%s:%d): sp=0x%p pc=0x%p ra=0x%p\n", current->comm, current->pid, frame, regs->cp0_epc, frame->code); #endif return; give_sigsegv: if (signr == SIGSEGV) ka->sa.sa_handler = SIG_DFL; force_sig(SIGSEGV, current); } static void inline setup_rt_frame(struct k_sigaction * ka, struct pt_regs *regs, int signr, sigset_t *set, siginfo_t *info) { struct rt_sigframe *frame; int err = 0; frame = get_sigframe(ka, regs, sizeof(*frame)); if (!access_ok(VERIFY_WRITE, frame, sizeof (*frame))) goto give_sigsegv; /* Set up to return from userspace. If provided, use a stub already in userspace. */ if (ka->sa.sa_flags & SA_RESTORER) regs->regs[31] = (unsigned long) ka->sa.sa_restorer; else { /* * Set up the return code ... * * li v0, __NR_Linux32_rt_sigreturn * syscall */ err |= __put_user(0x24020000 + __NR_Linux32_rt_sigreturn, frame->rs_code + 0); err |= __put_user(0x0000000c , frame->rs_code + 1); flush_cache_sigtramp((unsigned long) frame->rs_code); } /* Create siginfo. */ err |= __copy_to_user(&frame->rs_info, info, sizeof(*info)); /* Create the ucontext. */ err |= __put_user(0, &frame->rs_uc.uc_flags); err |= __put_user(0, &frame->rs_uc.uc_link); err |= __put_user((void *)current->sas_ss_sp, &frame->rs_uc.uc_stack.ss_sp); err |= __put_user(sas_ss_flags(regs->regs[29]), &frame->rs_uc.uc_stack.ss_flags); err |= __put_user(current->sas_ss_size, &frame->rs_uc.uc_stack.ss_size); err |= setup_sigcontext(regs, &frame->rs_uc.uc_mcontext); err |= __copy_to_user(&frame->rs_uc.uc_sigmask, set, sizeof(*set)); if (err) goto give_sigsegv; /* * Arguments to signal handler: * * a0 = signal number * a1 = 0 (should be cause) * a2 = pointer to ucontext * * $25 and c0_epc point to the signal handler, $29 points to * the struct rt_sigframe. */ regs->regs[ 4] = signr; regs->regs[ 5] = (unsigned long) &frame->rs_info; regs->regs[ 6] = (unsigned long) &frame->rs_uc; regs->regs[29] = (unsigned long) frame; regs->regs[31] = (unsigned long) frame->rs_code; regs->cp0_epc = regs->regs[25] = (unsigned long) ka->sa.sa_handler; #if DEBUG_SIG printk("SIG deliver (%s:%d): sp=0x%p pc=0x%p ra=0x%p\n", current->comm, current->pid, frame, regs->cp0_epc, frame->code); #endif return; give_sigsegv: if (signr == SIGSEGV) ka->sa.sa_handler = SIG_DFL; force_sig(SIGSEGV, current); } static inline void handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info, sigset_t *oldset, struct pt_regs * regs) { if (ka->sa.sa_flags & SA_SIGINFO) setup_rt_frame(ka, regs, sig, oldset, info); else setup_frame(ka, regs, sig, oldset); if (ka->sa.sa_flags & SA_ONESHOT) ka->sa.sa_handler = SIG_DFL; if (!(ka->sa.sa_flags & SA_NODEFER)) { spin_lock_irq(¤t->sigmask_lock); sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask); sigaddset(¤t->blocked,sig); recalc_sigpending(current); spin_unlock_irq(¤t->sigmask_lock); } } static inline void syscall_restart(struct pt_regs *regs, struct k_sigaction *ka) { switch(regs->regs[0]) { case ERESTARTNOHAND: regs->regs[2] = EINTR; break; case ERESTARTSYS: if(!(ka->sa.sa_flags & SA_RESTART)) { regs->regs[2] = EINTR; break; } /* fallthrough */ case ERESTARTNOINTR: /* Userland will reload $v0. */ regs->regs[7] = regs->regs[26]; regs->cp0_epc -= 8; } regs->regs[0] = 0; /* Don't deal with this again. */ } asmlinkage int do_signal32(sigset_t *oldset, struct pt_regs *regs) { struct k_sigaction *ka; siginfo_t info; if (!oldset) oldset = ¤t->blocked; for (;;) { unsigned long signr; spin_lock_irq(¤t->sigmask_lock); signr = dequeue_signal(¤t->blocked, &info); spin_unlock_irq(¤t->sigmask_lock); if (!signr) break; if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) { /* Let the debugger run. */ current->exit_code = signr; current->state = TASK_STOPPED; notify_parent(current, SIGCHLD); schedule(); /* We're back. Did the debugger cancel the sig? */ if (!(signr = current->exit_code)) continue; current->exit_code = 0; /* The debugger continued. Ignore SIGSTOP. */ if (signr == SIGSTOP) continue; /* Update the siginfo structure. Is this good? */ if (signr != info.si_signo) { info.si_signo = signr; info.si_errno = 0; info.si_code = SI_USER; info.si_pid = current->p_pptr->pid; info.si_uid = current->p_pptr->uid; } /* If the (new) signal is now blocked, requeue it. */ if (sigismember(¤t->blocked, signr)) { send_sig_info(signr, &info, current); continue; } } ka = ¤t->sig->action[signr-1]; if (ka->sa.sa_handler == SIG_IGN) { if (signr != SIGCHLD) continue; /* Check for SIGCHLD: it's special. */ while (sys_wait4(-1, NULL, WNOHANG, NULL) > 0) /* nothing */; continue; } if (ka->sa.sa_handler == SIG_DFL) { int exit_code = signr; /* Init gets no signals it doesn't want. */ if (current->pid == 1) continue; switch (signr) { case SIGCONT: case SIGCHLD: case SIGWINCH: continue; case SIGTSTP: case SIGTTIN: case SIGTTOU: if (is_orphaned_pgrp(current->pgrp)) continue; /* FALLTHRU */ case SIGSTOP: current->state = TASK_STOPPED; current->exit_code = signr; if (!(current->p_pptr->sig->action[SIGCHLD-1].sa.sa_flags & SA_NOCLDSTOP)) notify_parent(current, SIGCHLD); schedule(); continue; case SIGQUIT: case SIGILL: case SIGTRAP: case SIGABRT: case SIGFPE: case SIGSEGV: case SIGBUS: case SIGSYS: case SIGXCPU: case SIGXFSZ: if (do_coredump(signr, regs)) exit_code |= 0x80; /* FALLTHRU */ default: sigaddset(¤t->pending.signal, signr); recalc_sigpending(current); current->flags |= PF_SIGNALED; do_exit(exit_code); /* NOTREACHED */ } } if (regs->regs[0]) syscall_restart(regs, ka); /* Whee! Actually deliver the signal. */ handle_signal(signr, ka, &info, oldset, regs); return 1; } /* * Who's code doesn't conform to the restartable syscall convention * dies here!!! The li instruction, a single machine instruction, * must directly be followed by the syscall instruction. */ if (regs->regs[0]) { if (regs->regs[2] == ERESTARTNOHAND || regs->regs[2] == ERESTARTSYS || regs->regs[2] == ERESTARTNOINTR) { regs->regs[7] = regs->regs[26]; regs->cp0_epc -= 8; } } return 0; } extern asmlinkage int sys_sigprocmask(int how, old_sigset_t *set, old_sigset_t *oset); asmlinkage int sys32_sigprocmask(int how, old_sigset_t32 *set, old_sigset_t32 *oset) { old_sigset_t s; int ret; mm_segment_t old_fs = get_fs(); if (set && get_user (s, set)) return -EFAULT; set_fs (KERNEL_DS); ret = sys_sigprocmask(how, set ? &s : NULL, oset ? &s : NULL); set_fs (old_fs); if (!ret && oset && put_user (s, oset)) return -EFAULT; return ret; } asmlinkage long sys_sigpending(old_sigset_t *set); asmlinkage int sys32_sigpending(old_sigset_t32 *set) { old_sigset_t pending; int ret; mm_segment_t old_fs = get_fs(); set_fs (KERNEL_DS); ret = sys_sigpending(&pending); set_fs (old_fs); if (put_user(pending, set)) return -EFAULT; return ret; } asmlinkage int sys32_rt_sigaction(int sig, const struct sigaction32 *act, struct sigaction32 *oact, unsigned int sigsetsize) { struct k_sigaction new_sa, old_sa; int ret = -EINVAL; /* XXX: Don't preclude handling different sized sigset_t's. */ if (sigsetsize != sizeof(sigset_t)) goto out; if (act) { int err = 0; if (!access_ok(VERIFY_READ, act, sizeof(*act))) return -EFAULT; err |= __get_user((u32)(u64)new_sa.sa.sa_handler, &act->sa_handler); err |= __get_user(new_sa.sa.sa_flags, &act->sa_flags); err |= __get_user((u32)(u64)new_sa.sa.sa_restorer, &act->sa_restorer); err |= get_sigset(&new_sa.sa.sa_mask, &act->sa_mask); if (err) return -EFAULT; } ret = do_sigaction(sig, act ? &new_sa : NULL, oact ? &old_sa : NULL); if (!ret && oact) { int err = 0; if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact))) return -EFAULT; err |= __put_user((u32)(u64)old_sa.sa.sa_handler, &oact->sa_handler); err |= __put_user(old_sa.sa.sa_flags, &oact->sa_flags); err |= __put_user((u32)(u64)old_sa.sa.sa_restorer, &oact->sa_restorer); err |= put_sigset(&old_sa.sa.sa_mask, &oact->sa_mask); if (err) return -EFAULT; } out: return ret; } asmlinkage long sys_rt_sigprocmask(int how, sigset_t *set, sigset_t *oset, size_t sigsetsize); asmlinkage int sys32_rt_sigprocmask(int how, sigset32_t *set, sigset32_t *oset, unsigned int sigsetsize) { sigset_t old_set, new_set; int ret; mm_segment_t old_fs = get_fs(); if (set && get_sigset(&new_set, set)) return -EFAULT; set_fs (KERNEL_DS); ret = sys_rt_sigprocmask(how, set ? &new_set : NULL, oset ? &old_set : NULL, sigsetsize); set_fs (old_fs); if (!ret && oset && put_sigset(&old_set, oset)) return -EFAULT; return ret; } asmlinkage long sys_rt_sigpending(sigset_t *set, size_t sigsetsize); asmlinkage int sys32_rt_sigpending(sigset32_t *uset, unsigned int sigsetsize) { int ret; sigset_t set; mm_segment_t old_fs = get_fs(); set_fs (KERNEL_DS); ret = sys_rt_sigpending(&set, sigsetsize); set_fs (old_fs); if (!ret && put_sigset(&set, uset)) return -EFAULT; return ret; } asmlinkage void sys32_rt_sigtimedwait(void) { panic(__FUNCTION__ " called."); } asmlinkage void sys32_rt_sigqueueinfo(void) { panic(__FUNCTION__ " called."); } |
From: James S. <jsi...@us...> - 2001-10-11 23:00:49
|
Update of /cvsroot/linux-mips/linux/arch/mips64/kernel In directory usw-pr-cvs1:/tmp/cvs-serv24384 Modified Files: mips64_ksyms.c Log Message: removed flush_tbl export. Index: mips64_ksyms.c =================================================================== RCS file: /cvsroot/linux-mips/linux/arch/mips64/kernel/mips64_ksyms.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- mips64_ksyms.c 2001/08/16 17:27:58 1.2 +++ mips64_ksyms.c 2001/10/11 23:00:47 1.3 @@ -118,4 +118,3 @@ #endif EXPORT_SYMBOL(get_wchan); -EXPORT_SYMBOL(_flush_tlb_page); |
From: James S. <jsi...@us...> - 2001-10-11 22:59:17
|
Update of /cvsroot/linux-mips/linux/arch/mips64/kernel In directory usw-pr-cvs1:/tmp/cvs-serv23904 Added Files: Makefile Log Message: Exporting stuff out of smp.c --- NEW FILE: Makefile --- # # Makefile for the Linux/MIPS kernel. # # Note! Dependencies are done automagically by 'make dep', which also # removes any old dependencies. DON'T put your own dependencies here # unless it's something special (ie not a .c file). # .S.o: $(CC) $(CFLAGS) $(CFLAGS_$@) -c $< -o $*.o all: kernel.o head.o init_task.o O_TARGET := kernel.o export-objs = mips64_ksyms.o smp.o obj-y := branch.o entry.o proc.o process.o ptrace.o r4k_cache.o r4k_fpu.o \ r4k_genex.o r4k_switch.o r4k_tlb.o r4k_tlb_debug.o r4k_tlb_glue.o \ scall_64.o semaphore.o setup.o signal.o softfp.o syscall.o \ traps.o unaligned.o obj-$(CONFIG_MODULES) += mips64_ksyms.o obj-$(CONFIG_MIPS32_COMPAT) += linux32.o scall_o32.o signal32.o ioctl32.o obj-$(CONFIG_BINFMT_ELF32) += binfmt_elf32.o obj-$(CONFIG_SMP) += smp.o CFLAGS_r4k_genex.o := -P CFLAGS_r4k_tlb_glue.o := -P include $(TOPDIR)/Rules.make |
From: James S. <jsi...@us...> - 2001-10-11 22:55:13
|
Update of /cvsroot/linux-mips/linux/arch/mips64/configs In directory usw-pr-cvs1:/tmp/cvs-serv22903 Modified Files: defconfig-ip22 defconfig-ip27 Log Message: Synced up with ralph's current work. Index: defconfig-ip22 =================================================================== RCS file: /cvsroot/linux-mips/linux/arch/mips64/configs/defconfig-ip22,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- defconfig-ip22 2001/08/25 06:34:24 1.1 +++ defconfig-ip22 2001/10/11 22:55:10 1.2 @@ -244,6 +244,7 @@ # CONFIG_EQUALIZER is not set # CONFIG_TUN is not set # CONFIG_ETHERTAP is not set +# CONFIG_NET_SB1000 is not set # # Ethernet (10 or 100Mbit) @@ -259,6 +260,8 @@ # CONFIG_LANCE is not set # CONFIG_NET_VENDOR_SMC is not set # CONFIG_NET_VENDOR_RACAL is not set +# CONFIG_AT1700 is not set +# CONFIG_DEPCA is not set # CONFIG_NET_ISA is not set # CONFIG_NET_PCI is not set # CONFIG_NET_POCKET is not set @@ -413,6 +416,7 @@ # CONFIG_ROMFS_FS is not set CONFIG_EXT2_FS=y # CONFIG_SYSV_FS is not set +# CONFIG_SYSV_FS_WRITE is not set # CONFIG_UDF_FS is not set # CONFIG_UDF_RW is not set # CONFIG_UFS_FS is not set Index: defconfig-ip27 =================================================================== RCS file: /cvsroot/linux-mips/linux/arch/mips64/configs/defconfig-ip27,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- defconfig-ip27 2001/08/25 06:34:24 1.1 +++ defconfig-ip27 2001/10/11 22:55:10 1.2 @@ -241,6 +241,7 @@ # CONFIG_BONDING is not set # CONFIG_EQUALIZER is not set # CONFIG_TUN is not set +# CONFIG_NET_SB1000 is not set # # Ethernet (10 or 100Mbit) @@ -258,6 +259,7 @@ # CONFIG_LANCE is not set # CONFIG_NET_VENDOR_SMC is not set # CONFIG_NET_VENDOR_RACAL is not set +# CONFIG_DEPCA is not set # CONFIG_HP100 is not set # CONFIG_NET_ISA is not set # CONFIG_NET_PCI is not set @@ -408,6 +410,7 @@ # CONFIG_ROMFS_FS is not set CONFIG_EXT2_FS=y # CONFIG_SYSV_FS is not set +# CONFIG_SYSV_FS_WRITE is not set # CONFIG_UDF_FS is not set # CONFIG_UDF_RW is not set # CONFIG_UFS_FS is not set @@ -479,3 +482,4 @@ CONFIG_CROSSCOMPILE=y # CONFIG_REMOTE_DEBUG is not set # CONFIG_MAGIC_SYSRQ is not set +# CONFIG_MIPS_UNCACHED is not set |
From: James S. <jsi...@us...> - 2001-10-11 22:49:32
|
Update of /cvsroot/linux-mips/linux/arch/mips64 In directory usw-pr-cvs1:/tmp/cvs-serv21114 Removed Files: defconfig-ip22 Log Message: Oops. Didn't see configs directory. --- defconfig-ip22 DELETED --- |
From: James S. <jsi...@us...> - 2001-10-11 22:47:59
|
Update of /cvsroot/linux-mips/linux/arch/mips64 In directory usw-pr-cvs1:/tmp/cvs-serv20668 Added Files: defconfig-ip22 Log Message: Synced up to ralph's tree. |
From: James S. <jsi...@us...> - 2001-10-11 22:44:28
|
Update of /cvsroot/linux-mips/linux/arch/mips/mm In directory usw-pr-cvs1:/tmp/cvs-serv20010 Modified Files: andes.c sb1.c Added Files: umap.c Log Message: Convert from local_flush_tlb* to flush_tlb*. Index: andes.c =================================================================== RCS file: /cvsroot/linux-mips/linux/arch/mips/mm/andes.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- andes.c 2001/10/08 16:29:33 1.4 +++ andes.c 2001/10/11 22:44:25 1.5 @@ -60,23 +60,23 @@ } /* TLB operations. XXX Write these dave... */ -void flush_tlb_all(void) +void local_flush_tlb_all(void) { /* XXX */ } -void flush_tlb_mm(struct mm_struct *mm) +void local_flush_tlb_mm(struct mm_struct *mm) { /* XXX */ } -void flush_tlb_range(struct mm_struct *mm, unsigned long start, +void local_flush_tlb_range(struct mm_struct *mm, unsigned long start, unsigned long end) { /* XXX */ } -void flush_tlb_page(struct vm_area_struct *vma, unsigned long page) +void local_flush_tlb_page(struct vm_area_struct *vma, unsigned long page) { /* XXX */ } @@ -109,7 +109,7 @@ write_32bit_cp0_register(CP0_FRAMEMASK, 0); flush_cache_all(); - flush_tlb_all(); + local_flush_tlb_all(); /* * The R10k might even work for Linux/MIPS - but we're paranoid Index: sb1.c =================================================================== RCS file: /cvsroot/linux-mips/linux/arch/mips/mm/sb1.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- sb1.c 2001/10/05 17:10:56 1.3 +++ sb1.c 2001/10/11 22:44:25 1.4 @@ -1,10 +1,7 @@ /* * Copyright (C) 1996 David S. Miller (dm...@en...) * Copyright (C) 1997, 2001 Ralf Baechle (ra...@gn...) - * Copyright (C) 2000 Sibyte - * - * Written by Justin Carlson (ca...@si...) - * + * Copyright (C) 2000, 2001 Broadcom Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -21,7 +18,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - /* * In this entire file, I'm not sure what the role of the L2 on the sb1250 * is. Since it is coherent to the system, we should never need to flush @@ -61,7 +57,7 @@ } } -void flush_tlb_all(void) +void local_flush_tlb_all(void) { unsigned long flags; unsigned long old_ctx; @@ -81,8 +77,6 @@ __restore_flags(flags); } - - /* These are the functions hooked by the memory management function pointers */ static void sb1_clear_page(void *page) { @@ -422,8 +416,8 @@ * at this level instead of as common code in loadmmu()? */ flush_cache_all(); - flush_tlb_all(); - + local_flush_tlb_all(); + /* Turn on caching in kseg0 */ set_cp0_config(CONF_CM_CMASK, 0); } |
From: James S. <jsi...@us...> - 2001-10-11 22:40:35
|
Update of /cvsroot/linux-mips/linux/arch/mips/math-emu In directory usw-pr-cvs1:/tmp/cvs-serv19194 Added Files: dp_tint.c Log Message: Another floating point fix. --- NEW FILE: dp_tint.c --- /* IEEE754 floating point arithmetic * double precision: common utilities */ /* * MIPS floating point support * Copyright (C) 1994-2000 Algorithmics Ltd. All rights reserved. * http://www.algor.co.uk * * ######################################################################## * * This program is free software; you can distribute it and/or modify it * under the terms of the GNU General Public License (Version 2) as * published by the Free Software Foundation. * * This program is distributed in the hope it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. * * ######################################################################## */ #include <linux/kernel.h> #include "ieee754dp.h" int ieee754dp_tint(ieee754dp x) { COMPXDP; CLEARCX; EXPLODEXDP; FLUSHXDP; switch (xc) { case IEEE754_CLASS_SNAN: case IEEE754_CLASS_QNAN: case IEEE754_CLASS_INF: SETCX(IEEE754_INVALID_OPERATION); return ieee754si_xcpt(ieee754si_indef(), "dp_tint", x); case IEEE754_CLASS_ZERO: return 0; case IEEE754_CLASS_DNORM: case IEEE754_CLASS_NORM: break; } if (xe >= 31) { /* Set invalid. We will only use overflow for floating point overflow */ SETCX(IEEE754_INVALID_OPERATION); return ieee754si_xcpt(ieee754si_indef(), "dp_tint", x); } /* oh gawd */ if (xe > DP_MBITS) { xm <<= xe - DP_MBITS; } else if (xe < DP_MBITS) { unsigned long long residue; int round; int sticky; int odd; if (xe < -1) { residue = xm; round = 0; sticky = residue != 0; xm = 0; } else { residue = xm << (64 - DP_MBITS + xe); round = (residue >> 63) != 0; sticky = (residue << 1) != 0; xm >>= DP_MBITS - xe; } /* Note: At this point upper 32 bits of xm are guaranteed to be zero */ odd = (xm & 0x1) != 0x0; switch (ieee754_csr.rm) { case IEEE754_RN: if (round && (sticky || odd)) xm++; break; case IEEE754_RZ: break; case IEEE754_RU: /* toward +Infinity */ if ((round || sticky) && !xs) xm++; break; case IEEE754_RD: /* toward -Infinity */ if ((round || sticky) && xs) xm++; break; } if ((xm >> 31) != 0) { /* This can happen after rounding */ SETCX(IEEE754_INVALID_OPERATION); return ieee754si_xcpt(ieee754si_indef(), "dp_tint", x); } if (round || sticky) SETCX(IEEE754_INEXACT); } if (xs) return -xm; else return xm; } unsigned int ieee754dp_tuns(ieee754dp x) { ieee754dp hb = ieee754dp_1e31(); /* what if x < 0 ?? */ if (ieee754dp_lt(x, hb)) return (unsigned) ieee754dp_tint(x); return (unsigned) ieee754dp_tint(ieee754dp_sub(x, hb)) | ((unsigned) 1 << 31); } |
From: James S. <jsi...@us...> - 2001-10-11 22:39:12
|
Update of /cvsroot/linux-mips/linux/arch/mips/kernel In directory usw-pr-cvs1:/tmp/cvs-serv18810 Added Files: irixinv.c Log Message: Don't need initcall now. --- NEW FILE: irixinv.c --- /* * Support the inventory interface for IRIX binaries * This is invoked before the mm layer is working, so we do not * use the linked lists for the inventory yet. * * Miguel de Icaza, 1997. */ #include <linux/mm.h> #include <linux/init.h> #include <linux/slab.h> #include <asm/uaccess.h> #include <asm/inventory.h> #define MAX_INVENTORY 50 int inventory_items = 0; static inventory_t inventory [MAX_INVENTORY]; void add_to_inventory (int class, int type, int controller, int unit, int state) { inventory_t *ni = &inventory [inventory_items]; if (inventory_items == MAX_INVENTORY) return; ni->inv_class = class; ni->inv_type = type; ni->inv_controller = controller; ni->inv_unit = unit; ni->inv_state = state; ni->inv_next = ni; inventory_items++; } int dump_inventory_to_user (void *userbuf, int size) { inventory_t *inv = &inventory [0]; inventory_t *user = userbuf; int v; if ((v = verify_area (VERIFY_WRITE, userbuf, size))) return v; for (v = 0; v < inventory_items; v++){ inv = &inventory [v]; copy_to_user (user, inv, sizeof (inventory_t)); user++; } return inventory_items * sizeof (inventory_t); } void __init init_inventory (void) { /* gross hack while we put the right bits all over the kernel * most likely this will not let just anyone run the X server * until we put the right values all over the place */ add_to_inventory (10, 3, 0, 0, 16400); add_to_inventory (1, 1, 150, -1, 12); add_to_inventory (1, 3, 0, 0, 8976); add_to_inventory (1, 2, 0, 0, 8976); add_to_inventory (4, 8, 0, 0, 2); add_to_inventory (5, 5, 0, 0, 1); add_to_inventory (3, 3, 0, 0, 32768); add_to_inventory (3, 4, 0, 0, 32768); add_to_inventory (3, 8, 0, 0, 524288); add_to_inventory (3, 9, 0, 0, 64); add_to_inventory (3, 1, 0, 0, 67108864); add_to_inventory (12, 3, 0, 0, 16); add_to_inventory (8, 7, 17, 0, 16777472); add_to_inventory (8, 0, 0, 0, 1); add_to_inventory (2, 1, 0, 13, 2); add_to_inventory (2, 2, 0, 2, 0); add_to_inventory (2, 2, 0, 1, 0); add_to_inventory (7, 14, 0, 0, 6); } __initcall(init_inventory); |
From: James S. <jsi...@us...> - 2001-10-11 22:18:24
|
Update of /cvsroot/linux-mips/linux/arch/mips/lib In directory usw-pr-cvs1:/tmp/cvs-serv12041 Added Files: memcpy.S Log Message: memory copy bug fixes. --- NEW FILE: memcpy.S --- /* * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Unified implementation of memcpy, memmove and the __copy_user backend. * For __rmemcpy and memmove an exception is always a kernel bug, therefore * they're not protected. In order to keep the exception fixup routine * simple all memory accesses in __copy_user to src rsp. dst are stricly * incremental. The fixup routine depends on $at not being changed. */ #include <asm/asm.h> #include <asm/offset.h> #include <asm/regdef.h> /* * The fixup routine for copy_to_user depends on copying strictly in * increasing order. Gas expands the ulw/usw macros in the wrong order for * little endian machines, so we cannot depend on them. */ #ifdef __MIPSEB__ #define uswL swl #define uswU swr #define ulwL lwl #define ulwU lwr #endif #ifdef __MIPSEL__ #define uswL swr #define uswU swl #define ulwL lwr #define ulwU lwl #endif #define EX(insn,reg,addr,handler) \ 9: insn reg, addr; \ .section __ex_table,"a"; \ PTR 9b, handler; \ .previous #define UEX(insn,reg,addr,handler) \ 9: insn ## L reg, addr; \ 10: insn ## U reg, 3 + addr; \ .section __ex_table,"a"; \ PTR 9b, handler; \ PTR 10b, handler; \ .previous /* ascending order, destination aligned */ #define MOVE_BIGCHUNK(src, dst, offset, t0, t1, t2, t3) \ EX(lw, t0, (offset + 0x00)(src), l_fixup); \ EX(lw, t1, (offset + 0x04)(src), l_fixup); \ EX(lw, t2, (offset + 0x08)(src), l_fixup); \ EX(lw, t3, (offset + 0x0c)(src), l_fixup); \ EX(sw, t0, (offset + 0x00)(dst), s_fixup); \ EX(sw, t1, (offset + 0x04)(dst), s_fixup); \ EX(sw, t2, (offset + 0x08)(dst), s_fixup); \ EX(sw, t3, (offset + 0x0c)(dst), s_fixup); \ EX(lw, t0, (offset + 0x10)(src), l_fixup); \ EX(lw, t1, (offset + 0x14)(src), l_fixup); \ EX(lw, t2, (offset + 0x18)(src), l_fixup); \ EX(lw, t3, (offset + 0x1c)(src), l_fixup); \ EX(sw, t0, (offset + 0x10)(dst), s_fixup); \ EX(sw, t1, (offset + 0x14)(dst), s_fixup); \ EX(sw, t2, (offset + 0x18)(dst), s_fixup); \ EX(sw, t3, (offset + 0x1c)(dst), s_fixup) /* ascending order, destination unaligned */ #define UMOVE_BIGCHUNK(src, dst, offset, t0, t1, t2, t3) \ EX(lw, t0, (offset + 0x00)(src), l_fixup); \ EX(lw, t1, (offset + 0x04)(src), l_fixup); \ EX(lw, t2, (offset + 0x08)(src), l_fixup); \ EX(lw, t3, (offset + 0x0c)(src), l_fixup); \ UEX(usw, t0, (offset + 0x00)(dst), s_fixup); \ UEX(usw, t1, (offset + 0x04)(dst), s_fixup); \ UEX(usw, t2, (offset + 0x08)(dst), s_fixup); \ UEX(usw, t3, (offset + 0x0c)(dst), s_fixup); \ EX(lw, t0, (offset + 0x10)(src), l_fixup); \ EX(lw, t1, (offset + 0x14)(src), l_fixup); \ EX(lw, t2, (offset + 0x18)(src), l_fixup); \ EX(lw, t3, (offset + 0x1c)(src), l_fixup); \ UEX(usw, t0, (offset + 0x10)(dst), s_fixup); \ UEX(usw, t1, (offset + 0x14)(dst), s_fixup); \ UEX(usw, t2, (offset + 0x18)(dst), s_fixup); \ UEX(usw, t3, (offset + 0x1c)(dst), s_fixup) .text .set noreorder .set noat .align 5 LEAF(memcpy) /* a0=dst a1=src a2=len */ move v0, a0 /* return value */ __memcpy: EXPORT(__copy_user) xor t0, a0, a1 andi t0, t0, 0x3 move t7, a0 beqz t0, can_align sltiu t8, a2, 0x8 b memcpy_u_src # bad alignment move t2, a2 can_align: bnez t8, small_memcpy # < 8 bytes to copy move t2, a2 beqz a2, out andi t8, a1, 0x1 hword_align: beqz t8, word_align andi t8, a1, 0x2 EX(lb, t0, (a1), l_fixup) subu a2, a2, 0x1 EX(sb, t0, (a0), s_fixup) addu a1, a1, 0x1 addu a0, a0, 0x1 andi t8, a1, 0x2 word_align: beqz t8, dword_align sltiu t8, a2, 56 EX(lh, t0, (a1), l_fixup) subu a2, a2, 0x2 EX(sh, t0, (a0), s_fixup) sltiu t8, a2, 56 addu a0, a0, 0x2 addu a1, a1, 0x2 dword_align: bnez t8, do_end_words move t8, a2 andi t8, a1, 0x4 beqz t8, qword_align andi t8, a1, 0x8 EX(lw, t0, 0x00(a1), l_fixup) subu a2, a2, 0x4 EX(sw, t0, 0x00(a0), s_fixup) addu a1, a1, 0x4 addu a0, a0, 0x4 andi t8, a1, 0x8 qword_align: beqz t8, oword_align andi t8, a1, 0x10 EX(lw, t0, 0x00(a1), l_fixup) EX(lw, t1, 0x04(a1), l_fixup) subu a2, a2, 0x8 EX(sw, t0, 0x00(a0), s_fixup) EX(sw, t1, 0x04(a0), s_fixup) addu a1, a1, 0x8 andi t8, a1, 0x10 addu a0, a0, 0x8 oword_align: beqz t8, begin_movement srl t8, a2, 0x7 EX(lw, t3, 0x00(a1), l_fixup) EX(lw, t4, 0x04(a1), l_fixup) EX(lw, t0, 0x08(a1), l_fixup) EX(lw, t1, 0x0c(a1), l_fixup) EX(sw, t3, 0x00(a0), s_fixup) EX(sw, t4, 0x04(a0), s_fixup) EX(sw, t0, 0x08(a0), s_fixup) EX(sw, t1, 0x0c(a0), s_fixup) subu a2, a2, 0x10 addu a1, a1, 0x10 srl t8, a2, 0x7 addu a0, a0, 0x10 begin_movement: beqz t8, 0f andi t2, a2, 0x40 move_128bytes: MOVE_BIGCHUNK(a1, a0, 0x00, t0, t1, t3, t4) MOVE_BIGCHUNK(a1, a0, 0x20, t0, t1, t3, t4) MOVE_BIGCHUNK(a1, a0, 0x40, t0, t1, t3, t4) MOVE_BIGCHUNK(a1, a0, 0x60, t0, t1, t3, t4) subu t8, t8, 0x01 addu a1, a1, 0x80 bnez t8, move_128bytes addu a0, a0, 0x80 0: beqz t2, 1f andi t2, a2, 0x20 move_64bytes: MOVE_BIGCHUNK(a1, a0, 0x00, t0, t1, t3, t4) MOVE_BIGCHUNK(a1, a0, 0x20, t0, t1, t3, t4) addu a1, a1, 0x40 addu a0, a0, 0x40 1: beqz t2, do_end_words andi t8, a2, 0x1c move_32bytes: MOVE_BIGCHUNK(a1, a0, 0x00, t0, t1, t3, t4) andi t8, a2, 0x1c addu a1, a1, 0x20 addu a0, a0, 0x20 do_end_words: beqz t8, maybe_end_cruft srl t8, t8, 0x2 end_words: EX(lw, t0, (a1), l_fixup) subu t8, t8, 0x1 EX(sw, t0, (a0), s_fixup) addu a1, a1, 0x4 bnez t8, end_words addu a0, a0, 0x4 maybe_end_cruft: andi t2, a2, 0x3 small_memcpy: beqz t2, out move a2, t2 end_bytes: EX(lb, t0, (a1), l_fixup) subu a2, a2, 0x1 EX(sb, t0, (a0), s_fixup) addu a1, a1, 0x1 bnez a2, end_bytes addu a0, a0, 0x1 out: jr ra move a2, zero /* ------------------------------------------------------------------------- */ /* Bad, bad. At least try to align the source */ memcpy_u_src: bnez t8, small_memcpy # < 8 bytes? move t2, a2 addiu t0, a1, 7 # t0: how much to align ori t0, 7 xori t0, 7 subu t0, a1 UEX(ulw, t1, 0(a1), l_fixup) # dword alignment UEX(ulw, t2, 4(a1), l_fixup) UEX(usw, t1, 0(a0), s_fixup) UEX(usw, t2, 4(a0), s_fixup) addu a1, t0 # src addu a0, t0 # dst subu a2, t0 # len sltiu t8, a2, 56 bnez t8, u_do_end_words andi t8, a2, 0x3c andi t8, a1, 8 # now qword aligned? u_qword_align: beqz t8, u_oword_align andi t8, a1, 0x10 EX(lw, t0, 0x00(a1), l_fixup) EX(lw, t1, 0x04(a1), l_fixup) subu a2, a2, 0x8 UEX(usw, t0, 0x00(a0), s_fixup) UEX(usw, t1, 0x04(a0), s_fixup) addu a1, a1, 0x8 andi t8, a1, 0x10 addu a0, a0, 0x8 u_oword_align: beqz t8, u_begin_movement srl t8, a2, 0x7 EX(lw, t3, 0x08(a1), l_fixup) EX(lw, t4, 0x0c(a1), l_fixup) EX(lw, t0, 0x00(a1), l_fixup) EX(lw, t1, 0x04(a1), l_fixup) UEX(usw, t3, 0x08(a0), s_fixup) UEX(usw, t4, 0x0c(a0), s_fixup) UEX(usw, t0, 0x00(a0), s_fixup) UEX(usw, t1, 0x04(a0), s_fixup) subu a2, a2, 0x10 addu a1, a1, 0x10 srl t8, a2, 0x7 addu a0, a0, 0x10 u_begin_movement: beqz t8, 0f andi t2, a2, 0x40 u_move_128bytes: UMOVE_BIGCHUNK(a1, a0, 0x00, t0, t1, t3, t4) UMOVE_BIGCHUNK(a1, a0, 0x20, t0, t1, t3, t4) UMOVE_BIGCHUNK(a1, a0, 0x40, t0, t1, t3, t4) UMOVE_BIGCHUNK(a1, a0, 0x60, t0, t1, t3, t4) subu t8, t8, 0x01 addu a1, a1, 0x80 bnez t8, u_move_128bytes addu a0, a0, 0x80 0: beqz t2, 1f andi t2, a2, 0x20 u_move_64bytes: UMOVE_BIGCHUNK(a1, a0, 0x00, t0, t1, t3, t4) UMOVE_BIGCHUNK(a1, a0, 0x20, t0, t1, t3, t4) addu a1, a1, 0x40 addu a0, a0, 0x40 1: beqz t2, u_do_end_words andi t8, a2, 0x1c u_move_32bytes: UMOVE_BIGCHUNK(a1, a0, 0x00, t0, t1, t3, t4) andi t8, a2, 0x1c addu a1, a1, 0x20 addu a0, a0, 0x20 u_do_end_words: beqz t8, u_maybe_end_cruft srl t8, t8, 0x2 u_end_words: EX(lw, t0, 0x00(a1), l_fixup) subu t8, t8, 0x1 UEX(usw, t0, 0x00(a0), s_fixup) addu a1, a1, 0x4 bnez t8, u_end_words addu a0, a0, 0x4 u_maybe_end_cruft: andi t2, a2, 0x3 u_cannot_optimize: beqz t2, out move a2, t2 u_end_bytes: EX(lb, t0, (a1), l_fixup) subu a2, a2, 0x1 EX(sb, t0, (a0), s_fixup) addu a1, a1, 0x1 bnez a2, u_end_bytes addu a0, a0, 0x1 jr ra move a2, zero END(memcpy) /* descending order, destination aligned */ #define RMOVE_BIGCHUNK(src, dst, offset, t0, t1, t2, t3) \ lw t0, (offset + 0x10)(src); \ lw t1, (offset + 0x14)(src); \ lw t2, (offset + 0x18)(src); \ lw t3, (offset + 0x1c)(src); \ sw t0, (offset + 0x10)(dst); \ sw t1, (offset + 0x14)(dst); \ sw t2, (offset + 0x18)(dst); \ sw t3, (offset + 0x1c)(dst); \ lw t0, (offset + 0x00)(src); \ lw t1, (offset + 0x04)(src); \ lw t2, (offset + 0x08)(src); \ lw t3, (offset + 0x0c)(src); \ sw t0, (offset + 0x00)(dst); \ sw t1, (offset + 0x04)(dst); \ sw t2, (offset + 0x08)(dst); \ sw t3, (offset + 0x0c)(dst) /* descending order, destination ununaligned */ #define RUMOVE_BIGCHUNK(src, dst, offset, t0, t1, t2, t3) \ lw t0, (offset + 0x10)(src); \ lw t1, (offset + 0x14)(src); \ lw t2, (offset + 0x18)(src); \ lw t3, (offset + 0x1c)(src); \ usw t0, (offset + 0x10)(dst); \ usw t1, (offset + 0x14)(dst); \ usw t2, (offset + 0x18)(dst); \ usw t3, (offset + 0x1c)(dst); \ lw t0, (offset + 0x00)(src); \ lw t1, (offset + 0x04)(src); \ lw t2, (offset + 0x08)(src); \ lw t3, (offset + 0x0c)(src); \ usw t0, (offset + 0x00)(dst); \ usw t1, (offset + 0x04)(dst); \ usw t2, (offset + 0x08)(dst); \ usw t3, (offset + 0x0c)(dst) .align 5 LEAF(memmove) addu t0, a0, a2 sltu t0, a1, t0 # dst + len <= src -> memcpy addu t1, a1, a2 sltu t1, a0, t1 # dst >= src + len -> memcpy and t0, t1 beqz t0, __memcpy move v0, a0 /* return value */ beqz a2, r_out END(memmove) LEAF(__rmemcpy) /* a0=dst a1=src a2=len */ sltu t0, a1, a0 beqz t0, r_end_bytes_up # src >= dst nop addu a0, a2 # dst = dst + len addu a1, a2 # src = src + len #if 0 /* Horror fix */ xor t0, a0, a1 andi t0, t0, 0x3 move t7, a0 beqz t0, r_can_align sltiu t8, a2, 0x8 b r_memcpy_u_src # bad alignment move t2, a2 r_can_align: bnez t8, r_small_memcpy # < 8 bytes to copy move t2, a2 beqz a2, r_out andi t8, a1, 0x1 r_hword_align: beqz t8, r_word_align andi t8, a1, 0x2 lb t0, -1(a1) subu a2, a2, 0x1 sb t0, -1(a0) subu a1, a1, 0x1 subu a0, a0, 0x1 andi t8, a1, 0x2 r_word_align: beqz t8, r_dword_align sltiu t8, a2, 56 lh t0, -2(a1) subu a2, a2, 0x2 sh t0, -2(a0) sltiu t8, a2, 56 subu a0, a0, 0x2 subu a1, a1, 0x2 r_dword_align: bnez t8, r_do_end_words move t8, a2 andi t8, a1, 0x4 beqz t8, r_qword_align andi t8, a1, 0x8 lw t0, -4(a1) subu a2, a2, 0x4 sw t0, -4(a0) subu a1, a1, 0x4 subu a0, a0, 0x4 andi t8, a1, 0x8 r_qword_align: beqz t8, r_oword_align andi t8, a1, 0x10 subu a1, a1, 0x8 lw t0, 0x04(a1) lw t1, 0x00(a1) subu a0, a0, 0x8 sw t0, 0x04(a0) sw t1, 0x00(a0) subu a2, a2, 0x8 andi t8, a1, 0x10 r_oword_align: beqz t8, r_begin_movement srl t8, a2, 0x7 subu a1, a1, 0x10 lw t3, 0x08(a1) # assumes subblock ordering lw t4, 0x0c(a1) lw t0, 0x00(a1) lw t1, 0x04(a1) subu a0, a0, 0x10 sw t3, 0x08(a0) sw t4, 0x0c(a0) sw t0, 0x00(a0) sw t1, 0x04(a0) subu a2, a2, 0x10 srl t8, a2, 0x7 r_begin_movement: beqz t8, 0f andi t2, a2, 0x40 r_move_128bytes: RMOVE_BIGCHUNK(a1, a0, -0x80, t0, t1, t3, t4) RMOVE_BIGCHUNK(a1, a0, -0x60, t0, t1, t3, t4) RMOVE_BIGCHUNK(a1, a0, -0x40, t0, t1, t3, t4) RMOVE_BIGCHUNK(a1, a0, -0x20, t0, t1, t3, t4) subu t8, t8, 0x01 subu a1, a1, 0x80 bnez t8, r_move_128bytes subu a0, a0, 0x80 0: beqz t2, 1f andi t2, a2, 0x20 r_move_64bytes: subu a1, a1, 0x40 subu a0, a0, 0x40 RMOVE_BIGCHUNK(a1, a0, 0x20, t0, t1, t3, t4) RMOVE_BIGCHUNK(a1, a0, 0x00, t0, t1, t3, t4) 1: beqz t2, r_do_end_words andi t8, a2, 0x1c r_move_32bytes: subu a1, a1, 0x20 subu a0, a0, 0x20 RMOVE_BIGCHUNK(a1, a0, 0x00, t0, t1, t3, t4) andi t8, a2, 0x1c r_do_end_words: beqz t8, r_maybe_end_cruft srl t8, t8, 0x2 r_end_words: lw t0, -4(a1) subu t8, t8, 0x1 sw t0, -4(a0) subu a1, a1, 0x4 bnez t8, r_end_words subu a0, a0, 0x4 r_maybe_end_cruft: andi t2, a2, 0x3 r_small_memcpy: beqz t2, r_out move a2, t2 #endif /* Horror fix */ r_end_bytes: lb t0, -1(a1) subu a2, a2, 0x1 sb t0, -1(a0) subu a1, a1, 0x1 bnez a2, r_end_bytes subu a0, a0, 0x1 r_out: jr ra move a2, zero r_end_bytes_up: lb t0, (a1) subu a2, a2, 0x1 sb t0, (a0) addu a1, a1, 0x1 bnez a2, r_end_bytes_up addu a0, a0, 0x1 jr ra move a2, zero #if 0 /* Horror fix */ /* ------------------------------------------------------------------------- */ /* Bad, bad. At least try to align the source */ r_memcpy_u_src: bnez t8, r_small_memcpy # < 8 bytes? move t2, a2 andi t0, a1, 7 # t0: how much to align ulw t1, -8(a1) # dword alignment ulw t2, -4(a1) usw t1, -8(a0) usw t2, -4(a0) subu a1, t0 # src subu a0, t0 # dst subu a2, t0 # len sltiu t8, a2, 56 bnez t8, ru_do_end_words andi t8, a2, 0x3c andi t8, a1, 8 # now qword aligned? ru_qword_align: beqz t8, ru_oword_align andi t8, a1, 0x10 subu a1, a1, 0x8 lw t0, 0x00(a1) lw t1, 0x04(a1) subu a0, a0, 0x8 usw t0, 0x00(a0) usw t1, 0x04(a0) subu a2, a2, 0x8 andi t8, a1, 0x10 ru_oword_align: beqz t8, ru_begin_movement srl t8, a2, 0x7 subu a1, a1, 0x10 lw t3, 0x08(a1) # assumes subblock ordering lw t4, 0x0c(a1) lw t0, 0x00(a1) lw t1, 0x04(a1) subu a0, a0, 0x10 usw t3, 0x08(a0) usw t4, 0x0c(a0) usw t0, 0x00(a0) usw t1, 0x04(a0) subu a2, a2, 0x10 srl t8, a2, 0x7 ru_begin_movement: beqz t8, 0f andi t2, a2, 0x40 ru_move_128bytes: RUMOVE_BIGCHUNK(a1, a0, -0x80, t0, t1, t3, t4) RUMOVE_BIGCHUNK(a1, a0, -0x60, t0, t1, t3, t4) RUMOVE_BIGCHUNK(a1, a0, -0x40, t0, t1, t3, t4) RUMOVE_BIGCHUNK(a1, a0, -0x20, t0, t1, t3, t4) subu t8, t8, 0x01 subu a1, a1, 0x80 bnez t8, ru_move_128bytes subu a0, a0, 0x80 0: beqz t2, 1f andi t2, a2, 0x20 ru_move_64bytes: subu a1, a1, 0x40 subu a0, a0, 0x40 RUMOVE_BIGCHUNK(a1, a0, 0x20, t0, t1, t3, t4) RUMOVE_BIGCHUNK(a1, a0, 0x00, t0, t1, t3, t4) 1: beqz t2, ru_do_end_words andi t8, a2, 0x1c ru_move_32bytes: subu a1, a1, 0x20 subu a0, a0, 0x20 RUMOVE_BIGCHUNK(a1, a0, 0x00, t0, t1, t3, t4) andi t8, a2, 0x1c ru_do_end_words: beqz t8, ru_maybe_end_cruft srl t8, t8, 0x2 ru_end_words: lw t0, -4(a1) usw t0, -4(a0) subu t8, t8, 0x1 subu a1, a1, 0x4 bnez t8, ru_end_words subu a0, a0, 0x4 ru_maybe_end_cruft: andi t2, a2, 0x3 ru_cannot_optimize: beqz t2, r_out move a2, t2 ru_end_bytes: lb t0, -1(a1) subu a2, a2, 0x1 sb t0, -1(a0) subu a1, a1, 0x1 bnez a2, ru_end_bytes subu a0, a0, 0x1 jr ra move a2, zero #endif /* Horror fix */ END(__rmemcpy) l_fixup: # clear the rest of the buffer lw t0, THREAD_BUADDR($28) nop subu a2, AT, t0 # a2 bytes to go addu a0, t0 # compute start address in a1 subu a0, a1 j __bzero move a1, zero s_fixup: jr ra nop |
From: James S. <jsi...@us...> - 2001-10-11 22:17:23
|
Update of /cvsroot/linux-mips/linux/arch/mips/kernel In directory usw-pr-cvs1:/tmp/cvs-serv11663 Modified Files: smp.c Log Message: Copyright notice stuff. Index: smp.c =================================================================== RCS file: /cvsroot/linux-mips/linux/arch/mips/kernel/smp.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- smp.c 2001/10/09 21:37:55 1.3 +++ smp.c 2001/10/11 22:17:20 1.4 @@ -1,10 +1,5 @@ /* - * - * arch/mips/kernel/smp.c - * - * Copyright (C) 2000 Sibyte - * - * Written by Justin Carlson (ca...@si...) + * Copyright (C) 2000, 2001 Broadcom Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -19,8 +14,8 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * */ + #include <linux/config.h> #include <linux/init.h> #include <linux/spinlock.h> |
From: James S. <jsi...@us...> - 2001-10-11 22:11:39
|
Update of /cvsroot/linux-mips/linux/arch/mips/kernel In directory usw-pr-cvs1:/tmp/cvs-serv10166 Added Files: signal.c Log Message: Return __NR_sigreturn to user. --- NEW FILE: signal.c --- /* * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (C) 1991, 1992 Linus Torvalds * Copyright (C) 1994 - 1999 Ralf Baechle * Copyright (C) 1999 Silicon Graphics, Inc. */ #include <linux/config.h> #include <linux/sched.h> #include <linux/mm.h> #include <linux/smp.h> #include <linux/smp_lock.h> #include <linux/kernel.h> #include <linux/signal.h> #include <linux/errno.h> #include <linux/wait.h> #include <linux/ptrace.h> #include <linux/unistd.h> #include <asm/asm.h> #include <asm/bitops.h> #include <asm/pgalloc.h> #include <asm/stackframe.h> #include <asm/uaccess.h> #include <asm/ucontext.h> #define DEBUG_SIG 0 #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) extern asmlinkage int do_signal(sigset_t *oldset, struct pt_regs *regs); extern asmlinkage int (*save_fp_context)(struct sigcontext *sc); extern asmlinkage int (*restore_fp_context)(struct sigcontext *sc); extern asmlinkage void syscall_trace(void); int copy_siginfo_to_user(siginfo_t *to, siginfo_t *from) { if (!access_ok (VERIFY_WRITE, to, sizeof(siginfo_t))) return -EFAULT; if (from->si_code < 0) return __copy_to_user(to, from, sizeof(siginfo_t)); else { int err; /* If you change siginfo_t structure, please be sure this code is fixed accordingly. It should never copy any pad contained in the structure to avoid security leaks, but must copy the generic 3 ints plus the relevant union member. */ err = __put_user(from->si_signo, &to->si_signo); err |= __put_user(from->si_errno, &to->si_errno); err |= __put_user((short)from->si_code, &to->si_code); /* First 32bits of unions are always present. */ err |= __put_user(from->si_pid, &to->si_pid); switch (from->si_code >> 16) { case __SI_FAULT >> 16: break; case __SI_CHLD >> 16: err |= __put_user(from->si_utime, &to->si_utime); err |= __put_user(from->si_stime, &to->si_stime); err |= __put_user(from->si_status, &to->si_status); default: err |= __put_user(from->si_uid, &to->si_uid); break; /* case __SI_RT: This is not generated by the kernel as of now. */ } return err; } } /* * Atomically swap in the new signal mask, and wait for a signal. */ save_static_function(sys_sigsuspend); static_unused int _sys_sigsuspend(struct pt_regs regs) { sigset_t *uset, saveset, newset; uset = (sigset_t *) regs.regs[4]; if (copy_from_user(&newset, uset, sizeof(sigset_t))) return -EFAULT; sigdelsetmask(&newset, ~_BLOCKABLE); spin_lock_irq(¤t->sigmask_lock); saveset = current->blocked; current->blocked = newset; recalc_sigpending(current); spin_unlock_irq(¤t->sigmask_lock); regs.regs[2] = EINTR; regs.regs[7] = 1; while (1) { current->state = TASK_INTERRUPTIBLE; schedule(); if (do_signal(&saveset, ®s)) return -EINTR; } } save_static_function(sys_rt_sigsuspend); static_unused int _sys_rt_sigsuspend(struct pt_regs regs) { sigset_t *unewset, saveset, newset; size_t sigsetsize; /* XXX Don't preclude handling different sized sigset_t's. */ sigsetsize = regs.regs[5]; if (sigsetsize != sizeof(sigset_t)) return -EINVAL; unewset = (sigset_t *) regs.regs[4]; if (copy_from_user(&newset, unewset, sizeof(newset))) return -EFAULT; sigdelsetmask(&newset, ~_BLOCKABLE); spin_lock_irq(¤t->sigmask_lock); saveset = current->blocked; current->blocked = newset; recalc_sigpending(current); spin_unlock_irq(¤t->sigmask_lock); regs.regs[2] = EINTR; regs.regs[7] = 1; while (1) { current->state = TASK_INTERRUPTIBLE; schedule(); if (do_signal(&saveset, ®s)) return -EINTR; } } asmlinkage int sys_sigaction(int sig, const struct sigaction *act, struct sigaction *oact) { struct k_sigaction new_ka, old_ka; int ret; int err = 0; if (act) { old_sigset_t mask; if (!access_ok(VERIFY_READ, act, sizeof(*act))) return -EFAULT; err |= __get_user(new_ka.sa.sa_handler, &act->sa_handler); err |= __get_user(new_ka.sa.sa_flags, &act->sa_flags); err |= __get_user(mask, &act->sa_mask.sig[0]); err |= __get_user(new_ka.sa.sa_restorer, &act->sa_restorer); if (err) return -EFAULT; siginitset(&new_ka.sa.sa_mask, mask); } ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); if (!ret && oact) { if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact))) return -EFAULT; err |= __put_user(old_ka.sa.sa_flags, &oact->sa_flags); err |= __put_user(old_ka.sa.sa_handler, &oact->sa_handler); err |= __put_user(old_ka.sa.sa_mask.sig[0], oact->sa_mask.sig); err |= __put_user(0, &oact->sa_mask.sig[1]); err |= __put_user(0, &oact->sa_mask.sig[2]); err |= __put_user(0, &oact->sa_mask.sig[3]); err |= __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer); if (err) return -EFAULT; } return ret; } asmlinkage int sys_sigaltstack(struct pt_regs regs) { const stack_t *uss = (const stack_t *) regs.regs[4]; stack_t *uoss = (stack_t *) regs.regs[5]; unsigned long usp = regs.regs[29]; return do_sigaltstack(uss, uoss, usp); } asmlinkage int restore_sigcontext(struct pt_regs *regs, struct sigcontext *sc) { int owned_fp; int err = 0; u64 reg; err |= __get_user(regs->cp0_epc, &sc->sc_pc); err |= __get_user(reg, &sc->sc_mdhi); regs->hi = (int) reg; err |= __get_user(reg, &sc->sc_mdlo); regs->lo = (int) reg; #define restore_gp_reg(i) do { \ err |= __get_user(reg, &sc->sc_regs[i]); \ regs->regs[i] = reg; \ } while(0); restore_gp_reg( 1); restore_gp_reg( 2); restore_gp_reg( 3); restore_gp_reg( 4); restore_gp_reg( 5); restore_gp_reg( 6); restore_gp_reg( 7); restore_gp_reg( 8); restore_gp_reg( 9); restore_gp_reg(10); restore_gp_reg(11); restore_gp_reg(12); restore_gp_reg(13); restore_gp_reg(14); restore_gp_reg(15); restore_gp_reg(16); restore_gp_reg(17); restore_gp_reg(18); restore_gp_reg(19); restore_gp_reg(20); restore_gp_reg(21); restore_gp_reg(22); restore_gp_reg(23); restore_gp_reg(24); restore_gp_reg(25); restore_gp_reg(26); restore_gp_reg(27); restore_gp_reg(28); restore_gp_reg(29); restore_gp_reg(30); restore_gp_reg(31); #undef restore_gp_reg err |= __get_user(owned_fp, &sc->sc_ownedfp); if (owned_fp) { err |= restore_fp_context(sc); last_task_used_math = current; } return err; } struct sigframe { u32 sf_ass[4]; /* argument save space for o32 */ u32 sf_code[2]; /* signal trampoline */ struct sigcontext sf_sc; sigset_t sf_mask; }; struct rt_sigframe { u32 rs_ass[4]; /* argument save space for o32 */ u32 rs_code[2]; /* signal trampoline */ struct siginfo rs_info; struct ucontext rs_uc; }; asmlinkage void sys_sigreturn(struct pt_regs regs) { struct sigframe *frame; sigset_t blocked; frame = (struct sigframe *) regs.regs[29]; if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) goto badframe; if (__copy_from_user(&blocked, &frame->sf_mask, sizeof(blocked))) goto badframe; sigdelsetmask(&blocked, ~_BLOCKABLE); spin_lock_irq(¤t->sigmask_lock); current->blocked = blocked; recalc_sigpending(current); spin_unlock_irq(¤t->sigmask_lock); if (restore_sigcontext(®s, &frame->sf_sc)) goto badframe; /* * Don't let your children do this ... */ if (current->ptrace & PT_TRACESYS) syscall_trace(); __asm__ __volatile__( "move\t$29, %0\n\t" "j\tret_from_sys_call" :/* no outputs */ :"r" (®s)); /* Unreached */ badframe: force_sig(SIGSEGV, current); } asmlinkage void sys_rt_sigreturn(struct pt_regs regs) { struct rt_sigframe *frame; sigset_t set; stack_t st; frame = (struct rt_sigframe *) regs.regs[29]; if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) goto badframe; if (__copy_from_user(&set, &frame->rs_uc.uc_sigmask, sizeof(set))) goto badframe; sigdelsetmask(&set, ~_BLOCKABLE); spin_lock_irq(¤t->sigmask_lock); current->blocked = set; recalc_sigpending(current); spin_unlock_irq(¤t->sigmask_lock); if (restore_sigcontext(®s, &frame->rs_uc.uc_mcontext)) goto badframe; if (__copy_from_user(&st, &frame->rs_uc.uc_stack, sizeof(st))) goto badframe; /* It is more difficult to avoid calling this function than to call it and ignore errors. */ do_sigaltstack(&st, NULL, regs.regs[29]); /* * Don't let your children do this ... */ __asm__ __volatile__( "move\t$29, %0\n\t" "j\tret_from_sys_call" :/* no outputs */ :"r" (®s)); /* Unreached */ badframe: force_sig(SIGSEGV, current); } static int inline setup_sigcontext(struct pt_regs *regs, struct sigcontext *sc) { int owned_fp; int err = 0; u64 reg; err |= __put_user(regs->cp0_epc, &sc->sc_pc); err |= __put_user(regs->cp0_status, &sc->sc_status); #define save_gp_reg(i) { \ reg = regs->regs[i]; \ err |= __put_user(reg, &sc->sc_regs[i]); \ } while(0) __put_user(0, &sc->sc_regs[0]); save_gp_reg(1); save_gp_reg(2); save_gp_reg(3); save_gp_reg(4); save_gp_reg(5); save_gp_reg(6); save_gp_reg(7); save_gp_reg(8); save_gp_reg(9); save_gp_reg(10); save_gp_reg(11); save_gp_reg(12); save_gp_reg(13); save_gp_reg(14); save_gp_reg(15); save_gp_reg(16); save_gp_reg(17); save_gp_reg(18); save_gp_reg(19); save_gp_reg(20); save_gp_reg(21); save_gp_reg(22); save_gp_reg(23); save_gp_reg(24); save_gp_reg(25); save_gp_reg(26); save_gp_reg(27); save_gp_reg(28); save_gp_reg(29); save_gp_reg(30); save_gp_reg(31); #undef save_gp_reg err |= __put_user(regs->hi, &sc->sc_mdhi); err |= __put_user(regs->lo, &sc->sc_mdlo); err |= __put_user(regs->cp0_cause, &sc->sc_cause); err |= __put_user(regs->cp0_badvaddr, &sc->sc_badvaddr); owned_fp = (current == last_task_used_math); err |= __put_user(owned_fp, &sc->sc_ownedfp); if (current->used_math) { /* fp is active. */ set_cp0_status(ST0_CU1); err |= save_fp_context(sc); last_task_used_math = NULL; regs->cp0_status &= ~ST0_CU1; current->used_math = 0; } return err; } /* * Determine which stack to use.. */ static inline void * get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size) { unsigned long sp; /* Default to using normal stack */ sp = regs->regs[29]; /* This is the X/Open sanctioned signal stack switching. */ if ((ka->sa.sa_flags & SA_ONSTACK) && ! on_sig_stack(sp)) sp = current->sas_ss_sp + current->sas_ss_size; return (void *)((sp - frame_size) & ALMASK); } static void inline setup_frame(struct k_sigaction * ka, struct pt_regs *regs, int signr, sigset_t *set) { struct sigframe *frame; int err = 0; frame = get_sigframe(ka, regs, sizeof(*frame)); if (!access_ok(VERIFY_WRITE, frame, sizeof (*frame))) goto give_sigsegv; /* Set up to return from userspace. If provided, use a stub already in userspace. */ if (ka->sa.sa_flags & SA_RESTORER) regs->regs[31] = (unsigned long) ka->sa.sa_restorer; else { /* * Set up the return code ... * * li v0, __NR_sigreturn * syscall */ err |= __put_user(0x24020000 + __NR_sigreturn, frame->sf_code + 0); err |= __put_user(0x0000000c , frame->sf_code + 1); flush_cache_sigtramp((unsigned long) frame->sf_code); } err |= setup_sigcontext(regs, &frame->sf_sc); err |= __copy_to_user(&frame->sf_mask, set, sizeof(*set)); if (err) goto give_sigsegv; /* * Arguments to signal handler: * * a0 = signal number * a1 = 0 (should be cause) * a2 = pointer to struct sigcontext * * $25 and c0_epc point to the signal handler, $29 points to the * struct sigframe. */ regs->regs[ 4] = signr; regs->regs[ 5] = 0; regs->regs[ 6] = (unsigned long) &frame->sf_sc; regs->regs[29] = (unsigned long) frame; regs->regs[31] = (unsigned long) frame->sf_code; regs->cp0_epc = regs->regs[25] = (unsigned long) ka->sa.sa_handler; #if DEBUG_SIG printk("SIG deliver (%s:%d): sp=0x%p pc=0x%p ra=0x%p\n", current->comm, current->pid, frame, regs->cp0_epc, frame->code); #endif return; give_sigsegv: if (signr == SIGSEGV) ka->sa.sa_handler = SIG_DFL; force_sig(SIGSEGV, current); } static void inline setup_rt_frame(struct k_sigaction * ka, struct pt_regs *regs, int signr, sigset_t *set, siginfo_t *info) { struct rt_sigframe *frame; int err = 0; frame = get_sigframe(ka, regs, sizeof(*frame)); if (!access_ok(VERIFY_WRITE, frame, sizeof (*frame))) goto give_sigsegv; /* Set up to return from userspace. If provided, use a stub already in userspace. */ if (ka->sa.sa_flags & SA_RESTORER) regs->regs[31] = (unsigned long) ka->sa.sa_restorer; else { /* * Set up the return code ... * * li v0, __NR_rt_sigreturn * syscall */ err |= __put_user(0x24020000 + __NR_rt_sigreturn, frame->rs_code + 0); err |= __put_user(0x0000000c , frame->rs_code + 1); flush_cache_sigtramp((unsigned long) frame->rs_code); } /* Create siginfo. */ err |= copy_siginfo_to_user(&frame->rs_info, info); /* Create the ucontext. */ err |= __put_user(0, &frame->rs_uc.uc_flags); err |= __put_user(0, &frame->rs_uc.uc_link); err |= __put_user((void *)current->sas_ss_sp, &frame->rs_uc.uc_stack.ss_sp); err |= __put_user(sas_ss_flags(regs->regs[29]), &frame->rs_uc.uc_stack.ss_flags); err |= __put_user(current->sas_ss_size, &frame->rs_uc.uc_stack.ss_size); err |= setup_sigcontext(regs, &frame->rs_uc.uc_mcontext); err |= __copy_to_user(&frame->rs_uc.uc_sigmask, set, sizeof(*set)); if (err) goto give_sigsegv; /* * Arguments to signal handler: * * a0 = signal number * a1 = 0 (should be cause) * a2 = pointer to ucontext * * $25 and c0_epc point to the signal handler, $29 points to * the struct rt_sigframe. */ regs->regs[ 4] = signr; regs->regs[ 5] = (unsigned long) &frame->rs_info; regs->regs[ 6] = (unsigned long) &frame->rs_uc; regs->regs[29] = (unsigned long) frame; regs->regs[31] = (unsigned long) frame->rs_code; regs->cp0_epc = regs->regs[25] = (unsigned long) ka->sa.sa_handler; #if DEBUG_SIG printk("SIG deliver (%s:%d): sp=0x%p pc=0x%p ra=0x%p\n", current->comm, current->pid, frame, regs->cp0_epc, frame->code); #endif return; give_sigsegv: if (signr == SIGSEGV) ka->sa.sa_handler = SIG_DFL; force_sig(SIGSEGV, current); } static inline void handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info, sigset_t *oldset, struct pt_regs * regs) { if (ka->sa.sa_flags & SA_SIGINFO) setup_rt_frame(ka, regs, sig, oldset, info); else setup_frame(ka, regs, sig, oldset); if (ka->sa.sa_flags & SA_ONESHOT) ka->sa.sa_handler = SIG_DFL; if (!(ka->sa.sa_flags & SA_NODEFER)) { spin_lock_irq(¤t->sigmask_lock); sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask); sigaddset(¤t->blocked,sig); recalc_sigpending(current); spin_unlock_irq(¤t->sigmask_lock); } } static inline void syscall_restart(struct pt_regs *regs, struct k_sigaction *ka) { switch(regs->regs[0]) { case ERESTARTNOHAND: regs->regs[2] = EINTR; break; case ERESTARTSYS: if(!(ka->sa.sa_flags & SA_RESTART)) { regs->regs[2] = EINTR; break; } /* fallthrough */ case ERESTARTNOINTR: /* Userland will reload $v0. */ regs->regs[7] = regs->regs[26]; regs->cp0_epc -= 8; } regs->regs[0] = 0; /* Don't deal with this again. */ } extern int do_irix_signal(sigset_t *oldset, struct pt_regs *regs); asmlinkage int do_signal(sigset_t *oldset, struct pt_regs *regs) { struct k_sigaction *ka; siginfo_t info; #ifdef CONFIG_BINFMT_IRIX if (current->personality != PER_LINUX) return do_irix_signal(oldset, regs); #endif if (!oldset) oldset = ¤t->blocked; for (;;) { unsigned long signr; spin_lock_irq(¤t->sigmask_lock); signr = dequeue_signal(¤t->blocked, &info); spin_unlock_irq(¤t->sigmask_lock); if (!signr) break; if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) { /* Let the debugger run. */ current->exit_code = signr; current->state = TASK_STOPPED; notify_parent(current, SIGCHLD); schedule(); /* We're back. Did the debugger cancel the sig? */ if (!(signr = current->exit_code)) continue; current->exit_code = 0; /* The debugger continued. Ignore SIGSTOP. */ if (signr == SIGSTOP) continue; /* Update the siginfo structure. Is this good? */ if (signr != info.si_signo) { info.si_signo = signr; info.si_errno = 0; info.si_code = SI_USER; info.si_pid = current->p_pptr->pid; info.si_uid = current->p_pptr->uid; } /* If the (new) signal is now blocked, requeue it. */ if (sigismember(¤t->blocked, signr)) { send_sig_info(signr, &info, current); continue; } } ka = ¤t->sig->action[signr-1]; if (ka->sa.sa_handler == SIG_IGN) { if (signr != SIGCHLD) continue; /* Check for SIGCHLD: it's special. */ while (sys_wait4(-1, NULL, WNOHANG, NULL) > 0) /* nothing */; continue; } if (ka->sa.sa_handler == SIG_DFL) { int exit_code = signr; /* Init gets no signals it doesn't want. */ if (current->pid == 1) continue; switch (signr) { case SIGCONT: case SIGCHLD: case SIGWINCH: continue; case SIGTSTP: case SIGTTIN: case SIGTTOU: if (is_orphaned_pgrp(current->pgrp)) continue; /* FALLTHRU */ case SIGSTOP: current->state = TASK_STOPPED; current->exit_code = signr; if (!(current->p_pptr->sig->action[SIGCHLD-1].sa.sa_flags & SA_NOCLDSTOP)) notify_parent(current, SIGCHLD); schedule(); continue; case SIGQUIT: case SIGILL: case SIGTRAP: case SIGABRT: case SIGFPE: case SIGSEGV: case SIGBUS: case SIGSYS: case SIGXCPU: case SIGXFSZ: if (do_coredump(signr, regs)) exit_code |= 0x80; /* FALLTHRU */ default: sigaddset(¤t->pending.signal, signr); recalc_sigpending(current); current->flags |= PF_SIGNALED; do_exit(exit_code); /* NOTREACHED */ } } if (regs->regs[0]) syscall_restart(regs, ka); /* Whee! Actually deliver the signal. */ handle_signal(signr, ka, &info, oldset, regs); return 1; } /* * Who's code doesn't conform to the restartable syscall convention * dies here!!! The li instruction, a single machine instruction, * must directly be followed by the syscall instruction. */ if (regs->regs[0]) { if (regs->regs[2] == ERESTARTNOHAND || regs->regs[2] == ERESTARTSYS || regs->regs[2] == ERESTARTNOINTR) { regs->regs[7] = regs->regs[26]; regs->cp0_epc -= 8; } } return 0; } |
From: James S. <jsi...@us...> - 2001-10-11 22:02:48
|
Update of /cvsroot/linux-mips/linux/arch/mips In directory usw-pr-cvs1:/tmp/cvs-serv7888 Modified Files: defconfig Log Message: Added debug option. Index: defconfig =================================================================== RCS file: /cvsroot/linux-mips/linux/arch/mips/defconfig,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- defconfig 2001/10/02 18:35:47 1.9 +++ defconfig 2001/10/11 22:02:46 1.10 @@ -527,5 +527,6 @@ # Kernel hacking # CONFIG_CROSSCOMPILE=y +# CONFIG_DEBUG is not set # CONFIG_MAGIC_SYSRQ is not set # CONFIG_MIPS_UNCACHED is not set |
From: James S. <jsi...@us...> - 2001-10-11 22:01:31
|
Update of /cvsroot/linux-mips/linux/arch/mips/dec In directory usw-pr-cvs1:/tmp/cvs-serv7597 Added Files: reset.c Log Message: Bye to dec_intr_halt --- NEW FILE: reset.c --- /* * Reset a DECstation machine. */ void (*back_to_prom)(void) = (void (*)(void))0xBFC00000; void dec_machine_restart(char *command) { back_to_prom(); } void dec_machine_halt(void) { back_to_prom(); } void dec_machine_power_off(void) { /* DECstations don't have a software power switch */ back_to_prom(); } void dec_intr_halt(int irq, void *dev_id, struct pt_regs *regs) { dec_machine_halt(); } |