CVS commit: [matt-nb5-mips64] src/sys/arch/mips/mips
Module Name:src Committed By: cliff Date: Fri Nov 13 05:25:16 UTC 2009 Modified Files: src/sys/arch/mips/mips [matt-nb5-mips64]: mipsX_subr.S Log Message: - KSEG and XK labels, useful for address representation in ddb, moved here from RMI specific code - replace .word XXX with proper mnemonics for mfcr ops in cacheException now that binutils knows these ops To generate a diff of this commit: cvs rdiff -u -r1.26.36.1.2.10 -r1.26.36.1.2.11 \ src/sys/arch/mips/mips/mipsX_subr.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/mips/mipsX_subr.S diff -u src/sys/arch/mips/mips/mipsX_subr.S:1.26.36.1.2.10 src/sys/arch/mips/mips/mipsX_subr.S:1.26.36.1.2.11 --- src/sys/arch/mips/mips/mipsX_subr.S:1.26.36.1.2.10 Mon Nov 9 10:01:14 2009 +++ src/sys/arch/mips/mips/mipsX_subr.S Fri Nov 13 05:25:15 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: mipsX_subr.S,v 1.26.36.1.2.10 2009/11/09 10:01:14 cliff Exp $ */ +/* $NetBSD: mipsX_subr.S,v 1.26.36.1.2.11 2009/11/13 05:25:15 cliff Exp $ */ /* * Copyright 2002 Wasabi Systems, Inc. @@ -301,6 +301,27 @@ /* + * some useful labels for debugging + */ +.global mips_kseg0 +.equiv mips_kseg0, MIPS_KSEG0_START +.global mips_kseg1 +.equiv mips_kseg1, MIPS_KSEG1_START +.global mips_kseg2 +.equiv mips_kseg2, MIPS_KSEG2_START +.global mips_xkphys +.equiv mips_xkphys, MIPS_XKPHYS_START +.global mips_xkphys_u +.equiv mips_xkphys_u, MIPS_XKPHYS_UNCACHED +.global mips_xkphys_cca3 +.equiv mips_xkphys_cca3, MIPS_XKPHYS_CCA3 +.global mips_xkphys_cca4 +.equiv mips_xkphys_cca4, MIPS_XKPHYS_CCA4 +.global mips_xkseg +.equiv mips_xkseg, MIPS_XKSEG_START + + +/* * * * mips3_TLBMiss -- @@ -1055,9 +1076,9 @@ _MFC0 a1, MIPS_COP_0_ERROR_PC #if defined(MIPS64_XLS) li k1, 0x309 /* L1D_CACHE_ERROR_LOG */ - .word 0x73660018 /* mfcr a2, k1 */ + mfcr a2, k1 li k1, 0x30b /* L1D_CACHE_INTERRUPT */ - .word 0x73670018 /* mfcr a3, k1 */ + mfcr a3, k1 mfc0 a4, MIPS_COP_0_STATUS mfc0 a5, MIPS_COP_0_CAUSE #else
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/mips
Module Name:src Committed By: cliff Date: Fri Nov 13 05:25:50 UTC 2009 Modified Files: src/sys/arch/mips/mips [matt-nb5-mips64]: mips_machdep.c Log Message: - pridtab definition is removed to cpu.h - pritab entries now initialize cpu_cp0flags and cpu_cidflags except for RMI XLS entries, these are all 0 for now. - pridtab entries for RMI XLS use those new fields and CPU_MIPS_HAVE_MxCR To generate a diff of this commit: cvs rdiff -u -r1.205.4.1.2.1.2.16 -r1.205.4.1.2.1.2.17 \ src/sys/arch/mips/mips/mips_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/mips/mips_machdep.c diff -u src/sys/arch/mips/mips/mips_machdep.c:1.205.4.1.2.1.2.16 src/sys/arch/mips/mips/mips_machdep.c:1.205.4.1.2.1.2.17 --- src/sys/arch/mips/mips/mips_machdep.c:1.205.4.1.2.1.2.16 Tue Nov 3 16:30:58 2009 +++ src/sys/arch/mips/mips/mips_machdep.c Fri Nov 13 05:25:49 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.16 2009/11/03 16:30:58 uebayasi Exp $ */ +/* $NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.17 2009/11/13 05:25:49 cliff Exp $ */ /* * Copyright 2002 Wasabi Systems, Inc. @@ -112,7 +112,7 @@ #include sys/cdefs.h /* RCS ID Copyright macro defns */ -__KERNEL_RCSID(0, $NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.16 2009/11/03 16:30:58 uebayasi Exp $); +__KERNEL_RCSID(0, $NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.17 2009/11/13 05:25:49 cliff Exp $); #include opt_cputype.h #include opt_compat_netbsd32.h @@ -153,6 +153,7 @@ #include mips/frame.h #include mips/regnum.h +#include mips/cpu.h #include mips/locore.h #include mips/psl.h #include mips/pte.h @@ -235,16 +236,6 @@ char machine_arch[] = MACHINE_ARCH; /* from machine/param.h */ char cpu_model[128]; -struct pridtab { - int cpu_cid; - int cpu_pid; - int cpu_rev; /* -1 == wildcard */ - int cpu_copts; /* -1 == wildcard */ - int cpu_isa; /* -1 == probed (mips32/mips64) */ - int cpu_ntlb; /* -1 == unknown, 0 == probed */ - int cpu_flags; - const char *cpu_name; -}; /* * Assumptions: @@ -260,19 +251,19 @@ #define MIPS32_FLAGS CPU_MIPS_R4K_MMU | CPU_MIPS_CAUSE_IV | CPU_MIPS_USE_WAIT #define MIPS64_FLAGS MIPS32_FLAGS /* same as MIPS32 flags (for now) */ -static const struct pridtab *mycpu; +const struct pridtab *mycpu; static const struct pridtab cputab[] = { { 0, MIPS_R2000, -1, -1, CPU_ARCH_MIPS1, 64, - CPU_MIPS_NO_LLSC, MIPS R2000 CPU }, + CPU_MIPS_NO_LLSC, 0, 0, MIPS R2000 CPU }, { 0, MIPS_R3000, MIPS_REV_R2000A, -1, CPU_ARCH_MIPS1, 64, - CPU_MIPS_NO_LLSC, MIPS R2000A CPU }, + CPU_MIPS_NO_LLSC, 0, 0, MIPS R2000A CPU }, { 0, MIPS_R3000, MIPS_REV_R3000, -1, CPU_ARCH_MIPS1, 64, - CPU_MIPS_NO_LLSC, MIPS R3000 CPU }, + CPU_MIPS_NO_LLSC, 0, 0, MIPS R3000 CPU }, { 0, MIPS_R3000, MIPS_REV_R3000A, -1, CPU_ARCH_MIPS1, 64, - CPU_MIPS_NO_LLSC, MIPS R3000A CPU }, + CPU_MIPS_NO_LLSC, 0, 0, MIPS R3000A CPU }, { 0, MIPS_R6000, -1, -1, CPU_ARCH_MIPS2, 32, - MIPS_NOT_SUPP, MIPS R6000 CPU }, + MIPS_NOT_SUPP, 0, 0, MIPS R6000 CPU }, /* * rev 0x00, 0x22 and 0x30 are R4000, 0x40, 0x50 and 0x60 are R4400. @@ -280,52 +271,55 @@ * 0x40 - 0xff for R4400? */ { 0, MIPS_R4000, MIPS_REV_R4000_A, -1, CPU_ARCH_MIPS3, 48, - CPU_MIPS_R4K_MMU | CPU_MIPS_DOUBLE_COUNT, + CPU_MIPS_R4K_MMU | CPU_MIPS_DOUBLE_COUNT, 0, 0, MIPS R4000 CPU }, { 0, MIPS_R4000, MIPS_REV_R4000_B, -1, CPU_ARCH_MIPS3, 48, - CPU_MIPS_R4K_MMU | CPU_MIPS_DOUBLE_COUNT, + CPU_MIPS_R4K_MMU | CPU_MIPS_DOUBLE_COUNT, 0, 0, MIPS R4000 CPU }, { 0, MIPS_R4000, MIPS_REV_R4000_C, -1, CPU_ARCH_MIPS3, 48, - CPU_MIPS_R4K_MMU | CPU_MIPS_DOUBLE_COUNT, + CPU_MIPS_R4K_MMU | CPU_MIPS_DOUBLE_COUNT, 0, 0, MIPS R4000 CPU }, { 0, MIPS_R4000, MIPS_REV_R4400_A, -1, CPU_ARCH_MIPS3, 48, - CPU_MIPS_R4K_MMU | CPU_MIPS_DOUBLE_COUNT, + CPU_MIPS_R4K_MMU | CPU_MIPS_DOUBLE_COUNT, 0, 0, MIPS R4400 CPU }, { 0, MIPS_R4000, MIPS_REV_R4400_B, -1, CPU_ARCH_MIPS3, 48, - CPU_MIPS_R4K_MMU | CPU_MIPS_DOUBLE_COUNT, + CPU_MIPS_R4K_MMU | CPU_MIPS_DOUBLE_COUNT, 0, 0, MIPS R4400 CPU }, { 0, MIPS_R4000, MIPS_REV_R4400_C, -1, CPU_ARCH_MIPS3, 48, - CPU_MIPS_R4K_MMU | CPU_MIPS_DOUBLE_COUNT, + CPU_MIPS_R4K_MMU | CPU_MIPS_DOUBLE_COUNT, 0, 0, MIPS R4400 CPU }, { 0, MIPS_R3LSI, -1, -1, CPU_ARCH_MIPS1, -1, - MIPS_NOT_SUPP, LSI Logic R3000 derivative }, + MIPS_NOT_SUPP, 0, 0, LSI Logic R3000 derivative }, { 0, MIPS_R6000A, -1, -1, CPU_ARCH_MIPS2, 32, - MIPS_NOT_SUPP, MIPS R6000A CPU }, + MIPS_NOT_SUPP, 0, 0, MIPS R6000A CPU }, { 0, MIPS_R3IDT, -1, -1, CPU_ARCH_MIPS1, -1, - MIPS_NOT_SUPP, IDT R3041 or RC36100 CPU }, + MIPS_NOT_SUPP, 0, 0, IDT R3041 or RC36100 CPU }, { 0, MIPS_R4100, -1, -1, CPU_ARCH_MIPS3, 32, - CPU_MIPS_R4K_MMU | CPU_MIPS_NO_LLSC, NEC VR4100 CPU }, + CPU_MIPS_R4K_MMU | CPU_MIPS_NO_LLSC, 0, 0, + NEC VR4100 CPU }, {
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/rmi
Module Name:src Committed By: cliff Date: Fri Nov 13 05:26:42 UTC 2009 Modified Files: src/sys/arch/mips/rmi [matt-nb5-mips64]: rmixl_comvar.h rmixl_obiovar.h Log Message: - define used to prevent recursive include gets renamed according to convention To generate a diff of this commit: cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/sys/arch/mips/rmi/rmixl_comvar.h cvs rdiff -u -r1.1.2.4 -r1.1.2.5 src/sys/arch/mips/rmi/rmixl_obiovar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/rmi/rmixl_comvar.h diff -u src/sys/arch/mips/rmi/rmixl_comvar.h:1.1.2.1 src/sys/arch/mips/rmi/rmixl_comvar.h:1.1.2.2 --- src/sys/arch/mips/rmi/rmixl_comvar.h:1.1.2.1 Sun Sep 13 03:27:38 2009 +++ src/sys/arch/mips/rmi/rmixl_comvar.h Fri Nov 13 05:26:42 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: rmixl_comvar.h,v 1.1.2.1 2009/09/13 03:27:38 cliff Exp $ */ +/* $NetBSD: rmixl_comvar.h,v 1.1.2.2 2009/11/13 05:26:42 cliff Exp $ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -29,8 +29,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef _MIPS_RMIXL_RMIXL_COMVAR_H_ -#define _MIPS_RMIXL_RMIXL_COMVAR_H_ +#ifndef _MIPS_RMI_RMIXL_COMVAR_H_ +#define _MIPS_RMI_RMIXL_COMVAR_H_ #include sys/bus.h @@ -42,4 +42,4 @@ void rmixl_puthex32(uint32_t); /* XXX DEBUG */ void rmixl_puthex64(uint64_t); /* XXX DEBUG */ -#endif /* _MIPS_RMIXL_RMIXL_COMVAR_H_ */ +#endif /* _MIPS_RMI_RMIXL_COMVAR_H_ */ Index: src/sys/arch/mips/rmi/rmixl_obiovar.h diff -u src/sys/arch/mips/rmi/rmixl_obiovar.h:1.1.2.4 src/sys/arch/mips/rmi/rmixl_obiovar.h:1.1.2.5 --- src/sys/arch/mips/rmi/rmixl_obiovar.h:1.1.2.4 Mon Nov 9 10:05:50 2009 +++ src/sys/arch/mips/rmi/rmixl_obiovar.h Fri Nov 13 05:26:42 2009 @@ -1,7 +1,7 @@ -/* $NetBSD: rmixl_obiovar.h,v 1.1.2.4 2009/11/09 10:05:50 cliff Exp $ */ +/* $NetBSD: rmixl_obiovar.h,v 1.1.2.5 2009/11/13 05:26:42 cliff Exp $ */ -#ifndef _MIPS_RMIXL_OBIOVAR_H_ -#define _MIPS_RMIXL_OBIOVAR_H_ +#ifndef _MIPS_RMI_RMIXL_OBIOVAR_H_ +#define _MIPS_RMI_RMIXL_OBIOVAR_H_ #include dev/pci/pcivar.h #include mips/bus_dma.h @@ -30,4 +30,4 @@ bus_size_t sc_size; } obio_softc_t; -#endif /* _MIPS_OMAP_RMIXL_OBIOVAR_H_ */ +#endif /* _MIPS_RMI_RMIXL_OBIOVAR_H_ */
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/rmi
Module Name:src Committed By: cliff Date: Fri Nov 13 05:27:09 UTC 2009 Modified Files: src/sys/arch/mips/rmi [matt-nb5-mips64]: rmixl_intr.c Log Message: - KASSERT this interrupt code being used on XLS family CPU To generate a diff of this commit: cvs rdiff -u -r1.1.2.4 -r1.1.2.5 src/sys/arch/mips/rmi/rmixl_intr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/rmi/rmixl_intr.c diff -u src/sys/arch/mips/rmi/rmixl_intr.c:1.1.2.4 src/sys/arch/mips/rmi/rmixl_intr.c:1.1.2.5 --- src/sys/arch/mips/rmi/rmixl_intr.c:1.1.2.4 Mon Nov 9 10:03:04 2009 +++ src/sys/arch/mips/rmi/rmixl_intr.c Fri Nov 13 05:27:09 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: rmixl_intr.c,v 1.1.2.4 2009/11/09 10:03:04 cliff Exp $ */ +/* $NetBSD: rmixl_intr.c,v 1.1.2.5 2009/11/13 05:27:09 cliff Exp $ */ /*- * Copyright (c) 2007 Ruslan Ermilov and Vsevolod Lobko. @@ -64,7 +64,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: rmixl_intr.c,v 1.1.2.4 2009/11/09 10:03:04 cliff Exp $); +__KERNEL_RCSID(0, $NetBSD: rmixl_intr.c,v 1.1.2.5 2009/11/13 05:27:09 cliff Exp $); #include opt_ddb.h @@ -78,7 +78,9 @@ #include machine/bus.h #include machine/intr.h +#include mips/cpu.h #include mips/locore.h + #include mips/rmi/rmixlreg.h #include mips/rmi/rmixlvar.h @@ -314,6 +316,8 @@ uint32_t r; int i; + KASSERT(cpu_rmixls(mycpu)); + #ifdef DIAGNOSTIC if (evbmips_intr_init_done != 0) panic(%s: evbmips_intr_init_done %d,
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/rmi
Module Name:src Committed By: cliff Date: Fri Nov 13 05:27:30 UTC 2009 Modified Files: src/sys/arch/mips/rmi [matt-nb5-mips64]: rmixlvar.h Log Message: - add inline to simplify recognizing RMI Company ID - add inlines to simplify use of RMI company specific flags in pridtab entry To generate a diff of this commit: cvs rdiff -u -r1.1.2.5 -r1.1.2.6 src/sys/arch/mips/rmi/rmixlvar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/rmi/rmixlvar.h diff -u src/sys/arch/mips/rmi/rmixlvar.h:1.1.2.5 src/sys/arch/mips/rmi/rmixlvar.h:1.1.2.6 --- src/sys/arch/mips/rmi/rmixlvar.h:1.1.2.5 Mon Nov 9 10:08:40 2009 +++ src/sys/arch/mips/rmi/rmixlvar.h Fri Nov 13 05:27:30 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: rmixlvar.h,v 1.1.2.5 2009/11/09 10:08:40 cliff Exp $ */ +/* $NetBSD: rmixlvar.h,v 1.1.2.6 2009/11/13 05:27:30 cliff Exp $ */ /* * Copyright 2002 Wasabi Systems, Inc. @@ -35,9 +35,49 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#ifndef _MIPS_RMI_RMIXLVAR_H_ +#define _MIPS_RMI_RMIXLVAR_H_ + +#include mips/cpu.h #include dev/pci/pcivar.h #include machine/bus.h +static inline bool +cpu_rmixl(const struct pridtab *ct) +{ + if (ct-cpu_cid == MIPS_PRID_CID_RMI) + return true; + return false; +} + +static inline bool +cpu_rmixlr(const struct pridtab *ct) +{ + u_int type = ct-cpu_cidflags MIPS_CIDFL_RMI_TYPE; + if (cpu_rmixl(ct) type == CIDFL_RMI_TYPE_XLR) + return true; + return false; +} + +static inline bool +cpu_rmixls(const struct pridtab *ct) +{ + u_int type = ct-cpu_cidflags MIPS_CIDFL_RMI_TYPE; + if (cpu_rmixl(ct) type == CIDFL_RMI_TYPE_XLS) + return true; + return false; +} + +static inline bool +cpu_rmixlp(const struct pridtab *ct) +{ + u_int type = ct-cpu_cidflags MIPS_CIDFL_RMI_TYPE; + if (cpu_rmixl(ct) type == CIDFL_RMI_TYPE_XLP) + return true; + return false; +} + + typedef enum { RMIXL_INTR_EDGE=0, RMIXL_INTR_LEVEL, @@ -83,6 +123,7 @@ extern void rmixl_addr_error_init(void); extern int rmixl_addr_error_check(void); -extern uint64_t rmixls_mfcr(u_int); -extern void rmixls_mtcr(uint64_t, u_int); +extern uint64_t rmixl_mfcr(u_int); +extern void rmixl_mtcr(uint64_t, u_int); +#endif /* _MIPS_RMI_RMIXLVAR_H_ */
CVS commit: [matt-nb5-mips64] src/sys/arch/evbmips/conf
Module Name:src Committed By: cliff Date: Mon Nov 9 09:42:33 UTC 2009 Modified Files: src/sys/arch/evbmips/conf [matt-nb5-mips64]: XLS6ATX_7A Log Message: - deconfigure DDB_COMMANDONENTER - add config's for msk0 and wm0 kernels - configure PCI - configure msk0 and wm0 PHYs - deconfigure ksyms for now to keep kernel image size small To generate a diff of this commit: cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/sys/arch/evbmips/conf/XLS6ATX_7A Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/evbmips/conf/XLS6ATX_7A diff -u src/sys/arch/evbmips/conf/XLS6ATX_7A:1.1.2.2 src/sys/arch/evbmips/conf/XLS6ATX_7A:1.1.2.3 --- src/sys/arch/evbmips/conf/XLS6ATX_7A:1.1.2.2 Fri Sep 25 22:22:27 2009 +++ src/sys/arch/evbmips/conf/XLS6ATX_7A Mon Nov 9 09:42:33 2009 @@ -1,19 +1,18 @@ # -# $NetBSD: XLS6ATX_7A,v 1.1.2.2 2009/09/25 22:22:27 cliff Exp $ +# $NetBSD: XLS6ATX_7A,v 1.1.2.3 2009/11/09 09:42:33 cliff Exp $ include arch/evbmips/conf/std.rmixl #options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident XLS6ATX_7A-$Revision: 1.1.2.2 $ +#ident XLS6ATX_7A-$Revision: 1.1.2.3 $ maxusers 32 # -# XXX obtain memsize from firmware TBD +# MEMSIZE can be used to limit memory size obtained from firmware or DRAM BARs # options MEMSIZE=0x1000 # 256MB -## options MEMSIZE=0x1 # 4GB options NOFPU # No FPU options SOFTFLOAT # emulate FPU insn @@ -23,7 +22,8 @@ # options MEMORY_DISK_IS_ROOT # force root on memory disk # options MEMORY_DISK_SERVER=0 # no userspace memory disk support # options MEMORY_DISK_ROOT_SIZE=6144 # size of memory disk, in blocks -#options MEMORY_DISK_ROOT_SIZE=16384 # size of memory disk, in blocks +# options MEMORY_DISK_ROOT_SIZE=8224 # size of memory disk, in blocks +# options MEMORY_DISK_ROOT_SIZE=16384 # size of memory disk, in blocks # Standard system options options KTRACE # system call tracing support @@ -43,8 +43,8 @@ options DDB # kernel dynamic debugger options DDB_HISTORY_SIZE=100 # enable history editing in DDB makeoptions DEBUG=-g # compile full symbol table -options SYMTAB_SPACE=0x50 # size for embedded symbol table -options DDB_COMMANDONENTER=trace;show registers +##options SYMTAB_SPACE=0x50 # size for embedded symbol table +#options DDB_COMMANDONENTER=trace;show registers options DB_MAX_LINE=-1 # Compatibility options @@ -133,7 +133,10 @@ options NFS_BOOT_DHCP -config netbsd root on ? type ? +config netbsd root on ? type ? +config netbsd-wm0 root on wm0 type nfs +config netbsd-msk0 root on msk0 type nfs +##config netbsd-md0 root on md0 type ffs mainbus0 at root @@ -141,6 +144,17 @@ obio0 at mainbus? com0 at obio0 addr 0x14000 mult 4 intr 9 options COM_REGMAP +rmixl_pcie0 at obio0 +pci0 at rmixl_pcie0 +ppb* at pci? +pci* at ppb? +wm* at pci? dev ? function ? # Intel i82546EB Gig-E +skc* at pci? dev ? function ? +sk* at skc? +mskc* at pci? dev ? function ? +msk* at mskc? +makphy* at mii? phy ? # Marvell 88E1000 PHYs +ukphy* at mii? phy ? # unknown PHY # Pseudo-devices @@ -174,7 +188,7 @@ #pseudo-device sequencer 1 # MIDI sequencer pseudo-device rnd# /dev/random kernel generator pseudo-device clockctl # user control of clock subsystem -pseudo-device ksyms# /dev/ksyms +##pseudo-device ksyms# /dev/ksyms # A pseudo device needed for Coda # also needs CODA (above) #pseudo-device vcoda 4 # coda minicache - venus comm.
CVS commit: [matt-nb5-mips64] src/sys/arch/evbmips/conf
Module Name:src Committed By: cliff Date: Mon Nov 9 09:42:59 UTC 2009 Modified Files: src/sys/arch/evbmips/conf [matt-nb5-mips64]: XLS6ATX_7A64 Log Message: - add options COMPAT_NETBSD32 to enable 32 bit binary exec support To generate a diff of this commit: cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/sys/arch/evbmips/conf/XLS6ATX_7A64 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/evbmips/conf/XLS6ATX_7A64 diff -u src/sys/arch/evbmips/conf/XLS6ATX_7A64:1.1.2.1 src/sys/arch/evbmips/conf/XLS6ATX_7A64:1.1.2.2 --- src/sys/arch/evbmips/conf/XLS6ATX_7A64:1.1.2.1 Sun Sep 13 03:27:38 2009 +++ src/sys/arch/evbmips/conf/XLS6ATX_7A64 Mon Nov 9 09:42:59 2009 @@ -1,4 +1,4 @@ -# $NetBSD: XLS6ATX_7A64,v 1.1.2.1 2009/09/13 03:27:38 cliff Exp $ +# $NetBSD: XLS6ATX_7A64,v 1.1.2.2 2009/11/09 09:42:59 cliff Exp $ # include arch/evbmips/conf/XLS6ATX_7A @@ -8,3 +8,5 @@ no options MIPS32 options EXEC_ELF64 +options COMPAT_NETBSD32 +
CVS commit: [matt-nb5-mips64] src/sys/arch/evbmips/conf
Module Name:src Committed By: cliff Date: Mon Nov 9 09:43:22 UTC 2009 Modified Files: src/sys/arch/evbmips/conf [matt-nb5-mips64]: files.rmixl Log Message: - remove pci_machdep.c, pciide_machdep.c entries, those never existed here To generate a diff of this commit: cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/sys/arch/evbmips/conf/files.rmixl Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/evbmips/conf/files.rmixl diff -u src/sys/arch/evbmips/conf/files.rmixl:1.1.2.1 src/sys/arch/evbmips/conf/files.rmixl:1.1.2.2 --- src/sys/arch/evbmips/conf/files.rmixl:1.1.2.1 Sun Sep 13 03:27:38 2009 +++ src/sys/arch/evbmips/conf/files.rmixl Mon Nov 9 09:43:22 2009 @@ -1,4 +1,4 @@ -# $NetBSD: files.rmixl,v 1.1.2.1 2009/09/13 03:27:38 cliff Exp $ +# $NetBSD: files.rmixl,v 1.1.2.2 2009/11/09 09:43:22 cliff Exp $ file arch/evbmips/rmixl/autoconf.c file arch/evbmips/rmixl/machdep.c @@ -50,8 +50,6 @@ # ## TBD -file arch/evbmips/rmixl/pci/pci_machdep.c pci -file arch/evbmips/rmixl/pci/pciide_machdep.c pciide_common device pchb attach pchb at pci
CVS commit: [matt-nb5-mips64] src/sys/arch/evbmips/rmixl
Module Name:src Committed By: cliff Date: Mon Nov 9 09:55:11 UTC 2009 Modified Files: src/sys/arch/evbmips/rmixl [matt-nb5-mips64]: machdep.c Log Message: - rmixl_physaddr_init() instantiates a fixed extent used to allocate physical address regions; allocate regions known to be occupied by DRAM or I/O BARs - physmap_print() prints the physmap as provided by boot firmware - add ram_seg_resv() to reserve regions in a phys_ram_seg_to by splitting segments where needed. - in mem_clusters_init(), if possible use avail_mem_map, else use psb_physmem_map, otherwise use MEMSIZE. avail_mem_map and psb_physmem_map can be limited w/ MEMSIZE To generate a diff of this commit: cvs rdiff -u -r1.1.2.5 -r1.1.2.6 src/sys/arch/evbmips/rmixl/machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/evbmips/rmixl/machdep.c diff -u src/sys/arch/evbmips/rmixl/machdep.c:1.1.2.5 src/sys/arch/evbmips/rmixl/machdep.c:1.1.2.6 --- src/sys/arch/evbmips/rmixl/machdep.c:1.1.2.5 Tue Sep 22 07:47:30 2009 +++ src/sys/arch/evbmips/rmixl/machdep.c Mon Nov 9 09:55:11 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.1.2.5 2009/09/22 07:47:30 cliff Exp $ */ +/* $NetBSD: machdep.c,v 1.1.2.6 2009/11/09 09:55:11 cliff Exp $ */ /* * Copyright 2001, 2002 Wasabi Systems, Inc. @@ -112,7 +112,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.1.2.5 2009/09/22 07:47:30 cliff Exp $); +__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.1.2.6 2009/11/09 09:55:11 cliff Exp $); #include opt_ddb.h #include opt_com.h @@ -132,6 +132,8 @@ #include sys/ksyms.h #include sys/bus.h #include sys/device.h +#include sys/extent.h +#include sys/malloc.h #include uvm/uvm_extern.h @@ -160,6 +162,13 @@ #include mips/rmi/rmixl_firmware.h #include mips/rmi/rmixlreg.h +#ifdef MACHDEP_DEBUG +int machdep_debug=MACHDEP_DEBUG; +# define DPRINTF(x) do { if (machdep_debug) printf x ; } while(0) +#else +# define DPRINTF(x) +#endif + #ifndef CONSFREQ # define CONSFREQ -1 /* inherit from firmware */ #endif @@ -202,6 +211,17 @@ #define RMIXLFW_INFOP_LEGAL 0x8c00 +/* + * storage for fixed extent used to allocate physical address regions + * because extent(9) start and end values are u_long, they are only + * 32 bits on a 32 bit kernel, which is insuffucuent since XLS physical + * address is 40 bits wide. So the physaddr map stores regions + * in units of megabytes. + */ +static u_long rmixl_physaddr_storage[ + EXTENT_FIXED_STORAGE_SIZE(32)/sizeof(u_long) +]; + /* For sysctl_hw. */ extern char cpu_model[]; @@ -218,13 +238,17 @@ phys_ram_seg_t mem_clusters[VM_PHYSSEG_MAX]; -int mem_cluster_cnt; +u_int mem_cluster_cnt; + void configure(void); void mach_init(int, int32_t *, void *, void *); static u_long rmixlfw_init(void *); static u_long mem_clusters_init(rmixlfw_mmap_t *, rmixlfw_mmap_t *); static void __attribute__((__noreturn__)) rmixl_exit(int); +static void rmixl_physaddr_init(void); +static u_int ram_seg_resv(phys_ram_seg_t *, u_int, u_quad_t, u_quad_t); +void rmixlfw_mmap_print(rmixlfw_mmap_t *); /* @@ -243,8 +267,9 @@ { struct rmixl_config *rcp = rmixl_configuration; void *kernend, *v; -size_t first, last; u_long memsize; + u_int vm_cluster_cnt; + phys_ram_seg_t vm_clusters[VM_PHYSSEG_MAX]; extern char edata[], end[]; /* @@ -280,6 +305,8 @@ printf(\nNetBSD/rmixl\n); printf(memsize = %#lx\n, memsize); + rmixl_physaddr_init(); + /* * Obtain the cpu frequency * Compute the number of ticks for hz. @@ -309,26 +336,48 @@ howto = 0; BOOT_FLAG(*cp, howto); - if (! howto) -printf(bootflag '%c' not recognised\n, *cp); - else + if (howto != 0) boothowto |= howto; +#ifdef DIAGNOSTIC + else +printf(bootflag '%c' not recognised\n, *cp); +#endif } } +#ifdef DIAGNOSTIC printf(boothowto %#x\n, boothowto); +#endif /* - * Load the rest of the available pages into the VM system. - */ - first = round_page(MIPS_KSEG0_TO_PHYS(kernend)); - last = mem_clusters[0].start + mem_clusters[0].size; - uvm_page_physload(atop(first), atop(last), atop(first), atop(last), - VM_FREELIST_DEFAULT); - for (int i = 1; i mem_cluster_cnt; i++) { - first = round_page(mem_clusters[i].start); - last = mem_clusters[i].start + mem_clusters[i].size; - uvm_page_physload(atop(first), atop(last), atop(first), atop(last), - VM_FREELIST_DEFAULT); + * Reserve pages from the VM system. + * to maintain mem_clusters[] as a map of raw ram, + * copy into temporary table vm_clusters[] + * work on that and use it to feed vm_physload() + */ + KASSERT(sizeof(mem_clusters) == sizeof(vm_clusters)); + memcpy(vm_clusters, mem_clusters, sizeof(vm_clusters)); + vm_cluster_cnt = mem_cluster_cnt; + + /* reserve 0..start..kernend pages */ + vm_cluster_cnt = ram_seg_resv(vm_clusters, vm_cluster_cnt, + 0,
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/include
Module Name:src Committed By: cliff Date: Mon Nov 9 09:57:27 UTC 2009 Modified Files: src/sys/arch/mips/include [matt-nb5-mips64]: cpuregs.h Log Message: - fix some RMI XLR PRID typos (comments) To generate a diff of this commit: cvs rdiff -u -r1.74.28.9 -r1.74.28.10 src/sys/arch/mips/include/cpuregs.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/include/cpuregs.h diff -u src/sys/arch/mips/include/cpuregs.h:1.74.28.9 src/sys/arch/mips/include/cpuregs.h:1.74.28.10 --- src/sys/arch/mips/include/cpuregs.h:1.74.28.9 Sun Sep 13 03:28:22 2009 +++ src/sys/arch/mips/include/cpuregs.h Mon Nov 9 09:57:27 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: cpuregs.h,v 1.74.28.9 2009/09/13 03:28:22 cliff Exp $ */ +/* $NetBSD: cpuregs.h,v 1.74.28.10 2009/11/09 09:57:27 cliff Exp $ */ /* * Copyright (c) 1992, 1993 @@ -115,6 +115,7 @@ #define MIPS_XKSEG_START (0x3ULL 62) #define MIPS_XKSEG_P(x) (((uint64_t)(x) 62) == 3) +#ifndef _LOCORE #define MIPS_XKPHYS_START (0x2ULL 62) #define MIPS_PHYS_TO_XKPHYS_UNCACHED(x) \ (MIPS_XKPHYS_START | ((uint64_t)(CCA_UNCACHED) 59) | (x)) @@ -125,6 +126,7 @@ #define MIPS_XKPHYS_TO_PHYS(x) ((uint64_t)(x) 0x07ffLL) #define MIPS_XKPHYS_TO_CCA(x) (((uint64_t)(x) 59) 7) #define MIPS_XKPHYS_P(x) (((uint64_t)(x) 62) == 2) +#endif /* _LOCORE */ #define CCA_UNCACHED 2 #define CCA_CACHEABLE 3 /* cacheable non-coherent */ @@ -830,12 +832,12 @@ /* * CPU processor revision IDs for company ID == 12 (RMI) */ -#define MIPS_XLR732 0x00 /* RMI XLS732-C ISA 64 */ -#define MIPS_XLR716 0x02 /* RMI XLS716-C ISA 64 */ -#define MIPS_XLR532 0x08 /* RMI XLS532-C ISA 64 */ -#define MIPS_XLR516 0x0a /* RMI XLS516-C ISA 64 */ -#define MIPS_XLR508 0x0b /* RMI XLS508-C ISA 64 */ -#define MIPS_XLR308 0x0f /* RMI XLS308-C ISA 64 */ +#define MIPS_XLR732 0x00 /* RMI XLR732-C ISA 64 */ +#define MIPS_XLR716 0x02 /* RMI XLR716-C ISA 64 */ +#define MIPS_XLR532 0x08 /* RMI XLR532-C ISA 64 */ +#define MIPS_XLR516 0x0a /* RMI XLR516-C ISA 64 */ +#define MIPS_XLR508 0x0b /* RMI XLR508-C ISA 64 */ +#define MIPS_XLR308 0x0f /* RMI XLR308-C ISA 64 */ #define MIPS_XLS616 0x40 /* RMI XLS616 ISA 64 */ #define MIPS_XLS416 0x44 /* RMI XLS416 ISA 64 */ #define MIPS_XLS608 0x4A /* RMI XLS608 ISA 64 */
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/include
Module Name:src Committed By: cliff Date: Mon Nov 9 09:58:19 UTC 2009 Modified Files: src/sys/arch/mips/include [matt-nb5-mips64]: vmparam.h Log Message: - fix definition of VM_MAXUSER32_ADDRESS as per Matt To generate a diff of this commit: cvs rdiff -u -r1.41.28.4 -r1.41.28.5 src/sys/arch/mips/include/vmparam.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/include/vmparam.h diff -u src/sys/arch/mips/include/vmparam.h:1.41.28.4 src/sys/arch/mips/include/vmparam.h:1.41.28.5 --- src/sys/arch/mips/include/vmparam.h:1.41.28.4 Sat Sep 12 17:16:38 2009 +++ src/sys/arch/mips/include/vmparam.h Mon Nov 9 09:58:19 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: vmparam.h,v 1.41.28.4 2009/09/12 17:16:38 matt Exp $ */ +/* $NetBSD: vmparam.h,v 1.41.28.5 2009/11/09 09:58:19 cliff Exp $ */ /* * Copyright (c) 1992, 1993 @@ -186,7 +186,7 @@ #define VM_MAX_KERNEL_ADDRESS ((vaddr_t)-0x4000) /* 0xC000 */ #endif #endif -#define VM_MAXUSER32_ADDRESS ((vaddr_t)-0x7fff-1)/* 0x8000 */ +#define VM_MAXUSER32_ADDRESS ((vaddr_t)(1UL 31))/* 0x8000 */ /* * The address to which unspecified mapping requests default
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/mips
Module Name:src Committed By: cliff Date: Mon Nov 9 09:59:27 UTC 2009 Modified Files: src/sys/arch/mips/mips [matt-nb5-mips64]: bus_space_alignstride_chipdep.c Log Message: revamp read_[1,2,4,8] and write_[1,2,4,8] functions - fix bug in read_8 when Little Endian, Access Size 1, Stride 0 - fix bug in write_1 when Little Endian, Access Size 4, Stride 0 - fix bug in read_8 when Little Endian, Access Size 4, Stride 0 - fix bug in read_2 when Big Endian, Access Size 1, Stride 0 - fix bug in read_4 when Big Endian, Access Size 1, Stride 0 - fix bug in read_8 when Big Endian, Access Size 1, Stride 0 - fix bug in write_1 when Big Endian, Access Size 4, Stride 0 - fix bug in write_2 when Big Endian, Access Size 4, Stride 0 - fix bug in read_8 when Big Endian, Access Size 4, Stride 0 To generate a diff of this commit: cvs rdiff -u -r1.10.18.3 -r1.10.18.4 \ src/sys/arch/mips/mips/bus_space_alignstride_chipdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/mips/bus_space_alignstride_chipdep.c diff -u src/sys/arch/mips/mips/bus_space_alignstride_chipdep.c:1.10.18.3 src/sys/arch/mips/mips/bus_space_alignstride_chipdep.c:1.10.18.4 --- src/sys/arch/mips/mips/bus_space_alignstride_chipdep.c:1.10.18.3 Tue Sep 22 07:20:39 2009 +++ src/sys/arch/mips/mips/bus_space_alignstride_chipdep.c Mon Nov 9 09:59:27 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: bus_space_alignstride_chipdep.c,v 1.10.18.3 2009/09/22 07:20:39 cliff Exp $ */ +/* $NetBSD: bus_space_alignstride_chipdep.c,v 1.10.18.4 2009/11/09 09:59:27 cliff Exp $ */ /*- * Copyright (c) 1998, 2000, 2001 The NetBSD Foundation, Inc. @@ -81,7 +81,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: bus_space_alignstride_chipdep.c,v 1.10.18.3 2009/09/22 07:20:39 cliff Exp $); +__KERNEL_RCSID(0, $NetBSD: bus_space_alignstride_chipdep.c,v 1.10.18.4 2009/11/09 09:59:27 cliff Exp $); #ifdef CHIP_EXTENT #include sys/extent.h @@ -384,6 +384,7 @@ #define CHIP_OFF64(o) (o) #endif + void __BS(init)(bus_space_tag_t t, void *v) { @@ -978,9 +979,15 @@ #else /* CHIP_ACCESS_SIZE 1 */ volatile uint8_t *ptr; #endif /* CHIP_ACCESS_SIZE 1 */ + uint8_t r; +int shift; - ptr = (void *)(h + CHIP_OFF8(off)); - return (uint8_t)(CHIP_SWAP_ACCESS(*ptr) 0xff); +h += CHIP_OFF8(off); +shift = (off (CHIP_ACCESS_SIZE - 1)) * 8; +ptr = (void *)(h ~((bus_space_handle_t)(CHIP_ACCESS_SIZE - 1))); +r = (uint8_t)(CHIP_SWAP_ACCESS(*ptr) shift); + +return r; } inline uint16_t @@ -991,9 +998,16 @@ #else /* CHIP_ACCESS_SIZE 2 */ volatile uint16_t *ptr; #endif /* CHIP_ACCESS_SIZE 2 */ + uint16_t r; +int shift; - ptr = (void *)(h + CHIP_OFF16(off)); - return (uint16_t)(CHIP_SWAP_ACCESS(*ptr) 0x); + KASSERT((off 1) == 0); +h += CHIP_OFF16(off); +shift = (off (CHIP_ACCESS_SIZE - 1)) * 8; +ptr = (void *)(h ~((bus_space_handle_t)(CHIP_ACCESS_SIZE - 1))); + r = (uint16_t)CHIP_SWAP16(*ptr shift); + + return r; } inline uint32_t @@ -1004,18 +1018,32 @@ #else /* CHIP_ACCESS_SIZE 4 */ volatile uint32_t *ptr; #endif + uint32_t r; +int shift; - ptr = (void *)(h + CHIP_OFF32(off)); - return (uint32_t)(CHIP_SWAP_ACCESS(*ptr) 0x); + KASSERT((off 3) == 0); +h += CHIP_OFF32(off); +shift = (off (CHIP_ACCESS_SIZE - 1)) * 8; +ptr = (void *)(h ~((bus_space_handle_t)(CHIP_ACCESS_SIZE - 1))); + r = (uint32_t)CHIP_SWAP32(*ptr shift); + + return r; } inline uint64_t __BS(read_8)(void *v, bus_space_handle_t h, bus_size_t off) { volatile uint64_t *ptr; + volatile uint64_t r; +int shift; - ptr = (void *)(h + CHIP_OFF64(off)); - return CHIP_SWAP64(*ptr); + KASSERT((off 7) == 0); +h += CHIP_OFF64(off); +shift = (off (CHIP_ACCESS_SIZE - 1)) * 8; +ptr = (void *)(h ~((bus_space_handle_t)(CHIP_ACCESS_SIZE - 1))); + r = CHIP_SWAP64(*ptr shift); + + return r; } @@ -1052,6 +1080,7 @@ CHIP_read_region_N(4,uint32_t) CHIP_read_region_N(8,uint64_t) + inline void __BS(write_1)(void *v, bus_space_handle_t h, bus_size_t off, uint8_t val) { @@ -1060,9 +1089,12 @@ #else /* CHIP_ACCESS_SIZE 1 */ volatile uint8_t *ptr; #endif /* CHIP_ACCESS_SIZE 1 */ + int shift; - ptr = (void *)(h + CHIP_OFF8(off)); - *ptr = CHIP_SWAP_ACCESS((CHIP_TYPE)val); + h += CHIP_OFF8(off); + shift = (off (CHIP_ACCESS_SIZE - 1)) * 8; + ptr = (void *)(h ~((bus_space_handle_t)(CHIP_ACCESS_SIZE - 1))); + *ptr = CHIP_SWAP_ACCESS(((CHIP_TYPE)val) shift); } inline void @@ -1073,10 +1105,14 @@ #else /* CHIP_ACCESS_SIZE 2 */ volatile uint16_t *ptr; #endif /* CHIP_ACCESS_SIZE 2 */ + int shift; - ptr = (void *)(h + CHIP_OFF16(off)); + KASSERT((off 1) == 0); + h += CHIP_OFF16(off); + shift = (off (CHIP_ACCESS_SIZE - 1)) * 8; + ptr = (void *)(h
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/mips
Module Name:src Committed By: cliff Date: Mon Nov 9 10:00:28 UTC 2009 Modified Files: src/sys/arch/mips/mips [matt-nb5-mips64]: genassym.cf Log Message: - add syms for MIPS_XKPHYS_START, MIPS_XKPHYS_UNCACHED, MIPS_XKPHYS_CCA3, MIPS_XKPHYS_CCA4, MIPS_XKSEG_START. To generate a diff of this commit: cvs rdiff -u -r1.44.12.6 -r1.44.12.7 src/sys/arch/mips/mips/genassym.cf Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/mips/genassym.cf diff -u src/sys/arch/mips/mips/genassym.cf:1.44.12.6 src/sys/arch/mips/mips/genassym.cf:1.44.12.7 --- src/sys/arch/mips/mips/genassym.cf:1.44.12.6 Mon Sep 7 21:54:39 2009 +++ src/sys/arch/mips/mips/genassym.cf Mon Nov 9 10:00:28 2009 @@ -1,4 +1,4 @@ -# $NetBSD: genassym.cf,v 1.44.12.6 2009/09/07 21:54:39 matt Exp $ +# $NetBSD: genassym.cf,v 1.44.12.7 2009/11/09 10:00:28 cliff Exp $ # # Copyright (c) 1992, 1993 # The Regents of the University of California. All rights reserved. @@ -93,6 +93,11 @@ define MIPS_KSEG0_START MIPS_KSEG0_START define MIPS_KSEG1_START MIPS_KSEG1_START define MIPS_KSEG2_START MIPS_KSEG2_START +define MIPS_XKPHYS_START MIPS_XKPHYS_START +define MIPS_XKPHYS_UNCACHED MIPS_PHYS_TO_XKPHYS_UNCACHED(0) +define MIPS_XKPHYS_CCA3 MIPS_PHYS_TO_XKPHYS(3, 0) +define MIPS_XKPHYS_CCA4 MIPS_PHYS_TO_XKPHYS(4, 0) +define MIPS_XKSEG_START MIPS_XKSEG_START # Important offsets into the lwp and proc structs associated constants define L_ADDR offsetof(struct lwp, l_addr) @@ -312,3 +317,4 @@ define CPU_INFO_CURLWP offsetof(struct cpu_info, ci_curlwp) define CPU_INFO_FPCURLWP offsetof(struct cpu_info, ci_fpcurlwp) +
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/mips
Module Name:src Committed By: cliff Date: Mon Nov 9 10:02:30 UTC 2009 Modified Files: src/sys/arch/mips/mips [matt-nb5-mips64]: trap.c Log Message: - #if DDB call Debugger() before panic(trapsignal) for non-user trap To generate a diff of this commit: cvs rdiff -u -r1.217.12.9 -r1.217.12.10 src/sys/arch/mips/mips/trap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/mips/trap.c diff -u src/sys/arch/mips/mips/trap.c:1.217.12.9 src/sys/arch/mips/mips/trap.c:1.217.12.10 --- src/sys/arch/mips/mips/trap.c:1.217.12.9 Mon Sep 7 22:06:32 2009 +++ src/sys/arch/mips/mips/trap.c Mon Nov 9 10:02:30 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: trap.c,v 1.217.12.9 2009/09/07 22:06:32 matt Exp $ */ +/* $NetBSD: trap.c,v 1.217.12.10 2009/11/09 10:02:30 cliff Exp $ */ /* * Copyright (c) 1992, 1993 @@ -78,7 +78,7 @@ #include sys/cdefs.h /* RCS ID Copyright macro defns */ -__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.217.12.9 2009/09/07 22:06:32 matt Exp $); +__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.217.12.10 2009/11/09 10:02:30 cliff Exp $); #include opt_cputype.h /* which mips CPU levels do we support? */ #include opt_ddb.h @@ -585,8 +585,12 @@ } #endif (*p-p_emul-e_trapsignal)(l, ksi); - if ((type T_USER) == 0) + if ((type T_USER) == 0) { +#ifdef DDB + Debugger(); +#endif panic(trapsignal); + } userret(l); return; }
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/rmi
Module Name:src Committed By: cliff Date: Mon Nov 9 10:05:06 UTC 2009 Modified Files: src/sys/arch/mips/rmi [matt-nb5-mips64]: rmixl_obio.c Log Message: - convert to CFATTACH_DECL_NEW related - add obio_dma_init_29() to allow DMA for addrs 512MB - obio_dma_init_32() and obio_dma_init_64() are TBD (#ifdef NOTYET) - obio_bus_dmamap_sync() provides null DMA sync function, since DMA is cache coherent - rmixl_addr_error_init() establishes ISR for address error interrupt To generate a diff of this commit: cvs rdiff -u -r1.1.2.4 -r1.1.2.5 src/sys/arch/mips/rmi/rmixl_obio.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/rmi/rmixl_obio.c diff -u src/sys/arch/mips/rmi/rmixl_obio.c:1.1.2.4 src/sys/arch/mips/rmi/rmixl_obio.c:1.1.2.5 --- src/sys/arch/mips/rmi/rmixl_obio.c:1.1.2.4 Tue Sep 15 03:04:03 2009 +++ src/sys/arch/mips/rmi/rmixl_obio.c Mon Nov 9 10:05:06 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: rmixl_obio.c,v 1.1.2.4 2009/09/15 03:04:03 cliff Exp $ */ +/* $NetBSD: rmixl_obio.c,v 1.1.2.5 2009/11/09 10:05:06 cliff Exp $ */ /* * Copyright (c) 2001, 2002, 2003 Wasabi Systems, Inc. @@ -40,33 +40,51 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: rmixl_obio.c,v 1.1.2.4 2009/09/15 03:04:03 cliff Exp $); +__KERNEL_RCSID(0, $NetBSD: rmixl_obio.c,v 1.1.2.5 2009/11/09 10:05:06 cliff Exp $); + +#include locators.h +#include obio.h +#include pci.h #include sys/param.h #include sys/systm.h #include sys/device.h +#include sys/extent.h +#include sys/malloc.h +#define _MIPS_BUS_DMA_PRIVATE #include machine/bus.h +#include machine/int_fmtio.h + #include mips/rmi/rmixlreg.h #include mips/rmi/rmixlvar.h #include mips/rmi/rmixl_obiovar.h +#include mips/rmi/rmixl_pcievar.h -#include locators.h +#ifdef OBIO_DEBUG +int obio_debug = OBIO_DEBUG; +# define DPRINTF(x) do { if (obio_debug) printf x ; } while (0) +#else +# define DPRINTF(x) +#endif -static int obio_match(struct device *, struct cfdata *, void *); -static void obio_attach(struct device *, struct device *, void *); +static int obio_match(device_t, cfdata_t, void *); +static void obio_attach(device_t, device_t, void *); static int obio_print(void *, const char *); -static int obio_search(struct device *, struct cfdata *, const int *, void *); +static int obio_search(device_t, cfdata_t, const int *, void *); static void obio_bus_init(struct obio_softc *); +static void obio_dma_init_29(bus_dma_tag_t); +static int rmixl_addr_error_intr(void *); + -CFATTACH_DECL(obio, sizeof(struct obio_softc), +CFATTACH_DECL_NEW(obio, sizeof(struct obio_softc), obio_match, obio_attach, NULL, NULL); int obio_found; static int -obio_match(struct device * parent, struct cfdata *cf, void *aux) +obio_match(device_t parent, cfdata_t cf, void *aux) { if (obio_found) return 0; @@ -74,12 +92,13 @@ } static void -obio_attach(struct device * parent, struct device * self, void *aux) +obio_attach(device_t parent, device_t self, void *aux) { struct obio_softc *sc = device_private(self); bus_addr_t ba; obio_found = 1; + sc-sc_dev = self; ba = (bus_addr_t)rmixl_configuration.rc_io_pbase; KASSERT(ba != 0); @@ -93,6 +112,7 @@ * Attach on-board devices as specified in the kernel config file. */ config_search_ia(obio_search, self, obio, NULL); + } static int @@ -100,20 +120,22 @@ { struct obio_attach_args *obio = aux; - aprint_normal( addr 0x%08lx, obio-obio_addr); - if (obio-obio_size != OBIOCF_SIZE_DEFAULT) - aprint_normal(-0x%08lx, obio-obio_addr + (obio-obio_size - 1)); - if (obio-obio_mult != OBIOCF_MULT) + if (obio-obio_addr != OBIOCF_ADDR_DEFAULT) { + aprint_normal( addr 0x%08lx, obio-obio_addr); + if (obio-obio_size != OBIOCF_SIZE_DEFAULT) + aprint_normal(-0x%08lx, +obio-obio_addr + (obio-obio_size - 1)); + } + if (obio-obio_mult != OBIOCF_MULT_DEFAULT) aprint_normal( mult %d, obio-obio_mult); - if (obio-obio_intr != -1) + if (obio-obio_intr != OBIOCF_INTR_DEFAULT) aprint_normal( intr %d, obio-obio_intr); return (UNCONF); } static int -obio_search(struct device * parent, struct cfdata *cf, - const int *ldesc, void *aux) +obio_search(device_t parent, cfdata_t cf, const int *ldesc, void *aux) { struct obio_softc *sc = device_private(parent); struct obio_attach_args obio; @@ -124,6 +146,9 @@ obio.obio_size = cf-cf_loc[OBIOCF_SIZE]; obio.obio_mult = cf-cf_loc[OBIOCF_MULT]; obio.obio_intr = cf-cf_loc[OBIOCF_INTR]; + obio.obio_29bit_dmat = sc-sc_29bit_dmat; + obio.obio_32bit_dmat = sc-sc_32bit_dmat; + obio.obio_64bit_dmat = sc-sc_64bit_dmat; if (config_match(parent, cf, obio) 0) config_attach(parent, cf, obio, obio_print); @@ -134,6 +159,7 @@ static void obio_bus_init(struct obio_softc *sc) { + struct rmixl_config *rcp = rmixl_configuration; static int done = 0; if (done) @@ -141,28 +167,184 @@ done = 1; /* little endian space
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/rmi
Module Name:src Committed By: cliff Date: Mon Nov 9 10:05:50 UTC 2009 Modified Files: src/sys/arch/mips/rmi [matt-nb5-mips64]: rmixl_obiovar.h Log Message: - convert to CFATTACH_DECL_NEW related - add bus_dma tags - removed unused fields: sc_pci_dmat, rmixl_bus_mbst, rmixl_bus_mdt - add PCI bus_space addrs and tags To generate a diff of this commit: cvs rdiff -u -r1.1.2.3 -r1.1.2.4 src/sys/arch/mips/rmi/rmixl_obiovar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/rmi/rmixl_obiovar.h diff -u src/sys/arch/mips/rmi/rmixl_obiovar.h:1.1.2.3 src/sys/arch/mips/rmi/rmixl_obiovar.h:1.1.2.4 --- src/sys/arch/mips/rmi/rmixl_obiovar.h:1.1.2.3 Tue Sep 15 02:32:02 2009 +++ src/sys/arch/mips/rmi/rmixl_obiovar.h Mon Nov 9 10:05:50 2009 @@ -1,9 +1,10 @@ -/* $NetBSD: rmixl_obiovar.h,v 1.1.2.3 2009/09/15 02:32:02 cliff Exp $ */ +/* $NetBSD: rmixl_obiovar.h,v 1.1.2.4 2009/11/09 10:05:50 cliff Exp $ */ #ifndef _MIPS_RMIXL_OBIOVAR_H_ #define _MIPS_RMIXL_OBIOVAR_H_ #include dev/pci/pcivar.h +#include mips/bus_dma.h #include mips/pci_machdep.h struct obio_attach_args { @@ -13,28 +14,20 @@ bus_size_t obio_size; int obio_intr; unsigned int obio_mult; - bus_dma_tag_t obio_dmat; + bus_dma_tag_t obio_29bit_dmat; + bus_dma_tag_t obio_32bit_dmat; + bus_dma_tag_t obio_64bit_dmat; }; typedef struct obio_softc { - struct device sc_dev; + device_t sc_dev; bus_space_tag_t sc_el_bst; bus_space_tag_t sc_eb_bst; - bus_dma_tag_t sc_lt4G_dmat; - bus_dma_tag_t sc_ge4G_dmat; + bus_dma_tag_t sc_29bit_dmat; + bus_dma_tag_t sc_32bit_dmat; + bus_dma_tag_t sc_64bit_dmat; bus_addr_t sc_base; bus_size_t sc_size; - - /* Bus space, DMA, and PCI tags for the PCI bus. */ - bus_space_handle_t sc_pcicfg_ioh; -#ifdef NOTYET - struct XXX_bus_dma_tag sc_pci_dmat; - struct XXX_pci_chipset sc_pci_chipset; -#endif } obio_softc_t; -extern struct mips_bus_space rmixl_bus_mbst; -extern struct mips_bus_dma_tag rmixl_bus_mdt; - - #endif /* _MIPS_OMAP_RMIXL_OBIOVAR_H_ */
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/rmi
Module Name:src Committed By: cliff Date: Mon Nov 9 10:07:44 UTC 2009 Modified Files: src/sys/arch/mips/rmi [matt-nb5-mips64]: rmixlreg.h Log Message: - RMIXL_IOREG_READ, RMIXL_IOREG_WRITE provide general use ops for accessing on-chip DEV_IO regs w/ Big Endian byte order. - add System Bridge Controller registers defines - add Address Error registers defines - add DRAM register defines - add GPIO signal and system control register offsets - add PCIE Interface controller register offsets - fix typo for RMIXL_PIC_INTRACK - add RMIXL_PIC_IRTENTRYC0_RESV To generate a diff of this commit: cvs rdiff -u -r1.1.2.3 -r1.1.2.4 src/sys/arch/mips/rmi/rmixlreg.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/rmi/rmixlreg.h diff -u src/sys/arch/mips/rmi/rmixlreg.h:1.1.2.3 src/sys/arch/mips/rmi/rmixlreg.h:1.1.2.4 --- src/sys/arch/mips/rmi/rmixlreg.h:1.1.2.3 Fri Sep 25 22:20:43 2009 +++ src/sys/arch/mips/rmi/rmixlreg.h Mon Nov 9 10:07:44 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: rmixlreg.h,v 1.1.2.3 2009/09/25 22:20:43 cliff Exp $ */ +/* $NetBSD: rmixlreg.h,v 1.1.2.4 2009/11/09 10:07:44 cliff Exp $ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -33,6 +33,19 @@ #ifndef _MIPS_RMI_RMIXLREGS_H_ #define _MIPS_RMI_RMIXLREGS_H_ +#include sys/endian.h + +/* + * on chip I/O register byte order is + * BIG ENDIAN regardless of code model + */ +#define RMIXL_IOREG_VADDR(o)\ + (volatile uint32_t *)MIPS_PHYS_TO_KSEG1( \ + rmixl_configuration.rc_io_pbase + (o)) +#define RMIXL_IOREG_READ(o) be32toh(*RMIXL_IOREG_VADDR(o)) +#define RMIXL_IOREG_WRITE(o,v) *RMIXL_IOREG_VADDR(o) = htobe32(v) + + /* * RMIXL Coprocessor 2 registers: */ @@ -105,6 +118,8 @@ /* default virtual base address */ #define RMIXL_IO_DEV_SIZE 0x10 /* I/O Conf. space is 1MB region */ + + /* * Peripheral and I/O Configuration Region of Memory * @@ -115,7 +130,7 @@ * * Device region offsets are relative to RMIXL_IO_DEV_PBASE. */ -#define RMIXL_IO_DEV_BRIDGE 0x0 /* System Bridge Controller */ +#define RMIXL_IO_DEV_BRIDGE 0x0 /* System Bridge Controller (SBC) */ #define RMIXL_IO_DEV_DDR_CHNA 0x01000 /* DDR1/DDR2 DRAM_A Channel, Port MA */ #define RMIXL_IO_DEV_DDR_CHNB 0x02000 /* DDR1/DDR2 DRAM_B Channel, Port MB */ #define RMIXL_IO_DEV_DDR_CHNC 0x03000 /* DDR1/DDR2 DRAM_C Channel, Port MC */ @@ -170,15 +185,157 @@ /* - * Programmable Interrupt Controller registers - * the Programming Reference Manual table 10.4 + * the Programming Reference Manual * lists Reg ID values not offsets; - * assume offset = id * 4 + * offset = id * 4 */ #define _RMIXL_OFFSET(id) ((id) * 4) + + +/* + * System Bridge Controller registers + * offsets are relative to RMIXL_IO_DEV_BRIDGE + */ +#define RMIXL_SBC_DRAM_NBARS 8 +#define RMIXL_SBC_DRAM_BAR(n) _RMIXL_OFFSET(0x000 + (n)) + /* DRAM Region Base Address Regs[0-7] */ +#define RMIXL_SBC_DRAM_CHNAC_DTR(n) _RMIXL_OFFSET(0x008 + (n)) + /* DRAM Region Channels A,C Address Translation Regs[0-7] */ +#define RMIXL_SBC_DRAM_CHNBD_DTR(n) _RMIXL_OFFSET(0x010 + (n)) + /* DRAM Region Channels B,D Address Translation Regs[0-7] */ +#define RMIXL_SBC_DRAM_BRIDGE_CFG _RMIXL_OFFSET(0x18) /* SBC DRAM config reg */ +#define RMIXL_SBC_XLS_IO_BAR _RMIXL_OFFSET(0x19) /* I/O Config Base Addr reg */ +#define RMIXL_SBC_XLS_FLASH_BAR _RMIXL_OFFSET(0x20) /* Flash Memory Base Addr reg */ +#define RMIXL_SBC_PCIE_CFG_BAR _RMIXL_OFFSET(0x40) /* PCI Configuration BAR */ +#define RMIXL_SBC_PCIE_ECFG_BAR _RMIXL_OFFSET(0x41) /* PCI Extended Configuration BAR */ +#define RMIXL_SBC_PCIE_MEM_BAR _RMIXL_OFFSET(0x42) /* PCI Memory region BAR */ +#define RMIXL_SBC_PCIE_IO_BAR _RMIXL_OFFSET(0x43) /* PCI IO region BAR */ + +/* + * Address Error registers + * offsets are relative to RMIXL_IO_DEV_BRIDGE + */ +#define RMIXL_ADDR_ERR_DEVICE_MASK _RMIXL_OFFSET(0x25) /* Address Error Device Mask */ +#define RMIXL_ADDR_ERR_AERR0_LOG1 _RMIXL_OFFSET(0x26) /* Address Error Set 0 Log 1 */ +#define RMIXL_ADDR_ERR_AERR0_LOG2 _RMIXL_OFFSET(0x27) /* Address Error Set 0 Log 2 */ +#define RMIXL_ADDR_ERR_AERR0_LOG3 _RMIXL_OFFSET(0x28) /* Address Error Set 0 Log 3 */ +#define RMIXL_ADDR_ERR_AERR0_DEVSTAT _RMIXL_OFFSET(0x29) /* Address Error Set 0 irpt status */ +#define RMIXL_ADDR_ERR_AERR1_LOG1 _RMIXL_OFFSET(0x2a) /* Address Error Set 1 Log 1 */ +#define RMIXL_ADDR_ERR_AERR1_LOG2 _RMIXL_OFFSET(0x2b) /* Address Error Set 1 Log 2 */ +#define RMIXL_ADDR_ERR_AERR1_LOG3 _RMIXL_OFFSET(0x2c) /* Address Error Set 1 Log 3 */ +#define RMIXL_ADDR_ERR_AERR1_DEVSTAT _RMIXL_OFFSET(0x2d) /* Address Error Set 1 irpt status */ +#define RMIXL_ADDR_ERR_AERR0_EN _RMIXL_OFFSET(0x2e) /* Address Error Set 0 irpt enable */ +#define RMIXL_ADDR_ERR_AERR0_UPG _RMIXL_OFFSET(0x2f) /* Address Error Set 0 Upgrade */ +#define RMIXL_ADDR_ERR_AERR0_CLEAR _RMIXL_OFFSET(0x30) /* Address Error Set 0 irpt clear */
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/mips
Module Name:src Committed By: uebayasi Date: Tue Nov 3 16:30:58 UTC 2009 Modified Files: src/sys/arch/mips/mips [matt-nb5-mips64]: mips_machdep.c Log Message: Add XLS416. To generate a diff of this commit: cvs rdiff -u -r1.205.4.1.2.1.2.15 -r1.205.4.1.2.1.2.16 \ src/sys/arch/mips/mips/mips_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/mips/mips_machdep.c diff -u src/sys/arch/mips/mips/mips_machdep.c:1.205.4.1.2.1.2.15 src/sys/arch/mips/mips/mips_machdep.c:1.205.4.1.2.1.2.16 --- src/sys/arch/mips/mips/mips_machdep.c:1.205.4.1.2.1.2.15 Tue Sep 22 07:06:14 2009 +++ src/sys/arch/mips/mips/mips_machdep.c Tue Nov 3 16:30:58 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.15 2009/09/22 07:06:14 cliff Exp $ */ +/* $NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.16 2009/11/03 16:30:58 uebayasi Exp $ */ /* * Copyright 2002 Wasabi Systems, Inc. @@ -112,7 +112,7 @@ #include sys/cdefs.h /* RCS ID Copyright macro defns */ -__KERNEL_RCSID(0, $NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.15 2009/09/22 07:06:14 cliff Exp $); +__KERNEL_RCSID(0, $NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.16 2009/11/03 16:30:58 uebayasi Exp $); #include opt_cputype.h #include opt_compat_netbsd32.h @@ -451,6 +451,10 @@ MIPS64_FLAGS | CPU_MIPS_D_CACHE_COHERENT | CPU_MIPS_NO_LLADDR, XLS616 }, + { MIPS_PRID_CID_RMI, MIPS_XLS416, -1, -1, -1, 0, + MIPS64_FLAGS | CPU_MIPS_D_CACHE_COHERENT | CPU_MIPS_NO_LLADDR, + XLS416 }, + { MIPS_PRID_CID_RMI, MIPS_XLS408, -1, -1, -1, 0, MIPS64_FLAGS | CPU_MIPS_D_CACHE_COHERENT | CPU_MIPS_NO_LLADDR, XLS408 },
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/rmi
Module Name:src Committed By: cliff Date: Fri Sep 25 22:20:43 UTC 2009 Modified Files: src/sys/arch/mips/rmi [matt-nb5-mips64]: rmixlreg.h Log Message: define some fields for reserved register bits To generate a diff of this commit: cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/sys/arch/mips/rmi/rmixlreg.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/rmi/rmixlreg.h diff -u src/sys/arch/mips/rmi/rmixlreg.h:1.1.2.2 src/sys/arch/mips/rmi/rmixlreg.h:1.1.2.3 --- src/sys/arch/mips/rmi/rmixlreg.h:1.1.2.2 Tue Sep 15 02:34:34 2009 +++ src/sys/arch/mips/rmi/rmixlreg.h Fri Sep 25 22:20:43 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: rmixlreg.h,v 1.1.2.2 2009/09/15 02:34:34 cliff Exp $ */ +/* $NetBSD: rmixlreg.h,v 1.1.2.3 2009/09/25 22:20:43 cliff Exp $ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -202,6 +202,8 @@ #define RMIXL_PIC_CONTROL_TIMER_ENB __BITS(15,8) /* per-Timer enable bits */ #define RMIXL_PIC_CONTROL_TIMER_ENBn(n) ((1 (n)) RMIXL_PIC_CONTROL_TIMER_ENB) #define RMIXL_PIC_CONTROL_RESb __BITS(31,16) +#define RMIXL_PIC_CONTROL_RESV \ + (RMIXL_PIC_CONTROL_RESa|RMIXL_PIC_CONTROL_RESb) /* * RMIXL_PIC_IPIBASE bits @@ -211,10 +213,13 @@ #define RMIXL_PIC_IPIBASE_BCAST __BIT(7) #define RMIXL_PIC_IPIBASE_NMI __BIT(8) #define RMIXL_PIC_IPIBASE_ID __BITS(31,16) -#define RMIXL_PIC_IPIBASE_ID_RESa __BITS(31,23) +#define RMIXL_PIC_IPIBASE_ID_RESb __BITS(31,23) #define RMIXL_PIC_IPIBASE_ID_CPU __BITS(22,20) /* Physical CPU ID */ -#define RMIXL_PIC_IPIBASE_ID_RESb __BITS(19,18) +#define RMIXL_PIC_IPIBASE_ID_RESc __BITS(19,18) #define RMIXL_PIC_IPIBASE_ID_THREAD __BITS(22,20) /* Thread ID */ +#define RMIXL_PIC_IPIBASE_ID_RESV \ + (RMIXL_PIC_IPIBASE_ID_RESa|RMIXL_PIC_IPIBASE_ID_RESb \ + |RMIXL_PIC_IPIBASE_ID_RESc) /* * RMIXL_PIC_IRTENTRYC0 bits
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/rmi
Module Name:src Committed By: cliff Date: Fri Sep 25 22:21:12 UTC 2009 Modified Files: src/sys/arch/mips/rmi [matt-nb5-mips64]: rmixlvar.h Log Message: - add enums for rmixl interrupt trigger and polarity attributes - rmixl_intr_establish gets an updated prpototype To generate a diff of this commit: cvs rdiff -u -r1.1.2.3 -r1.1.2.4 src/sys/arch/mips/rmi/rmixlvar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/rmi/rmixlvar.h diff -u src/sys/arch/mips/rmi/rmixlvar.h:1.1.2.3 src/sys/arch/mips/rmi/rmixlvar.h:1.1.2.4 --- src/sys/arch/mips/rmi/rmixlvar.h:1.1.2.3 Tue Sep 15 02:32:02 2009 +++ src/sys/arch/mips/rmi/rmixlvar.h Fri Sep 25 22:21:12 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: rmixlvar.h,v 1.1.2.3 2009/09/15 02:32:02 cliff Exp $ */ +/* $NetBSD: rmixlvar.h,v 1.1.2.4 2009/09/25 22:21:12 cliff Exp $ */ /* * Copyright 2002 Wasabi Systems, Inc. @@ -38,6 +38,18 @@ #include dev/pci/pcivar.h #include machine/bus.h +typedef enum { + RMIXL_INTR_EDGE=0, + RMIXL_INTR_LEVEL, +} rmixl_intr_trigger_t; + +typedef enum { + RMIXL_INTR_RISING=0, + RMIXL_INTR_HIGH, + RMIXL_INTR_FALLING, + RMIXL_INTR_LOW, +} rmixl_intr_polarity_t; + struct rmixl_config { uint64_t rc_io_pbase; struct mips_bus_space rc_el_memt; /* little endian bus */ @@ -55,5 +67,7 @@ extern void rmixl_el_bus_mem_init(bus_space_tag_t, void *); extern void rmixl_eb_bus_mem_init(bus_space_tag_t, void *); -extern void *rmixl_intr_establish(int, int, int (*)(void *), void *); +extern void *rmixl_intr_establish(int, int, + rmixl_intr_trigger_t, rmixl_intr_polarity_t, + int (*)(void *), void *); extern void rmixl_intr_disestablish(void *);
CVS commit: [matt-nb5-mips64] src/sys/arch/evbmips/include
Module Name:src Committed By: cliff Date: Fri Sep 25 22:21:42 UTC 2009 Modified Files: src/sys/arch/evbmips/include [matt-nb5-mips64]: intr.h Log Message: struct evbmips_intrhand gets field 'ih_ipl' to associate this interrupt with an IPL To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.16.18.1 src/sys/arch/evbmips/include/intr.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/evbmips/include/intr.h diff -u src/sys/arch/evbmips/include/intr.h:1.16 src/sys/arch/evbmips/include/intr.h:1.16.18.1 --- src/sys/arch/evbmips/include/intr.h:1.16 Mon Apr 28 20:23:17 2008 +++ src/sys/arch/evbmips/include/intr.h Fri Sep 25 22:21:42 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: intr.h,v 1.16 2008/04/28 20:23:17 martin Exp $ */ +/* $NetBSD: intr.h,v 1.16.18.1 2009/09/25 22:21:42 cliff Exp $ */ /*- * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc. @@ -96,6 +96,7 @@ int (*ih_func)(void *); void *ih_arg; int ih_irq; + int ih_ipl; }; #include mips/softintr.h
CVS commit: [matt-nb5-mips64] src/sys/arch/evbmips/conf
Module Name:src Committed By: cliff Date: Fri Sep 25 22:22:27 UTC 2009 Modified Files: src/sys/arch/evbmips/conf [matt-nb5-mips64]: XLS6ATX_7A Log Message: specify interrupt# for com0 To generate a diff of this commit: cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/sys/arch/evbmips/conf/XLS6ATX_7A Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/evbmips/conf/XLS6ATX_7A diff -u src/sys/arch/evbmips/conf/XLS6ATX_7A:1.1.2.1 src/sys/arch/evbmips/conf/XLS6ATX_7A:1.1.2.2 --- src/sys/arch/evbmips/conf/XLS6ATX_7A:1.1.2.1 Sun Sep 13 03:27:38 2009 +++ src/sys/arch/evbmips/conf/XLS6ATX_7A Fri Sep 25 22:22:27 2009 @@ -1,11 +1,11 @@ # -# $NetBSD: XLS6ATX_7A,v 1.1.2.1 2009/09/13 03:27:38 cliff Exp $ +# $NetBSD: XLS6ATX_7A,v 1.1.2.2 2009/09/25 22:22:27 cliff Exp $ include arch/evbmips/conf/std.rmixl #options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident XLS6ATX_7A-$Revision: 1.1.2.1 $ +#ident XLS6ATX_7A-$Revision: 1.1.2.2 $ maxusers 32 @@ -139,7 +139,7 @@ mainbus0 at root cpu0 at mainbus? obio0 at mainbus? -com0 at obio0 addr 0x14000 mult 4 +com0 at obio0 addr 0x14000 mult 4 intr 9 options COM_REGMAP # Pseudo-devices
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/rmi
Module Name:src Committed By: cliff Date: Fri Sep 25 22:22:52 UTC 2009 Modified Files: src/sys/arch/mips/rmi [matt-nb5-mips64]: rmixl_com.c Log Message: establish interrupt in rmixl_com_attach() To generate a diff of this commit: cvs rdiff -u -r1.1.2.5 -r1.1.2.6 src/sys/arch/mips/rmi/rmixl_com.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/rmi/rmixl_com.c diff -u src/sys/arch/mips/rmi/rmixl_com.c:1.1.2.5 src/sys/arch/mips/rmi/rmixl_com.c:1.1.2.6 --- src/sys/arch/mips/rmi/rmixl_com.c:1.1.2.5 Tue Sep 22 07:01:18 2009 +++ src/sys/arch/mips/rmi/rmixl_com.c Fri Sep 25 22:22:52 2009 @@ -1,4 +1,4 @@ -/* $Id: rmixl_com.c,v 1.1.2.5 2009/09/22 07:01:18 cliff Exp $ */ +/* $Id: rmixl_com.c,v 1.1.2.6 2009/09/25 22:22:52 cliff Exp $ */ /*- * Copyright (c) 2006 Urbana-Champaign Independent Media Center. * Copyright (c) 2006 Garrett D'Amore. @@ -101,7 +101,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: rmixl_com.c,v 1.1.2.5 2009/09/22 07:01:18 cliff Exp $); +__KERNEL_RCSID(0, $NetBSD: rmixl_com.c,v 1.1.2.6 2009/09/25 22:22:52 cliff Exp $); #include sys/param.h #include sys/systm.h @@ -157,6 +157,7 @@ if (rate 0) return; /* XXX */ + com0addr[com_ier] = 0; com0addr[com_lctl] = htobe32(LCR_DLAB); com0addr[com_dlbl] = htobe32(rate 0xff); com0addr[com_dlbh] = htobe32(rate 8); @@ -280,9 +281,9 @@ com_attach_subr(sc); -#ifdef NOTYET - rmixl_intr_establish(obio-obio_intr, comintr, sc); -#endif + rmixl_intr_establish(obio-obio_intr, IPL_SERIAL, + RMIXL_INTR_LEVEL, RMIXL_INTR_HIGH, comintr, sc); + } void
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/rmi
Module Name:src Committed By: cliff Date: Fri Sep 25 22:27:02 UTC 2009 Modified Files: src/sys/arch/mips/rmi [matt-nb5-mips64]: rmixl_intr.c Log Message: chop out some test printf's To generate a diff of this commit: cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/sys/arch/mips/rmi/rmixl_intr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/rmi/rmixl_intr.c diff -u src/sys/arch/mips/rmi/rmixl_intr.c:1.1.2.2 src/sys/arch/mips/rmi/rmixl_intr.c:1.1.2.3 --- src/sys/arch/mips/rmi/rmixl_intr.c:1.1.2.2 Fri Sep 25 22:22:09 2009 +++ src/sys/arch/mips/rmi/rmixl_intr.c Fri Sep 25 22:27:02 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: rmixl_intr.c,v 1.1.2.2 2009/09/25 22:22:09 cliff Exp $ */ +/* $NetBSD: rmixl_intr.c,v 1.1.2.3 2009/09/25 22:27:02 cliff Exp $ */ /*- * Copyright (c) 2007 Ruslan Ermilov and Vsevolod Lobko. @@ -64,7 +64,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: rmixl_intr.c,v 1.1.2.2 2009/09/25 22:22:09 cliff Exp $); +__KERNEL_RCSID(0, $NetBSD: rmixl_intr.c,v 1.1.2.3 2009/09/25 22:27:02 cliff Exp $); #include opt_ddb.h @@ -389,16 +389,8 @@ { struct evbmips_intrhand *ih; uint64_t eirr; - uint64_t eimr; - uint32_t sr; int vec; - printf(\n%s: status: %#x, cause %#x\n, __func__, status, cause); - asm volatile (mfc0 %0, $9, 6; :=r(sr)); - printf(%s:%d: SR: %#x\n, __func__, __LINE__, sr); - asm volatile (dmfc0 %0, $9, 7; :=r(eimr)); - printf(%s: EIMR: %#lx\n, __func__, eimr); - for (vec = NINTRVECS - 1; vec = 0; vec--) { if ((ipending (MIPS_SOFT_INT_MASK_0 vec)) == 0) continue; @@ -415,16 +407,5 @@ } /* Re-enable anything that we have processed. */ - printf(%s:%d: re-enable: %#x\n, __func__, __LINE__, - MIPS_SR_INT_IE | ((status ~cause) MIPS_HARD_INT_MASK)); _splset(MIPS_SR_INT_IE | ((status ~cause) MIPS_HARD_INT_MASK)); - - asm volatile (mfc0 %0, $9, 6; :=r(sr)); - printf(%s: SR: %#x\n, __func__, sr); - - asm volatile (dmfc0 %0, $9, 6; :=r(eirr)); - printf(%s: EIRR: %#lx\n, __func__, eirr); - - asm volatile (dmfc0 %0, $9, 7; :=r(eimr)); - printf(%s: EIMR: %#lx\n, __func__, eimr); }
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/conf
Module Name:src Committed By: cliff Date: Tue Sep 22 06:58:20 UTC 2009 Modified Files: src/sys/arch/mips/conf [matt-nb5-mips64]: files.rmixl Log Message: add CONSFREQ to opt_com.h options To generate a diff of this commit: cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/sys/arch/mips/conf/files.rmixl Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/conf/files.rmixl diff -u src/sys/arch/mips/conf/files.rmixl:1.1.2.2 src/sys/arch/mips/conf/files.rmixl:1.1.2.3 --- src/sys/arch/mips/conf/files.rmixl:1.1.2.2 Tue Sep 15 02:32:01 2009 +++ src/sys/arch/mips/conf/files.rmixl Tue Sep 22 06:58:20 2009 @@ -1,4 +1,4 @@ -# $NetBSD: files.rmixl,v 1.1.2.2 2009/09/15 02:32:01 cliff Exp $ +# $NetBSD: files.rmixl,v 1.1.2.3 2009/09/22 06:58:20 cliff Exp $ # # Configuration info for RMI XLP, XLR, XLS # @@ -16,5 +16,5 @@ # NS16550 compatible serial ports attach com at obio with rmixl_com file arch/mips/rmi/rmixl_com.c rmixl_com -defparam opt_com.hCONSADDR CONSPEED CONMODE +defparam opt_com.hCONSADDR CONSFREQ CONSPEED CONMODE
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/rmi
Module Name:src Committed By: cliff Date: Tue Sep 22 07:01:18 UTC 2009 Modified Files: src/sys/arch/mips/rmi [matt-nb5-mips64]: rmixl_com.c Log Message: add baud rate initialization to rmixl_putchar_init() use symbolic offsets for reg access in rmixl_putchar() To generate a diff of this commit: cvs rdiff -u -r1.1.2.4 -r1.1.2.5 src/sys/arch/mips/rmi/rmixl_com.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/rmi/rmixl_com.c diff -u src/sys/arch/mips/rmi/rmixl_com.c:1.1.2.4 src/sys/arch/mips/rmi/rmixl_com.c:1.1.2.5 --- src/sys/arch/mips/rmi/rmixl_com.c:1.1.2.4 Tue Sep 15 10:32:41 2009 +++ src/sys/arch/mips/rmi/rmixl_com.c Tue Sep 22 07:01:18 2009 @@ -1,4 +1,4 @@ -/* $Id: rmixl_com.c,v 1.1.2.4 2009/09/15 10:32:41 cliff Exp $ */ +/* $Id: rmixl_com.c,v 1.1.2.5 2009/09/22 07:01:18 cliff Exp $ */ /*- * Copyright (c) 2006 Urbana-Champaign Independent Media Center. * Copyright (c) 2006 Garrett D'Amore. @@ -101,7 +101,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: rmixl_com.c,v 1.1.2.4 2009/09/15 10:32:41 cliff Exp $); +__KERNEL_RCSID(0, $NetBSD: rmixl_com.c,v 1.1.2.5 2009/09/22 07:01:18 cliff Exp $); #include sys/param.h #include sys/systm.h @@ -146,22 +146,40 @@ void rmixl_putchar_init(uint64_t io_pbase) { + int rate; + extern int comspeed(long, long, int); + com0addr = (uint32_t *) MIPS_PHYS_TO_KSEG1(io_pbase + RMIXL_IO_DEV_UART_1); + + if (CONSFREQ != -1) { + rate = comspeed(CONSPEED, CONSFREQ, COM_TYPE_NORMAL); + if (rate 0) + return; /* XXX */ + + com0addr[com_lctl] = htobe32(LCR_DLAB); + com0addr[com_dlbl] = htobe32(rate 0xff); + com0addr[com_dlbh] = htobe32(rate 8); + com0addr[com_lctl] = htobe32(LCR_8BITS); /* XXX */ + com0addr[com_mcr] = htobe32(MCR_DTR|MCR_RTS); + com0addr[com_fifo] = htobe32( + FIFO_ENABLE|FIFO_RCV_RST|FIFO_XMT_RST|FIFO_TRIGGER_1); + } } + void rmixl_putchar(char c) { int timo = 15; - while ((be32toh(com0addr[5]) LSR_TXRDY) == 0) + while ((be32toh(com0addr[com_lsr]) LSR_TXRDY) == 0) if (--timo == 0) break; - com0addr[0] = htobe32((uint32_t)c); + com0addr[com_data] = htobe32((uint32_t)c); - while ((be32toh(com0addr[5]) LSR_TSRE) == 0) + while ((be32toh(com0addr[com_lsr]) LSR_TSRE) == 0) if (--timo == 0) break; }
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/mips
Module Name:src Committed By: cliff Date: Tue Sep 22 07:06:15 UTC 2009 Modified Files: src/sys/arch/mips/mips [matt-nb5-mips64]: mips_machdep.c Log Message: add entries in cputab[] for RMI XLS408 and XLS408LITE To generate a diff of this commit: cvs rdiff -u -r1.205.4.1.2.1.2.14 -r1.205.4.1.2.1.2.15 \ src/sys/arch/mips/mips/mips_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/mips/mips_machdep.c diff -u src/sys/arch/mips/mips/mips_machdep.c:1.205.4.1.2.1.2.14 src/sys/arch/mips/mips/mips_machdep.c:1.205.4.1.2.1.2.15 --- src/sys/arch/mips/mips/mips_machdep.c:1.205.4.1.2.1.2.14 Wed Sep 16 04:23:19 2009 +++ src/sys/arch/mips/mips/mips_machdep.c Tue Sep 22 07:06:14 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.14 2009/09/16 04:23:19 matt Exp $ */ +/* $NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.15 2009/09/22 07:06:14 cliff Exp $ */ /* * Copyright 2002 Wasabi Systems, Inc. @@ -112,7 +112,7 @@ #include sys/cdefs.h /* RCS ID Copyright macro defns */ -__KERNEL_RCSID(0, $NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.14 2009/09/16 04:23:19 matt Exp $); +__KERNEL_RCSID(0, $NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.15 2009/09/22 07:06:14 cliff Exp $); #include opt_cputype.h #include opt_compat_netbsd32.h @@ -451,6 +451,14 @@ MIPS64_FLAGS | CPU_MIPS_D_CACHE_COHERENT | CPU_MIPS_NO_LLADDR, XLS616 }, + { MIPS_PRID_CID_RMI, MIPS_XLS408, -1, -1, -1, 0, + MIPS64_FLAGS | CPU_MIPS_D_CACHE_COHERENT | CPU_MIPS_NO_LLADDR, + XLS408 }, + + { MIPS_PRID_CID_RMI, MIPS_XLS408LITE, -1, -1, -1, 0, + MIPS64_FLAGS | CPU_MIPS_D_CACHE_COHERENT | CPU_MIPS_NO_LLADDR, + XLS408LITE }, + { 0, 0, 0,0, 0, 0, 0, NULL } };
CVS commit: [matt-nb5-mips64] src/sys/arch/evbmips/rmixl
Module Name:src Committed By: cliff Date: Tue Sep 22 07:15:37 UTC 2009 Modified Files: src/sys/arch/evbmips/rmixl [matt-nb5-mips64]: machdep.c Log Message: - if COMFREQ is undefined, define as -1 (inherit BRG settings from FW) - add a new recognized FW version entry to rmiclfw_psb_versions - break out initialization of mem_clusters into own function - imprpove early boot diagnostics - avoid faulting on possible NULL avail_mem_map pointer from FW - avoid using possible NULL reset FW callback pointer To generate a diff of this commit: cvs rdiff -u -r1.1.2.3 -r1.1.2.4 src/sys/arch/evbmips/rmixl/machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/evbmips/rmixl/machdep.c diff -u src/sys/arch/evbmips/rmixl/machdep.c:1.1.2.3 src/sys/arch/evbmips/rmixl/machdep.c:1.1.2.4 --- src/sys/arch/evbmips/rmixl/machdep.c:1.1.2.3 Tue Sep 15 02:46:43 2009 +++ src/sys/arch/evbmips/rmixl/machdep.c Tue Sep 22 07:15:37 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.1.2.3 2009/09/15 02:46:43 cliff Exp $ */ +/* $NetBSD: machdep.c,v 1.1.2.4 2009/09/22 07:15:37 cliff Exp $ */ /* * Copyright 2001, 2002 Wasabi Systems, Inc. @@ -112,7 +112,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.1.2.3 2009/09/15 02:46:43 cliff Exp $); +__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.1.2.4 2009/09/22 07:15:37 cliff Exp $); #include opt_ddb.h #include opt_com.h @@ -160,6 +160,9 @@ #include mips/rmi/rmixl_firmware.h #include mips/rmi/rmixlreg.h +#ifndef CONSFREQ +# define CONSFREQ -1 /* inherit from firmware */ +#endif #ifndef CONSPEED # define CONSPEED 38400 #endif @@ -170,9 +173,9 @@ # define CONSADDR RMIXL_IO_DEV_UART_1 #endif -int comcnfreq = -1; -uint comcnspeed = CONSPEED; -uint comcnmode = CONMODE; +int comcnfreq = CONSFREQ; +int comcnspeed = CONSPEED; +tcflag_t comcnmode = CONMODE; bus_addr_t comcnaddr = (bus_addr_t)CONSADDR; struct rmixl_config rmixl_configuration; @@ -180,11 +183,12 @@ /* * array of tested firmware versions - * if you fiund new ones and they work + * if you find new ones and they work * please add them */ static uint64_t rmiclfw_psb_versions[] = { 0x4958d4fb0056, + 0x49a5a8fa0056, }; #define RMICLFW_PSB_VERSIONS_LEN \ (sizeof(rmiclfw_psb_versions)/sizeof(rmiclfw_psb_versions[0])) @@ -195,6 +199,7 @@ static rmixlfw_info_t rmixlfw_info; static rmixlfw_mmap_t rmixlfw_phys_mmap; static rmixlfw_mmap_t rmixlfw_avail_mmap; +#define RMIXLFW_INFOP_LEGAL 0x8c00 /* For sysctl_hw. */ @@ -218,6 +223,7 @@ void configure(void); void mach_init(int, int32_t *, void *, void *); static u_long rmixlfw_init(void *); +static u_long mem_clusters_init(rmixlfw_mmap_t *, rmixlfw_mmap_t *); static void __attribute__((__noreturn__)) rmixl_exit(int); @@ -235,7 +241,7 @@ void mach_init(int argc, int32_t *argv, void *envp, void *infop) { - struct rmixl_config *rcp; + struct rmixl_config *rcp = rmixl_configuration; void *kernend, *v; size_t first, last; u_long memsize; @@ -263,13 +269,11 @@ physmem = btoc(memsize); - rcp = rmixl_configuration; - rcp-rc_io_pbase = MIPS_KSEG1_TO_PHYS(rmixlfw_info.io_base); rmixl_eb_bus_mem_init(rcp-rc_eb_memt, rcp); /* need for console */ rmixl_el_bus_mem_init(rcp-rc_el_memt, rcp); /* XXX defer ? */ #if NCOM 0 - rmixl_com_cnattach(comcnaddr, comcnspeed, comcnfreq, + rmixl_com_cnattach(comcnaddr, comcnspeed, -1, COM_TYPE_NORMAL, comcnmode); #endif @@ -367,12 +371,8 @@ static u_long rmixlfw_init(void *infop) { + struct rmixl_config *rcp = rmixl_configuration; uint64_t tmp; - uint64_t sz; - uint64_t sum; -#ifdef MEMSIZE - u_long memsize = MEMSIZE; -#endif strcpy(cpu_model, RMI XLS616ATX VIIA); /* XXX */ @@ -386,15 +386,68 @@ goto found; } - rmixl_putchar_init(MIPS_KSEG1_TO_PHYS(rmixlfw_info.io_base)); + rcp-rc_io_pbase = MIPS_KSEG1_TO_PHYS(RMIXL_IO_DEV_PBASE); + rmixl_putchar_init(rcp-rc_io_pbase); + rmixl_puts(\r\nWARNING: untested psb_version: ); rmixl_puthex64(rmixlfw_info.psb_version); rmixl_puts(\r\n); + found: + rcp-rc_io_pbase = MIPS_KSEG1_TO_PHYS(rmixlfw_info.io_base); + rmixl_putchar_init(rcp-rc_io_pbase); + rmixl_puts(\r\ninfop: ); + rmixl_puthex64((uint64_t)infop); + rmixl_puts(\r\nrecognized psb_version: ); + rmixl_puthex64(rmixlfw_info.psb_version); + rmixl_puts(\r\n); - rmixlfw_phys_mmap = *(rmixlfw_mmap_t *)rmixlfw_info.psb_physaddr_map; - rmixlfw_avail_mmap = *(rmixlfw_mmap_t *)rmixlfw_info.avail_mem_map; + return mem_clusters_init( + (rmixlfw_mmap_t *)rmixlfw_info.psb_physaddr_map, + (rmixlfw_mmap_t *)rmixlfw_info.avail_mem_map); +} + +static u_long +mem_clusters_init( + rmixlfw_mmap_t *psb_physaddr_map, + rmixlfw_mmap_t *avail_mem_map) +{ + uint64_t tmp; + uint64_t sz; + uint64_t sum; +#ifdef MEMSIZE + u_long memsize = MEMSIZE; +#endif + + rmixl_puts(psb_physaddr_map: ); +
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/mips
Module Name:src Committed By: cliff Date: Tue Sep 22 07:20:40 UTC 2009 Modified Files: src/sys/arch/mips/mips [matt-nb5-mips64]: bus_space_alignstride_chipdep.c Log Message: make bus read_N and bus write_N routines swizzle correctly if CHIP_LITTLE_ENDIAN or CHIP_BIG_ENDIAN is specified and CHIP_ACCESS_SIZE 1 To generate a diff of this commit: cvs rdiff -u -r1.10.18.2 -r1.10.18.3 \ src/sys/arch/mips/mips/bus_space_alignstride_chipdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/mips/bus_space_alignstride_chipdep.c diff -u src/sys/arch/mips/mips/bus_space_alignstride_chipdep.c:1.10.18.2 src/sys/arch/mips/mips/bus_space_alignstride_chipdep.c:1.10.18.3 --- src/sys/arch/mips/mips/bus_space_alignstride_chipdep.c:1.10.18.2 Tue Sep 15 02:20:07 2009 +++ src/sys/arch/mips/mips/bus_space_alignstride_chipdep.c Tue Sep 22 07:20:39 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: bus_space_alignstride_chipdep.c,v 1.10.18.2 2009/09/15 02:20:07 cliff Exp $ */ +/* $NetBSD: bus_space_alignstride_chipdep.c,v 1.10.18.3 2009/09/22 07:20:39 cliff Exp $ */ /*- * Copyright (c) 1998, 2000, 2001 The NetBSD Foundation, Inc. @@ -81,7 +81,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: bus_space_alignstride_chipdep.c,v 1.10.18.2 2009/09/15 02:20:07 cliff Exp $); +__KERNEL_RCSID(0, $NetBSD: bus_space_alignstride_chipdep.c,v 1.10.18.3 2009/09/22 07:20:39 cliff Exp $); #ifdef CHIP_EXTENT #include sys/extent.h @@ -122,6 +122,18 @@ #define CHIP_ACCESS_SIZE 1 #endif +#if CHIP_ACCESS_SIZE==1 +# define CHIP_SWAP_ACCESS(x) (x) +#elif CHIP_ACCESS_SIZE==2 +# define CHIP_SWAP_ACCESS(x) CHIP_SWAP16(x) +#elif CHIP_ACCESS_SIZE==4 +# define CHIP_SWAP_ACCESS(x) CHIP_SWAP32(x) +#elif CHIP_ACCESS_SIZE==8 +# define CHIP_SWAP_ACCESS(x) CHIP_SWAP64(x) +#else +# error your access size not implemented +#endif + /* * The logic here determines a few macros to support requirements for * whole-word accesses: @@ -968,8 +980,7 @@ #endif /* CHIP_ACCESS_SIZE 1 */ ptr = (void *)(h + CHIP_OFF8(off)); - - return *ptr 0xff; + return (uint8_t)(CHIP_SWAP_ACCESS(*ptr) 0xff); } inline uint16_t @@ -982,7 +993,7 @@ #endif /* CHIP_ACCESS_SIZE 2 */ ptr = (void *)(h + CHIP_OFF16(off)); - return CHIP_SWAP16(*ptr) 0x; + return (uint16_t)(CHIP_SWAP_ACCESS(*ptr) 0x); } inline uint32_t @@ -995,7 +1006,7 @@ #endif ptr = (void *)(h + CHIP_OFF32(off)); - return CHIP_SWAP32(*ptr) 0x; + return (uint32_t)(CHIP_SWAP_ACCESS(*ptr) 0x); } inline uint64_t @@ -1051,7 +1062,7 @@ #endif /* CHIP_ACCESS_SIZE 1 */ ptr = (void *)(h + CHIP_OFF8(off)); - *ptr = val; + *ptr = CHIP_SWAP_ACCESS((CHIP_TYPE)val); } inline void @@ -1064,7 +1075,10 @@ #endif /* CHIP_ACCESS_SIZE 2 */ ptr = (void *)(h + CHIP_OFF16(off)); - *ptr = CHIP_SWAP16(val); + if (CHIP_ACCESS_SIZE 2) + *ptr = CHIP_SWAP_ACCESS((CHIP_TYPE)val); + else + *ptr = CHIP_SWAP16(val); } inline void @@ -1072,12 +1086,15 @@ { #if CHIP_ACCESS_SIZE 4 volatile CHIP_TYPE *ptr; -#else /* CHIP_ACESSS_SIZE 4 */ +#else /* CHIP_ACCESS_SIZE 4 */ volatile uint32_t *ptr; #endif /* CHIP_ACCESS_SIZE 4 */ ptr = (void *)(h + CHIP_OFF32(off)); - *ptr = CHIP_SWAP32(val); + if (CHIP_ACCESS_SIZE 4) + *ptr = CHIP_SWAP_ACCESS((CHIP_TYPE)val); + else + *ptr = CHIP_SWAP32(val); } inline void @@ -1296,7 +1313,7 @@ { #if CHIP_ACCESS_SIZE 4 volatile CHIP_TYPE *ptr; -#else /* CHIP_ACESSS_SIZE 4 */ +#else /* CHIP_ACCESS_SIZE 4 */ volatile uint32_t *ptr; #endif /* CHIP_ACCESS_SIZE 4 */
CVS commit: [matt-nb5-mips64] src/sys/arch/evbmips/rmixl
Module Name:src Committed By: cliff Date: Tue Sep 22 07:47:30 UTC 2009 Modified Files: src/sys/arch/evbmips/rmixl [matt-nb5-mips64]: machdep.c Log Message: fix typo To generate a diff of this commit: cvs rdiff -u -r1.1.2.4 -r1.1.2.5 src/sys/arch/evbmips/rmixl/machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/evbmips/rmixl/machdep.c diff -u src/sys/arch/evbmips/rmixl/machdep.c:1.1.2.4 src/sys/arch/evbmips/rmixl/machdep.c:1.1.2.5 --- src/sys/arch/evbmips/rmixl/machdep.c:1.1.2.4 Tue Sep 22 07:15:37 2009 +++ src/sys/arch/evbmips/rmixl/machdep.c Tue Sep 22 07:47:30 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.1.2.4 2009/09/22 07:15:37 cliff Exp $ */ +/* $NetBSD: machdep.c,v 1.1.2.5 2009/09/22 07:47:30 cliff Exp $ */ /* * Copyright 2001, 2002 Wasabi Systems, Inc. @@ -112,7 +112,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.1.2.4 2009/09/22 07:15:37 cliff Exp $); +__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.1.2.5 2009/09/22 07:47:30 cliff Exp $); #include opt_ddb.h #include opt_com.h @@ -423,7 +423,7 @@ rmixl_puthex64((uint64_t)psb_physaddr_map); rmixl_puts(\r\n); - if (psb_physaddr_map != NULL) + if (psb_physaddr_map == NULL) rmixl_puts(WARNING: no psb_physaddr_map\r\n); else rmixlfw_phys_mmap = *psb_physaddr_map;
CVS commit: [matt-nb5-mips64] src/sys/arch/pmax
Module Name:src Committed By: matt Date: Wed Sep 16 19:23:18 UTC 2009 Modified Files: src/sys/arch/pmax/include [matt-nb5-mips64]: dec_prom.h src/sys/arch/pmax/pmax [matt-nb5-mips64]: machdep.c promcall.c src/sys/arch/pmax/stand/common [matt-nb5-mips64]: callvec.c printf.S startprog.S Log Message: Deal with some LP64 issues with only O32 console. Make bootloader invoke kernel compatible with both O32 and N32 To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.20.96.1 src/sys/arch/pmax/include/dec_prom.h cvs rdiff -u -r1.223.8.1.2.2 -r1.223.8.1.2.3 src/sys/arch/pmax/pmax/machdep.c cvs rdiff -u -r1.12 -r1.12.76.1 src/sys/arch/pmax/pmax/promcall.c cvs rdiff -u -r1.16 -r1.16.96.1 src/sys/arch/pmax/stand/common/callvec.c cvs rdiff -u -r1.5 -r1.5.18.1 src/sys/arch/pmax/stand/common/printf.S cvs rdiff -u -r1.4 -r1.4.18.1 src/sys/arch/pmax/stand/common/startprog.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/pmax/include/dec_prom.h diff -u src/sys/arch/pmax/include/dec_prom.h:1.20 src/sys/arch/pmax/include/dec_prom.h:1.20.96.1 --- src/sys/arch/pmax/include/dec_prom.h:1.20 Sun Dec 11 12:18:39 2005 +++ src/sys/arch/pmax/include/dec_prom.h Wed Sep 16 19:23:18 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: dec_prom.h,v 1.20 2005/12/11 12:18:39 christos Exp $ */ +/* $NetBSD: dec_prom.h,v 1.20.96.1 2009/09/16 19:23:18 matt Exp $ */ /* * Copyright (c) 1992, 1993 @@ -92,55 +92,59 @@ typedef void (*psig_t)(int); struct callback { - void *(*_memcpy) __P((void *, void *, int)); /* 00 */ - void *(*_memset) __P((void *, int, int)); /* 04 */ - char *(*_strcat) __P((char *, char *)); /* 08 */ - int (*_strcmp) __P((char *, char *)); /* 0c */ - char *(*_strcpy) __P((char *, char *)); /* 10 */ - int (*_strlen) __P((char *)); /* 14 */ - char *(*_strncat) __P((char *, char *, int)); /* 18 */ - char *(*_strncpy) __P((char *, char *, int)); /* 1c */ - int (*_strncmp) __P((char *, char *, int)); /* 20 */ - int (*_getchar) __P((void)); /* 24 */ - char *(*_gets) __P((char *)); /* 28 */ - int (*_puts) __P((char *));/* 2c */ - int (*_printf) __P((const char *, ...)); /* 30 */ - int (*_sprintf) __P((char *, char *, ...)); /* 34 */ - int (*_io_poll) __P((void)); /* 38 */ - long (*_strtol) __P((char *, char **, int)); /* 3c */ - psig_t (*_signal) __P((int, psig_t)); /* 40 */ - int (*_raise) __P((int));/* 44 */ - long (*_time) __P((long *));/* 48 */ - int (*_setjmp) __P((jmp_buf)); /* 4c */ - void (*_longjmp) __P((jmp_buf, int)); /* 50 */ - int (*_bootinit) __P((char *)); /* 54 */ - int (*_bootread) __P((int, void *, int)); /* 58 */ - int (*_bootwrite) __P((int, void *, int)); /* 5c */ - int (*_setenv) __P((char *, char *)); /* 60 */ - char *(*_getenv) __P((const char *)); /* 64 */ - int (*_unsetenv) __P((char *)); /* 68 */ - u_long (*_slot_address) __P((int)); /* 6c */ - void (*_wbflush) __P((void)); /* 70 */ - void (*_msdelay) __P((int));/* 74 */ - void (*_leds) __P((int));/* 78 */ - void (*_clear_cache) __P((char *, int)); /* 7c */ - int (*_getsysid) __P((void)); /* 80 */ - int (*_getbitmap) __P((memmap *)); /* 84 */ - int (*_disableintr) __P((int)); /* 88 */ - int (*_enableintr) __P((int)); /* 8c */ - int (*_testintr) __P((int)); /* 90 */ + void *(*_memcpy)(void *, void *, int); /* 00 */ + void *(*_memset)(void *, int, int); /* 04 */ + char *(*_strcat)(char *, char *); /* 08 */ + int (*_strcmp)(char *, char *); /* 0c */ + char *(*_strcpy)(char *, char *); /* 10 */ + int (*_strlen)(char *);/* 14 */ + char *(*_strncat)(char *, char *, int); /* 18 */ + char *(*_strncpy)(char *, char *, int); /* 1c */ + int (*_strncmp)(char *, char *, int); /* 20 */ + int (*_getchar)(void);/* 24 */ + char *(*_gets)(char *);/* 28 */ + int (*_puts)(char *);/* 2c */ + int (*_printf)(const char *, ...); /* 30 */ + int (*_sprintf)(char *, char *, ...); /* 34 */ + int (*_io_poll)(void);/* 38 */ + long (*_strtol)(char *, char **, int); /* 3c */ + psig_t (*_signal)(int, psig_t); /* 40 */ + int (*_raise)(int); /* 44 */ + long (*_time)(long *);/* 48 */ + int (*_setjmp)(jmp_buf);/* 4c */ + void (*_longjmp)(jmp_buf, int); /* 50 */ + int (*_bootinit)(char *);/* 54 */ + int (*_bootread)(int, void *, int); /* 58 */ + int (*_bootwrite)(int, void *, int); /* 5c */ + int (*_setenv)(char *, char *); /* 60 */ + char *(*_getenv)(const char *); /* 64 */ + int (*_unsetenv)(char *);/* 68 */ + u_long (*_slot_address)(int);/* 6c */ + void (*_wbflush)(void);/* 70 */ + void (*_msdelay)(int);/* 74 */ + void (*_leds)(int); /* 78 */ + void (*_clear_cache)(char *, int); /* 7c */ + int (*_getsysid)(void);/* 80 */ + int (*_getbitmap)(memmap *); /* 84 */ + int (*_disableintr)(int);/* 88 */ + int (*_enableintr)(int);/* 8c */ + int (*_testintr)(int);/* 90 */ void
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/include
Module Name:src Committed By: matt Date: Tue Sep 15 06:10:14 UTC 2009 Modified Files: src/sys/arch/mips/include [matt-nb5-mips64]: cpu.h Log Message: Define MIPS_HAS_LLADDR everywhere it should be. To generate a diff of this commit: cvs rdiff -u -r1.90.16.3 -r1.90.16.4 src/sys/arch/mips/include/cpu.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/include/cpu.h diff -u src/sys/arch/mips/include/cpu.h:1.90.16.3 src/sys/arch/mips/include/cpu.h:1.90.16.4 --- src/sys/arch/mips/include/cpu.h:1.90.16.3 Tue Sep 15 05:12:53 2009 +++ src/sys/arch/mips/include/cpu.h Tue Sep 15 06:10:14 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.h,v 1.90.16.3 2009/09/15 05:12:53 matt Exp $ */ +/* $NetBSD: cpu.h,v 1.90.16.4 2009/09/15 06:10:14 matt Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -190,6 +190,7 @@ # define MIPS_HAS_R4K_MMU 0 # define MIPS_HAS_CLOCK 0 # define MIPS_HAS_LLSC 0 +# define MIPS_HAS_LLADDR 0 #elif defined(MIPS3) || defined(MIPS4) @@ -209,6 +210,7 @@ # else /* _LOCORE */ # define MIPS_HAS_LLSC (mips_has_llsc) # endif /* _LOCORE */ +# define MIPS_HAS_LLADDR ((mips_cpu_flags CPU_MIPS_NO_LLADDR) == 0) #elif defined(MIPS32) @@ -220,6 +222,7 @@ # define MIPS_HAS_R4K_MMU 1 # define MIPS_HAS_CLOCK 1 # define MIPS_HAS_LLSC 1 +# define MIPS_HAS_LLADDR ((mips_cpu_flags CPU_MIPS_NO_LLADDR) == 0) #elif defined(MIPS64) @@ -231,6 +234,7 @@ # define MIPS_HAS_R4K_MMU 1 # define MIPS_HAS_CLOCK 1 # define MIPS_HAS_LLSC 1 +# define MIPS_HAS_LLADDR ((mips_cpu_flags CPU_MIPS_NO_LLADDR) == 0) #endif
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/mips
Module Name:src Committed By: cliff Date: Tue Sep 15 06:51:02 UTC 2009 Modified Files: src/sys/arch/mips/mips [matt-nb5-mips64]: mips_machdep.c Log Message: MIPS_XLS616 gets CPU_MIPS_NO_LLADDR To generate a diff of this commit: cvs rdiff -u -r1.205.4.1.2.1.2.12 -r1.205.4.1.2.1.2.13 \ src/sys/arch/mips/mips/mips_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/mips/mips_machdep.c diff -u src/sys/arch/mips/mips/mips_machdep.c:1.205.4.1.2.1.2.12 src/sys/arch/mips/mips/mips_machdep.c:1.205.4.1.2.1.2.13 --- src/sys/arch/mips/mips/mips_machdep.c:1.205.4.1.2.1.2.12 Sun Sep 13 03:30:27 2009 +++ src/sys/arch/mips/mips/mips_machdep.c Tue Sep 15 06:51:02 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.12 2009/09/13 03:30:27 cliff Exp $ */ +/* $NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.13 2009/09/15 06:51:02 cliff Exp $ */ /* * Copyright 2002 Wasabi Systems, Inc. @@ -112,7 +112,7 @@ #include sys/cdefs.h /* RCS ID Copyright macro defns */ -__KERNEL_RCSID(0, $NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.12 2009/09/13 03:30:27 cliff Exp $); +__KERNEL_RCSID(0, $NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.13 2009/09/15 06:51:02 cliff Exp $); #include opt_cputype.h #include opt_compat_netbsd32.h @@ -448,7 +448,7 @@ SB-1 }, { MIPS_PRID_CID_RMI, MIPS_XLS616, -1, -1, -1, 0, - MIPS64_FLAGS | CPU_MIPS_D_CACHE_COHERENT, + MIPS64_FLAGS | CPU_MIPS_D_CACHE_COHERENT | CPU_MIPS_NO_LLADDR, XLS616 }, { 0, 0, 0,0, 0, 0,
CVS commit: [matt-nb5-mips64] src/sys/arch
Module Name:src Committed By: matt Date: Tue Sep 15 06:58:22 UTC 2009 Added Files: src/sys/arch/algor/include [matt-nb5-mips64]: netbsd32_machdep.h src/sys/arch/sbmips/include [matt-nb5-mips64]: netbsd32_machdep.h Log Message: Add netbsd32_machdep.h for algor64 and sbmips64 To generate a diff of this commit: cvs rdiff -u -r0 -r1.1.2.1 src/sys/arch/algor/include/netbsd32_machdep.h cvs rdiff -u -r0 -r1.1.2.1 src/sys/arch/sbmips/include/netbsd32_machdep.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/sys/arch/algor/include/netbsd32_machdep.h diff -u /dev/null src/sys/arch/algor/include/netbsd32_machdep.h:1.1.2.1 --- /dev/null Tue Sep 15 06:58:23 2009 +++ src/sys/arch/algor/include/netbsd32_machdep.h Tue Sep 15 06:58:22 2009 @@ -0,0 +1,3 @@ +/* $NetBSD: netbsd32_machdep.h,v 1.1.2.1 2009/09/15 06:58:22 matt Exp $ */ + +#include mips/netbsd32_machdep.h Index: src/sys/arch/sbmips/include/netbsd32_machdep.h diff -u /dev/null src/sys/arch/sbmips/include/netbsd32_machdep.h:1.1.2.1 --- /dev/null Tue Sep 15 06:58:23 2009 +++ src/sys/arch/sbmips/include/netbsd32_machdep.h Tue Sep 15 06:58:22 2009 @@ -0,0 +1,3 @@ +/* $NetBSD: netbsd32_machdep.h,v 1.1.2.1 2009/09/15 06:58:22 matt Exp $ */ + +#include mips/netbsd32_machdep.h
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/rmi
Module Name:src Committed By: cliff Date: Tue Sep 15 10:32:41 UTC 2009 Modified Files: src/sys/arch/mips/rmi [matt-nb5-mips64]: rmixl_com.c Log Message: fix typo assigning bus_space_tag in rmixl_com_cnattach set sc_dev in rmixl_com_attach To generate a diff of this commit: cvs rdiff -u -r1.1.2.3 -r1.1.2.4 src/sys/arch/mips/rmi/rmixl_com.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/rmi/rmixl_com.c diff -u src/sys/arch/mips/rmi/rmixl_com.c:1.1.2.3 src/sys/arch/mips/rmi/rmixl_com.c:1.1.2.4 --- src/sys/arch/mips/rmi/rmixl_com.c:1.1.2.3 Tue Sep 15 02:33:39 2009 +++ src/sys/arch/mips/rmi/rmixl_com.c Tue Sep 15 10:32:41 2009 @@ -1,4 +1,4 @@ -/* $Id: rmixl_com.c,v 1.1.2.3 2009/09/15 02:33:39 cliff Exp $ */ +/* $Id: rmixl_com.c,v 1.1.2.4 2009/09/15 10:32:41 cliff Exp $ */ /*- * Copyright (c) 2006 Urbana-Champaign Independent Media Center. * Copyright (c) 2006 Garrett D'Amore. @@ -101,7 +101,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: rmixl_com.c,v 1.1.2.3 2009/09/15 02:33:39 cliff Exp $); +__KERNEL_RCSID(0, $NetBSD: rmixl_com.c,v 1.1.2.4 2009/09/15 10:32:41 cliff Exp $); #include sys/param.h #include sys/systm.h @@ -218,6 +218,7 @@ if (bus_space_map(bst, addr, size, 0, regs.cr_ioh)) return 0; /* FAIL */ + memset(regs, 0, sizeof(regs)); regs.cr_iot = bst; regs.cr_iobase = addr; regs.cr_nports = size; @@ -241,6 +242,7 @@ bus_addr_t addr; bus_size_t size; + sc-sc_dev = self; sc-sc_frequency = -1; /* XXX */ bst = obio-obio_eb_bst; @@ -253,6 +255,7 @@ return; } + memset(sc-sc_regs, 0, sizeof(sc-sc_regs)); COM_INIT_REGS(sc-sc_regs, bst, ioh, addr); sc-sc_regs.cr_nports = size; rmixl_com_initmap(sc-sc_regs); @@ -286,7 +289,7 @@ bus_size_t sz; struct com_regs regs; - bst = (bus_space_tag_t)rmixl_configuration.rc_el_memt; + bst = (bus_space_tag_t)rmixl_configuration.rc_eb_memt; sz = COM_NPORTS * sizeof(uint32_t); /* span of UART regs in bytes */ memset(regs, 0, sizeof(regs));
CVS commit: [matt-nb5-mips64] src/sys/arch/algor
Module Name:src Committed By: matt Date: Wed Sep 16 03:39:03 UTC 2009 Modified Files: src/sys/arch/algor/algor [matt-nb5-mips64]: machdep.c pmon.c Added Files: src/sys/arch/algor/conf [matt-nb5-mips64]: P5064-64 std.algor64 Log Message: Add ELF64 config for P5064 and do the LP64 dance in mach_init. Deal with envp being a list of 32bit pointers. XXX still need to do argv. To generate a diff of this commit: cvs rdiff -u -r1.38.10.1 -r1.38.10.2 src/sys/arch/algor/algor/machdep.c cvs rdiff -u -r1.5 -r1.5.18.1 src/sys/arch/algor/algor/pmon.c cvs rdiff -u -r0 -r1.1.2.1 src/sys/arch/algor/conf/P5064-64 \ src/sys/arch/algor/conf/std.algor64 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/algor/algor/machdep.c diff -u src/sys/arch/algor/algor/machdep.c:1.38.10.1 src/sys/arch/algor/algor/machdep.c:1.38.10.2 --- src/sys/arch/algor/algor/machdep.c:1.38.10.1 Wed Aug 26 03:46:38 2009 +++ src/sys/arch/algor/algor/machdep.c Wed Sep 16 03:39:03 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.38.10.1 2009/08/26 03:46:38 matt Exp $ */ +/* $NetBSD: machdep.c,v 1.38.10.2 2009/09/16 03:39:03 matt Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -106,7 +106,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.38.10.1 2009/08/26 03:46:38 matt Exp $); +__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.38.10.2 2009/09/16 03:39:03 matt Exp $); #include opt_algor_p4032.h #include opt_algor_p5064.h @@ -569,7 +569,13 @@ v = (void *) uvm_pageboot_alloc(USPACE); lwp0.l_addr = proc0paddr = (struct user *) v; lwp0.l_md.md_regs = (struct frame *)((char*)v + USPACE) - 1; - proc0paddr-u_pcb.pcb_context[11] = +#ifdef _LP64 + lwp0.l_md.md_regs-f_regs[_R_SR] = MIPS_SR_KX; +#endif + proc0paddr-u_pcb.pcb_context.val[_L_SR] = +#ifdef _LP64 + MIPS_SR_KX | +#endif MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */ /* Index: src/sys/arch/algor/algor/pmon.c diff -u src/sys/arch/algor/algor/pmon.c:1.5 src/sys/arch/algor/algor/pmon.c:1.5.18.1 --- src/sys/arch/algor/algor/pmon.c:1.5 Mon Apr 28 20:23:10 2008 +++ src/sys/arch/algor/algor/pmon.c Wed Sep 16 03:39:03 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: pmon.c,v 1.5 2008/04/28 20:23:10 martin Exp $ */ +/* $NetBSD: pmon.c,v 1.5.18.1 2009/09/16 03:39:03 matt Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -30,14 +30,18 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: pmon.c,v 1.5 2008/04/28 20:23:10 martin Exp $); +__KERNEL_RCSID(0, $NetBSD: pmon.c,v 1.5.18.1 2009/09/16 03:39:03 matt Exp $); #include sys/param.h #include sys/systm.h #include machine/pmon.h +#ifdef _LP64 +static char *environ[64]; +#else static char **environ; +#endif /* * pmon_init: @@ -47,9 +51,22 @@ void pmon_init(char *envp[]) { +#ifdef _LP64 + int32_t *envp32 = (void *) envp; + envp = environ; + if (envp32 != NULL) { + while (*envp32 != 0) { + KASSERT(envp - environ __arraycount(environ)); + *envp++ = (char *)(intptr_t)*envp32++; + } + } + KASSERT(envp - environ __arraycount(environ)); + *envp = NULL; +#else if (environ == NULL) environ = envp; +#endif #ifdef PMON_DEBUG printf(pmon_init: environ = %p (%p)\n, environ, *environ); #endif Added files: Index: src/sys/arch/algor/conf/P5064-64 diff -u /dev/null src/sys/arch/algor/conf/P5064-64:1.1.2.1 --- /dev/null Wed Sep 16 03:39:03 2009 +++ src/sys/arch/algor/conf/P5064-64 Wed Sep 16 03:39:03 2009 @@ -0,0 +1,12 @@ +# $NetBSD: P5064-64,v 1.1.2.1 2009/09/16 03:39:03 matt Exp $ +# +# Algorithmics P-5064 kernel (64-bit). +# + +include arch/algor/conf/P5064 + +include arch/algor/conf/std.algor64 + +no options SYMTAB_SPACE +options SYMTAB_SPACE=505000 +#ident P5064-64-$Revision: 1.1.2.1 $ Index: src/sys/arch/algor/conf/std.algor64 diff -u /dev/null src/sys/arch/algor/conf/std.algor64:1.1.2.1 --- /dev/null Wed Sep 16 03:39:03 2009 +++ src/sys/arch/algor/conf/std.algor64 Wed Sep 16 03:39:03 2009 @@ -0,0 +1,13 @@ +# $NetBSD: std.algor64,v 1.1.2.1 2009/09/16 03:39:03 matt Exp $ +# standard, required pmax info + +no makeoptions MACHINE_ARCH +makeoptions MACHINE_ARCH=mips64el + +# Standard exec-package options +options EXEC_ELF64 # 64-bit ELF support (native format) +#options EXEC_ELF32 +options COMPAT_NETBSD32 # exec NetBSD 32-bit binaries + +makeoptions LP64=yes +
CVS commit: [matt-nb5-mips64] src/sys/arch/algor/algor
Module Name:src Committed By: matt Date: Wed Sep 16 03:44:59 UTC 2009 Modified Files: src/sys/arch/algor/algor [matt-nb5-mips64]: machdep.c Log Message: Deal with argv on LP64 To generate a diff of this commit: cvs rdiff -u -r1.38.10.2 -r1.38.10.3 src/sys/arch/algor/algor/machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/algor/algor/machdep.c diff -u src/sys/arch/algor/algor/machdep.c:1.38.10.2 src/sys/arch/algor/algor/machdep.c:1.38.10.3 --- src/sys/arch/algor/algor/machdep.c:1.38.10.2 Wed Sep 16 03:39:03 2009 +++ src/sys/arch/algor/algor/machdep.c Wed Sep 16 03:44:59 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.38.10.2 2009/09/16 03:39:03 matt Exp $ */ +/* $NetBSD: machdep.c,v 1.38.10.3 2009/09/16 03:44:59 matt Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -106,7 +106,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.38.10.2 2009/09/16 03:39:03 matt Exp $); +__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.38.10.3 2009/09/16 03:44:59 matt Exp $); #include opt_algor_p4032.h #include opt_algor_p5064.h @@ -404,7 +404,12 @@ led_display('b', 'o', 'p', 't'); boothowto = 0; if (argc 1) { - for (cp = argv[1]; cp != NULL *cp != '\0'; cp++) { +#ifdef _LP64 + cp = (void *)(intptr_t)((int32_t *)argv)[1]; +#else + cp = argv[1]; +#endif + for (; cp != NULL *cp != '\0'; cp++) { switch (*cp) { #if defined(KGDB) || defined(DDB) case 'd': /* break into kernel debugger */
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/mips
Module Name:src Committed By: matt Date: Wed Sep 16 04:23:19 UTC 2009 Modified Files: src/sys/arch/mips/mips [matt-nb5-mips64]: mips_machdep.c Log Message: Set early clobber on status. Make sure to preserve KX. To generate a diff of this commit: cvs rdiff -u -r1.205.4.1.2.1.2.13 -r1.205.4.1.2.1.2.14 \ src/sys/arch/mips/mips/mips_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/mips/mips_machdep.c diff -u src/sys/arch/mips/mips/mips_machdep.c:1.205.4.1.2.1.2.13 src/sys/arch/mips/mips/mips_machdep.c:1.205.4.1.2.1.2.14 --- src/sys/arch/mips/mips/mips_machdep.c:1.205.4.1.2.1.2.13 Tue Sep 15 06:51:02 2009 +++ src/sys/arch/mips/mips/mips_machdep.c Wed Sep 16 04:23:19 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.13 2009/09/15 06:51:02 cliff Exp $ */ +/* $NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.14 2009/09/16 04:23:19 matt Exp $ */ /* * Copyright 2002 Wasabi Systems, Inc. @@ -112,7 +112,7 @@ #include sys/cdefs.h /* RCS ID Copyright macro defns */ -__KERNEL_RCSID(0, $NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.13 2009/09/15 06:51:02 cliff Exp $); +__KERNEL_RCSID(0, $NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.14 2009/09/16 04:23:19 matt Exp $); #include opt_cputype.h #include opt_compat_netbsd32.h @@ -1631,8 +1631,8 @@ cfc1 %1, $31\n\t .set reorder \n\t .set at - : =r (status), =r(fpcsr) - : r(f-f_regs[_R_SR] (MIPS_SR_COP_1_BIT|MIPS3_SR_FR))); + : =r (status), =r(fpcsr) + : r(f-f_regs[_R_SR] (MIPS_SR_COP_1_BIT|MIPS3_SR_FR|MIPS_SR_KX))); /* * Make sure we don't reenable FP when we return to userspace. @@ -1766,8 +1766,8 @@ ___STRING(COP0_HAZARD_FPUENABLE) .set reorder \n\t .set at - : =r(status) - : r(f-f_regs[_R_SR] (MIPS_SR_COP_1_BIT|MIPS3_SR_FR))); + : =r(status) + : r(f-f_regs[_R_SR] (MIPS_SR_COP_1_BIT|MIPS3_SR_FR|MIPS_SR_KX))); /* * load FP registers and establish processes' FP context.
CVS commit: [matt-nb5-mips64] src/sys/arch/sbmips/conf
Module Name:src Committed By: matt Date: Mon Sep 14 19:26:08 UTC 2009 Modified Files: src/sys/arch/sbmips/conf [matt-nb5-mips64]: GENERIC64 Log Message: Add COMPAT_NETBSD32 To generate a diff of this commit: cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/sys/arch/sbmips/conf/GENERIC64 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/sbmips/conf/GENERIC64 diff -u src/sys/arch/sbmips/conf/GENERIC64:1.1.2.1 src/sys/arch/sbmips/conf/GENERIC64:1.1.2.2 --- src/sys/arch/sbmips/conf/GENERIC64:1.1.2.1 Thu Aug 20 06:52:43 2009 +++ src/sys/arch/sbmips/conf/GENERIC64 Mon Sep 14 19:26:08 2009 @@ -3,3 +3,4 @@ makeoptions LP64=yes options EXEC_ELF64 +options COMPAT_NETBSD32
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/mips
Module Name:src Committed By: cliff Date: Tue Sep 15 02:20:07 UTC 2009 Modified Files: src/sys/arch/mips/mips [matt-nb5-mips64]: bus_space_alignstride_chipdep.c Log Message: fix 2 typos that show up when CHIP_LITTLE_ENDIAN or CHIP_BIG_ENDIAN flag is used To generate a diff of this commit: cvs rdiff -u -r1.10.18.1 -r1.10.18.2 \ src/sys/arch/mips/mips/bus_space_alignstride_chipdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/mips/bus_space_alignstride_chipdep.c diff -u src/sys/arch/mips/mips/bus_space_alignstride_chipdep.c:1.10.18.1 src/sys/arch/mips/mips/bus_space_alignstride_chipdep.c:1.10.18.2 --- src/sys/arch/mips/mips/bus_space_alignstride_chipdep.c:1.10.18.1 Tue Sep 8 08:11:29 2009 +++ src/sys/arch/mips/mips/bus_space_alignstride_chipdep.c Tue Sep 15 02:20:07 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: bus_space_alignstride_chipdep.c,v 1.10.18.1 2009/09/08 08:11:29 matt Exp $ */ +/* $NetBSD: bus_space_alignstride_chipdep.c,v 1.10.18.2 2009/09/15 02:20:07 cliff Exp $ */ /*- * Copyright (c) 1998, 2000, 2001 The NetBSD Foundation, Inc. @@ -81,7 +81,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: bus_space_alignstride_chipdep.c,v 1.10.18.1 2009/09/08 08:11:29 matt Exp $); +__KERNEL_RCSID(0, $NetBSD: bus_space_alignstride_chipdep.c,v 1.10.18.2 2009/09/15 02:20:07 cliff Exp $); #ifdef CHIP_EXTENT #include sys/extent.h @@ -1248,7 +1248,7 @@ #define CHIP_read_region_stream_N(BYTES,TYPE)\ void \ -__C(__BS(read_region_stream),BYTES)(void *v, bus_space_handle_t h, \ +__C(__BS(read_region_stream_),BYTES)(void *v, bus_space_handle_t h, \ bus_size_t o, TYPE *a, bus_size_t c)\ { \ \ @@ -1301,7 +1301,7 @@ #endif /* CHIP_ACCESS_SIZE 4 */ ptr = (void *)(h + CHIP_OFF32(off)); - *ptr = val + *ptr = val; } inline void
CVS commit: [matt-nb5-mips64] src/sys/arch/mips
Module Name:src Committed By: cliff Date: Tue Sep 15 02:32:02 UTC 2009 Modified Files: src/sys/arch/mips/conf [matt-nb5-mips64]: files.rmixl src/sys/arch/mips/rmi [matt-nb5-mips64]: rmixl_obio.c rmixl_obiovar.h rmixlvar.h Added Files: src/sys/arch/mips/rmi [matt-nb5-mips64]: rmixl_eb_space.c rmixl_el_space.c Removed Files: src/sys/arch/mips/rmi [matt-nb5-mips64]: rmixl_obio_space.c Log Message: obio now provides both big endian and little endian bus spaces to allow child devices to use according to access method needs also preparing for dual bus_dma methods, one for addrs 4GB, the other for all memory, including addrs = 4GB the bulk of XLS DMA work is still TBD To generate a diff of this commit: cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/sys/arch/mips/conf/files.rmixl cvs rdiff -u -r0 -r1.1.2.1 src/sys/arch/mips/rmi/rmixl_eb_space.c \ src/sys/arch/mips/rmi/rmixl_el_space.c cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/sys/arch/mips/rmi/rmixl_obio.c \ src/sys/arch/mips/rmi/rmixl_obiovar.h src/sys/arch/mips/rmi/rmixlvar.h cvs rdiff -u -r1.1.2.2 -r0 src/sys/arch/mips/rmi/rmixl_obio_space.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/conf/files.rmixl diff -u src/sys/arch/mips/conf/files.rmixl:1.1.2.1 src/sys/arch/mips/conf/files.rmixl:1.1.2.2 --- src/sys/arch/mips/conf/files.rmixl:1.1.2.1 Sun Sep 13 03:27:38 2009 +++ src/sys/arch/mips/conf/files.rmixl Tue Sep 15 02:32:01 2009 @@ -1,4 +1,4 @@ -# $NetBSD: files.rmixl,v 1.1.2.1 2009/09/13 03:27:38 cliff Exp $ +# $NetBSD: files.rmixl,v 1.1.2.2 2009/09/15 02:32:01 cliff Exp $ # # Configuration info for RMI XLP, XLR, XLS # @@ -10,7 +10,8 @@ device obio: obio, pcibus attach obio at mainbus file arch/mips/rmi/rmixl_obio.c obio needs-count -filearch/mips/rmi/rmixl_obio_space.c obio +filearch/mips/rmi/rmixl_el_space.c obio +filearch/mips/rmi/rmixl_eb_space.c obio # NS16550 compatible serial ports attach com at obio with rmixl_com Index: src/sys/arch/mips/rmi/rmixl_obio.c diff -u src/sys/arch/mips/rmi/rmixl_obio.c:1.1.2.2 src/sys/arch/mips/rmi/rmixl_obio.c:1.1.2.3 --- src/sys/arch/mips/rmi/rmixl_obio.c:1.1.2.2 Sun Sep 13 20:35:00 2009 +++ src/sys/arch/mips/rmi/rmixl_obio.c Tue Sep 15 02:32:02 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: rmixl_obio.c,v 1.1.2.2 2009/09/13 20:35:00 cliff Exp $ */ +/* $NetBSD: rmixl_obio.c,v 1.1.2.3 2009/09/15 02:32:02 cliff Exp $ */ /* * Copyright (c) 2001, 2002, 2003 Wasabi Systems, Inc. @@ -40,7 +40,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: rmixl_obio.c,v 1.1.2.2 2009/09/13 20:35:00 cliff Exp $); +__KERNEL_RCSID(0, $NetBSD: rmixl_obio.c,v 1.1.2.3 2009/09/15 02:32:02 cliff Exp $); #include sys/param.h #include sys/systm.h @@ -54,21 +54,19 @@ #include locators.h -int obio_match(struct device *, struct cfdata *, void *); -void obio_attach(struct device *, struct device *, void *); +static int obio_match(struct device *, struct cfdata *, void *); +static void obio_attach(struct device *, struct device *, void *); +static int obio_print(void *, const char *); +static int obio_search(struct device *, struct cfdata *, const int *, void *); +static void obio_bus_init(struct obio_softc *); -CFATTACH_DECL(obio, sizeof(struct device), +CFATTACH_DECL(obio, sizeof(struct obio_softc), obio_match, obio_attach, NULL, NULL); -int obio_print(void *, const char *); -int obio_search(struct device *, struct cfdata *, - const int *, void *); - -/* there can be only one */ -int obio_found; +int obio_found; int -obio_match(struct device *parent, struct cfdata *cf, void *aux) +obio_match(struct device * parent, struct cfdata *cf, void *aux) { if (obio_found) return 0; @@ -76,16 +74,17 @@ } void -obio_attach(struct device *parent, device_t self, void *aux) +obio_attach(struct device * parent, struct device * self, void *aux) { struct obio_softc *sc = device_private(self); bus_addr_t ba; obio_found = 1; - rmixl_obio_bus_init(); - ba = rmixl_obio_get_io_pbase(); - sc-sc_bst = rmixl_obio_get_bus_space_tag(); + ba = (bus_addr_t)rmixl_configuration.rc_io_pbase; + KASSERT(ba != 0); + + obio_bus_init(sc); aprint_normal( addr %#lx size %#x\n, ba, RMIXL_IO_DEV_SIZE); aprint_naive(\n); @@ -113,13 +112,14 @@ } int -obio_search(struct device *parent, struct cfdata *cf, +obio_search(struct device * parent, struct cfdata *cf, const int *ldesc, void *aux) { struct obio_softc *sc = device_private(parent); struct obio_attach_args obio; - obio.obio_bst = sc-sc_bst; + obio.obio_el_bst = sc-sc_el_bst; + obio.obio_eb_bst = sc-sc_eb_bst; obio.obio_addr = cf-cf_loc[OBIOCF_ADDR]; obio.obio_size = cf-cf_loc[OBIOCF_SIZE]; obio.obio_mult = cf-cf_loc[OBIOCF_MULT]; @@ -130,3 +130,39 @@ return 0; } + +static void +obio_bus_init(struct obio_softc *sc) +{ + static int done = 0; + + if (done) +
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/rmi
Module Name:src Committed By: cliff Date: Tue Sep 15 02:33:39 UTC 2009 Modified Files: src/sys/arch/mips/rmi [matt-nb5-mips64]: rmixl_com.c Log Message: always use big endian access methods bus space for com also do some code cleanup To generate a diff of this commit: cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/sys/arch/mips/rmi/rmixl_com.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/rmi/rmixl_com.c diff -u src/sys/arch/mips/rmi/rmixl_com.c:1.1.2.2 src/sys/arch/mips/rmi/rmixl_com.c:1.1.2.3 --- src/sys/arch/mips/rmi/rmixl_com.c:1.1.2.2 Sun Sep 13 07:00:30 2009 +++ src/sys/arch/mips/rmi/rmixl_com.c Tue Sep 15 02:33:39 2009 @@ -1,4 +1,4 @@ -/* $Id: rmixl_com.c,v 1.1.2.2 2009/09/13 07:00:30 cliff Exp $ */ +/* $Id: rmixl_com.c,v 1.1.2.3 2009/09/15 02:33:39 cliff Exp $ */ /*- * Copyright (c) 2006 Urbana-Champaign Independent Media Center. * Copyright (c) 2006 Garrett D'Amore. @@ -101,7 +101,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: rmixl_com.c,v 1.1.2.2 2009/09/13 07:00:30 cliff Exp $); +__KERNEL_RCSID(0, $NetBSD: rmixl_com.c,v 1.1.2.3 2009/09/15 02:33:39 cliff Exp $); #include sys/param.h #include sys/systm.h @@ -146,7 +146,8 @@ void rmixl_putchar_init(uint64_t io_pbase) { - com0addr = (uint32_t *)MIPS_PHYS_TO_KSEG1(io_pbase + RMIXL_IO_DEV_UART_1); + com0addr = (uint32_t *) + MIPS_PHYS_TO_KSEG1(io_pbase + RMIXL_IO_DEV_UART_1); } void @@ -154,13 +155,13 @@ { int timo = 15; - while ((com0addr[5] LSR_TXRDY) == 0) + while ((be32toh(com0addr[5]) LSR_TXRDY) == 0) if (--timo == 0) break; - com0addr[0] = c; + com0addr[0] = htobe32((uint32_t)c); - while ((com0addr[5] LSR_TSRE) == 0) + while ((be32toh(com0addr[5]) LSR_TSRE) == 0) if (--timo == 0) break; } @@ -174,70 +175,57 @@ rmixl_putchar(c); } +static char hexc[] = 0123456789abcdef; + +#define RMIXL_PUTHEX \ + u_int shift = sizeof(val) * 8;\ + rmixl_putchar('0'); \ + rmixl_putchar('x'); \ + do { \ + shift -= 4; \ + rmixl_putchar(hexc[(val shift) 0xf]); \ + } while(shift != 0) + void rmixl_puthex32(uint32_t val) { - char hexc[] = 0123456789abcdef; - - rmixl_putchar('0'); - rmixl_putchar('x'); - rmixl_putchar(hexc[(val 28) 0xf]); - rmixl_putchar(hexc[(val 24) 0xf]); - rmixl_putchar(hexc[(val 20) 0xf]); - rmixl_putchar(hexc[(val 16) 0xf]); - rmixl_putchar(hexc[(val 12) 0xf]); - rmixl_putchar(hexc[(val 8) 0xf]); - rmixl_putchar(hexc[(val 4) 0xf]); - rmixl_putchar(hexc[(val 0) 0xf]); + RMIXL_PUTHEX; } void rmixl_puthex64(uint64_t val) { - char hexc[] = 0123456789abcdef; - - rmixl_putchar('0'); - rmixl_putchar('x'); - rmixl_putchar(hexc[(val 60) 0xf]); - rmixl_putchar(hexc[(val 56) 0xf]); - rmixl_putchar(hexc[(val 52) 0xf]); - rmixl_putchar(hexc[(val 48) 0xf]); - rmixl_putchar(hexc[(val 44) 0xf]); - rmixl_putchar(hexc[(val 40) 0xf]); - rmixl_putchar(hexc[(val 36) 0xf]); - rmixl_putchar(hexc[(val 32) 0xf]); - rmixl_putchar(hexc[(val 28) 0xf]); - rmixl_putchar(hexc[(val 24) 0xf]); - rmixl_putchar(hexc[(val 20) 0xf]); - rmixl_putchar(hexc[(val 16) 0xf]); - rmixl_putchar(hexc[(val 12) 0xf]); - rmixl_putchar(hexc[(val 8) 0xf]); - rmixl_putchar(hexc[(val 4) 0xf]); - rmixl_putchar(hexc[(val 0) 0xf]); + RMIXL_PUTHEX; } int rmixl_com_match(device_t parent, cfdata_t cf, void *aux) { struct obio_attach_args *obio = aux; + bus_space_tag_t bst; + bus_addr_t addr; + bus_size_t size; struct com_regs regs; int rv; - if (com_is_console(obio-obio_bst, obio-obio_addr, regs.cr_ioh)) + bst = obio-obio_eb_bst; /* com is always big endian */ + addr = obio-obio_addr; + size = obio-obio_size; + + if (com_is_console(bst, addr, regs.cr_ioh)) return 1; - if (bus_space_map(obio-obio_bst, obio-obio_addr, obio-obio_size, - 0, regs.cr_ioh)) - return 0; - - regs.cr_iot = obio-obio_bst; - regs.cr_iobase = obio-obio_addr; - regs.cr_nports = obio-obio_size; + if (bus_space_map(bst, addr, size, 0, regs.cr_ioh)) + return 0; /* FAIL */ + + regs.cr_iot = bst; + regs.cr_iobase = addr; + regs.cr_nports = size; rmixl_com_initmap(regs); rv = com_probe_subr(regs); - bus_space_unmap(obio-obio_bst, regs.cr_ioh, obio-obio_size); + bus_space_unmap(bst, regs.cr_ioh, size); return rv; } @@ -248,36 +236,25 @@ struct rmixl_com_softc *rsc = device_private(self); struct com_softc *sc = rsc-sc_com; struct obio_attach_args *obio = aux; -#if 0 - prop_number_t prop; -#endif + bus_space_tag_t bst; bus_space_handle_t ioh; + bus_addr_t addr; + bus_size_t size; - sc-sc_dev = self; - -#if 0 - prop = prop_dictionary_get(device_properties(sc-sc_dev), - frequency); - if (prop == NULL) { - aprint_error(: unable to get frequency property\n); - return; - } - KASSERT(prop_object_type(prop) == PROP_TYPE_NUMBER); - - sc-sc_frequency = (int)prop_number_integer_value(prop); -#else sc-sc_frequency =
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/rmi
Module Name:src Committed By: cliff Date: Tue Sep 15 02:34:03 UTC 2009 Modified Files: src/sys/arch/mips/rmi [matt-nb5-mips64]: rmixl_mainbus.c Log Message: some code cleanup To generate a diff of this commit: cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/sys/arch/mips/rmi/rmixl_mainbus.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/rmi/rmixl_mainbus.c diff -u src/sys/arch/mips/rmi/rmixl_mainbus.c:1.1.2.1 src/sys/arch/mips/rmi/rmixl_mainbus.c:1.1.2.2 --- src/sys/arch/mips/rmi/rmixl_mainbus.c:1.1.2.1 Sun Sep 13 03:27:38 2009 +++ src/sys/arch/mips/rmi/rmixl_mainbus.c Tue Sep 15 02:34:03 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: rmixl_mainbus.c,v 1.1.2.1 2009/09/13 03:27:38 cliff Exp $ */ +/* $NetBSD: rmixl_mainbus.c,v 1.1.2.2 2009/09/15 02:34:03 cliff Exp $ */ /* * Copyright (c) 1994,1995 Mark Brinicombe. @@ -42,7 +42,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: rmixl_mainbus.c,v 1.1.2.1 2009/09/13 03:27:38 cliff Exp $); +__KERNEL_RCSID(0, $NetBSD: rmixl_mainbus.c,v 1.1.2.2 2009/09/15 02:34:03 cliff Exp $); #include sys/param.h #include sys/systm.h @@ -54,10 +54,10 @@ #include machine/bus.h #include locators.h -static int mainbusmatch __P((struct device *, struct cfdata *, void *)); -static void mainbusattach __P((struct device *, struct device *, void *)); -static int mainbussearch __P((struct device *, struct cfdata *, -const int *, void *)); +static int mainbusmatch(struct device *, struct cfdata *, void *); +static void mainbusattach(struct device *, struct device *, void *); +static int mainbussearch(struct device *, struct cfdata *, +const int *, void *); CFATTACH_DECL(mainbus, sizeof(struct device), mainbusmatch, mainbusattach, NULL, NULL); @@ -65,10 +65,7 @@ static int mainbus_found; static int -mainbusmatch(parent, cf, aux) - struct device *parent; - struct cfdata *cf; - void *aux; +mainbusmatch(struct device *parent, struct cfdata *cf, void *aux) { if (mainbus_found) return 0; @@ -76,11 +73,8 @@ } static int -mainbussearch(parent, cf, ldesc, aux) - struct device *parent; - struct cfdata *cf; - const int *ldesc; - void *aux; +mainbussearch(struct device *parent, struct cfdata *cf, + const int *ldesc, void *aux) { if (config_match(parent, cf, NULL) 0) config_attach(parent, cf, aux, NULL); @@ -89,13 +83,12 @@ } static void -mainbusattach(parent, self, aux) - struct device *parent; - struct device *self; - void *aux; +mainbusattach(struct device *parent, struct device *self, void *aux) { aprint_naive(\n); aprint_normal(\n); + mainbus_found = 1; + config_search_ia(mainbussearch, self, mainbus, NULL); }
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/rmi
Module Name:src Committed By: cliff Date: Tue Sep 15 03:04:03 UTC 2009 Modified Files: src/sys/arch/mips/rmi [matt-nb5-mips64]: rmixl_obio.c Log Message: make functions static To generate a diff of this commit: cvs rdiff -u -r1.1.2.3 -r1.1.2.4 src/sys/arch/mips/rmi/rmixl_obio.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/rmi/rmixl_obio.c diff -u src/sys/arch/mips/rmi/rmixl_obio.c:1.1.2.3 src/sys/arch/mips/rmi/rmixl_obio.c:1.1.2.4 --- src/sys/arch/mips/rmi/rmixl_obio.c:1.1.2.3 Tue Sep 15 02:32:02 2009 +++ src/sys/arch/mips/rmi/rmixl_obio.c Tue Sep 15 03:04:03 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: rmixl_obio.c,v 1.1.2.3 2009/09/15 02:32:02 cliff Exp $ */ +/* $NetBSD: rmixl_obio.c,v 1.1.2.4 2009/09/15 03:04:03 cliff Exp $ */ /* * Copyright (c) 2001, 2002, 2003 Wasabi Systems, Inc. @@ -40,7 +40,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: rmixl_obio.c,v 1.1.2.3 2009/09/15 02:32:02 cliff Exp $); +__KERNEL_RCSID(0, $NetBSD: rmixl_obio.c,v 1.1.2.4 2009/09/15 03:04:03 cliff Exp $); #include sys/param.h #include sys/systm.h @@ -65,7 +65,7 @@ int obio_found; -int +static int obio_match(struct device * parent, struct cfdata *cf, void *aux) { if (obio_found) @@ -73,7 +73,7 @@ return 1; } -void +static void obio_attach(struct device * parent, struct device * self, void *aux) { struct obio_softc *sc = device_private(self); @@ -95,7 +95,7 @@ config_search_ia(obio_search, self, obio, NULL); } -int +static int obio_print(void *aux, const char *pnp) { struct obio_attach_args *obio = aux; @@ -111,7 +111,7 @@ return (UNCONF); } -int +static int obio_search(struct device * parent, struct cfdata *cf, const int *ldesc, void *aux) {
CVS commit: [matt-nb5-mips64] src/sys/compat/netbsd32
Module Name:src Committed By: matt Date: Sun Sep 13 06:19:43 UTC 2009 Modified Files: src/sys/compat/netbsd32 [matt-nb5-mips64]: netbsd32_fs.c netbsd32_netbsd.c Log Message: Move netbsd32___mount50 from netbsd32_netbsd.c to netbsd32_fs.c To generate a diff of this commit: cvs rdiff -u -r1.55 -r1.55.14.1 src/sys/compat/netbsd32/netbsd32_fs.c cvs rdiff -u -r1.145.4.2.4.1 -r1.145.4.2.4.2 \ src/sys/compat/netbsd32/netbsd32_netbsd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_fs.c diff -u src/sys/compat/netbsd32/netbsd32_fs.c:1.55 src/sys/compat/netbsd32/netbsd32_fs.c:1.55.14.1 --- src/sys/compat/netbsd32/netbsd32_fs.c:1.55 Tue Jun 24 11:18:15 2008 +++ src/sys/compat/netbsd32/netbsd32_fs.c Sun Sep 13 06:19:43 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_fs.c,v 1.55 2008/06/24 11:18:15 ad Exp $ */ +/* $NetBSD: netbsd32_fs.c,v 1.55.14.1 2009/09/13 06:19:43 matt Exp $ */ /* * Copyright (c) 1998, 2001 Matthew R. Green @@ -27,7 +27,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: netbsd32_fs.c,v 1.55 2008/06/24 11:18:15 ad Exp $); +__KERNEL_RCSID(0, $NetBSD: netbsd32_fs.c,v 1.55.14.1 2009/09/13 06:19:43 matt Exp $); #include sys/param.h #include sys/systm.h @@ -50,6 +50,9 @@ #include sys/kauth.h #include sys/vfs_syscalls.h +#include fs/cd9660/cd9660_mount.h +#include ufs/ufs/ufsmount.h + #include compat/netbsd32/netbsd32.h #include compat/netbsd32/netbsd32_syscallargs.h #include compat/netbsd32/netbsd32_conv.h @@ -754,3 +757,132 @@ free(path, M_TEMP); return error; } + +int +netbsd32___mount50(struct lwp *l, const struct netbsd32___mount50_args *uap, + register_t *retval) +{ + /* { + syscallarg(netbsd32_charp) type; + syscallarg(netbsd32_charp) path; + syscallarg(int) flags; + syscallarg(netbsd32_voidp) data; + syscallarg(netbsd32_size_t) data_len; + } */ + char mtype[MNAMELEN]; + union { + struct netbsd32_ufs_args ufs_args; + struct netbsd32_mfs_args mfs_args; + struct netbsd32_iso_args iso_args; + } fs_args32; + union { + struct ufs_args ufs_args; + struct mfs_args mfs_args; + struct iso_args iso_args; + } fs_args; + const char *type = SCARG_P32(uap, type); + const char *path = SCARG_P32(uap, path); + int flags = SCARG(uap, flags); + void *data = SCARG_P32(uap, data); + size_t data_len = SCARG(uap, data_len); + enum uio_seg data_seg; + size_t len; + int error; + + error = copyinstr(type, mtype, sizeof(mtype), len); + if (error) + return error; + if (strcmp(mtype, MOUNT_MFS) == 0) { + if (data_len != sizeof(fs_args32.mfs_args)) + return EINVAL; + if ((flags MNT_GETARGS) == 0) { + error = copyin(data, fs_args32.mfs_args, + sizeof(fs_args32.mfs_args)); + if (error) +return error; + fs_args.mfs_args.fspec = + NETBSD32PTR64(fs_args32.mfs_args.fspec); + memset(fs_args.mfs_args._pad1, 0, + sizeof(fs_args.mfs_args._pad1)); + fs_args.mfs_args.base = + NETBSD32PTR64(fs_args32.mfs_args.base); + fs_args.mfs_args.size = fs_args32.mfs_args.size; + } + data_seg = UIO_SYSSPACE; + data = fs_args.mfs_args; + data_len = sizeof(fs_args.mfs_args); + } else if (strcmp(mtype, MOUNT_UFS) == 0) { + if (data_len sizeof(fs_args32.ufs_args)) + return EINVAL; + if ((flags MNT_GETARGS) == 0) { + error = copyin(data, fs_args32.ufs_args, + sizeof(fs_args32.ufs_args)); + if (error) +return error; + fs_args.ufs_args.fspec = + NETBSD32PTR64(fs_args32.ufs_args.fspec); + } + data_seg = UIO_SYSSPACE; + data = fs_args.ufs_args; + data_len = sizeof(fs_args.ufs_args); + } else if (strcmp(mtype, MOUNT_CD9660) == 0) { + if (data_len != sizeof(fs_args32.iso_args)) + return EINVAL; + if ((flags MNT_GETARGS) == 0) { + error = copyin(data, fs_args32.iso_args, + sizeof(fs_args32.iso_args)); + if (error) +return error; + fs_args.iso_args.fspec = + NETBSD32PTR64(fs_args32.iso_args.fspec); + memset(fs_args.iso_args._pad1, 0, + sizeof(fs_args.iso_args._pad1)); + fs_args.iso_args.flags = fs_args32.iso_args.flags; + } + data_seg = UIO_SYSSPACE; + data = fs_args.iso_args; + data_len = sizeof(fs_args.iso_args); + } else { + data_seg = UIO_USERSPACE; + } + error = do_sys_mount(l, NULL, type, path, flags, data, data_seg, + data_len, retval); + if (error) { + printf(do_sys_mount(%s): %p, %p, %#x, %p, %d, %zu, %p: failed: error %d\n, mtype, type, path, flags, data, data_seg, data_len, retval, error); + return error; + } + if (flags MNT_GETARGS) { + data_len = *retval; + if (strcmp(mtype, MOUNT_MFS) == 0) { + if (data_len != sizeof(fs_args.mfs_args)) +return EINVAL; + NETBSD32PTR32(fs_args32.mfs_args.fspec, + fs_args.mfs_args.fspec); + memset(fs_args32.mfs_args._pad1, 0, + sizeof(fs_args32.mfs_args._pad1)); + NETBSD32PTR32(fs_args32.mfs_args.base, + fs_args.mfs_args.base); +
CVS commit: [matt-nb5-mips64] src/sys/arch
Module Name:src Committed By: cliff Date: Sun Sep 13 07:00:31 UTC 2009 Modified Files: src/sys/arch/evbmips/rmixl [matt-nb5-mips64]: machdep.c src/sys/arch/mips/rmi [matt-nb5-mips64]: rmixl_com.c rmixl_obio_space.c rmixl_obiovar.h rmixlvar.h Log Message: improve how some config data are managed To generate a diff of this commit: cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/sys/arch/evbmips/rmixl/machdep.c cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/sys/arch/mips/rmi/rmixl_com.c \ src/sys/arch/mips/rmi/rmixl_obio_space.c \ src/sys/arch/mips/rmi/rmixl_obiovar.h src/sys/arch/mips/rmi/rmixlvar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/evbmips/rmixl/machdep.c diff -u src/sys/arch/evbmips/rmixl/machdep.c:1.1.2.1 src/sys/arch/evbmips/rmixl/machdep.c:1.1.2.2 --- src/sys/arch/evbmips/rmixl/machdep.c:1.1.2.1 Sun Sep 13 03:27:38 2009 +++ src/sys/arch/evbmips/rmixl/machdep.c Sun Sep 13 07:00:30 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.1.2.1 2009/09/13 03:27:38 cliff Exp $ */ +/* $NetBSD: machdep.c,v 1.1.2.2 2009/09/13 07:00:30 cliff Exp $ */ /* * Copyright 2001, 2002 Wasabi Systems, Inc. @@ -112,7 +112,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.1.2.1 2009/09/13 03:27:38 cliff Exp $); +__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.1.2.2 2009/09/13 07:00:30 cliff Exp $); #include opt_ddb.h #include opt_com.h @@ -264,7 +264,7 @@ physmem = btoc(memsize); rcp = rmixl_configuration; - rcp-rc_io_base = rmixlfw_info.io_base; + rcp-rc_io_pbase = MIPS_KSEG1_TO_PHYS(rmixlfw_info.io_base); rmixl_bus_mem_init(rcp-rc_memt, rcp); #ifdef NOTYET rmixl_bus_io_init(rcp-rc_iot, rcp); @@ -392,7 +392,7 @@ goto found; } - rmixl_putchar_init(rmixlfw_info.io_base); + rmixl_putchar_init(MIPS_KSEG1_TO_PHYS(rmixlfw_info.io_base)); rmixl_puts(\r\nWARNING: untested psb_version: ); rmixl_puthex64(rmixlfw_info.psb_version); rmixl_puts(\r\n); Index: src/sys/arch/mips/rmi/rmixl_com.c diff -u src/sys/arch/mips/rmi/rmixl_com.c:1.1.2.1 src/sys/arch/mips/rmi/rmixl_com.c:1.1.2.2 --- src/sys/arch/mips/rmi/rmixl_com.c:1.1.2.1 Sun Sep 13 03:27:38 2009 +++ src/sys/arch/mips/rmi/rmixl_com.c Sun Sep 13 07:00:30 2009 @@ -1,4 +1,4 @@ -/* $Id: rmixl_com.c,v 1.1.2.1 2009/09/13 03:27:38 cliff Exp $ */ +/* $Id: rmixl_com.c,v 1.1.2.2 2009/09/13 07:00:30 cliff Exp $ */ /*- * Copyright (c) 2006 Urbana-Champaign Independent Media Center. * Copyright (c) 2006 Garrett D'Amore. @@ -101,7 +101,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: rmixl_com.c,v 1.1.2.1 2009/09/13 03:27:38 cliff Exp $); +__KERNEL_RCSID(0, $NetBSD: rmixl_com.c,v 1.1.2.2 2009/09/13 07:00:30 cliff Exp $); #include sys/param.h #include sys/systm.h @@ -144,10 +144,9 @@ MIPS_PHYS_TO_KSEG1(RMIXL_IO_DEV_PBASE + RMIXL_IO_DEV_UART_1); void -rmixl_putchar_init(uint64_t io_base) +rmixl_putchar_init(uint64_t io_pbase) { - com0addr = (uint32_t *) - MIPS_PHYS_TO_KSEG1(io_base + RMIXL_IO_DEV_UART_1); + com0addr = (uint32_t *)MIPS_PHYS_TO_KSEG1(io_pbase + RMIXL_IO_DEV_UART_1); } void Index: src/sys/arch/mips/rmi/rmixl_obio_space.c diff -u src/sys/arch/mips/rmi/rmixl_obio_space.c:1.1.2.1 src/sys/arch/mips/rmi/rmixl_obio_space.c:1.1.2.2 --- src/sys/arch/mips/rmi/rmixl_obio_space.c:1.1.2.1 Sun Sep 13 03:27:38 2009 +++ src/sys/arch/mips/rmi/rmixl_obio_space.c Sun Sep 13 07:00:30 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: rmixl_obio_space.c,v 1.1.2.1 2009/09/13 03:27:38 cliff Exp $ */ +/* $NetBSD: rmixl_obio_space.c,v 1.1.2.2 2009/09/13 07:00:30 cliff Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -34,8 +34,9 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: rmixl_obio_space.c,v 1.1.2.1 2009/09/13 03:27:38 cliff Exp $); +__KERNEL_RCSID(0, $NetBSD: rmixl_obio_space.c,v 1.1.2.2 2009/09/13 07:00:30 cliff Exp $); +#include sys/types.h #include sys/param.h #include machine/bus.h @@ -50,32 +51,34 @@ /* MEM region 1 */ #define CHIP_W1_BUS_START(v) 0 #define CHIP_W1_BUS_END(v) (RMIXL_IO_DEV_SIZE - 1) -#define CHIP_W1_SYS_START(v) (((struct rmixl_config *)(v))-rc_io_base) +#define CHIP_W1_SYS_START(v) (((struct rmixl_config *)(v))-rc_io_pbase) #define CHIP_W1_SYS_END(v) (CHIP_W1_SYS_START(v) + RMIXL_IO_DEV_SIZE - 1) -struct mips_bus_space rmixl_bus_memt; -struct mips_bus_dma_tag rmixl_bus_dmat; - void rmixl_obio_bus_init(void) { static int done = 0; + if (done) return; done = 1; - - rmixl_bus_mem_init(rmixl_bus_memt, rmixl_configuration); + rmixl_bus_mem_init(rmixl_configuration.rc_memt, rmixl_configuration); #ifdef NOTYET - rmixl_dma_init(NULL, rmixl_bus_dmat); + rmixl_dma_init(rmixl_configuration.rc_pci_dmat); #endif } -/* this primarily exists so we can get to the console... */ bus_space_tag_t rmixl_obio_get_bus_space_tag(void) { - rmixl_obio_bus_init(); - return (bus_space_tag_t)rmixl_bus_memt; + return
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/mips
Module Name:src Committed By: matt Date: Sun Sep 13 23:06:22 UTC 2009 Modified Files: src/sys/arch/mips/mips [matt-nb5-mips64]: cpu_exec.c Log Message: Try to find an exact interp match before defaulting to one supplied: o32: ld.elf_so-32 n32: ld.elf_so-n32 o64: ld.elf_so-o64 n64: ld.elf_so-64 To generate a diff of this commit: cvs rdiff -u -r1.50.54.1.4.8 -r1.50.54.1.4.9 \ src/sys/arch/mips/mips/cpu_exec.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/mips/cpu_exec.c diff -u src/sys/arch/mips/mips/cpu_exec.c:1.50.54.1.4.8 src/sys/arch/mips/mips/cpu_exec.c:1.50.54.1.4.9 --- src/sys/arch/mips/mips/cpu_exec.c:1.50.54.1.4.8 Sat Sep 5 03:03:44 2009 +++ src/sys/arch/mips/mips/cpu_exec.c Sun Sep 13 23:06:22 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu_exec.c,v 1.50.54.1.4.8 2009/09/05 03:03:44 matt Exp $ */ +/* $NetBSD: cpu_exec.c,v 1.50.54.1.4.9 2009/09/13 23:06:22 matt Exp $ */ /* * Copyright (c) 1992, 1993 @@ -35,7 +35,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: cpu_exec.c,v 1.50.54.1.4.8 2009/09/05 03:03:44 matt Exp $); +__KERNEL_RCSID(0, $NetBSD: cpu_exec.c,v 1.50.54.1.4.9 2009/09/13 23:06:22 matt Exp $); #include opt_compat_netbsd.h #include opt_compat_ultrix.h @@ -47,6 +47,7 @@ #include sys/malloc.h #include sys/vnode.h #include sys/exec.h +#include sys/namei.h #include sys/resourcevar.h #include uvm/uvm_extern.h @@ -309,14 +310,52 @@ return 0; } +static int +elf_check_itp(struct exec_package *epp, const char *itp, + const char *itp_suffix) +{ + int error = 0; + if (itp) { + /* + * If the path is exactly /usr/libexec/ld.elf_so, first + * try to see if /usr/libexec/ld.elf_so-abi exists + * and if so, use that instead. + * XXX maybe move this into compat/common + */ + if (strcmp(itp, /usr/libexec/ld.elf_so) == 0 || + strcmp(itp, /libexec/ld.elf_so) == 0) { + struct nameidata nd; + char *path; + + path = PNBUF_GET(); + snprintf(path, MAXPATHLEN, %s-%s, itp, itp_suffix); + NDINIT(nd, LOOKUP, FOLLOW, UIO_SYSSPACE, path); + error = namei(nd); + /* + * If that worked, replace interpreter in case we + * actually need to load it + */ + if (error == 0) { +if (epp-ep_interp != NULL) + vrele(epp-ep_interp); +epp-ep_interp = nd.ni_vp; + } + PNBUF_PUT(path); + error = 0; + } + } + return error; +} + #if EXEC_ELF32 int mips_netbsd_elf32_probe(struct lwp *l, struct exec_package *epp, void *eh0, - char *idt, vaddr_t *start_p) + char *itp, vaddr_t *start_p) { struct proc * const p = l-l_proc; const Elf32_Ehdr * const eh = eh0; int old_abi = p-p_md.md_abi; + const char *itp_suffix = NULL; /* * Verify we can support the architecture. @@ -350,22 +389,26 @@ switch (eh-e_flags (EF_MIPS_ABI|EF_MIPS_ABI2)) { #if !defined(__mips_o32) case EF_MIPS_ABI2: + itp_suffix = n32; p-p_md.md_abi = _MIPS_BSD_API_N32; if (old_abi != p-p_md.md_abi) printf(pid %d(%s): ABI set to N32 (e_flags=%#x)\n, p-p_pid, p-p_comm, eh-e_flags); - return 0; + break; #endif case EF_MIPS_ABI_O32: + itp_suffix = o32; p-p_md.md_abi = _MIPS_BSD_API_O32; #ifdef COMPAT_16 *start_p = ELF32_LINK_ADDR; #endif if (old_abi != p-p_md.md_abi) printf(pid %d(%s): ABI set to O32 (e_flags=%#x)\n, p-p_pid, p-p_comm, eh-e_flags); - return 0; + break; default: return ENOEXEC; } + + return elf_check_itp(epp, itp, itp_suffix); } void @@ -407,11 +450,12 @@ #if EXEC_ELF64 int mips_netbsd_elf64_probe(struct lwp *l, struct exec_package *epp, void *eh0, - char *idt, vaddr_t *start_p) + char *itp, vaddr_t *start_p) { struct proc * const p = l-l_proc; const Elf64_Ehdr * const eh = eh0; int old_abi = p-p_md.md_abi; + const char *itp_suffix = NULL; switch (eh-e_flags EF_MIPS_ARCH) { case EF_MIPS_ARCH_1: @@ -442,18 +486,22 @@ switch (eh-e_flags (EF_MIPS_ABI|EF_MIPS_ABI2)) { case 0: + itp_suffix = 64; p-p_md.md_abi = _MIPS_BSD_API_N64; if (old_abi != p-p_md.md_abi) printf(pid %d(%s): ABI set to N64 (e_flags=%#x)\n, p-p_pid, p-p_comm, eh-e_flags); - return 0; + break; case EF_MIPS_ABI_O64: + itp_suffix = o64; p-p_md.md_abi = _MIPS_BSD_API_O64; if (old_abi != p-p_md.md_abi) printf(pid %d(%s): ABI set to O64 (e_flags=%#x)\n, p-p_pid, p-p_comm, eh-e_flags); - return 0; + break; default: return ENOEXEC; } + + return elf_check_itp(epp, itp, itp_suffix); } void
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/include
Module Name:src Committed By: matt Date: Sun Sep 13 23:38:04 UTC 2009 Modified Files: src/sys/arch/mips/include [matt-nb5-mips64]: mcontext.h Log Message: Use __int32_t instead int32_t to make userland happy. To generate a diff of this commit: cvs rdiff -u -r1.8.18.2 -r1.8.18.3 src/sys/arch/mips/include/mcontext.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/include/mcontext.h diff -u src/sys/arch/mips/include/mcontext.h:1.8.18.2 src/sys/arch/mips/include/mcontext.h:1.8.18.3 --- src/sys/arch/mips/include/mcontext.h:1.8.18.2 Sat Sep 12 17:23:06 2009 +++ src/sys/arch/mips/include/mcontext.h Sun Sep 13 23:38:04 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: mcontext.h,v 1.8.18.2 2009/09/12 17:23:06 matt Exp $ */ +/* $NetBSD: mcontext.h,v 1.8.18.3 2009/09/13 23:38:04 matt Exp $ */ /*- * Copyright (c) 1999, 2002 The NetBSD Foundation, Inc. @@ -110,7 +110,7 @@ union { double __fp_dregs[16]; float __fp_fregs[32]; - int32_t __fp_regs[32]; + __int32_t __fp_regs[32]; } __fp_r; unsigned int __fp_csr; unsigned int __fp_pad; @@ -128,7 +128,7 @@ } mcontext_t; #if defined(_KERNEL) defined(_LP64) -typedef int32_t __greg32_t; +typedef __int32_t __greg32_t; typedef __greg32_t __gregset32_t[_NGREG]; typedef struct {
CVS commit: [matt-nb5-mips64] src/sys/arch/evbmips/conf
Module Name:src Committed By: matt Date: Sat Sep 12 16:49:05 UTC 2009 Modified Files: src/sys/arch/evbmips/conf [matt-nb5-mips64]: MALTA Log Message: bump SYMTAB_SPACE To generate a diff of this commit: cvs rdiff -u -r1.48 -r1.48.8.1 src/sys/arch/evbmips/conf/MALTA Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/evbmips/conf/MALTA diff -u src/sys/arch/evbmips/conf/MALTA:1.48 src/sys/arch/evbmips/conf/MALTA:1.48.8.1 --- src/sys/arch/evbmips/conf/MALTA:1.48 Thu Jul 31 07:41:00 2008 +++ src/sys/arch/evbmips/conf/MALTA Sat Sep 12 16:49:05 2009 @@ -1,10 +1,10 @@ -# $NetBSD: MALTA,v 1.48 2008/07/31 07:41:00 simonb Exp $ +# $NetBSD: MALTA,v 1.48.8.1 2009/09/12 16:49:05 matt Exp $ include arch/evbmips/conf/std.malta #options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident MALTA-$Revision: 1.48 $ +#ident MALTA-$Revision: 1.48.8.1 $ maxusers 32 @@ -32,13 +32,14 @@ # Debugging options options DIAGNOSTIC # extra kernel sanity checking options DEBUG # extra kernel debugging support +#options SYSCALL_DEBUG # symbolic syscall names #options KMEMSTATS # kernel memory statistics (vmstat -m) options USERCONF # userconf(4) support #options SYSCTL_INCLUDE_DESCR # Include sysctl descriptions in kernel options DDB # kernel dynamic debugger options DDB_HISTORY_SIZE=100 # enable history editing in DDB makeoptions DEBUG=-g # compile full symbol table -options SYMTAB_SPACE=175000 # size for embedded symbol table +options SYMTAB_SPACE=375000 # size for embedded symbol table # Compatibility options #options COMPAT_43 # compatibility with 4.3BSD binaries
CVS commit: [matt-nb5-mips64] src/sys/arch/evbmips/conf
Module Name:src Committed By: matt Date: Sat Sep 12 16:49:57 UTC 2009 Modified Files: src/sys/arch/evbmips/conf [matt-nb5-mips64]: MALTA64 Log Message: Add COMPAT_NETBSD32 and increase SYMTAB_SPACE To generate a diff of this commit: cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/sys/arch/evbmips/conf/MALTA64 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/evbmips/conf/MALTA64 diff -u src/sys/arch/evbmips/conf/MALTA64:1.1.2.2 src/sys/arch/evbmips/conf/MALTA64:1.1.2.3 --- src/sys/arch/evbmips/conf/MALTA64:1.1.2.2 Wed Aug 26 04:47:29 2009 +++ src/sys/arch/evbmips/conf/MALTA64 Sat Sep 12 16:49:57 2009 @@ -1,4 +1,4 @@ -# $NetBSD: MALTA64,v 1.1.2.2 2009/08/26 04:47:29 matt Exp $ +# $NetBSD: MALTA64,v 1.1.2.3 2009/09/12 16:49:57 matt Exp $ # include arch/evbmips/conf/MALTA @@ -6,5 +6,8 @@ no options MIPS32 options EXEC_ELF64 +options COMPAT_NETBSD32 +no options SYMTAB_SPACE +options SYMTAB_SPACE=395000 # size for embedded symbol table no ath*
CVS commit: [matt-nb5-mips64] src/sys/conf
Module Name:src Committed By: matt Date: Sat Sep 12 16:51:41 UTC 2009 Modified Files: src/sys/conf [matt-nb5-mips64]: Makefile.kern.inc Log Message: Allow DBSYM to error out now that binutils can strip $L locals. To generate a diff of this commit: cvs rdiff -u -r1.118.4.2.4.1 -r1.118.4.2.4.2 src/sys/conf/Makefile.kern.inc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/conf/Makefile.kern.inc diff -u src/sys/conf/Makefile.kern.inc:1.118.4.2.4.1 src/sys/conf/Makefile.kern.inc:1.118.4.2.4.2 --- src/sys/conf/Makefile.kern.inc:1.118.4.2.4.1 Sat Sep 5 03:49:50 2009 +++ src/sys/conf/Makefile.kern.inc Sat Sep 12 16:51:41 2009 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.kern.inc,v 1.118.4.2.4.1 2009/09/05 03:49:50 matt Exp $ +# $NetBSD: Makefile.kern.inc,v 1.118.4.2.4.2 2009/09/12 16:51:41 matt Exp $ # # This file contains common `MI' targets and definitions and it is included # at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}. @@ -235,7 +235,7 @@ SYSTEM_LD_TAIL+=; \ if grep '^\#define.*SYMTAB_SPACE' opt_ddbparam.h /dev/null; then \ echo ${DBSYM} $@; \ - ${DBSYM} $@ || true; \ + ${DBSYM} $@; \ fi SYSTEM_LD_HEAD+=${SYSTEM_LD_HEAD_EXTRA}
CVS commit: [matt-nb5-mips64] src/sys/kern
Module Name:src Committed By: matt Date: Sat Sep 12 16:53:50 UTC 2009 Modified Files: src/sys/kern [matt-nb5-mips64]: kern_xxx.c Log Message: Print out syscallname on ret too. To generate a diff of this commit: cvs rdiff -u -r1.70 -r1.70.20.1 src/sys/kern/kern_xxx.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/kern/kern_xxx.c diff -u src/sys/kern/kern_xxx.c:1.70 src/sys/kern/kern_xxx.c:1.70.20.1 --- src/sys/kern/kern_xxx.c:1.70 Fri Apr 25 11:23:42 2008 +++ src/sys/kern/kern_xxx.c Sat Sep 12 16:53:50 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_xxx.c,v 1.70 2008/04/25 11:23:42 ad Exp $ */ +/* $NetBSD: kern_xxx.c,v 1.70.20.1 2009/09/12 16:53:50 matt Exp $ */ /* * Copyright (c) 1982, 1986, 1989, 1993 @@ -32,7 +32,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: kern_xxx.c,v 1.70 2008/04/25 11:23:42 ad Exp $); +__KERNEL_RCSID(0, $NetBSD: kern_xxx.c,v 1.70.20.1 2009/09/12 16:53:50 matt Exp $); #include opt_syscall_debug.h @@ -178,8 +178,9 @@ ) printf(OUT OF RANGE (%ld), (long)code); else - printf(%ld ret: err = %d, rv = 0x%lx,0x%lx, (long)code, - error, (long)retval[0], (long)retval[1]); + printf(%ld ret %s: err = %d, rv = 0x%lx,0x%lx, (long)code, + em-e_syscallnames[code], error, + (long)retval[0], (long)retval[1]); printf(\n); } #endif /* SYSCALL_DEBUG */
CVS commit: [matt-nb5-mips64] src/sys/arch/evbmips/include
Module Name:src Committed By: matt Date: Sat Sep 12 16:50:49 UTC 2009 Added Files: src/sys/arch/evbmips/include [matt-nb5-mips64]: netbsd32_machdep.h Log Message: Add include stub for mips/netbsd32_machdep.h To generate a diff of this commit: cvs rdiff -u -r0 -r1.1.2.1 src/sys/arch/evbmips/include/netbsd32_machdep.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/sys/arch/evbmips/include/netbsd32_machdep.h diff -u /dev/null src/sys/arch/evbmips/include/netbsd32_machdep.h:1.1.2.1 --- /dev/null Sat Sep 12 16:50:49 2009 +++ src/sys/arch/evbmips/include/netbsd32_machdep.h Sat Sep 12 16:50:48 2009 @@ -0,0 +1,3 @@ +/* $NetBSD: netbsd32_machdep.h,v 1.1.2.1 2009/09/12 16:50:48 matt Exp $ */ + +#include mips/netbsd32_machdep.h
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/include
Module Name:src Committed By: matt Date: Sat Sep 12 17:16:08 UTC 2009 Modified Files: src/sys/arch/mips/include [matt-nb5-mips64]: types.h Log Message: Because of the N32 support, register32_t on mips is really 64-bits wide. To generate a diff of this commit: cvs rdiff -u -r1.43.36.9 -r1.43.36.10 src/sys/arch/mips/include/types.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/include/types.h diff -u src/sys/arch/mips/include/types.h:1.43.36.9 src/sys/arch/mips/include/types.h:1.43.36.10 --- src/sys/arch/mips/include/types.h:1.43.36.9 Wed Sep 9 04:48:28 2009 +++ src/sys/arch/mips/include/types.h Sat Sep 12 17:16:07 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: types.h,v 1.43.36.9 2009/09/09 04:48:28 matt Exp $ */ +/* $NetBSD: types.h,v 1.43.36.10 2009/09/12 17:16:07 matt Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -98,10 +98,8 @@ typedef __uint64_t uregister_t; typedef __int64_t mips_reg_t; /* do not use */ typedef __uint64_t mips_ureg_t; /* do not use */ -typedef __int32_t register32_t; -typedef __uint32_t uregister32_t; -#define PRIxREGISTER32 PRIx32 -#define PRIxUREGISTER32 PRIx32 +typedef __int64_t register32_t; +typedef __uint64_t uregister32_t; #define PRIxREGISTER PRIx64 #define PRIxUREGISTER PRIx64 #endif /* __mips_o32 */
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/include
Module Name:src Committed By: matt Date: Sat Sep 12 17:16:38 UTC 2009 Modified Files: src/sys/arch/mips/include [matt-nb5-mips64]: vmparam.h Log Message: Add some COMPAT_NETBSD32 definitions of common macros. To generate a diff of this commit: cvs rdiff -u -r1.41.28.3 -r1.41.28.4 src/sys/arch/mips/include/vmparam.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/include/vmparam.h diff -u src/sys/arch/mips/include/vmparam.h:1.41.28.3 src/sys/arch/mips/include/vmparam.h:1.41.28.4 --- src/sys/arch/mips/include/vmparam.h:1.41.28.3 Tue Sep 8 00:52:14 2009 +++ src/sys/arch/mips/include/vmparam.h Sat Sep 12 17:16:38 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: vmparam.h,v 1.41.28.3 2009/09/08 00:52:14 matt Exp $ */ +/* $NetBSD: vmparam.h,v 1.41.28.4 2009/09/12 17:16:38 matt Exp $ */ /* * Copyright (c) 1992, 1993 @@ -98,7 +98,8 @@ * and some QED CPUs perform some virtual address checks before the * offset is calculated. */ -#define USRSTACK 0x7000 /* Start of user stack */ +#define USRSTACK (VM_MAXUSER_ADDRESS-PAGE_SIZE) /* Start of user stack */ +#define USRSTACK32 ((uint32_t)VM_MAXUSER32_ADDRESS-PAGE_SIZE) /* alignment requirement for u-area space in bytes */ #define USPACE_ALIGN USPACE @@ -123,6 +124,25 @@ #endif /* + * Virtual memory related constants, all in bytes + */ +#ifndef MAXTSIZ32 +#define MAXTSIZ32 MAXTSIZ /* max text size */ +#endif +#ifndef DFLDSIZ32 +#define DFLDSIZ32 DFLDSIZ /* initial data size limit */ +#endif +#ifndef MAXDSIZ32 +#define MAXDSIZ32 MAXDSIZ /* max data size */ +#endif +#ifndef DFLSSIZ32 +#define DFLSSIZ32 DFLTSIZ /* initial stack size limit */ +#endif +#ifndef MAXSSIZ32 +#define MAXSSIZ32 MAXSSIZ /* max stack size */ +#endif + +/* * PTEs for mapping user space into the kernel for phyio operations. * The default PTE number is enough to cover 8 disks * MAXBSIZE. */ @@ -166,6 +186,7 @@ #define VM_MAX_KERNEL_ADDRESS ((vaddr_t)-0x4000) /* 0xC000 */ #endif #endif +#define VM_MAXUSER32_ADDRESS ((vaddr_t)-0x7fff-1)/* 0x8000 */ /* * The address to which unspecified mapping requests default @@ -173,6 +194,8 @@ #define __USE_TOPDOWN_VM #define VM_DEFAULT_ADDRESS(da, sz) \ trunc_page(USRSTACK - MAXSSIZ - (sz)) +#define VM_DEFAULT_ADDRESS32(da, sz) \ + trunc_page(USRSTACK32 - MAXSSIZ32 - (sz)) /* virtual sizes (bytes) for various kernel submaps */ #define VM_PHYS_SIZE (USRIOSIZE*PAGE_SIZE)
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/include
Module Name:src Committed By: matt Date: Sat Sep 12 17:17:05 UTC 2009 Modified Files: src/sys/arch/mips/include [matt-nb5-mips64]: mips_param.h Log Message: Add MACHINE32_ARCH definitions. To generate a diff of this commit: cvs rdiff -u -r1.23.78.3 -r1.23.78.4 src/sys/arch/mips/include/mips_param.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/include/mips_param.h diff -u src/sys/arch/mips/include/mips_param.h:1.23.78.3 src/sys/arch/mips/include/mips_param.h:1.23.78.4 --- src/sys/arch/mips/include/mips_param.h:1.23.78.3 Mon Sep 7 21:50:24 2009 +++ src/sys/arch/mips/include/mips_param.h Sat Sep 12 17:17:05 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: mips_param.h,v 1.23.78.3 2009/09/07 21:50:24 matt Exp $ */ +/* $NetBSD: mips_param.h,v 1.23.78.4 2009/09/12 17:17:05 matt Exp $ */ #ifdef _KERNEL #include machine/cpu.h @@ -11,6 +11,8 @@ # if defined(__mips_n32) || defined(__mips_n64) # define _MACHINE_ARCH mips64eb # define MACHINE_ARCH mips64eb +# define _MACHINE32_ARCH mipseb +# define MACHINE32_ARCH mipseb # else # define _MACHINE_ARCH mipseb # define MACHINE_ARCH mipseb @@ -19,6 +21,8 @@ # if defined(__mips_n32) || defined(__mips_n64) # define _MACHINE_ARCH mips64el # define MACHINE_ARCH mips64el +# define _MACHINE32_ARCH mipsel +# define MACHINE32_ARCH mipsel # else # define _MACHINE_ARCH mipsel # define MACHINE_ARCH mipsel
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/include
Module Name:src Committed By: matt Date: Sat Sep 12 17:21:52 UTC 2009 Added Files: src/sys/arch/mips/include [matt-nb5-mips64]: netbsd32_machdep.h Log Message: Add support for COMPAT_NETBSD32 To generate a diff of this commit: cvs rdiff -u -r0 -r1.1.2.1 src/sys/arch/mips/include/netbsd32_machdep.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/sys/arch/mips/include/netbsd32_machdep.h diff -u /dev/null src/sys/arch/mips/include/netbsd32_machdep.h:1.1.2.1 --- /dev/null Sat Sep 12 17:21:52 2009 +++ src/sys/arch/mips/include/netbsd32_machdep.h Sat Sep 12 17:21:52 2009 @@ -0,0 +1,85 @@ +/* $NetBSD: netbsd32_machdep.h,v 1.1.2.1 2009/09/12 17:21:52 matt Exp $ */ + +/*- + * Copyright (c) 2009 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Matt Thomas m...@3am-software.com. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _MACHINE_NETBSD32_H_ +#define _MACHINE_NETBSD32_H_ + +#include sys/types.h + +/* + * On MIPS, pointers are signed. + */ +#define NETBSD32_POINTER_TYPE int32_t +typedef struct { NETBSD32_POINTER_TYPE i32; } netbsd32_pointer_t; + +#define NETBSD32_INT64_ALIGN + +typedef netbsd32_pointer_t netbsd32_sigcontextp_t; + +/* + * The sigcode is ABI neutral. + */ +#define netbsd32_sigcode sigcode +#define netbsd32_esigcode esigcode + +/* + * cpu_upcall knows about COMPAT_NETBSD32 + * syscall_intern and setregs don't about COMPAT_NETBSD32. + */ +#define netbsd32_syscall_intern syscall_intern +#define netbsd32_setregs setregs +#define netbsd32_cpu_upcall cpu_upcall + +/* mips/sysarch.h */ +struct mips_cacheflush_args32 { + netbsd32_intptr_t va; + netbsd32_size_t nbytes; + int whichcache; +}; + +struct mips_cachectl_args32 { + netbsd32_intptr_t va; + netbsd32_size_t nbytes; + int ctl; +}; + +/* mips/frame.h */ +struct saframe32 { + /* first 4 arguments passed in registers on entry to upcallcode */ + int sa_type; /* A0 */ + netbsd32_pointer_t sa_sas; /* A1 */ + int sa_events; /* A2 */ + int sa_interrupted; /* A3 */ + netbsd32_pointer_t sa_arg; + netbsd32_pointer_t sa_upcall; +}; + +#endif /* _MACHINE_NETBSD32_H_ */
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/include
Module Name:src Committed By: matt Date: Sat Sep 12 17:23:06 UTC 2009 Modified Files: src/sys/arch/mips/include [matt-nb5-mips64]: mcontext.h Log Message: Add COMPAT_NETBSD32 support. To generate a diff of this commit: cvs rdiff -u -r1.8.18.1 -r1.8.18.2 src/sys/arch/mips/include/mcontext.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/include/mcontext.h diff -u src/sys/arch/mips/include/mcontext.h:1.8.18.1 src/sys/arch/mips/include/mcontext.h:1.8.18.2 --- src/sys/arch/mips/include/mcontext.h:1.8.18.1 Sun Aug 16 03:33:58 2009 +++ src/sys/arch/mips/include/mcontext.h Sat Sep 12 17:23:06 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: mcontext.h,v 1.8.18.1 2009/08/16 03:33:58 matt Exp $ */ +/* $NetBSD: mcontext.h,v 1.8.18.2 2009/09/12 17:23:06 matt Exp $ */ /*- * Copyright (c) 1999, 2002 The NetBSD Foundation, Inc. @@ -81,15 +81,15 @@ /* Make sure this is signed; we need pointers to be sign-extended. */ #if defined(__mips_n32) -typedef long long __greg_t; +typedef long long __greg_t; #else -typedef long__greg_t; +typedef long __greg_t; #endif /* __mips_n32 */ typedef __greg_t __gregset_t[_NGREG]; /* - * For the O32 ABI, there are 16 doubles, one at each even FP reg + * For the O32/O64 ABI, there are 16 doubles, one at each even FP reg * number. The FP registers themselves are 32-bits. * * For 64-bit ABIs (include N32), each FP register is a 64-bit double. @@ -99,32 +99,50 @@ /* * Floating point register state */ -#if defined(__mips_n32) || defined(_LP64) -typedef struct { +struct __fpregset_nabi { union { double __fp64_dregs[32]; __freg_t __fp_regs[32]; } __fp_r; - unsigned int __fp_csr; - unsigned int __fp_pad; -} __fpregset_t; -#else /* !(__mips_n32 || _LP64) */ -typedef struct { + __greg_t __fp_csr; +}; +struct __fpregset_oabi { union { double __fp_dregs[16]; float __fp_fregs[32]; - __freg_t __fp_regs[32]; + int32_t __fp_regs[32]; } __fp_r; unsigned int __fp_csr; unsigned int __fp_pad; -} __fpregset_t; -#endif /* !(__mips_n32 || _LP64) */ +}; + +#if __mips_n32 || __mips_n64 +typedef struct __fpregset_nabi __fpregset_t; +#else +typedef struct __fpregset_oabi __fpregset_t; +#endif typedef struct { __gregset_t __gregs; __fpregset_t __fpregs; } mcontext_t; +#if defined(_KERNEL) defined(_LP64) +typedef int32_t __greg32_t; +typedef __greg32_t __gregset32_t[_NGREG]; + +typedef struct { + __gregset32_t __gregs; + struct __fpregset_oabi __fpregs; +} mcontext_o32_t; + +typedef struct { + __gregset_t __gregs; + struct __fpregset_nabi __fpregs; +} mcontext32_t; + +#endif /* _KERNEL _LP64 */ + #endif /* !__ASSEMBLER__ */ #define _UC_MACHINE_PAD 16 /* Padding appended to ucontext_t */ @@ -138,4 +156,10 @@ #define _UC_MACHINE_SET_PC(uc, pc) _UC_MACHINE_PC(uc) = (pc) +#define _UC_MACHINE32_SP(uc) _UC_MACHINE_SP(uc) +#define _UC_MACHINE32_PC(uc) _UC_MACHINE_PC(uc) +#define _UC_MACHINE32_INTRV(uc) _UC_MACHINE_INTRV(uc) + +#define _UC_MACHINE32_SET_PC(uc, pc) _UC_MACHINE_PC((uc), (pc)) + #endif /* _MIPS_MCONTEXT_H_ */
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/include
Module Name:src Committed By: matt Date: Sat Sep 12 17:26:23 UTC 2009 Modified Files: src/sys/arch/mips/include [matt-nb5-mips64]: elf_machdep.h Log Message: Fix for COMPAT_NETBSD32. To generate a diff of this commit: cvs rdiff -u -r1.10.96.6 -r1.10.96.7 src/sys/arch/mips/include/elf_machdep.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/include/elf_machdep.h diff -u src/sys/arch/mips/include/elf_machdep.h:1.10.96.6 src/sys/arch/mips/include/elf_machdep.h:1.10.96.7 --- src/sys/arch/mips/include/elf_machdep.h:1.10.96.6 Sat Sep 5 03:15:08 2009 +++ src/sys/arch/mips/include/elf_machdep.h Sat Sep 12 17:26:23 2009 @@ -1,17 +1,13 @@ -/* $NetBSD: elf_machdep.h,v 1.10.96.6 2009/09/05 03:15:08 matt Exp $ */ +/* $NetBSD: elf_machdep.h,v 1.10.96.7 2009/09/12 17:26:23 matt Exp $ */ #ifndef _MIPS_ELF_MACHDEP_H_ #define _MIPS_ELF_MACHDEP_H_ #if defined(ELFSIZE) #if ELFSIZE == 32 -#ifdef _LP64 -#define ELF32_MACHDEP_ID_CASES /* xxx */ -#else #define ELF32_MACHDEP_ID_CASES \ case EM_MIPS: \ break; -#endif /* _LP64 */ #define ELF32_MACHDEP_ID EM_MIPS #endif /* ELFSIZE == 32 */
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/mips
Module Name:src Committed By: matt Date: Sat Sep 12 17:37:00 UTC 2009 Modified Files: src/sys/arch/mips/mips [matt-nb5-mips64]: mips_machdep.c Added Files: src/sys/arch/mips/mips [matt-nb5-mips64]: netbsd32_machdep.c Log Message: Add COMPAT_NETBSD32 support. To generate a diff of this commit: cvs rdiff -u -r1.205.4.1.2.1.2.9 -r1.205.4.1.2.1.2.10 \ src/sys/arch/mips/mips/mips_machdep.c cvs rdiff -u -r0 -r1.1.2.1 src/sys/arch/mips/mips/netbsd32_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/mips/mips_machdep.c diff -u src/sys/arch/mips/mips/mips_machdep.c:1.205.4.1.2.1.2.9 src/sys/arch/mips/mips/mips_machdep.c:1.205.4.1.2.1.2.10 --- src/sys/arch/mips/mips/mips_machdep.c:1.205.4.1.2.1.2.9 Sat Sep 12 00:03:27 2009 +++ src/sys/arch/mips/mips/mips_machdep.c Sat Sep 12 17:37:00 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.9 2009/09/12 00:03:27 matt Exp $ */ +/* $NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.10 2009/09/12 17:37:00 matt Exp $ */ /* * Copyright 2002 Wasabi Systems, Inc. @@ -112,9 +112,10 @@ #include sys/cdefs.h /* RCS ID Copyright macro defns */ -__KERNEL_RCSID(0, $NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.9 2009/09/12 00:03:27 matt Exp $); +__KERNEL_RCSID(0, $NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.10 2009/09/12 17:37:00 matt Exp $); #include opt_cputype.h +#include opt_compat_netbsd32.h #include sys/param.h #include sys/systm.h @@ -137,8 +138,12 @@ #include sys/cpu.h #include sys/ucontext.h -#include machine/kcore.h -#include machine/cpu.h +#include mips/kcore.h +#include mips/cpu.h + +#ifdef COMPAT_NETBSD32 +#include compat/netbsd32/netbsd32.h +#endif #include uvm/uvm_extern.h @@ -1847,23 +1852,43 @@ * Start a new LWP */ void -startlwp(arg) - void *arg; +startlwp(void *arg) { - int err; ucontext_t *uc = arg; - struct lwp *l = curlwp; + int err; - err = cpu_setmcontext(l, uc-uc_mcontext, uc-uc_flags); + err = cpu_setmcontext(curlwp, uc-uc_mcontext, uc-uc_flags); #if DIAGNOSTIC if (err) { - printf(Error %d from cpu_setmcontext., err); + printf(%s: Error %d from cpu_setmcontext, __func__, err); } #endif pool_put(lwp_uc_pool, uc); - userret(l); + userret(curlwp); +} + +#ifdef COMPAT_NETBSD32 +/* + * Start a new LWP + */ +void +startlwp32(void *arg) +{ + ucontext32_t *uc = arg; + int err; + + err = cpu_setmcontext32(curlwp, uc-uc_mcontext, uc-uc_flags); +#if DIAGNOSTIC + if (err) { + printf(%s: Error %d from cpu_setmcontext32, __func__, err); + } +#endif + pool_put(lwp_uc_pool, uc); + + userret(curlwp); } +#endif /* COMPAT_NETBSD32 */ /* * XXX This is a terrible name. @@ -1878,8 +1903,13 @@ cpu_upcall(struct lwp *l, int type, int nevents, int ninterrupted, void *sas, void *ap, void *sp, sa_upcall_t upcall) { - struct saframe *sf, frame; struct frame *f = l-l_md.md_regs; + struct saframe frame; +#ifdef COMPAT_NETBSD32 + struct saframe32 frame32; +#endif + void *ksf, *usf; + size_t sfsz; #if 0 /* First 4 args in regs (see below). */ frame.sa_type = type; @@ -1887,11 +1917,29 @@ frame.sa_events = nevents; frame.sa_interrupted = ninterrupted; #endif - frame.sa_arg = ap; - frame.sa_upcall = upcall; +#ifdef COMPAT_NETBSD32 + switch (l-l_proc-p_md.md_abi) { + case _MIPS_BSD_API_O32: + case _MIPS_BSD_API_N32: + NETBSD32PTR32(frame32.sa_arg, ap); + NETBSD32PTR32(frame32.sa_upcall, upcall); + ksf = frame32; + usf = (struct saframe32 *)sp - 1; + sfsz = sizeof(frame32); + break; + default: +#endif + frame.sa_arg = ap; + frame.sa_upcall = upcall; + ksf = frame; + usf = (struct saframe *)sp - 1; + sfsz = sizeof(frame); +#ifdef COMPAT_NETBSD32 + break; + } +#endif - sf = (struct saframe *)sp - 1; - if (copyout(frame, sf, sizeof(frame)) != 0) { + if (copyout(ksf, usf, sfsz) != 0) { /* Copying onto the stack didn't work. Die. */ mutex_enter(l-l_proc-p_lock); sigexit(l, SIGILL); @@ -1899,7 +1947,7 @@ } f-f_regs[_R_PC] = (intptr_t)upcall; - f-f_regs[_R_SP] = (intptr_t)sf; + f-f_regs[_R_SP] = (intptr_t)usf; f-f_regs[_R_A0] = type; f-f_regs[_R_A1] = (intptr_t)sas; f-f_regs[_R_A2] = nevents; @@ -1911,10 +1959,7 @@ void -cpu_getmcontext(l, mcp, flags) - struct lwp *l; - mcontext_t *mcp; - unsigned int *flags; +cpu_getmcontext(struct lwp *l, mcontext_t *mcp, unsigned int *flags) { const struct frame *f = l-l_md.md_regs; __greg_t *gr = mcp-__gregs; @@ -1937,6 +1982,7 @@ /* Save floating point register context, if any. */ if (l-l_md.md_flags MDP_FPUSED) { + size_t fplen; /* * If this process is the current FP owner, dump its * context to the PCB first. @@ -1948,23 +1994,26 @@ * The PCB FP regs struct includes the FP CSR, so use the * size of __fpregs.__fp_r when copying. */ - memcpy(mcp-__fpregs.__fp_r, - l-l_addr-u_pcb.pcb_fpregs.r_regs, - sizeof(mcp-__fpregs.__fp_r)); -
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/conf
Module Name:src Committed By: matt Date: Sat Sep 12 17:37:29 UTC 2009 Modified Files: src/sys/arch/mips/conf [matt-nb5-mips64]: files.mips Log Message: Add COMPAT_NETBSD32 support To generate a diff of this commit: cvs rdiff -u -r1.58.24.1 -r1.58.24.2 src/sys/arch/mips/conf/files.mips Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/conf/files.mips diff -u src/sys/arch/mips/conf/files.mips:1.58.24.1 src/sys/arch/mips/conf/files.mips:1.58.24.2 --- src/sys/arch/mips/conf/files.mips:1.58.24.1 Sun Aug 23 04:38:34 2009 +++ src/sys/arch/mips/conf/files.mips Sat Sep 12 17:37:29 2009 @@ -1,4 +1,4 @@ -# $NetBSD: files.mips,v 1.58.24.1 2009/08/23 04:38:34 uebayasi Exp $ +# $NetBSD: files.mips,v 1.58.24.2 2009/09/12 17:37:29 matt Exp $ # defflag opt_cputype.h NOFPU @@ -61,6 +61,10 @@ file arch/mips/mips/procfs_machdep.c procfs +# Binary compatibility with 32bit NetBSD (COMPAT_NETBSD32) +file arch/mips/mips/netbsd32_machdep.c compat_netbsd32 +include compat/netbsd32/files.netbsd32 + # Binary compatibility with previous NetBSD releases (COMPAT_XX) file arch/mips/mips/compat_13_machdep.c compat_13 | compat_ultrix file arch/mips/mips/compat_16_machdep.c compat_16 | compat_ultrix
CVS commit: [matt-nb5-mips64] src/sys/compat/netbsd32
Module Name:src Committed By: matt Date: Sat Sep 12 17:42:05 UTC 2009 Modified Files: src/sys/compat/netbsd32 [matt-nb5-mips64]: syscalls.master Log Message: Add netbsd32___mount50 To generate a diff of this commit: cvs rdiff -u -r1.70.4.1 -r1.70.4.1.4.1 \ src/sys/compat/netbsd32/syscalls.master Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/syscalls.master diff -u src/sys/compat/netbsd32/syscalls.master:1.70.4.1 src/sys/compat/netbsd32/syscalls.master:1.70.4.1.4.1 --- src/sys/compat/netbsd32/syscalls.master:1.70.4.1 Tue Nov 25 17:31:26 2008 +++ src/sys/compat/netbsd32/syscalls.master Sat Sep 12 17:42:05 2009 @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.70.4.1 2008/11/25 17:31:26 snj Exp $ + $NetBSD: syscalls.master,v 1.70.4.1.4.1 2009/09/12 17:42:05 matt Exp $ ; from: NetBSD: syscalls.master,v 1.81 1998/07/05 08:49:50 jonathan Exp ; @(#)syscalls.master 8.2 (Berkeley) 1/13/94 @@ -682,9 +682,9 @@ 408 UNIMPL 409 UNIMPL -410 UNIMPL { int sys___mount50(const char *type, \ - const char *path, int flags, void *data, \ - size_t data_len); } +410 STD { int netbsd32___mount50(netbsd32_charp type, \ + netbsd32_charp path, int flags, \ + netbsd32_voidp data, netbsd32_size_t data_len); } 411 STD { netbsd32_voidp netbsd32_mremap( \ netbsd32_voidp old_address, \ netbsd32_size_t old_size, \
CVS commit: [matt-nb5-mips64] src/sys/compat/netbsd32
Module Name:src Committed By: matt Date: Sat Sep 12 17:43:26 UTC 2009 Modified Files: src/sys/compat/netbsd32 [matt-nb5-mips64]: netbsd32_syscall.h netbsd32_syscallargs.h netbsd32_syscalls.c Log Message: Regen. To generate a diff of this commit: cvs rdiff -u -r1.78.4.1 -r1.78.4.1.4.1 \ src/sys/compat/netbsd32/netbsd32_syscall.h \ src/sys/compat/netbsd32/netbsd32_syscallargs.h cvs rdiff -u -r1.77.4.1 -r1.77.4.1.4.1 \ src/sys/compat/netbsd32/netbsd32_syscalls.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_syscall.h diff -u src/sys/compat/netbsd32/netbsd32_syscall.h:1.78.4.1 src/sys/compat/netbsd32/netbsd32_syscall.h:1.78.4.1.4.1 --- src/sys/compat/netbsd32/netbsd32_syscall.h:1.78.4.1 Tue Nov 25 17:32:27 2008 +++ src/sys/compat/netbsd32/netbsd32_syscall.h Sat Sep 12 17:43:26 2009 @@ -1,10 +1,10 @@ -/* $NetBSD: netbsd32_syscall.h,v 1.78.4.1 2008/11/25 17:32:27 snj Exp $ */ +/* $NetBSD: netbsd32_syscall.h,v 1.78.4.1.4.1 2009/09/12 17:43:26 matt Exp $ */ /* * System call numbers. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.70.4.1 2008/11/25 17:31:26 snj Exp + * created from NetBSD: syscalls.master,v 1.70.4.1.4.1 2009/09/12 17:42:05 matt Exp */ #ifndef _NETBSD32_SYS_SYSCALL_H_ @@ -1103,6 +1103,9 @@ /* syscall: netbsd32___fhstat40 ret: int args: netbsd32_pointer_t netbsd32_size_t netbsd32_statp_t */ #define NETBSD32_SYS_netbsd32___fhstat40 398 +/* syscall: netbsd32___mount50 ret: int args: netbsd32_charp netbsd32_charp int netbsd32_voidp netbsd32_size_t */ +#define NETBSD32_SYS_netbsd32___mount50 410 + /* syscall: netbsd32_mremap ret: netbsd32_voidp args: netbsd32_voidp netbsd32_size_t netbsd32_voidp netbsd32_size_t int */ #define NETBSD32_SYS_netbsd32_mremap 411 Index: src/sys/compat/netbsd32/netbsd32_syscallargs.h diff -u src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.78.4.1 src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.78.4.1.4.1 --- src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.78.4.1 Tue Nov 25 17:32:27 2008 +++ src/sys/compat/netbsd32/netbsd32_syscallargs.h Sat Sep 12 17:43:26 2009 @@ -1,10 +1,10 @@ -/* $NetBSD: netbsd32_syscallargs.h,v 1.78.4.1 2008/11/25 17:32:27 snj Exp $ */ +/* $NetBSD: netbsd32_syscallargs.h,v 1.78.4.1.4.1 2009/09/12 17:43:26 matt Exp $ */ /* * System call argument lists. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.70.4.1 2008/11/25 17:31:26 snj Exp + * created from NetBSD: syscalls.master,v 1.70.4.1.4.1 2009/09/12 17:42:05 matt Exp */ #ifndef _NETBSD32_SYS_SYSCALLARGS_H_ @@ -2087,6 +2087,15 @@ }; check_syscall_args(netbsd32___fhstat40) +struct netbsd32___mount50_args { + syscallarg(netbsd32_charp) type; + syscallarg(netbsd32_charp) path; + syscallarg(int) flags; + syscallarg(netbsd32_voidp) data; + syscallarg(netbsd32_size_t) data_len; +}; +check_syscall_args(netbsd32___mount50) + struct netbsd32_mremap_args { syscallarg(netbsd32_voidp) old_address; syscallarg(netbsd32_size_t) old_size; @@ -2816,6 +2825,8 @@ int netbsd32___fhstat40(struct lwp *, const struct netbsd32___fhstat40_args *, register_t *); +int netbsd32___mount50(struct lwp *, const struct netbsd32___mount50_args *, register_t *); + int netbsd32_mremap(struct lwp *, const struct netbsd32_mremap_args *, register_t *); int netbsd32___posix_fadvise50(struct lwp *, const struct netbsd32___posix_fadvise50_args *, register_t *); Index: src/sys/compat/netbsd32/netbsd32_syscalls.c diff -u src/sys/compat/netbsd32/netbsd32_syscalls.c:1.77.4.1 src/sys/compat/netbsd32/netbsd32_syscalls.c:1.77.4.1.4.1 --- src/sys/compat/netbsd32/netbsd32_syscalls.c:1.77.4.1 Tue Nov 25 17:32:27 2008 +++ src/sys/compat/netbsd32/netbsd32_syscalls.c Sat Sep 12 17:43:26 2009 @@ -1,14 +1,14 @@ -/* $NetBSD: netbsd32_syscalls.c,v 1.77.4.1 2008/11/25 17:32:27 snj Exp $ */ +/* $NetBSD: netbsd32_syscalls.c,v 1.77.4.1.4.1 2009/09/12 17:43:26 matt Exp $ */ /* * System call names. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.70.4.1 2008/11/25 17:31:26 snj Exp + * created from NetBSD: syscalls.master,v 1.70.4.1.4.1 2009/09/12 17:42:05 matt Exp */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: netbsd32_syscalls.c,v 1.77.4.1 2008/11/25 17:32:27 snj Exp $); +__KERNEL_RCSID(0, $NetBSD: netbsd32_syscalls.c,v 1.77.4.1.4.1 2009/09/12 17:43:26 matt Exp $); #if defined(_KERNEL_OPT) #if defined(_KERNEL_OPT) @@ -523,7 +523,7 @@ /* 407 */ #407 (unimplemented), /* 408 */ #408 (unimplemented), /* 409 */ #409 (unimplemented), - /* 410 */ #410 (unimplemented { int sys___mount50 ( const char * type , const char * path , int flags , void * data , size_t data_len ) ; }), + /* 410 */ netbsd32___mount50, /* 411 */ netbsd32_mremap, /* 412 */ #412
CVS commit: [matt-nb5-mips64] src/sys/compat/netbsd32
Module Name:src Committed By: matt Date: Sat Sep 12 17:44:08 UTC 2009 Modified Files: src/sys/compat/netbsd32 [matt-nb5-mips64]: netbsd32_sysent.c Log Message: Regen. To generate a diff of this commit: cvs rdiff -u -r1.77.4.1.4.1 -r1.77.4.1.4.2 \ src/sys/compat/netbsd32/netbsd32_sysent.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_sysent.c diff -u src/sys/compat/netbsd32/netbsd32_sysent.c:1.77.4.1.4.1 src/sys/compat/netbsd32/netbsd32_sysent.c:1.77.4.1.4.2 --- src/sys/compat/netbsd32/netbsd32_sysent.c:1.77.4.1.4.1 Sat Sep 12 04:57:20 2009 +++ src/sys/compat/netbsd32/netbsd32_sysent.c Sat Sep 12 17:44:07 2009 @@ -1,14 +1,14 @@ -/* $NetBSD: netbsd32_sysent.c,v 1.77.4.1.4.1 2009/09/12 04:57:20 matt Exp $ */ +/* $NetBSD: netbsd32_sysent.c,v 1.77.4.1.4.2 2009/09/12 17:44:07 matt Exp $ */ /* * System call switch table. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.70.4.1 2008/11/25 17:31:26 snj Exp + * created from NetBSD: syscalls.master,v 1.70.4.1.4.1 2009/09/12 17:42:05 matt Exp */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: netbsd32_sysent.c,v 1.77.4.1.4.1 2009/09/12 04:57:20 matt Exp $); +__KERNEL_RCSID(0, $NetBSD: netbsd32_sysent.c,v 1.77.4.1.4.2 2009/09/12 17:44:07 matt Exp $); #if defined(_KERNEL_OPT) #include opt_nfsserver.h @@ -1044,8 +1044,8 @@ sys_nosys }, /* 408 = unimplemented */ { 0, 0, 0, sys_nosys }, /* 409 = unimplemented */ - { 0, 0, 0, - sys_nosys }, /* 410 = unimplemented { int sys___mount50 ( const char * type , const char * path , int flags , void * data , size_t data_len ) ; } */ + { ns(struct netbsd32___mount50_args), 0, + (sy_call_t *)netbsd32___mount50 }, /* 410 = netbsd32___mount50 */ { ns(struct netbsd32_mremap_args), 0, (sy_call_t *)netbsd32_mremap }, /* 411 = netbsd32_mremap */ { 0, 0, 0,
CVS commit: [matt-nb5-mips64] src/sys/compat/netbsd32
Module Name:src Committed By: matt Date: Sat Sep 12 17:45:08 UTC 2009 Modified Files: src/sys/compat/netbsd32 [matt-nb5-mips64]: netbsd32_exec_elf32.c Log Message: Add support/hooks for ELF_MD_PROBE_FUNC and ELF_INTERP_NON_RELOCATABLE. To generate a diff of this commit: cvs rdiff -u -r1.29 -r1.29.14.1 src/sys/compat/netbsd32/netbsd32_exec_elf32.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_exec_elf32.c diff -u src/sys/compat/netbsd32/netbsd32_exec_elf32.c:1.29 src/sys/compat/netbsd32/netbsd32_exec_elf32.c:1.29.14.1 --- src/sys/compat/netbsd32/netbsd32_exec_elf32.c:1.29 Sun Oct 26 07:07:35 2008 +++ src/sys/compat/netbsd32/netbsd32_exec_elf32.c Sat Sep 12 17:45:08 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_exec_elf32.c,v 1.29 2008/10/26 07:07:35 mrg Exp $ */ +/* $NetBSD: netbsd32_exec_elf32.c,v 1.29.14.1 2009/09/12 17:45:08 matt Exp $ */ /* from: NetBSD: exec_aout.c,v 1.15 1996/09/26 23:34:46 cgd Exp */ /* @@ -57,7 +57,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: netbsd32_exec_elf32.c,v 1.29 2008/10/26 07:07:35 mrg Exp $); +__KERNEL_RCSID(0, $NetBSD: netbsd32_exec_elf32.c,v 1.29.14.1 2009/09/12 17:45:08 matt Exp $); #define ELFSIZE 32 @@ -77,7 +77,6 @@ #include compat/netbsd32/netbsd32.h #include compat/netbsd32/netbsd32_exec.h -#include machine/frame.h #include machine/netbsd32_machdep.h int netbsd32_copyinargs(struct exec_package *, struct ps_strings *, @@ -96,6 +95,13 @@ if ((error = ELFNAME2(netbsd,signature)(l, epp, eh)) != 0) return error; +#ifdef ELF_MD_PROBE_FUNC + if ((error = ELF_MD_PROBE_FUNC(l, epp, eh, itp, pos)) != 0) + return error; +#elif defined(ELF_INTERP_NON_RELOCATABLE) + *pos = ELF_LINK_ADDR; +#endif + return ELFNAME2(netbsd32,probe_noteless)(l, epp, eh, itp, pos); }
CVS commit: [matt-nb5-mips64] src/sys/compat/netbsd32
Module Name:src Committed By: matt Date: Sat Sep 12 18:02:33 UTC 2009 Modified Files: src/sys/compat/netbsd32 [matt-nb5-mips64]: netbsd32.h netbsd32_netbsd.c Log Message: Add support for netbsd32___mount50. There's got to be a better of doing this. Maybe pushing it down to vfs. This only supports mfs/ufs/cd9660 and probably tmpfs. To generate a diff of this commit: cvs rdiff -u -r1.77.4.1 -r1.77.4.1.4.1 src/sys/compat/netbsd32/netbsd32.h cvs rdiff -u -r1.145.4.2 -r1.145.4.2.4.1 \ src/sys/compat/netbsd32/netbsd32_netbsd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32.h diff -u src/sys/compat/netbsd32/netbsd32.h:1.77.4.1 src/sys/compat/netbsd32/netbsd32.h:1.77.4.1.4.1 --- src/sys/compat/netbsd32/netbsd32.h:1.77.4.1 Tue Nov 25 17:31:26 2008 +++ src/sys/compat/netbsd32/netbsd32.h Sat Sep 12 18:02:32 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32.h,v 1.77.4.1 2008/11/25 17:31:26 snj Exp $ */ +/* $NetBSD: netbsd32.h,v 1.77.4.1.4.1 2009/09/12 18:02:32 matt Exp $ */ /* * Copyright (c) 1998, 2001, 2008 Matthew R. Green @@ -44,6 +44,7 @@ #include sys/ipc.h #include sys/shm.h #include sys/ucontext.h +#include sys/ucred.h #include compat/sys/ucontext.h #include compat/sys/mount.h @@ -225,6 +226,17 @@ char f_mntfromname[MNAMELEN]; /* mounted file system */ }; +struct netbsd32_export_args30 { + int ex_flags; /* export related flags */ + uid_t ex_root; /* mapping for root uid */ + struct uucred ex_anon; /* mapping for anonymous user */ + netbsd32_pointer_t ex_addr; /* net address to which exported */ + int ex_addrlen; /* and the net address length */ + netbsd32_pointer_t ex_mask; /* mask of valid bits in saddr */ + int ex_masklen; /* and the smask length */ + netbsd32_charp ex_indexfile; /* index file for WebNFS URLs */ +}; + /* from sys/poll.h */ typedef netbsd32_pointer_t netbsd32_pollfdp_t; @@ -678,6 +690,25 @@ typedef netbsd32_pointer_t netbsd32_sched_paramp_t; typedef netbsd32_pointer_t netbsd32_cpusetp_t; +/* from fs/cd9660/cd9660_mount.h */ +struct netbsd32_iso_args { + netbsd32_charp fspec; + struct export_args30 _pad1; + int flags; +}; + +/* from ufs/ufs/ufs_mount.h */ +struct netbsd32_ufs_args { + netbsd32_charp fspec; +}; + +struct netbsd32_mfs_args { + netbsd32_charp fspec; + struct netbsd32_export_args30 _pad1; + netbsd32_voidp base; + netbsd32_u_long size; +}; + #if 0 int netbsd32_kevent(struct lwp *, void *, register_t *); #endif Index: src/sys/compat/netbsd32/netbsd32_netbsd.c diff -u src/sys/compat/netbsd32/netbsd32_netbsd.c:1.145.4.2 src/sys/compat/netbsd32/netbsd32_netbsd.c:1.145.4.2.4.1 --- src/sys/compat/netbsd32/netbsd32_netbsd.c:1.145.4.2 Tue Nov 25 17:31:26 2008 +++ src/sys/compat/netbsd32/netbsd32_netbsd.c Sat Sep 12 18:02:32 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_netbsd.c,v 1.145.4.2 2008/11/25 17:31:26 snj Exp $ */ +/* $NetBSD: netbsd32_netbsd.c,v 1.145.4.2.4.1 2009/09/12 18:02:32 matt Exp $ */ /* * Copyright (c) 1998, 2001, 2008 Matthew R. Green @@ -27,7 +27,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: netbsd32_netbsd.c,v 1.145.4.2 2008/11/25 17:31:26 snj Exp $); +__KERNEL_RCSID(0, $NetBSD: netbsd32_netbsd.c,v 1.145.4.2.4.1 2009/09/12 18:02:32 matt Exp $); #if defined(_KERNEL_OPT) #include opt_ddb.h @@ -87,6 +87,9 @@ #include net/if.h +#include fs/cd9660/cd9660_mount.h +#include ufs/ufs/ufsmount.h + #include compat/netbsd32/netbsd32.h #include compat/netbsd32/netbsd32_exec.h #include compat/netbsd32/netbsd32_syscall.h @@ -94,8 +97,6 @@ #include compat/netbsd32/netbsd32_conv.h #include compat/netbsd32/netbsd32_sa.h -#include machine/frame.h - #if defined(DDB) #include ddb/ddbvar.h #endif @@ -119,6 +120,7 @@ extern struct sysctlnode netbsd32_sysctl_root; +#if defined(COMPAT_40) defined(KERN_SA) const struct sa_emul saemul_netbsd32 = { sizeof(ucontext32_t), sizeof(struct netbsd32_sa_t), @@ -133,6 +135,7 @@ NULL #endif }; +#endif const struct emul emul_netbsd32 = { netbsd32, @@ -177,7 +180,7 @@ netbsd32_vm_default_addr, NULL, -#ifdef COMPAT_40 +#if defined(COMPAT_40) defined(KERN_SA) saemul_netbsd32, #else NULL, @@ -404,6 +407,135 @@ } int +netbsd32___mount50(struct lwp *l, const struct netbsd32___mount50_args *uap, + register_t *retval) +{ + /* { + syscallarg(netbsd32_charp) type; + syscallarg(netbsd32_charp) path; + syscallarg(int) flags; + syscallarg(netbsd32_voidp) data; + syscallarg(netbsd32_size_t) data_len; + } */ + char mtype[MNAMELEN]; + union { + struct netbsd32_ufs_args ufs_args; + struct netbsd32_mfs_args mfs_args; + struct netbsd32_iso_args iso_args; + } fs_args32; + union { + struct ufs_args ufs_args; + struct mfs_args mfs_args; + struct iso_args iso_args; + } fs_args; + const char *type = SCARG_P32(uap, type); + const char *path = SCARG_P32(uap, path); + int flags = SCARG(uap, flags); + void *data =
CVS commit: [matt-nb5-mips64] src/sys/arch/evbmips/conf
Module Name:src Committed By: matt Date: Sat Sep 12 18:22:27 UTC 2009 Modified Files: src/sys/arch/evbmips/conf [matt-nb5-mips64]: MALTA Log Message: Add TMPFS To generate a diff of this commit: cvs rdiff -u -r1.48.8.1 -r1.48.8.2 src/sys/arch/evbmips/conf/MALTA Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/evbmips/conf/MALTA diff -u src/sys/arch/evbmips/conf/MALTA:1.48.8.1 src/sys/arch/evbmips/conf/MALTA:1.48.8.2 --- src/sys/arch/evbmips/conf/MALTA:1.48.8.1 Sat Sep 12 16:49:05 2009 +++ src/sys/arch/evbmips/conf/MALTA Sat Sep 12 18:22:27 2009 @@ -1,10 +1,10 @@ -# $NetBSD: MALTA,v 1.48.8.1 2009/09/12 16:49:05 matt Exp $ +# $NetBSD: MALTA,v 1.48.8.2 2009/09/12 18:22:27 matt Exp $ include arch/evbmips/conf/std.malta #options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident MALTA-$Revision: 1.48.8.1 $ +#ident MALTA-$Revision: 1.48.8.2 $ maxusers 32 @@ -72,6 +72,7 @@ #file-system PORTAL # portal filesystem (still experimental) #file-system PROCFS # /proc #file-system CD9660 # ISO 9660 + Rock Ridge file system +file-system TMPFS # Efficient memory file system #file-system UNION # union file system #file-system MSDOSFS # MS-DOS FAT filesystem(s). #file-system CODA # Coda File System; also needs vcoda (below)
CVS commit: [matt-nb5-mips64] src/sys/arch/evbmips/conf
Module Name:src Committed By: matt Date: Sat Sep 12 18:22:52 UTC 2009 Modified Files: src/sys/arch/evbmips/conf [matt-nb5-mips64]: ALCHEMY Log Message: Bump up SYMTAB_SPACE to 375000 To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.20.8.1 src/sys/arch/evbmips/conf/ALCHEMY Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/evbmips/conf/ALCHEMY diff -u src/sys/arch/evbmips/conf/ALCHEMY:1.20 src/sys/arch/evbmips/conf/ALCHEMY:1.20.8.1 --- src/sys/arch/evbmips/conf/ALCHEMY:1.20 Thu Jul 31 07:41:00 2008 +++ src/sys/arch/evbmips/conf/ALCHEMY Sat Sep 12 18:22:52 2009 @@ -1,11 +1,11 @@ -# $NetBSD: ALCHEMY,v 1.20 2008/07/31 07:41:00 simonb Exp $ +# $NetBSD: ALCHEMY,v 1.20.8.1 2009/09/12 18:22:52 matt Exp $ # # Kernel config for the Alchemy Semiconductor (AMD) PB1000, PB1500, # DBAu1000 and DBAu1500 evaluation boards. include arch/evbmips/conf/std.alchemy -#ident ALCHEMY-$Revision: 1.20 $ +#ident ALCHEMY-$Revision: 1.20.8.1 $ maxusers 32 @@ -48,7 +48,7 @@ options DDB # kernel dynamic debugger options DDB_HISTORY_SIZE=100 # enable history editing in DDB makeoptions DEBUG=-g # compile full symbol table -options SYMTAB_SPACE=34 # size for embedded symbol table +options SYMTAB_SPACE=375000 # size for embedded symbol table # Compatibility options #options COMPAT_43 # compatibility with 4.3BSD binaries
CVS commit: [matt-nb5-mips64] src/sys/arch/pmax
Module Name:src Committed By: matt Date: Sat Sep 12 18:25:25 UTC 2009 Modified Files: src/sys/arch/pmax/conf [matt-nb5-mips64]: std.pmax64 Added Files: src/sys/arch/pmax/include [matt-nb5-mips64]: netbsd32_machdep.h Log Message: Add COMPAT_NETBSD32 support. To generate a diff of this commit: cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/sys/arch/pmax/conf/std.pmax64 cvs rdiff -u -r0 -r1.1.2.1 src/sys/arch/pmax/include/netbsd32_machdep.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/pmax/conf/std.pmax64 diff -u src/sys/arch/pmax/conf/std.pmax64:1.1.2.1 src/sys/arch/pmax/conf/std.pmax64:1.1.2.2 --- src/sys/arch/pmax/conf/std.pmax64:1.1.2.1 Tue Sep 8 17:24:08 2009 +++ src/sys/arch/pmax/conf/std.pmax64 Sat Sep 12 18:25:25 2009 @@ -1,4 +1,4 @@ -# $NetBSD: std.pmax64,v 1.1.2.1 2009/09/08 17:24:08 matt Exp $ +# $NetBSD: std.pmax64,v 1.1.2.2 2009/09/12 18:25:25 matt Exp $ # standard, required pmax info machine pmax mips @@ -7,8 +7,9 @@ # Standard exec-package options options EXEC_ELF64 -#options EXEC_ELF32 # 32-bit ELF support (native format) +options EXEC_ELF32 # 32-bit ELF support (native format) options EXEC_SCRIPT # exec of #! scripts +options COMPAT_NETBSD32 # exec NetBSD 32-bit binaries makeoptions DEFTEXTADDR=0x8003 makeoptions LP64=yes Added files: Index: src/sys/arch/pmax/include/netbsd32_machdep.h diff -u /dev/null src/sys/arch/pmax/include/netbsd32_machdep.h:1.1.2.1 --- /dev/null Sat Sep 12 18:25:26 2009 +++ src/sys/arch/pmax/include/netbsd32_machdep.h Sat Sep 12 18:25:25 2009 @@ -0,0 +1,3 @@ +/* $NetBSD: netbsd32_machdep.h,v 1.1.2.1 2009/09/12 18:25:25 matt Exp $ */ + +#include mips/netbsd32_machdep.h
CVS commit: [matt-nb5-mips64] src/sys/arch/sgimips
Module Name:src Committed By: matt Date: Sat Sep 12 18:27:59 UTC 2009 Modified Files: src/sys/arch/sgimips/conf [matt-nb5-mips64]: std.sgimips64 Added Files: src/sys/arch/sgimips/include [matt-nb5-mips64]: netbsd32_machdep.h Log Message: Add COMPAT_NETBSD32 support. To generate a diff of this commit: cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/sys/arch/sgimips/conf/std.sgimips64 cvs rdiff -u -r0 -r1.1.2.1 src/sys/arch/sgimips/include/netbsd32_machdep.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/sgimips/conf/std.sgimips64 diff -u src/sys/arch/sgimips/conf/std.sgimips64:1.1.2.1 src/sys/arch/sgimips/conf/std.sgimips64:1.1.2.2 --- src/sys/arch/sgimips/conf/std.sgimips64:1.1.2.1 Thu Sep 10 01:51:31 2009 +++ src/sys/arch/sgimips/conf/std.sgimips64 Sat Sep 12 18:27:59 2009 @@ -1,8 +1,8 @@ -# $NetBSD: std.sgimips64,v 1.1.2.1 2009/09/10 01:51:31 matt Exp $ +# $NetBSD: std.sgimips64,v 1.1.2.2 2009/09/12 18:27:59 matt Exp $ no makeoptions MACHINE_ARCH makeoptions MACHINE_ARCH=mips64eb makeoptions LP64=yes -no options EXEC_ELF32 options EXEC_ELF64 # exec ELF64 binaries +options COMPAT_NETBSD64 Added files: Index: src/sys/arch/sgimips/include/netbsd32_machdep.h diff -u /dev/null src/sys/arch/sgimips/include/netbsd32_machdep.h:1.1.2.1 --- /dev/null Sat Sep 12 18:27:59 2009 +++ src/sys/arch/sgimips/include/netbsd32_machdep.h Sat Sep 12 18:27:59 2009 @@ -0,0 +1,3 @@ +/* $NetBSD: netbsd32_machdep.h,v 1.1.2.1 2009/09/12 18:27:59 matt Exp $ */ + +#include mips/netbsd32_machdep.h
CVS commit: [matt-nb5-mips64] src/sys/uvm
Module Name:src Committed By: matt Date: Sat Sep 12 18:38:46 UTC 2009 Modified Files: src/sys/uvm [matt-nb5-mips64]: uvm_page.c Log Message: Add KASSERT(pg) to uvm_pagefree() so that invalid physical address passed to VM_PHYS_TO_PAGE will be easily caught. To generate a diff of this commit: cvs rdiff -u -r1.140.6.3 -r1.140.6.3.4.1 src/sys/uvm/uvm_page.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/uvm/uvm_page.c diff -u src/sys/uvm/uvm_page.c:1.140.6.3 src/sys/uvm/uvm_page.c:1.140.6.3.4.1 --- src/sys/uvm/uvm_page.c:1.140.6.3 Mon Mar 2 20:51:35 2009 +++ src/sys/uvm/uvm_page.c Sat Sep 12 18:38:46 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_page.c,v 1.140.6.3 2009/03/02 20:51:35 snj Exp $ */ +/* $NetBSD: uvm_page.c,v 1.140.6.3.4.1 2009/09/12 18:38:46 matt Exp $ */ /* * Copyright (c) 1997 Charles D. Cranor and Washington University. @@ -71,7 +71,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: uvm_page.c,v 1.140.6.3 2009/03/02 20:51:35 snj Exp $); +__KERNEL_RCSID(0, $NetBSD: uvm_page.c,v 1.140.6.3.4.1 2009/09/12 18:38:46 matt Exp $); #include opt_uvmhist.h #include opt_readahead.h @@ -1345,6 +1345,8 @@ int index, color, queue; bool iszero; + KASSERT(pg); + #ifdef DEBUG if (pg-uobject == (void *)0xdeadbeef pg-uanon == (void *)0xdeadbeef) {
CVS commit: [matt-nb5-mips64] src/sys/compat/irix
Module Name:src Committed By: matt Date: Sat Sep 12 19:25:23 UTC 2009 Modified Files: src/sys/compat/irix [matt-nb5-mips64]: files.irix irix_exec.h irix_exec_elf32.c Added Files: src/sys/compat/irix [matt-nb5-mips64]: irix_exec_elf64.c Log Message: Add elf64 version. XXX needs work for netbsd32 To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.25.124.1 src/sys/compat/irix/files.irix cvs rdiff -u -r1.25.14.1 -r1.25.14.2 src/sys/compat/irix/irix_exec.h cvs rdiff -u -r1.15.18.1 -r1.15.18.2 src/sys/compat/irix/irix_exec_elf32.c cvs rdiff -u -r0 -r1.1.2.1 src/sys/compat/irix/irix_exec_elf64.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/irix/files.irix diff -u src/sys/compat/irix/files.irix:1.25 src/sys/compat/irix/files.irix:1.25.124.1 --- src/sys/compat/irix/files.irix:1.25 Sat Nov 9 09:03:58 2002 +++ src/sys/compat/irix/files.irix Sat Sep 12 19:25:23 2009 @@ -1,4 +1,4 @@ -# $NetBSD: files.irix,v 1.25 2002/11/09 09:03:58 manu Exp $ +# $NetBSD: files.irix,v 1.25.124.1 2009/09/12 19:25:23 matt Exp $ # file arch/mips/mips/irix_syscall.c compat_irix @@ -7,6 +7,7 @@ file compat/irix/irix_errno.c compat_irix file compat/irix/irix_exec.c compat_irix file compat/irix/irix_exec_elf32.c compat_irix exec_elf32 +file compat/irix/irix_exec_elf64.c compat_irix exec_elf64 file compat/irix/irix_fcntl.c compat_irix file compat/irix/irix_ioctl.c compat_irix file compat/irix/irix_kmem.c compat_irix Index: src/sys/compat/irix/irix_exec.h diff -u src/sys/compat/irix/irix_exec.h:1.25.14.1 src/sys/compat/irix/irix_exec.h:1.25.14.2 --- src/sys/compat/irix/irix_exec.h:1.25.14.1 Wed Aug 26 03:46:40 2009 +++ src/sys/compat/irix/irix_exec.h Sat Sep 12 19:25:23 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: irix_exec.h,v 1.25.14.1 2009/08/26 03:46:40 matt Exp $ */ +/* $NetBSD: irix_exec.h,v 1.25.14.2 2009/09/12 19:25:23 matt Exp $ */ /*- * Copyright (c) 2001-2002 The NetBSD Foundation, Inc. @@ -93,7 +93,7 @@ int irix_elf64_copyargs(struct lwp *, struct exec_package *, struct ps_strings *, char **, void *); -int irix_elf64_probe(struct lwp *, struct exec_package *, void *, +int irix_elf64_probe_n64(struct lwp *, struct exec_package *, void *, char *, vaddr_t *); #endif Index: src/sys/compat/irix/irix_exec_elf32.c diff -u src/sys/compat/irix/irix_exec_elf32.c:1.15.18.1 src/sys/compat/irix/irix_exec_elf32.c:1.15.18.2 --- src/sys/compat/irix/irix_exec_elf32.c:1.15.18.1 Thu Sep 10 01:52:34 2009 +++ src/sys/compat/irix/irix_exec_elf32.c Sat Sep 12 19:25:23 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: irix_exec_elf32.c,v 1.15.18.1 2009/09/10 01:52:34 matt Exp $ */ +/* $NetBSD: irix_exec_elf32.c,v 1.15.18.2 2009/09/12 19:25:23 matt Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -30,15 +30,13 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: irix_exec_elf32.c,v 1.15.18.1 2009/09/10 01:52:34 matt Exp $); +__KERNEL_RCSID(0, $NetBSD: irix_exec_elf32.c,v 1.15.18.2 2009/09/12 19:25:23 matt Exp $); #ifndef ELFSIZE -#ifdef _LP64 -#define ELFSIZE 64 /* XXX should die */ -#else #define ELFSIZE 32 /* XXX should die */ #endif -#endif + +#include opt_execfmt.h #include sys/param.h #include sys/types.h @@ -60,17 +58,13 @@ #include compat/irix/irix_exec.h -#ifdef EXEC_ELF32 +#if ELFSIZE == 32 /* * IRIX o32 ABI probe function */ int -ELFNAME2(irix,probe_o32)(l, epp, eh, itp, pos) - struct lwp *l; - struct exec_package *epp; - void *eh; - char *itp; - vaddr_t *pos; +ELFNAME2(irix,probe_o32)(struct lwp *l, struct exec_package *epp, void *eh, + char *itp, vaddr_t *pos) { int error = 0; @@ -95,7 +89,7 @@ printf(epp-ep_vm_minaddr = 0x%lx\n, epp-ep_vm_minaddr); #endif epp-ep_vm_minaddr = epp-ep_vm_minaddr ~0xfUL; - l-l_proc-l_md.md_abi = _MIP_BSD_API_O32; + l-l_proc-p_md.md_abi = _MIPS_BSD_API_O32; return 0; } @@ -103,12 +97,8 @@ * IRIX n32 ABI probe function */ int -ELFNAME2(irix,probe_n32)(l, epp, eh, itp, pos) - struct lwp *l; - struct exec_package *epp; - void *eh; - char *itp; - vaddr_t *pos; +ELFNAME2(irix,probe_n32)(struct lwp *l, struct exec_package *epp, void *eh, + char *itp, vaddr_t *pos) { int error = 0; @@ -132,22 +122,18 @@ printf(epp-ep_vm_minaddr = 0x%lx\n, epp-ep_vm_minaddr); #endif epp-ep_vm_minaddr = epp-ep_vm_minaddr ~0xfUL; - l-l_proc-l_md.md_abi = _MIP_BSD_API_N32; + l-l_proc-p_md.md_abi = _MIPS_BSD_API_N32; return 0; } -#endif /* EXEC_ELF32 */ +#endif /* ELFSIZE == 32 */ -#ifdef EXEC_ELF64 +#if ELFSIZE == 64 /* - * IRIX n32 ABI probe function + * IRIX n64 ABI probe function */ int -ELFNAME2(irix,probe_n64)(l, epp, eh, itp, pos) - struct lwp *l; - struct exec_package *epp; - void *eh; - char *itp; - vaddr_t *pos; +irix_elf64_probe_n64(struct lwp *l, struct exec_package *epp, void *eh, + char *itp, vaddr_t *pos) { int error = 0; @@ -171,9 +157,10 @@
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/mips
Module Name:src Committed By: matt Date: Sat Sep 12 19:26:27 UTC 2009 Modified Files: src/sys/arch/mips/mips [matt-nb5-mips64]: netbsd32_machdep.c Log Message: Add COMPAT_13 support To generate a diff of this commit: cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/sys/arch/mips/mips/netbsd32_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/mips/netbsd32_machdep.c diff -u src/sys/arch/mips/mips/netbsd32_machdep.c:1.1.2.1 src/sys/arch/mips/mips/netbsd32_machdep.c:1.1.2.2 --- src/sys/arch/mips/mips/netbsd32_machdep.c:1.1.2.1 Sat Sep 12 17:37:00 2009 +++ src/sys/arch/mips/mips/netbsd32_machdep.c Sat Sep 12 19:26:27 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_machdep.c,v 1.1.2.1 2009/09/12 17:37:00 matt Exp $ */ +/* $NetBSD: netbsd32_machdep.c,v 1.1.2.2 2009/09/12 19:26:27 matt Exp $ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: netbsd32_machdep.c,v 1.1.2.1 2009/09/12 17:37:00 matt Exp $); +__KERNEL_RCSID(0, $NetBSD: netbsd32_machdep.c,v 1.1.2.2 2009/09/12 19:26:27 matt Exp $); #include opt_compat_netbsd.h #include opt_sa.h @@ -116,6 +116,20 @@ return (error); } +#ifdef COMPAT_13 +int +compat_13_netbsd32_sigreturn(struct lwp *l, + const struct compat_13_netbsd32_sigreturn_args *uap, + register_t *retval) +{ + struct compat_13_sys_sigreturn_args ua; + + NETBSD32TOP_UAP(sigcntxp, struct sigcontext13 *); + + return compat_13_sys_sigreturn(l, ua, retval); +} +#endif + #ifdef COMPAT_16 int compat_16_netbsd32___sigreturn14(struct lwp *l,
CVS commit: [matt-nb5-mips64] src/sys/arch/sgimips/hpc
Module Name:src Committed By: matt Date: Sat Sep 12 19:27:32 UTC 2009 Modified Files: src/sys/arch/sgimips/hpc [matt-nb5-mips64]: if_sq.c Log Message: Don't cast a paddr if you don't have to. To generate a diff of this commit: cvs rdiff -u -r1.33.62.1 -r1.33.62.2 src/sys/arch/sgimips/hpc/if_sq.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/sgimips/hpc/if_sq.c diff -u src/sys/arch/sgimips/hpc/if_sq.c:1.33.62.1 src/sys/arch/sgimips/hpc/if_sq.c:1.33.62.2 --- src/sys/arch/sgimips/hpc/if_sq.c:1.33.62.1 Thu Sep 10 01:51:32 2009 +++ src/sys/arch/sgimips/hpc/if_sq.c Sat Sep 12 19:27:31 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: if_sq.c,v 1.33.62.1 2009/09/10 01:51:32 matt Exp $ */ +/* $NetBSD: if_sq.c,v 1.33.62.2 2009/09/12 19:27:31 matt Exp $ */ /* * Copyright (c) 2001 Rafal K. Boni @@ -33,7 +33,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: if_sq.c,v 1.33.62.1 2009/09/10 01:51:32 matt Exp $); +__KERNEL_RCSID(0, $NetBSD: if_sq.c,v 1.33.62.2 2009/09/12 19:27:31 matt Exp $); #include bpfilter.h @@ -1326,7 +1326,7 @@ sq_dump_buffer(paddr_t addr, psize_t len) { u_int i; - u_char* physaddr = (char*) MIPS_PHYS_TO_KSEG1((void *)addr); + u_char* physaddr = (char*) MIPS_PHYS_TO_KSEG1(addr); if (len == 0) return;
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/include
Module Name:src Committed By: cliff Date: Sun Sep 13 03:28:22 UTC 2009 Modified Files: src/sys/arch/mips/include [matt-nb5-mips64]: cpuregs.h Log Message: include registers file for RMI XL chip family as needed To generate a diff of this commit: cvs rdiff -u -r1.74.28.8 -r1.74.28.9 src/sys/arch/mips/include/cpuregs.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/include/cpuregs.h diff -u src/sys/arch/mips/include/cpuregs.h:1.74.28.8 src/sys/arch/mips/include/cpuregs.h:1.74.28.9 --- src/sys/arch/mips/include/cpuregs.h:1.74.28.8 Tue Sep 8 07:54:53 2009 +++ src/sys/arch/mips/include/cpuregs.h Sun Sep 13 03:28:22 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: cpuregs.h,v 1.74.28.8 2009/09/08 07:54:53 matt Exp $ */ +/* $NetBSD: cpuregs.h,v 1.74.28.9 2009/09/13 03:28:22 cliff Exp $ */ /* * Copyright (c) 1992, 1993 @@ -869,5 +869,8 @@ #ifdef MIPS64_SB1 #include mips/sb1regs.h #endif +#if defined(MIPS64_XLP) || defined(MIPS64_XLR) || defined(MIPS64_XLS) +#include mips/rmi/rmixlreg.h +#endif #endif /* _MIPS_CPUREGS_H_ */
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/conf
Module Name:src Committed By: cliff Date: Sun Sep 13 03:28:51 UTC 2009 Modified Files: src/sys/arch/mips/conf [matt-nb5-mips64]: files.mips Log Message: add MIPS64_XLP MIPS64_XLR MIPS64_XLS to list of flags in opt_cputype.h To generate a diff of this commit: cvs rdiff -u -r1.58.24.2 -r1.58.24.3 src/sys/arch/mips/conf/files.mips Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/conf/files.mips diff -u src/sys/arch/mips/conf/files.mips:1.58.24.2 src/sys/arch/mips/conf/files.mips:1.58.24.3 --- src/sys/arch/mips/conf/files.mips:1.58.24.2 Sat Sep 12 17:37:29 2009 +++ src/sys/arch/mips/conf/files.mips Sun Sep 13 03:28:51 2009 @@ -1,8 +1,9 @@ -# $NetBSD: files.mips,v 1.58.24.2 2009/09/12 17:37:29 matt Exp $ +# $NetBSD: files.mips,v 1.58.24.3 2009/09/13 03:28:51 cliff Exp $ # defflag opt_cputype.h NOFPU MIPS64_SB1 +MIPS64_XLP MIPS64_XLR MIPS64_XLS # and the rest... # MIPS1 MIPS2 MIPS3 MIPS4 MIPS5 # MIPS32 MIPS64
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/include
Module Name:src Committed By: cliff Date: Sun Sep 13 03:29:36 UTC 2009 Modified Files: src/sys/arch/mips/include [matt-nb5-mips64]: pci_machdep.h Log Message: #ifdef to protect against recursive #include To generate a diff of this commit: cvs rdiff -u -r1.4.96.1 -r1.4.96.2 src/sys/arch/mips/include/pci_machdep.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/include/pci_machdep.h diff -u src/sys/arch/mips/include/pci_machdep.h:1.4.96.1 src/sys/arch/mips/include/pci_machdep.h:1.4.96.2 --- src/sys/arch/mips/include/pci_machdep.h:1.4.96.1 Sun Aug 16 03:33:58 2009 +++ src/sys/arch/mips/include/pci_machdep.h Sun Sep 13 03:29:36 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: pci_machdep.h,v 1.4.96.1 2009/08/16 03:33:58 matt Exp $ */ +/* $NetBSD: pci_machdep.h,v 1.4.96.2 2009/09/13 03:29:36 cliff Exp $ */ /* * Copyright (c) 1996 Carnegie-Mellon University. @@ -27,6 +27,9 @@ * rights to redistribute these changes. */ +#ifndef _MIPS_INCLUDE_PCI_MACHDEP_H_ +#define _MIPS_INCLUDE_PCI_MACHDEP_H_ + /* * __HAVE_PCIIDE_MACHDEP_COMPAT_INTR_ESTABLISH (if used) needs to be * defined before this file is included @@ -116,3 +119,5 @@ (*(c)-pc_pciide_compat_intr_establish)((c)-pc_conf_v, (d), (p), \ (ch), (f), (a))) #endif + +#endif /* _MIPS_INCLUDE_PCI_MACHDEP_H_ */
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/mips
Module Name:src Committed By: cliff Date: Sun Sep 13 03:30:27 UTC 2009 Modified Files: src/sys/arch/mips/mips [matt-nb5-mips64]: mips_machdep.c Log Message: - add support for MIPS_XLS616. - add RMI and others to cidnames[] - use MIPS_PHYS_TO_XKPHYS_CACHED to make va for msgbuf and maddr #ifdef _LP64 To generate a diff of this commit: cvs rdiff -u -r1.205.4.1.2.1.2.11 -r1.205.4.1.2.1.2.12 \ src/sys/arch/mips/mips/mips_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/mips/mips_machdep.c diff -u src/sys/arch/mips/mips/mips_machdep.c:1.205.4.1.2.1.2.11 src/sys/arch/mips/mips/mips_machdep.c:1.205.4.1.2.1.2.12 --- src/sys/arch/mips/mips/mips_machdep.c:1.205.4.1.2.1.2.11 Sat Sep 12 18:19:17 2009 +++ src/sys/arch/mips/mips/mips_machdep.c Sun Sep 13 03:30:27 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.11 2009/09/12 18:19:17 matt Exp $ */ +/* $NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.12 2009/09/13 03:30:27 cliff Exp $ */ /* * Copyright 2002 Wasabi Systems, Inc. @@ -112,7 +112,7 @@ #include sys/cdefs.h /* RCS ID Copyright macro defns */ -__KERNEL_RCSID(0, $NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.11 2009/09/12 18:19:17 matt Exp $); +__KERNEL_RCSID(0, $NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.12 2009/09/13 03:30:27 cliff Exp $); #include opt_cputype.h #include opt_compat_netbsd32.h @@ -447,6 +447,10 @@ CPU_MIPS_HAVE_SPECIAL_CCA | (5 CPU_MIPS_CACHED_CCA_SHIFT), SB-1 }, + { MIPS_PRID_CID_RMI, MIPS_XLS616, -1, -1, -1, 0, + MIPS64_FLAGS | CPU_MIPS_D_CACHE_COHERENT, + XLS616 }, + { 0, 0, 0,0, 0, 0, 0, NULL } }; @@ -471,6 +475,13 @@ Alchemy, /* or Alchemy Semiconductor */ SiByte, /* or Broadcom Corp. (SiByte) */ SandCraft, + Phillips, + Toshiba, + LSI, + (unannounced), + (unannounced), + Lexra, + RMI, }; #define ncidnames (sizeof(cidnames) / sizeof(cidnames[0])) @@ -1494,6 +1505,8 @@ bytes = mem_clusters[memcl].size; for (i = 0; i bytes; i += n, totalbytesleft -= n) { + void *maddr_va; + /* Print out how many MBs we have left to go. */ if ((totalbytesleft % (1024*1024)) == 0) printf_nolog(%ld , @@ -1504,8 +1517,12 @@ if (n BYTES_PER_DUMP) n = BYTES_PER_DUMP; - error = (*dump)(dumpdev, blkno, - (void *)MIPS_PHYS_TO_KSEG0(maddr), n); +#ifdef _LP64 + maddr_va = (void *)MIPS_PHYS_TO_XKPHYS_CACHED(maddr); +#else + maddr_va = (void *)MIPS_PHYS_TO_KSEG0(maddr); +#endif + error = (*dump)(dumpdev, blkno, maddr_va, n); if (error) goto err; maddr += n; @@ -1565,7 +1582,11 @@ vps-end -= atop(sz); vps-avail_end -= atop(sz); +#ifdef _LP64 + msgbufaddr = (void *) MIPS_PHYS_TO_XKPHYS_CACHED(ptoa(vps-end)); +#else msgbufaddr = (void *) MIPS_PHYS_TO_KSEG0(ptoa(vps-end)); +#endif initmsgbuf(msgbufaddr, sz); /* Remove the last segment if it now has no pages. */
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/mips
Module Name:src Committed By: cliff Date: Sun Sep 13 03:31:05 UTC 2009 Modified Files: src/sys/arch/mips/mips [matt-nb5-mips64]: db_interface.c mipsX_subr.S Log Message: CP0 ECC and CACHE_ERR not implemented on RMI XLS, so avoid accessing them To generate a diff of this commit: cvs rdiff -u -r1.64.16.4 -r1.64.16.5 src/sys/arch/mips/mips/db_interface.c cvs rdiff -u -r1.26.36.1.2.8 -r1.26.36.1.2.9 \ src/sys/arch/mips/mips/mipsX_subr.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/mips/db_interface.c diff -u src/sys/arch/mips/mips/db_interface.c:1.64.16.4 src/sys/arch/mips/mips/db_interface.c:1.64.16.5 --- src/sys/arch/mips/mips/db_interface.c:1.64.16.4 Mon Sep 7 21:54:39 2009 +++ src/sys/arch/mips/mips/db_interface.c Sun Sep 13 03:31:05 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: db_interface.c,v 1.64.16.4 2009/09/07 21:54:39 matt Exp $ */ +/* $NetBSD: db_interface.c,v 1.64.16.5 2009/09/13 03:31:05 cliff Exp $ */ /* * Mach Operating System @@ -27,7 +27,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: db_interface.c,v 1.64.16.4 2009/09/07 21:54:39 matt Exp $); +__KERNEL_RCSID(0, $NetBSD: db_interface.c,v 1.64.16.5 2009/09/13 03:31:05 cliff Exp $); #include opt_cputype.h /* which mips CPUs do we support? */ #include opt_ddb.h @@ -508,8 +508,10 @@ if (MIPS_HAS_LLSC) { if (CPUISMIPS64) { +#if !defined(MIPS64_XLS) /* CP0 reg #17 reserved */ SHOW64(MIPS_COP_0_LLADDR, lladdr); SHOW64(MIPS_COP_0_WATCH_LO, watchlo); +#endif } else { SHOW32(MIPS_COP_0_LLADDR, lladdr); SHOW32(MIPS_COP_0_WATCH_LO, watchlo); @@ -529,8 +531,10 @@ } } +#if !defined(MIPS64_XLS) /* CP0 ECC and CACHE_ERR not implemented */ SHOW32(MIPS_COP_0_ECC, ecc); SHOW32(MIPS_COP_0_CACHE_ERR, cacherr); +#endif SHOW32(MIPS_COP_0_TAG_LO, cachelo); SHOW32(MIPS_COP_0_TAG_HI, cachehi); Index: src/sys/arch/mips/mips/mipsX_subr.S diff -u src/sys/arch/mips/mips/mipsX_subr.S:1.26.36.1.2.8 src/sys/arch/mips/mips/mipsX_subr.S:1.26.36.1.2.9 --- src/sys/arch/mips/mips/mipsX_subr.S:1.26.36.1.2.8 Tue Sep 8 00:51:14 2009 +++ src/sys/arch/mips/mips/mipsX_subr.S Sun Sep 13 03:31:05 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: mipsX_subr.S,v 1.26.36.1.2.8 2009/09/08 00:51:14 matt Exp $ */ +/* $NetBSD: mipsX_subr.S,v 1.26.36.1.2.9 2009/09/13 03:31:05 cliff Exp $ */ /* * Copyright 2002 Wasabi Systems, Inc. @@ -1053,8 +1053,14 @@ PTR_LA k0, panic # return to panic PTR_LA a0, 9f# panicstr _MFC0 a1, MIPS_COP_0_ERROR_PC +#if defined(MIPS64_XLS) + # CP0 ECC and CACHE_ERR not implemented + move a2, $0 + move a3, $0 +#else mfc0 a2, MIPS_COP_0_ECC mfc0 a3, MIPS_COP_0_CACHE_ERR +#endif _MTC0 k0, MIPS_COP_0_ERROR_PC # set return address COP0_SYNC
CVS commit: [matt-nb5-mips64] src/sys/arch/evbmips/include
Module Name:src Committed By: cliff Date: Sun Sep 13 03:33:08 UTC 2009 Modified Files: src/sys/arch/evbmips/include [matt-nb5-mips64]: vmparam.h Log Message: bump VM_PHYSSEG_MAX to 32 (was 1) for sake of systems with multiple noncontiguous regions of physical memory To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.1.142.1 src/sys/arch/evbmips/include/vmparam.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/evbmips/include/vmparam.h diff -u src/sys/arch/evbmips/include/vmparam.h:1.1 src/sys/arch/evbmips/include/vmparam.h:1.1.142.1 --- src/sys/arch/evbmips/include/vmparam.h:1.1 Thu Mar 7 14:44:02 2002 +++ src/sys/arch/evbmips/include/vmparam.h Sun Sep 13 03:33:08 2009 @@ -1,11 +1,11 @@ -/* $NetBSD: vmparam.h,v 1.1 2002/03/07 14:44:02 simonb Exp $ */ +/* $NetBSD: vmparam.h,v 1.1.142.1 2009/09/13 03:33:08 cliff Exp $ */ #ifndef _EVBMIPS_VMPARAM_H_ #define _EVBMIPS_VMPARAM_H_ #include mips/vmparam.h -#define VM_PHYSSEG_MAX 1 +#define VM_PHYSSEG_MAX 32 #define VM_NFREELIST 1 #define VM_FREELIST_DEFAULT 0
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/mips
Module Name:src Committed By: matt Date: Fri Sep 11 23:51:26 UTC 2009 Modified Files: src/sys/arch/mips/mips [matt-nb5-mips64]: locore.S mips_machdep.c Log Message: Add code to probe TLB for VA/PA/PG_MASK sizes Increase waynames to include 8-way. To generate a diff of this commit: cvs rdiff -u -r1.167.38.2 -r1.167.38.3 src/sys/arch/mips/mips/locore.S cvs rdiff -u -r1.205.4.1.2.1.2.7 -r1.205.4.1.2.1.2.8 \ src/sys/arch/mips/mips/mips_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/mips/locore.S diff -u src/sys/arch/mips/mips/locore.S:1.167.38.2 src/sys/arch/mips/mips/locore.S:1.167.38.3 --- src/sys/arch/mips/mips/locore.S:1.167.38.2 Mon Sep 7 22:05:45 2009 +++ src/sys/arch/mips/mips/locore.S Fri Sep 11 23:51:25 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.167.38.2 2009/09/07 22:05:45 matt Exp $ */ +/* $NetBSD: locore.S,v 1.167.38.3 2009/09/11 23:51:25 matt Exp $ */ /* * Copyright (c) 1992, 1993 @@ -530,6 +530,98 @@ nop END(mips_cp0_status_write) +#ifdef MIPS3_PLUS + .set push + .set mips3 +/* + * uint64_t mips_cp0_tlb_entry_hi_probe(void); + * + * Write 1s to the VPN field of Entry_Hi0 to see how many VA bits + * are implemented. Assumes that interrupts are disabled. + */ +LEAF(mips_cp0_tlb_entry_hi_probe) + dmfc0 t0, MIPS_COP_0_TLB_HI + li v0, -4096 /* all 1s except low 12 bits */ + dsll v0, v0, 2 /* except the top 2 */ + dsrl v0, v0, 2 + dmtc0 v0, MIPS_COP_0_TLB_HI + COP0_SYNC + nop + nop + dmfc0 v0, MIPS_COP_0_TLB_HI + dmtc0 t0, MIPS_COP_0_TLB_HI + COP0_SYNC + nop +#ifdef __mips_o32 + nop +#if BYTE_ORDER == BIG_ENDIAN + srl v1, v0, 0 + dsra v0, v0, 32 +#endif +#if BYTE_ORDER == LITTLE_ENDIAN + dsra v1, v0, 32 + srl v0, v0, 0 +#endif +#endif /* __mips_o32 */ + j ra + nop +END(mips_cp0_tlb_entry_hi_probe) + +/* + * uint64_t mips_cp0_tlb_entry_lo_probe(void); + * + * Write 1s to the PFN field of Entry_Lo0 to see how many + * PA bits are implemented. Assumes that interrupts are disabled. + */ +LEAF(mips_cp0_tlb_entry_lo_probe) + dmfc0 t0, MIPS_COP_0_TLB_LO0 + li v0, -64 /* all 1s except low 6 bits */ + dmtc0 v0, MIPS_COP_0_TLB_LO0 + COP0_SYNC + nop + nop + dmfc0 v0, MIPS_COP_0_TLB_LO0 + dmtc0 t0, MIPS_COP_0_TLB_LO0 + COP0_SYNC + nop +#ifdef __mips_o32 + nop +#if BYTE_ORDER == BIG_ENDIAN + srl v1, v0, 0 + dsra v0, v0, 32 +#endif +#if BYTE_ORDER == LITTLE_ENDIAN + dsra v1, v0, 32 + srl v0, v0, 0 +#endif +#endif /* __mips_o32 */ + j ra + nop +END(mips_cp0_tlb_entry_lo_probe) + .set pop + +/* + * uint32_t mips_cp0_tlb_page_mask_probe(void); + * + * Write 1s to the RPN field of Entry_Lo0 to see how many PA bits are implemented. + * Assumes that interrupts are disabled. + */ +LEAF(mips_cp0_tlb_page_mask_probe) + mfc0 t0, MIPS_COP_0_TLB_PG_MASK + lui v0, 0x + srl v0, v0, 3 + mtc0 v0, MIPS_COP_0_TLB_PG_MASK + COP0_SYNC + nop + nop + mfc0 v0, MIPS_COP_0_TLB_PG_MASK + mtc0 t0, MIPS_COP_0_TLB_PG_MASK + COP0_SYNC + nop + j ra + nop +END(mips_cp0_tlb_page_mask_probe) +#endif /* MIPS3_PLUS */ #if !defined(NOFPU) !defined(SOFTFLOAT) /* Index: src/sys/arch/mips/mips/mips_machdep.c diff -u src/sys/arch/mips/mips/mips_machdep.c:1.205.4.1.2.1.2.7 src/sys/arch/mips/mips/mips_machdep.c:1.205.4.1.2.1.2.8 --- src/sys/arch/mips/mips/mips_machdep.c:1.205.4.1.2.1.2.7 Tue Sep 8 08:11:29 2009 +++ src/sys/arch/mips/mips/mips_machdep.c Fri Sep 11 23:51:25 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.7 2009/09/08 08:11:29 matt Exp $ */ +/* $NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.8 2009/09/11 23:51:25 matt Exp $ */ /* * Copyright 2002 Wasabi Systems, Inc. @@ -112,7 +112,7 @@ #include sys/cdefs.h /* RCS ID Copyright macro defns */ -__KERNEL_RCSID(0, $NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.7 2009/09/08 08:11:29 matt Exp $); +__KERNEL_RCSID(0, $NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.8 2009/09/11 23:51:25 matt Exp $); #include opt_cputype.h @@ -166,6 +166,14 @@ u_long cpu_dump_mempagecnt(void); int cpu_dump(void); +#if defined(MIPS3_PLUS) +uint32_t mips_cp0_tlb_page_mask_probe(void); +uint64_t mips_cp0_tlb_entry_hi_probe(void); +uint64_t mips_cp0_tlb_entry_lo_probe(void); + +static void mips3_tlb_probe(void); +#endif + #if defined(MIPS1) static void mips1_vector_init(void); extern const struct locoresw mips1_locoresw; @@ -206,6 +214,11 @@ uint64_t mips3_xkphys_cached; #endif u_int mips3_pg_shift; +#ifdef MIPS3_PLUS +uint64_t mips3_tlb_vpn_mask; +uint64_t mips3_tlb_pfn_mask; +uint32_t mips3_tlb_pg_mask; +#endif struct user *proc0paddr; struct segtab *segbase = (void *)(MIPS_KSEG2_START + 0x1eadbeef); @@ -916,6 +929,7 @@ case CPU_ARCH_MIPS3: case CPU_ARCH_MIPS4: #if defined(MIPS3_5900) /* XXX */ + mips3_tlb_probe(); mips3_cp0_pg_mask_write(MIPS3_PG_SIZE_4K); mips3_cp0_wired_write(0); mips5900_TBIA(mips_num_tlb_entries);
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/mips
Module Name:src Committed By: matt Date: Sat Sep 12 00:03:28 UTC 2009 Modified Files: src/sys/arch/mips/mips [matt-nb5-mips64]: mips_machdep.c Log Message: Fix PFN width calculation. To generate a diff of this commit: cvs rdiff -u -r1.205.4.1.2.1.2.8 -r1.205.4.1.2.1.2.9 \ src/sys/arch/mips/mips/mips_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/mips/mips_machdep.c diff -u src/sys/arch/mips/mips/mips_machdep.c:1.205.4.1.2.1.2.8 src/sys/arch/mips/mips/mips_machdep.c:1.205.4.1.2.1.2.9 --- src/sys/arch/mips/mips/mips_machdep.c:1.205.4.1.2.1.2.8 Fri Sep 11 23:51:25 2009 +++ src/sys/arch/mips/mips/mips_machdep.c Sat Sep 12 00:03:27 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.8 2009/09/11 23:51:25 matt Exp $ */ +/* $NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.9 2009/09/12 00:03:27 matt Exp $ */ /* * Copyright 2002 Wasabi Systems, Inc. @@ -112,7 +112,7 @@ #include sys/cdefs.h /* RCS ID Copyright macro defns */ -__KERNEL_RCSID(0, $NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.8 2009/09/11 23:51:25 matt Exp $); +__KERNEL_RCSID(0, $NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.9 2009/09/12 00:03:27 matt Exp $); #include opt_cputype.h @@ -1132,7 +1132,7 @@ i = ffs(~(mips3_tlb_vpn_mask 31)) + 30; printf(, %d%cB (%d-bit) VAs, 1 (i % 10), sufx[(i / 10) - 1], i); - for (i = 64, pfn_mask = mips3_tlb_pfn_mask; + for (i = 64, pfn_mask = mips3_tlb_pfn_mask 6; pfn_mask 0; i--, pfn_mask = 1) ; printf(, %d%cB (%d-bit) PAs,
CVS commit: [matt-nb5-mips64] src/sys/compat/netbsd32
Module Name:src Committed By: matt Date: Sat Sep 12 04:57:20 UTC 2009 Modified Files: src/sys/compat/netbsd32 [matt-nb5-mips64]: netbsd32_sysent.c Log Message: Regen. To generate a diff of this commit: cvs rdiff -u -r1.77.4.1 -r1.77.4.1.4.1 \ src/sys/compat/netbsd32/netbsd32_sysent.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/netbsd32/netbsd32_sysent.c diff -u src/sys/compat/netbsd32/netbsd32_sysent.c:1.77.4.1 src/sys/compat/netbsd32/netbsd32_sysent.c:1.77.4.1.4.1 --- src/sys/compat/netbsd32/netbsd32_sysent.c:1.77.4.1 Tue Nov 25 17:32:27 2008 +++ src/sys/compat/netbsd32/netbsd32_sysent.c Sat Sep 12 04:57:20 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_sysent.c,v 1.77.4.1 2008/11/25 17:32:27 snj Exp $ */ +/* $NetBSD: netbsd32_sysent.c,v 1.77.4.1.4.1 2009/09/12 04:57:20 matt Exp $ */ /* * System call switch table. @@ -8,7 +8,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: netbsd32_sysent.c,v 1.77.4.1 2008/11/25 17:32:27 snj Exp $); +__KERNEL_RCSID(0, $NetBSD: netbsd32_sysent.c,v 1.77.4.1.4.1 2009/09/12 04:57:20 matt Exp $); #if defined(_KERNEL_OPT) #include opt_nfsserver.h @@ -465,9 +465,9 @@ #endif { 0, 0, 0, sys_nosys }, /* 172 = unimplemented */ - { ns(struct netbsd32_pread_args), 0, + { ns(struct netbsd32_pread_args), SYCALL_NARGS64_VAL(1) | SYCALL_ARG4_64, (sy_call_t *)netbsd32_pread }, /* 173 = netbsd32_pread */ - { ns(struct netbsd32_pwrite_args), 0, + { ns(struct netbsd32_pwrite_args), SYCALL_NARGS64_VAL(1) | SYCALL_ARG4_64, (sy_call_t *)netbsd32_pwrite }, /* 174 = netbsd32_pwrite */ { ns(struct compat_30_netbsd32_ntp_gettime_args), 0, (sy_call_t *)compat_30(netbsd32_ntp_gettime) },/* 175 = compat_30_netbsd32_ntp_gettime */ @@ -524,15 +524,15 @@ (sy_call_t *)netbsd32_setrlimit }, /* 195 = netbsd32_setrlimit */ { ns(struct compat_12_netbsd32_getdirentries_args), 0, (sy_call_t *)compat_12(netbsd32_getdirentries) },/* 196 = compat_12_netbsd32_getdirentries */ - { ns(struct netbsd32_mmap_args), 0, + { ns(struct netbsd32_mmap_args), SYCALL_NARGS64_VAL(1) | SYCALL_ARG6_64, (sy_call_t *)netbsd32_mmap }, /* 197 = netbsd32_mmap */ - { ns(struct netbsd32_sys___syscall_args), SYCALL_INDIRECT, + { ns(struct netbsd32_sys___syscall_args), SYCALL_NARGS64_VAL(1) | SYCALL_ARG0_64 | SYCALL_RET_64 | SYCALL_INDIRECT, (sy_call_t *)netbsd32_sys___syscall },/* 198 = __syscall */ - { ns(struct netbsd32_lseek_args), 0, + { ns(struct netbsd32_lseek_args), SYCALL_NARGS64_VAL(1) | SYCALL_ARG2_64 | SYCALL_RET_64, (sy_call_t *)netbsd32_lseek }, /* 199 = netbsd32_lseek */ - { ns(struct netbsd32_truncate_args), 0, + { ns(struct netbsd32_truncate_args), SYCALL_NARGS64_VAL(1) | SYCALL_ARG2_64, (sy_call_t *)netbsd32_truncate }, /* 200 = netbsd32_truncate */ - { ns(struct netbsd32_ftruncate_args), 0, + { ns(struct netbsd32_ftruncate_args), SYCALL_NARGS64_VAL(1) | SYCALL_ARG2_64, (sy_call_t *)netbsd32_ftruncate }, /* 201 = netbsd32_ftruncate */ { ns(struct netbsd32___sysctl_args), 0, (sy_call_t *)netbsd32___sysctl }, /* 202 = netbsd32___sysctl */ @@ -787,9 +787,9 @@ (sy_call_t *)netbsd32___clone }, /* 287 = netbsd32___clone */ { ns(struct netbsd32_fktrace_args), 0, (sy_call_t *)netbsd32_fktrace }, /* 288 = netbsd32_fktrace */ - { ns(struct netbsd32_preadv_args), 0, + { ns(struct netbsd32_preadv_args), SYCALL_NARGS64_VAL(1) | SYCALL_ARG4_64, (sy_call_t *)netbsd32_preadv }, /* 289 = netbsd32_preadv */ - { ns(struct netbsd32_pwritev_args), 0, + { ns(struct netbsd32_pwritev_args), SYCALL_NARGS64_VAL(1) | SYCALL_ARG4_64, (sy_call_t *)netbsd32_pwritev }, /* 290 = netbsd32_pwritev */ { ns(struct netbsd32___sigaction14_args), 0, (sy_call_t *)netbsd32___sigaction14 },/* 291 = netbsd32___sigaction14 */ @@ -932,7 +932,7 @@ sys_nosys }, /* 352 = unimplemented */ { 0, 0, 0, sys_nosys }, /* 353 = unimplemented */ - { ns(struct netbsd32_fsync_range_args), 0, + { ns(struct netbsd32_fsync_range_args), SYCALL_NARGS64_VAL(2) | SYCALL_ARG3_64 | SYCALL_ARG2_64, (sy_call_t *)netbsd32_fsync_range },/* 354 = netbsd32_fsync_range */ { ns(struct netbsd32_uuidgen_args), 0, (sy_call_t *)netbsd32_uuidgen }, /* 355 = netbsd32_uuidgen */ @@ -1056,7 +1056,7 @@ sys_nosys }, /* 414 = unimplemented */ { 0, 0, 0, sys_nosys }, /* 415 = unimplemented */ - { ns(struct netbsd32___posix_fadvise50_args), 0, + { ns(struct netbsd32___posix_fadvise50_args), SYCALL_NARGS64_VAL(2) | SYCALL_ARG3_64 | SYCALL_ARG2_64, (sy_call_t *)netbsd32___posix_fadvise50 },/* 416 = netbsd32___posix_fadvise50 */ { 0, 0, 0, sys_nosys }, /* 417 = filler */
CVS commit: [matt-nb5-mips64] src/sys/lkm
Module Name:src Committed By: matt Date: Wed Sep 9 21:14:59 UTC 2009 Modified Files: src/sys/lkm [matt-nb5-mips64]: Makefile.inc Log Message: If building LKMs for mips64, assume LP64 kernel. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.14.48.1 src/sys/lkm/Makefile.inc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/lkm/Makefile.inc diff -u src/sys/lkm/Makefile.inc:1.14 src/sys/lkm/Makefile.inc:1.14.48.1 --- src/sys/lkm/Makefile.inc:1.14 Mon May 28 12:06:24 2007 +++ src/sys/lkm/Makefile.inc Wed Sep 9 21:14:59 2009 @@ -1,10 +1,15 @@ -# $NetBSD: Makefile.inc,v 1.14 2007/05/28 12:06:24 tls Exp $ +# $NetBSD: Makefile.inc,v 1.14.48.1 2009/09/09 21:14:59 matt Exp $ .if !defined(__SYS_LKM_MAKEFILE_INC) __SYS_LKM_MAKEFILE_INC= 1 NOMAN= # defined +.if ${MACHINE_ARCH:Mmips64*} != +CPUFLAGS+= -mabi=64 +LDFLAGS+= -mabi=64 +.endif + .include bsd.own.mk
CVS commit: [matt-nb5-mips64] src/sys/compat/ultrix
Module Name:src Committed By: matt Date: Wed Sep 9 21:15:59 UTC 2009 Modified Files: src/sys/compat/ultrix [matt-nb5-mips64]: ultrix_flock.h ultrix_fs.c ultrix_ioctl.c ultrix_pathname.c ultrix_tty.h Log Message: Change to use fixed sized types. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.1.162.1 src/sys/compat/ultrix/ultrix_flock.h cvs rdiff -u -r1.49 -r1.49.16.1 src/sys/compat/ultrix/ultrix_fs.c cvs rdiff -u -r1.35 -r1.35.22.1 src/sys/compat/ultrix/ultrix_ioctl.c cvs rdiff -u -r1.35 -r1.35.12.1 src/sys/compat/ultrix/ultrix_pathname.c cvs rdiff -u -r1.2 -r1.2.186.1 src/sys/compat/ultrix/ultrix_tty.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/ultrix/ultrix_flock.h diff -u src/sys/compat/ultrix/ultrix_flock.h:1.1 src/sys/compat/ultrix/ultrix_flock.h:1.1.162.1 --- src/sys/compat/ultrix/ultrix_flock.h:1.1 Fri Jul 30 16:03:49 1999 +++ src/sys/compat/ultrix/ultrix_flock.h Wed Sep 9 21:15:58 2009 @@ -1,12 +1,12 @@ -/* $NetBSD: ultrix_flock.h,v 1.1 1999/07/30 16:03:49 drochner Exp $ */ +/* $NetBSD: ultrix_flock.h,v 1.1.162.1 2009/09/09 21:15:58 matt Exp $ */ struct ultrix_flock { - short l_type; + int16_t l_type; #define ULTRIX_F_RDLCK 1 #define ULTRIX_F_WRLCK 2 #define ULTRIX_F_UNLCK 3 - short l_whence; - long l_start; - long l_len; - int l_pid; + int16_t l_whence; + int32_t l_start; + int32_t l_len; + int32_t l_pid; }; Index: src/sys/compat/ultrix/ultrix_fs.c diff -u src/sys/compat/ultrix/ultrix_fs.c:1.49 src/sys/compat/ultrix/ultrix_fs.c:1.49.16.1 --- src/sys/compat/ultrix/ultrix_fs.c:1.49 Tue May 6 18:43:44 2008 +++ src/sys/compat/ultrix/ultrix_fs.c Wed Sep 9 21:15:59 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: ultrix_fs.c,v 1.49 2008/05/06 18:43:44 ad Exp $ */ +/* $NetBSD: ultrix_fs.c,v 1.49.16.1 2009/09/09 21:15:59 matt Exp $ */ /* * Copyright (c) 1995, 1997 Jonathan Stone @@ -33,7 +33,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: ultrix_fs.c,v 1.49 2008/05/06 18:43:44 ad Exp $); +__KERNEL_RCSID(0, $NetBSD: ultrix_fs.c,v 1.49.16.1 2009/09/09 21:15:59 matt Exp $); #include sys/param.h #include sys/systm.h @@ -75,24 +75,24 @@ * compatibility with the size the Ultrix kernel and user apps expect. */ struct ultrix_fs_data { - u_int32_t ufsd_flags; /* how mounted */ - u_int32_t ufsd_mtsize; /* max transfer size in bytes */ - u_int32_t ufsd_otsize; /* optimal transfer size in bytes */ - u_int32_t ufsd_bsize; /* fs block size (bytes) for vm code */ - u_int32_t ufsd_fstype; /* see ../h/fs_types.h */ - u_int32_t ufsd_gtot; /* total number of gnodes */ - u_int32_t ufsd_gfree; /* # of free gnodes */ - u_int32_t ufsd_btot; /* total number of 1K blocks */ - u_int32_t ufsd_bfree; /* # of free 1K blocks */ - u_int32_t ufsd_bfreen; /* user consumable 1K blocks */ - u_int32_t ufsd_pgthresh; /* min size in bytes before paging*/ + uint32_t ufsd_flags; /* how mounted */ + uint32_t ufsd_mtsize; /* max transfer size in bytes */ + uint32_t ufsd_otsize; /* optimal transfer size in bytes */ + uint32_t ufsd_bsize; /* fs block size (bytes) for vm code */ + uint32_t ufsd_fstype; /* see ../h/fs_types.h */ + uint32_t ufsd_gtot; /* total number of gnodes */ + uint32_t ufsd_gfree; /* # of free gnodes */ + uint32_t ufsd_btot; /* total number of 1K blocks */ + uint32_t ufsd_bfree; /* # of free 1K blocks */ + uint32_t ufsd_bfreen; /* user consumable 1K blocks */ + uint32_t ufsd_pgthresh; /* min size in bytes before paging*/ int32_t ufsd_uid; /* uid that mounted me */ int16_t ufsd_dev; /* major/minor of fs */ int16_t ufsd_exroot; /* root mapping from exports */ char ufsd_devname[ULTRIX_MAXPATHLEN + 4]; /* name of dev */ char ufsd_path[ULTRIX_MAXPATHLEN + 4]; /* name of mnt point */ - u_int32_t ufsd_nupdate; /* number of writes */ - u_int32_t ufsd_pad[112]; /* pad to 2560 bytes. */ + uint32_t ufsd_nupdate; /* number of writes */ + uint32_t ufsd_pad[112]; /* pad to 2560 bytes. */ }; /* @@ -337,8 +337,8 @@ * mounting local (4.2bsd FFS) filesystems */ struct ultrix_ufs_args { - u_long ufs_flags; /* mount flags?*/ - u_long ufs_pgthresh; /* minimum file size to page */ + uint32_t ufs_flags; /* mount flags?*/ + uint32_t ufs_pgthresh; /* minimum file size to page */ }; int Index: src/sys/compat/ultrix/ultrix_ioctl.c diff -u src/sys/compat/ultrix/ultrix_ioctl.c:1.35 src/sys/compat/ultrix/ultrix_ioctl.c:1.35.22.1 --- src/sys/compat/ultrix/ultrix_ioctl.c:1.35 Fri Mar 21 21:54:59 2008 +++ src/sys/compat/ultrix/ultrix_ioctl.c Wed Sep 9 21:15:59 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: ultrix_ioctl.c,v 1.35 2008/03/21 21:54:59 ad Exp $ */ +/* $NetBSD: ultrix_ioctl.c,v 1.35.22.1 2009/09/09 21:15:59 matt Exp $ */ /* from : NetBSD: sunos_ioctl.c,v 1.21 1995/10/07 06:27:31 mycroft Exp */ /* @@ -28,7 +28,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: ultrix_ioctl.c,v 1.35 2008/03/21 21:54:59 ad Exp $); +__KERNEL_RCSID(0,
CVS commit: [matt-nb5-mips64] src/sys/arch/sgimips
Module Name:src Committed By: matt Date: Thu Sep 10 01:51:32 UTC 2009 Modified Files: src/sys/arch/sgimips/conf [matt-nb5-mips64]: GENERIC32_IP3x src/sys/arch/sgimips/dev [matt-nb5-mips64]: int.c src/sys/arch/sgimips/hpc [matt-nb5-mips64]: hpcdma.c if_sq.c wdsc.c src/sys/arch/sgimips/include [matt-nb5-mips64]: loadfile_machdep.h src/sys/arch/sgimips/mace [matt-nb5-mips64]: if_mec.c mace.c src/sys/arch/sgimips/sgimips [matt-nb5-mips64]: bus.c machdep.c src/sys/arch/sgimips/stand [matt-nb5-mips64]: Makefile.booters src/sys/arch/sgimips/stand/boot [matt-nb5-mips64]: Makefile Added Files: src/sys/arch/sgimips/conf [matt-nb5-mips64]: GENERIC64_IP2x GENERIC64_IP3x INSTALL64_IP2x INSTALL64_IP3x std.sgimips64 Log Message: Add preliminary LP64 support for sgimips To generate a diff of this commit: cvs rdiff -u -r1.76.4.1 -r1.76.4.1.4.1 \ src/sys/arch/sgimips/conf/GENERIC32_IP3x cvs rdiff -u -r0 -r1.1.2.1 src/sys/arch/sgimips/conf/GENERIC64_IP2x \ src/sys/arch/sgimips/conf/GENERIC64_IP3x \ src/sys/arch/sgimips/conf/INSTALL64_IP2x \ src/sys/arch/sgimips/conf/INSTALL64_IP3x \ src/sys/arch/sgimips/conf/std.sgimips64 cvs rdiff -u -r1.19 -r1.19.12.1 src/sys/arch/sgimips/dev/int.c cvs rdiff -u -r1.16 -r1.16.16.1 src/sys/arch/sgimips/hpc/hpcdma.c cvs rdiff -u -r1.33 -r1.33.62.1 src/sys/arch/sgimips/hpc/if_sq.c cvs rdiff -u -r1.25 -r1.25.14.1 src/sys/arch/sgimips/hpc/wdsc.c cvs rdiff -u -r1.6 -r1.6.18.1 src/sys/arch/sgimips/include/loadfile_machdep.h cvs rdiff -u -r1.33 -r1.33.12.1 src/sys/arch/sgimips/mace/if_mec.c cvs rdiff -u -r1.15 -r1.15.12.1 src/sys/arch/sgimips/mace/mace.c cvs rdiff -u -r1.55 -r1.55.16.1 src/sys/arch/sgimips/sgimips/bus.c cvs rdiff -u -r1.121.8.1 -r1.121.8.2 src/sys/arch/sgimips/sgimips/machdep.c cvs rdiff -u -r1.15 -r1.15.22.1 src/sys/arch/sgimips/stand/Makefile.booters cvs rdiff -u -r1.13 -r1.13.22.1 src/sys/arch/sgimips/stand/boot/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/sgimips/conf/GENERIC32_IP3x diff -u src/sys/arch/sgimips/conf/GENERIC32_IP3x:1.76.4.1 src/sys/arch/sgimips/conf/GENERIC32_IP3x:1.76.4.1.4.1 --- src/sys/arch/sgimips/conf/GENERIC32_IP3x:1.76.4.1 Sat Dec 27 03:50:52 2008 +++ src/sys/arch/sgimips/conf/GENERIC32_IP3x Thu Sep 10 01:51:31 2009 @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC32_IP3x,v 1.76.4.1 2008/12/27 03:50:52 snj Exp $ +# $NetBSD: GENERIC32_IP3x,v 1.76.4.1.4.1 2009/09/10 01:51:31 matt Exp $ # # GENERIC32_IP3x machine description file # @@ -28,7 +28,7 @@ options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident GENERIC32_IP3x-$Revision: 1.76.4.1 $ +#ident GENERIC32_IP3x-$Revision: 1.76.4.1.4.1 $ maxusers 32 @@ -36,7 +36,7 @@ options MIPS3 # MIPS3 support options ENABLE_MIPS4_CACHE_R10K # enable R1 cache ops #options BLINK # blinkenlitzen -makeoptions CPUFLAGS=-march=mips3 -mabi=32 -mtune=vr5000 +makeoptions CPUFLAGS=-march=mips3 -mtune=vr5000 # Standard system options #options INSECURE # disable kernel security levels Index: src/sys/arch/sgimips/dev/int.c diff -u src/sys/arch/sgimips/dev/int.c:1.19 src/sys/arch/sgimips/dev/int.c:1.19.12.1 --- src/sys/arch/sgimips/dev/int.c:1.19 Sat Aug 23 17:25:54 2008 +++ src/sys/arch/sgimips/dev/int.c Thu Sep 10 01:51:31 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: int.c,v 1.19 2008/08/23 17:25:54 tsutsui Exp $ */ +/* $NetBSD: int.c,v 1.19.12.1 2009/09/10 01:51:31 matt Exp $ */ /* * Copyright (c) 2004 Christopher SEKIYA @@ -32,7 +32,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: int.c,v 1.19 2008/08/23 17:25:54 tsutsui Exp $); +__KERNEL_RCSID(0, $NetBSD: int.c,v 1.19.12.1 2009/09/10 01:51:31 matt Exp $); #include opt_cputype.h @@ -207,7 +207,7 @@ int intnum; uint32_t mstat; uint32_t mmask; - int which = (int)arg; + int which = (intptr_t)arg; struct sgimips_intrhand *ih; ret = 0; Index: src/sys/arch/sgimips/hpc/hpcdma.c diff -u src/sys/arch/sgimips/hpc/hpcdma.c:1.16 src/sys/arch/sgimips/hpc/hpcdma.c:1.16.16.1 --- src/sys/arch/sgimips/hpc/hpcdma.c:1.16 Sat May 10 15:31:05 2008 +++ src/sys/arch/sgimips/hpc/hpcdma.c Thu Sep 10 01:51:32 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: hpcdma.c,v 1.16 2008/05/10 15:31:05 martin Exp $ */ +/* $NetBSD: hpcdma.c,v 1.16.16.1 2009/09/10 01:51:32 matt Exp $ */ /* * Copyright (c) 2001 Wayne Knowles @@ -44,7 +44,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: hpcdma.c,v 1.16 2008/05/10 15:31:05 martin Exp $); +__KERNEL_RCSID(0, $NetBSD: hpcdma.c,v 1.16.16.1 2009/09/10 01:51:32 matt Exp $); #include sys/param.h #include sys/systm.h @@ -139,13 +139,13 @@ if (sc-hpc-revision == 3) { hva-hpc3_hdd_bufptr = segp-ds_addr; hva-hpc3_hdd_ctl= segp-ds_len; - hva-hdd_descptr = (u_int32_t) ++hpa; + hva-hdd_descptr = (uintptr_t) ++hpa; } else /* HPC 1/1.5 */ { /* there doesn't
CVS commit: [matt-nb5-mips64] src/sys/compat/irix
Module Name:src Committed By: matt Date: Thu Sep 10 01:52:34 UTC 2009 Modified Files: src/sys/compat/irix [matt-nb5-mips64]: irix_exec.c irix_exec_elf32.c irix_fcntl.c irix_kmem.c irix_prctl.c irix_signal.c irix_sysmp.c irix_syssgi.c irix_types.h Log Message: Make LP64 safe (XXX probably need an irix32). To generate a diff of this commit: cvs rdiff -u -r1.52.14.1 -r1.52.14.2 src/sys/compat/irix/irix_exec.c cvs rdiff -u -r1.15 -r1.15.18.1 src/sys/compat/irix/irix_exec_elf32.c cvs rdiff -u -r1.25 -r1.25.18.1 src/sys/compat/irix/irix_fcntl.c cvs rdiff -u -r1.8 -r1.8.18.1 src/sys/compat/irix/irix_kmem.c cvs rdiff -u -r1.48 -r1.48.14.1 src/sys/compat/irix/irix_prctl.c cvs rdiff -u -r1.48.18.1 -r1.48.18.2 src/sys/compat/irix/irix_signal.c cvs rdiff -u -r1.21 -r1.21.18.1 src/sys/compat/irix/irix_sysmp.c cvs rdiff -u -r1.48 -r1.48.16.1 src/sys/compat/irix/irix_syssgi.c cvs rdiff -u -r1.18 -r1.18.18.1 src/sys/compat/irix/irix_types.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/irix/irix_exec.c diff -u src/sys/compat/irix/irix_exec.c:1.52.14.1 src/sys/compat/irix/irix_exec.c:1.52.14.2 --- src/sys/compat/irix/irix_exec.c:1.52.14.1 Wed Aug 26 03:46:40 2009 +++ src/sys/compat/irix/irix_exec.c Thu Sep 10 01:52:34 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: irix_exec.c,v 1.52.14.1 2009/08/26 03:46:40 matt Exp $ */ +/* $NetBSD: irix_exec.c,v 1.52.14.2 2009/09/10 01:52:34 matt Exp $ */ /*- * Copyright (c) 2001-2002 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: irix_exec.c,v 1.52.14.1 2009/08/26 03:46:40 matt Exp $); +__KERNEL_RCSID(0, $NetBSD: irix_exec.c,v 1.52.14.2 2009/09/10 01:52:34 matt Exp $); #ifdef _KERNEL_OPT #include opt_syscall_debug.h @@ -127,7 +127,10 @@ struct frame *f = l-l_md.md_regs; /* Enable 64 bit instructions (eg: sd) */ - f-f_regs[_R_SR] |= MIPS3_SR_UX; + f-f_regs[_R_SR] |= MIPS3_SR_UX | MIPS3_SR_FR; +#ifdef _LP64 + f-f_regs[_R_SR] |= MIPS3_SR_KX; +#endif } /* Index: src/sys/compat/irix/irix_exec_elf32.c diff -u src/sys/compat/irix/irix_exec_elf32.c:1.15 src/sys/compat/irix/irix_exec_elf32.c:1.15.18.1 --- src/sys/compat/irix/irix_exec_elf32.c:1.15 Mon Apr 28 20:23:41 2008 +++ src/sys/compat/irix/irix_exec_elf32.c Thu Sep 10 01:52:34 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: irix_exec_elf32.c,v 1.15 2008/04/28 20:23:41 martin Exp $ */ +/* $NetBSD: irix_exec_elf32.c,v 1.15.18.1 2009/09/10 01:52:34 matt Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -30,11 +30,15 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: irix_exec_elf32.c,v 1.15 2008/04/28 20:23:41 martin Exp $); +__KERNEL_RCSID(0, $NetBSD: irix_exec_elf32.c,v 1.15.18.1 2009/09/10 01:52:34 matt Exp $); #ifndef ELFSIZE +#ifdef _LP64 +#define ELFSIZE 64 /* XXX should die */ +#else #define ELFSIZE 32 /* XXX should die */ #endif +#endif #include sys/param.h #include sys/types.h @@ -56,6 +60,7 @@ #include compat/irix/irix_exec.h +#ifdef EXEC_ELF32 /* * IRIX o32 ABI probe function */ @@ -90,6 +95,7 @@ printf(epp-ep_vm_minaddr = 0x%lx\n, epp-ep_vm_minaddr); #endif epp-ep_vm_minaddr = epp-ep_vm_minaddr ~0xfUL; + l-l_proc-l_md.md_abi = _MIP_BSD_API_O32; return 0; } @@ -126,6 +132,46 @@ printf(epp-ep_vm_minaddr = 0x%lx\n, epp-ep_vm_minaddr); #endif epp-ep_vm_minaddr = epp-ep_vm_minaddr ~0xfUL; + l-l_proc-l_md.md_abi = _MIP_BSD_API_N32; + return 0; +} +#endif /* EXEC_ELF32 */ + +#ifdef EXEC_ELF64 +/* + * IRIX n32 ABI probe function + */ +int +ELFNAME2(irix,probe_n64)(l, epp, eh, itp, pos) + struct lwp *l; + struct exec_package *epp; + void *eh; + char *itp; + vaddr_t *pos; +{ + int error = 0; + +#ifdef DEBUG_IRIX + printf(irix_probe_n64()\n); +#endif + if Elf_Ehdr *)epp-ep_hdr)-e_flags IRIX_EF_IRIX_ABI_MASK) != + IRIX_EF_IRIX_ABI64) + return error; + + if (itp) { + /* n32 binaries use /lib64/libc.so.1 */ + if (strncmp(itp, /lib64/libc.so, 14) + strncmp(itp, /usr/lib64/libc.so, 18)) + return ENOEXEC; + if ((error = emul_find_interp(l, epp, itp))) + return error; + } +#ifdef DEBUG_IRIX + printf(irix_probe_n32: returning 0\n); + printf(epp-ep_vm_minaddr = 0x%lx\n, epp-ep_vm_minaddr); +#endif + epp-ep_vm_minaddr = epp-ep_vm_minaddr ~0xfUL; + l-l_proc-l_md.md_abi = _MIP_BSD_API_N32; return 0; } @@ -152,7 +198,7 @@ * the code that sets up the stack in copyargs(): */ #ifdef DEBUG_IRIX - printf(irix_elf32_copyargs(): *stackp = %p\n, *stackp); + printf(%s(): *stackp = %p\n, __func__, *stackp); #endif /* * This is borrowed from sys/kern/kern_exec.c:copyargs() Index: src/sys/compat/irix/irix_fcntl.c diff -u src/sys/compat/irix/irix_fcntl.c:1.25 src/sys/compat/irix/irix_fcntl.c:1.25.18.1 --- src/sys/compat/irix/irix_fcntl.c:1.25 Mon Apr 28 20:23:41 2008 +++ src/sys/compat/irix/irix_fcntl.c Thu Sep 10 01:52:34 2009 @@ -1,4 +1,4 @@ -/*
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/mips
Module Name:src Committed By: uebayasi Date: Tue Sep 8 07:46:14 UTC 2009 Modified Files: src/sys/arch/mips/mips [matt-nb5-mips64]: mips_machdep.c vm_machdep.c Log Message: To be consistent, always cast pointers to (intptr_t) even if the address is in userspace. Reviewed By:matt To generate a diff of this commit: cvs rdiff -u -r1.205.4.1.2.1.2.5 -r1.205.4.1.2.1.2.6 \ src/sys/arch/mips/mips/mips_machdep.c cvs rdiff -u -r1.121.6.1.2.4 -r1.121.6.1.2.5 \ src/sys/arch/mips/mips/vm_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/mips/mips_machdep.c diff -u src/sys/arch/mips/mips/mips_machdep.c:1.205.4.1.2.1.2.5 src/sys/arch/mips/mips/mips_machdep.c:1.205.4.1.2.1.2.6 --- src/sys/arch/mips/mips/mips_machdep.c:1.205.4.1.2.1.2.5 Mon Sep 7 22:27:30 2009 +++ src/sys/arch/mips/mips/mips_machdep.c Tue Sep 8 07:46:14 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.5 2009/09/07 22:27:30 matt Exp $ */ +/* $NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.6 2009/09/08 07:46:14 uebayasi Exp $ */ /* * Copyright 2002 Wasabi Systems, Inc. @@ -112,7 +112,7 @@ #include sys/cdefs.h /* RCS ID Copyright macro defns */ -__KERNEL_RCSID(0, $NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.5 2009/09/07 22:27:30 matt Exp $); +__KERNEL_RCSID(0, $NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.6 2009/09/08 07:46:14 uebayasi Exp $); #include opt_cputype.h @@ -1138,7 +1138,7 @@ * vectors. They are fixed up by ld.elf_so. * - ps_strings is a NetBSD extension. */ - f-f_regs[_R_A0] = (uintptr_t)stack; + f-f_regs[_R_A0] = (intptr_t)stack; f-f_regs[_R_A1] = 0; f-f_regs[_R_A2] = 0; f-f_regs[_R_A3] = (intptr_t)l-l_proc-p_psstr; @@ -1827,15 +1827,15 @@ /* NOTREACHED */ } - f-f_regs[_R_PC] = (uintptr_t)upcall; - f-f_regs[_R_SP] = (uintptr_t)sf; + f-f_regs[_R_PC] = (intptr_t)upcall; + f-f_regs[_R_SP] = (intptr_t)sf; f-f_regs[_R_A0] = type; - f-f_regs[_R_A1] = (uintptr_t)sas; + f-f_regs[_R_A1] = (intptr_t)sas; f-f_regs[_R_A2] = nevents; f-f_regs[_R_A3] = ninterrupted; f-f_regs[_R_S8] = 0; f-f_regs[_R_RA] = 0; - f-f_regs[_R_T9] = (uintptr_t)upcall; /* t9=Upcall function*/ + f-f_regs[_R_T9] = (intptr_t)upcall; /* t9=Upcall function*/ } Index: src/sys/arch/mips/mips/vm_machdep.c diff -u src/sys/arch/mips/mips/vm_machdep.c:1.121.6.1.2.4 src/sys/arch/mips/mips/vm_machdep.c:1.121.6.1.2.5 --- src/sys/arch/mips/mips/vm_machdep.c:1.121.6.1.2.4 Mon Sep 7 21:54:39 2009 +++ src/sys/arch/mips/mips/vm_machdep.c Tue Sep 8 07:46:14 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: vm_machdep.c,v 1.121.6.1.2.4 2009/09/07 21:54:39 matt Exp $ */ +/* $NetBSD: vm_machdep.c,v 1.121.6.1.2.5 2009/09/08 07:46:14 uebayasi Exp $ */ /* * Copyright (c) 1992, 1993 @@ -80,7 +80,7 @@ #include opt_coredump.h #include sys/cdefs.h /* RCS ID Copyright macro defns */ -__KERNEL_RCSID(0, $NetBSD: vm_machdep.c,v 1.121.6.1.2.4 2009/09/07 21:54:39 matt Exp $); +__KERNEL_RCSID(0, $NetBSD: vm_machdep.c,v 1.121.6.1.2.5 2009/09/08 07:46:14 uebayasi Exp $); #include sys/param.h #include sys/systm.h @@ -159,7 +159,7 @@ * If specified, give the child a different stack. */ if (stack != NULL) - f-f_regs[_R_SP] = (uintptr_t)stack + stacksize; + f-f_regs[_R_SP] = (intptr_t)stack + stacksize; l2-l_md.md_regs = f; l2-l_md.md_flags = l1-l_md.md_flags MDP_FPUSED;
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/mips
Module Name:src Committed By: matt Date: Tue Sep 8 08:11:30 UTC 2009 Modified Files: src/sys/arch/mips/mips [matt-nb5-mips64]: bus_dma.c bus_space_alignstride_chipdep.c mem.c mips_machdep.c pmap.c Log Message: For LP64 kernels, only use KSEG0 for pmap_steal_memory. Everything else uses XKPHYS. Use the new MIPS_PHYS_TO_XKPHYS_{,UN}CACHED macros. To generate a diff of this commit: cvs rdiff -u -r1.22.16.4 -r1.22.16.5 src/sys/arch/mips/mips/bus_dma.c cvs rdiff -u -r1.10 -r1.10.18.1 \ src/sys/arch/mips/mips/bus_space_alignstride_chipdep.c cvs rdiff -u -r1.35.38.1 -r1.35.38.2 src/sys/arch/mips/mips/mem.c cvs rdiff -u -r1.205.4.1.2.1.2.6 -r1.205.4.1.2.1.2.7 \ src/sys/arch/mips/mips/mips_machdep.c cvs rdiff -u -r1.179.16.4 -r1.179.16.5 src/sys/arch/mips/mips/pmap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/mips/bus_dma.c diff -u src/sys/arch/mips/mips/bus_dma.c:1.22.16.4 src/sys/arch/mips/mips/bus_dma.c:1.22.16.5 --- src/sys/arch/mips/mips/bus_dma.c:1.22.16.4 Mon Sep 7 22:28:24 2009 +++ src/sys/arch/mips/mips/bus_dma.c Tue Sep 8 08:11:29 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: bus_dma.c,v 1.22.16.4 2009/09/07 22:28:24 matt Exp $ */ +/* $NetBSD: bus_dma.c,v 1.22.16.5 2009/09/08 08:11:29 matt Exp $ */ /*- * Copyright (c) 1997, 1998, 2001 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #include sys/cdefs.h /* RCS ID Copyright macro defns */ -__KERNEL_RCSID(0, $NetBSD: bus_dma.c,v 1.22.16.4 2009/09/07 22:28:24 matt Exp $); +__KERNEL_RCSID(0, $NetBSD: bus_dma.c,v 1.22.16.5 2009/09/08 08:11:29 matt Exp $); #include sys/param.h #include sys/systm.h @@ -660,20 +660,18 @@ */ if (nsegs == 1) { #ifdef _LP64 - if (segs[0].ds_addr + segs[0].ds_len MIPS_PHYS_MASK) { - unsigned long cca; - if (flags BUS_DMA_COHERENT) -cca = MIPS3_PG_TO_CCA(MIPS3_PG_UNCACHED); - else -cca = MIPS3_PG_TO_CCA(MIPS3_PG_CACHED); - *kvap = (void *)MIPS_PHYS_TO_XKPHYS(cca, + if (flags BUS_DMA_COHERENT) + *kvap = (void *)MIPS_PHYS_TO_XKPHYS_UNCACHED( segs[0].ds_addr); - } else -#endif + else + *kvap = (void *)MIPS_PHYS_TO_XKPHYS_CACHED( + segs[0].ds_addr); +#else if (flags BUS_DMA_COHERENT) *kvap = (void *)MIPS_PHYS_TO_KSEG1(segs[0].ds_addr); else *kvap = (void *)MIPS_PHYS_TO_KSEG0(segs[0].ds_addr); +#endif return (0); } Index: src/sys/arch/mips/mips/bus_space_alignstride_chipdep.c diff -u src/sys/arch/mips/mips/bus_space_alignstride_chipdep.c:1.10 src/sys/arch/mips/mips/bus_space_alignstride_chipdep.c:1.10.18.1 --- src/sys/arch/mips/mips/bus_space_alignstride_chipdep.c:1.10 Mon Apr 28 20:23:28 2008 +++ src/sys/arch/mips/mips/bus_space_alignstride_chipdep.c Tue Sep 8 08:11:29 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: bus_space_alignstride_chipdep.c,v 1.10 2008/04/28 20:23:28 martin Exp $ */ +/* $NetBSD: bus_space_alignstride_chipdep.c,v 1.10.18.1 2009/09/08 08:11:29 matt Exp $ */ /*- * Copyright (c) 1998, 2000, 2001 The NetBSD Foundation, Inc. @@ -81,7 +81,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: bus_space_alignstride_chipdep.c,v 1.10 2008/04/28 20:23:28 martin Exp $); +__KERNEL_RCSID(0, $NetBSD: bus_space_alignstride_chipdep.c,v 1.10.18.1 2009/09/08 08:11:29 matt Exp $); #ifdef CHIP_EXTENT #include sys/extent.h @@ -729,12 +729,21 @@ mapit: #endif /* CHIP_EXTENT */ +#ifdef _LP64 + if (flags BUS_SPACE_MAP_CACHEABLE) + *hp = MIPS_PHYS_TO_XKPHYS_CACHED(mbst.mbst_sys_start + + (addr - mbst.mbst_bus_start)); + else + *hp = MIPS_PHYS_TO_XKPHYS_UNCACHED(mbst.mbst_sys_start + + (addr - mbst.mbst_bus_start)); +#else if (flags BUS_SPACE_MAP_CACHEABLE) *hp = MIPS_PHYS_TO_KSEG0(mbst.mbst_sys_start + (addr - mbst.mbst_bus_start)); else *hp = MIPS_PHYS_TO_KSEG1(mbst.mbst_sys_start + (addr - mbst.mbst_bus_start)); +#endif return (0); } @@ -753,10 +762,15 @@ printf(xxx: freeing handle 0x%lx for 0x%lx\n, h, size); #endif - if (h = MIPS_KSEG0_START h MIPS_KSEG1_START) +#ifdef _LP64 + KASSERT(MIPS_XKPHYS_P(h)); + h = MIPS_XKPHYS_TO_PHYS(h); +#else + if (MIPS_KSEG0_P(h)) h = MIPS_KSEG0_TO_PHYS(h); else h = MIPS_KSEG1_TO_PHYS(h); +#endif #ifdef CHIP_W1_BUS_START if (h = CHIP_W1_SYS_START(v) h = CHIP_W1_SYS_END(v)) { @@ -867,12 +881,21 @@ } *addrp = addr; +#ifdef _LP64 + if (flags BUS_SPACE_MAP_CACHEABLE) + *bshp = MIPS_PHYS_TO_XKPHYS_CACHED(mbst.mbst_sys_start + + (addr - mbst.mbst_bus_start)); + else + *bshp = MIPS_PHYS_TO_XKPHYS_UNCACHED(mbst.mbst_sys_start + + (addr - mbst.mbst_bus_start)); +#else if (flags BUS_SPACE_MAP_CACHEABLE) *bshp = MIPS_PHYS_TO_KSEG0(mbst.mbst_sys_start + (addr - mbst.mbst_bus_start)); else *bshp = MIPS_PHYS_TO_KSEG1(mbst.mbst_sys_start + (addr - mbst.mbst_bus_start)); +#endif return (0); #else /* ! CHIP_EXTENT */ Index: src/sys/arch/mips/mips/mem.c diff -u
CVS commit: [matt-nb5-mips64] src/sys/arch/pmax
Module Name:src Committed By: matt Date: Tue Sep 8 17:24:09 UTC 2009 Modified Files: src/sys/arch/pmax/include [matt-nb5-mips64]: loadfile_machdep.h tc_machdep.h src/sys/arch/pmax/pmax [matt-nb5-mips64]: dec_3maxplus.c dec_3min.c dec_maxine.c machdep.c machdep.h memc.h memc_3max.c memc_3min.c src/sys/arch/pmax/tc [matt-nb5-mips64]: asc_ioasic.c Added Files: src/sys/arch/pmax/conf [matt-nb5-mips64]: GENERIC64 INSTALL64 RAMDISK64 std.pmax64 Log Message: Enable building LP64 kernels for 3min, maxine, and 3maxplus. Fix various LP64 bugs. XXX still invoked via O32 call args To generate a diff of this commit: cvs rdiff -u -r0 -r1.1.2.1 src/sys/arch/pmax/conf/GENERIC64 \ src/sys/arch/pmax/conf/INSTALL64 src/sys/arch/pmax/conf/RAMDISK64 \ src/sys/arch/pmax/conf/std.pmax64 cvs rdiff -u -r1.6 -r1.6.18.1 src/sys/arch/pmax/include/loadfile_machdep.h cvs rdiff -u -r1.17 -r1.17.154.1 src/sys/arch/pmax/include/tc_machdep.h cvs rdiff -u -r1.58 -r1.58.28.1 src/sys/arch/pmax/pmax/dec_3maxplus.c cvs rdiff -u -r1.60 -r1.60.22.1 src/sys/arch/pmax/pmax/dec_3min.c cvs rdiff -u -r1.52 -r1.52.28.1 src/sys/arch/pmax/pmax/dec_maxine.c cvs rdiff -u -r1.223.8.1.2.1 -r1.223.8.1.2.2 src/sys/arch/pmax/pmax/machdep.c cvs rdiff -u -r1.11 -r1.11.96.1 src/sys/arch/pmax/pmax/machdep.h cvs rdiff -u -r1.3 -r1.3.154.1 src/sys/arch/pmax/pmax/memc.h cvs rdiff -u -r1.13 -r1.13.130.1 src/sys/arch/pmax/pmax/memc_3max.c cvs rdiff -u -r1.10 -r1.10.96.1 src/sys/arch/pmax/pmax/memc_3min.c cvs rdiff -u -r1.20 -r1.20.18.1 src/sys/arch/pmax/tc/asc_ioasic.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/pmax/include/loadfile_machdep.h diff -u src/sys/arch/pmax/include/loadfile_machdep.h:1.6 src/sys/arch/pmax/include/loadfile_machdep.h:1.6.18.1 --- src/sys/arch/pmax/include/loadfile_machdep.h:1.6 Mon Apr 28 20:23:31 2008 +++ src/sys/arch/pmax/include/loadfile_machdep.h Tue Sep 8 17:24:09 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: loadfile_machdep.h,v 1.6 2008/04/28 20:23:31 martin Exp $ */ +/* $NetBSD: loadfile_machdep.h,v 1.6.18.1 2009/09/08 17:24:09 matt Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -35,6 +35,7 @@ #define BOOT_AOUT #define BOOT_ECOFF #define BOOT_ELF32 +#define BOOT_ELF64 #define LOAD_KERNEL (LOAD_ALL ~LOAD_TEXTA) #define COUNT_KERNEL (COUNT_ALL ~COUNT_TEXTA) Index: src/sys/arch/pmax/include/tc_machdep.h diff -u src/sys/arch/pmax/include/tc_machdep.h:1.17 src/sys/arch/pmax/include/tc_machdep.h:1.17.154.1 --- src/sys/arch/pmax/include/tc_machdep.h:1.17 Tue Feb 29 04:41:59 2000 +++ src/sys/arch/pmax/include/tc_machdep.h Tue Sep 8 17:24:09 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: tc_machdep.h,v 1.17 2000/02/29 04:41:59 nisimura Exp $ */ +/* $NetBSD: tc_machdep.h,v 1.17.154.1 2009/09/08 17:24:09 matt Exp $ */ /* * Copyright (c) 1994, 1995 Carnegie-Mellon University. @@ -62,14 +62,14 @@ #include mips/cpuregs.h /* defines MIPS_PHYS_TO_KSEG1 */ -typedef int32_t tc_addr_t; +typedef paddr_t tc_addr_t; typedef int32_t tc_offset_t; #define tc_mb() wbflush() #define tc_wmb() wbflush() #define tc_syncbus() wbflush() /* XXX how to do this on a DECstation ? */ -#define tc_badaddr(tcaddr) badaddr((void *)(tcaddr), sizeof (u_int32_t)) +#define tc_badaddr(tcaddr) badaddr((void *)(tcaddr), sizeof (uint32_t)) #define TC_DENSE_TO_SPARSE(addr) (addr) Index: src/sys/arch/pmax/pmax/dec_3maxplus.c diff -u src/sys/arch/pmax/pmax/dec_3maxplus.c:1.58 src/sys/arch/pmax/pmax/dec_3maxplus.c:1.58.28.1 --- src/sys/arch/pmax/pmax/dec_3maxplus.c:1.58 Thu Jan 3 23:02:24 2008 +++ src/sys/arch/pmax/pmax/dec_3maxplus.c Tue Sep 8 17:24:09 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: dec_3maxplus.c,v 1.58 2008/01/03 23:02:24 joerg Exp $ */ +/* $NetBSD: dec_3maxplus.c,v 1.58.28.1 2009/09/08 17:24:09 matt Exp $ */ /* * Copyright (c) 1998 Jonathan Stone. All rights reserved. @@ -106,7 +106,7 @@ #include sys/cdefs.h /* RCS ID Copyright macro defns */ -__KERNEL_RCSID(0, $NetBSD: dec_3maxplus.c,v 1.58 2008/01/03 23:02:24 joerg Exp $); +__KERNEL_RCSID(0, $NetBSD: dec_3maxplus.c,v 1.58.28.1 2009/09/08 17:24:09 matt Exp $); #include sys/param.h #include sys/systm.h @@ -147,7 +147,7 @@ /* * Local declarations */ -static u_int32_t kn03_tc3_imask; +static uint32_t kn03_tc3_imask; static unsigned latched_cycle_cnt; static const int dec_3maxplus_ipl2spl_table[] = { @@ -167,7 +167,7 @@ void dec_3maxplus_init() { - u_int32_t prodtype; + uint32_t prodtype; platform.iobus = tcbus; platform.bus_reset = dec_3maxplus_bus_reset; @@ -179,7 +179,7 @@ platform.tc_init = dec_3maxplus_tc_init; /* clear any memory errors */ - *(u_int32_t *)MIPS_PHYS_TO_KSEG1(KN03_SYS_ERRADR) = 0; + *(uint32_t *)MIPS_PHYS_TO_KSEG1(KN03_SYS_ERRADR) = 0; kn03_wbflush(); ioasic_base = MIPS_PHYS_TO_KSEG1(KN03_SYS_ASIC); @@ -189,24 +189,24 @@
CVS commit: [matt-nb5-mips64] src/sys/arch/pmax/conf
Module Name:src Committed By: matt Date: Wed Sep 9 04:52:47 UTC 2009 Modified Files: src/sys/arch/pmax/conf [matt-nb5-mips64]: Makefile.pmax.inc Log Message: Don't convert to ECOFF if LP64 To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.5.132.1 src/sys/arch/pmax/conf/Makefile.pmax.inc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/pmax/conf/Makefile.pmax.inc diff -u src/sys/arch/pmax/conf/Makefile.pmax.inc:1.5 src/sys/arch/pmax/conf/Makefile.pmax.inc:1.5.132.1 --- src/sys/arch/pmax/conf/Makefile.pmax.inc:1.5 Fri Apr 12 05:11:17 2002 +++ src/sys/arch/pmax/conf/Makefile.pmax.inc Wed Sep 9 04:52:47 2009 @@ -1,5 +1,7 @@ -# $NetBSD: Makefile.pmax.inc,v 1.5 2002/04/12 05:11:17 lukem Exp $ +# $NetBSD: Makefile.pmax.inc,v 1.5.132.1 2009/09/09 04:52:47 matt Exp $ +.if ${MACHINE_ARCH} == mipsel SYSTEM_LD_TAIL_EXTRA=; \ echo ${ELF2ECOFF} $@ $...@.ecoff; ${ELF2ECOFF} $@ $...@.ecoff; \ chmod 755 $...@.ecoff +.endif
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/include
Module Name:src Committed By: matt Date: Mon Sep 7 21:28:01 UTC 2009 Modified Files: src/sys/arch/mips/include [matt-nb5-mips64]: types.h Log Message: Add symbolic constants for what's stored in label_t. To generate a diff of this commit: cvs rdiff -u -r1.43.36.7 -r1.43.36.8 src/sys/arch/mips/include/types.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/include/types.h diff -u src/sys/arch/mips/include/types.h:1.43.36.7 src/sys/arch/mips/include/types.h:1.43.36.8 --- src/sys/arch/mips/include/types.h:1.43.36.7 Sun Sep 6 22:34:53 2009 +++ src/sys/arch/mips/include/types.h Mon Sep 7 21:28:01 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: types.h,v 1.43.36.7 2009/09/06 22:34:53 matt Exp $ */ +/* $NetBSD: types.h,v 1.43.36.8 2009/09/07 21:28:01 matt Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -110,6 +110,19 @@ typedef struct label_t { register_t val[14]; } label_t; +#define _L_S0 0 +#define _L_S1 1 +#define _L_S2 2 +#define _L_S3 3 +#define _L_S4 4 +#define _L_S5 5 +#define _L_S6 6 +#define _L_S7 7 +#define _L_GP 8 +#define _L_SP 9 +#define _L_S8 10 +#define _L_RA 11 +#define _L_SR 12 #endif typedef volatile int __cpu_simple_lock_t;
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/include
Module Name:src Committed By: matt Date: Mon Sep 7 21:28:34 UTC 2009 Modified Files: src/sys/arch/mips/include [matt-nb5-mips64]: pcb.h Log Message: pcb_context is a label_t so use label_t as its type. To generate a diff of this commit: cvs rdiff -u -r1.20.62.1 -r1.20.62.2 src/sys/arch/mips/include/pcb.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/include/pcb.h diff -u src/sys/arch/mips/include/pcb.h:1.20.62.1 src/sys/arch/mips/include/pcb.h:1.20.62.2 --- src/sys/arch/mips/include/pcb.h:1.20.62.1 Thu Aug 20 07:50:36 2009 +++ src/sys/arch/mips/include/pcb.h Mon Sep 7 21:28:33 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: pcb.h,v 1.20.62.1 2009/08/20 07:50:36 matt Exp $ */ +/* $NetBSD: pcb.h,v 1.20.62.2 2009/09/07 21:28:33 matt Exp $ */ /* * Copyright (c) 1992, 1993 @@ -79,6 +79,7 @@ #ifndef _MIPS_PCB_H_ #define _MIPS_PCB_H_ +#include mips/types.h #include mips/reg.h /* @@ -87,7 +88,7 @@ struct pcb { struct fpreg pcb_fpregs; /* saved floating point registers */ - mips_reg_t pcb_context[12]; /* kernel context for resume */ + label_t pcb_context; /* kernel context for resume */ void * pcb_onfault; /* for copyin/copyout faults */ uint32_t pcb_ppl; /* previous priority level */ };
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/include
Module Name:src Committed By: matt Date: Mon Sep 7 21:34:47 UTC 2009 Modified Files: src/sys/arch/mips/include [matt-nb5-mips64]: cpuregs.h Log Message: Use intptr_t in MIPS_KSEGx_P() Use uintptr_t in MIPS_XKPHYS* To generate a diff of this commit: cvs rdiff -u -r1.74.28.6 -r1.74.28.7 src/sys/arch/mips/include/cpuregs.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/include/cpuregs.h diff -u src/sys/arch/mips/include/cpuregs.h:1.74.28.6 src/sys/arch/mips/include/cpuregs.h:1.74.28.7 --- src/sys/arch/mips/include/cpuregs.h:1.74.28.6 Sun Sep 6 22:36:16 2009 +++ src/sys/arch/mips/include/cpuregs.h Mon Sep 7 21:34:47 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: cpuregs.h,v 1.74.28.6 2009/09/06 22:36:16 matt Exp $ */ +/* $NetBSD: cpuregs.h,v 1.74.28.7 2009/09/07 21:34:47 matt Exp $ */ /* * Copyright (c) 1992, 1993 @@ -103,8 +103,8 @@ #define MIPS_KSEG1_TO_PHYS(x) ((uintptr_t)(x) MIPS_PHYS_MASK) #define MIPS_PHYS_TO_KSEG1(x) ((uintptr_t)(x) | (intptr_t)MIPS_KSEG1_START) -#define MIPS_KSEG0_P(x) (((uintptr_t)(x) ~MIPS_PHYS_MASK) == MIPS_KSEG0_START) -#define MIPS_KSEG1_P(x) (((uintptr_t)(x) ~MIPS_PHYS_MASK) == MIPS_KSEG1_START) +#define MIPS_KSEG0_P(x) (((intptr_t)(x) ~MIPS_PHYS_MASK) == MIPS_KSEG0_START) +#define MIPS_KSEG1_P(x) (((intptr_t)(x) ~MIPS_PHYS_MASK) == MIPS_KSEG1_START) #define MIPS_KSEG2_P(x) ((uintptr_t)MIPS_KSEG2_START = (uintptr_t)(x)) /* Map virtual address to index in mips3 r4k virtually-indexed cache */ @@ -118,8 +118,8 @@ #define MIPS_XKPHYS_START (0x2ULL 62) #define MIPS_PHYS_TO_XKPHYS(cca,x) \ (MIPS_XKPHYS_START | ((uint64_t)(cca) 59) | (x)) -#define MIPS_XKPHYS_TO_PHYS(x) ((x) 0x0effLL) -#define MIPS_XKPHYS_TO_CCA(x) (((x) 59) 7) +#define MIPS_XKPHYS_TO_PHYS(x) ((uintptr_t)(x) 0x0effLL) +#define MIPS_XKPHYS_TO_CCA(x) (((uintptr_t)(x) 59) 7) #define MIPS_XKPHYS_P(x) (((uint64_t)(x) 62) == 2) #define CCA_UNCACHED 2
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/include
Module Name:src Committed By: matt Date: Mon Sep 7 21:36:43 UTC 2009 Modified Files: src/sys/arch/mips/include [matt-nb5-mips64]: psl.h Log Message: Add MIPS_SR_KX to PSL_USERSET if _LP64 To generate a diff of this commit: cvs rdiff -u -r1.17.96.1 -r1.17.96.2 src/sys/arch/mips/include/psl.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/include/psl.h diff -u src/sys/arch/mips/include/psl.h:1.17.96.1 src/sys/arch/mips/include/psl.h:1.17.96.2 --- src/sys/arch/mips/include/psl.h:1.17.96.1 Sun Aug 16 03:33:58 2009 +++ src/sys/arch/mips/include/psl.h Mon Sep 7 21:36:43 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: psl.h,v 1.17.96.1 2009/08/16 03:33:58 matt Exp $ */ +/* $NetBSD: psl.h,v 1.17.96.2 2009/09/07 21:36:43 matt Exp $ */ /* * Copyright (c) 1992, 1993 @@ -48,9 +48,13 @@ #define MIPS3_PSL_LOWIPL (MIPS3_INT_MASK | MIPS_SR_INT_IE) #if !defined(__mips_o32) -#define MIPS3_PSL_XFLAGS (MIPS3_SR_XX | MIPS3_SR_UX) +# ifdef _LP64 +# define MIPS3_PSL_XFLAGS (MIPS3_SR_XX | MIPS_SR_KX) +# else +# define MIPS3_PSL_XFLAGS (MIPS3_SR_XX) +# endif #else -#define MIPS3_PSL_XFLAGS (0) +# define MIPS3_PSL_XFLAGS (0) #endif #define MIPS3_PSL_USERSET \
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/include
Module Name:src Committed By: matt Date: Mon Sep 7 21:42:17 UTC 2009 Modified Files: src/sys/arch/mips/include [matt-nb5-mips64]: pmap.h Log Message: Cleanup for LP64. XXX pv_entry needs work. To generate a diff of this commit: cvs rdiff -u -r1.54 -r1.54.26.1 src/sys/arch/mips/include/pmap.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/include/pmap.h diff -u src/sys/arch/mips/include/pmap.h:1.54 src/sys/arch/mips/include/pmap.h:1.54.26.1 --- src/sys/arch/mips/include/pmap.h:1.54 Wed Dec 26 16:01:34 2007 +++ src/sys/arch/mips/include/pmap.h Mon Sep 7 21:42:17 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.h,v 1.54 2007/12/26 16:01:34 ad Exp $ */ +/* $NetBSD: pmap.h,v 1.54.26.1 2009/09/07 21:42:17 matt Exp $ */ /* * Copyright (c) 1992, 1993 @@ -102,7 +102,7 @@ #define mips_round_seg(x) (((vaddr_t)(x) + SEGOFSET) ~SEGOFSET) #define pmap_segmap(m, v) ((m)-pm_segtab-seg_tab[((v) SEGSHIFT)]) -#define PMAP_SEGTABSIZE 512 +#define PMAP_SEGTABSIZE (1 (31 - SEGSHIFT)) union pt_entry; @@ -114,12 +114,12 @@ * Machine dependent pmap structure. */ typedef struct pmap { - int pm_count; /* pmap reference count */ kmutex_t pm_lock; /* lock on pmap */ - struct pmap_statistics pm_stats; /* pmap statistics */ - unsigned pm_asid; /* TLB address space tag */ - unsigned pm_asidgen; /* its generation number */ struct segtab *pm_segtab; /* pointers to pages of PTEs */ + int pm_count; /* pmap reference count */ + unsigned int pm_asid; /* TLB address space tag */ + unsigned int pm_asidgen; /* its generation number */ + struct pmap_statistics pm_stats; /* pmap statistics */ } *pmap_t; /* @@ -130,7 +130,7 @@ typedef struct pv_entry { struct pv_entry *pv_next; /* next pv_entry */ struct pmap *pv_pmap; /* pmap where mapping lies */ - vaddr_t pv_va; /* virtual address for mapping */ + vaddr_t pv_va; /* virtual address for mapping */ int pv_flags; /* some flags for the mapping */ } *pv_entry_t; @@ -189,12 +189,18 @@ /* * Other hooks for the pool allocator. */ +#ifdef _LP64 +#define POOL_VTOPHYS(va) (MIPS_KSEG0_P(va) \ +? MIPS_KSEG0_TO_PHYS(va) \ +: MIPS_XKPHYS_TO_PHYS(va)) +#else #define POOL_VTOPHYS(va) MIPS_KSEG0_TO_PHYS((vaddr_t)(va)) +#endif /* * Select CCA to use for unmanaged pages. */ -#define PMAP_CCA_FOR_PA(pa) 2 /* uncached */ +#define PMAP_CCA_FOR_PA(pa) CCA_UNCACHED /* uncached */ #if defined(_MIPS_PADDR_T_64BIT) || defined(_LP64) #define PMAP_NOCACHE 0x4000ULL
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/include
Module Name:src Committed By: matt Date: Mon Sep 7 21:50:24 UTC 2009 Modified Files: src/sys/arch/mips/include [matt-nb5-mips64]: mips_param.h Log Message: Derive NBSEG and SEGSHIFT from NBPG and PGSHIFT. To generate a diff of this commit: cvs rdiff -u -r1.23.78.2 -r1.23.78.3 src/sys/arch/mips/include/mips_param.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/include/mips_param.h diff -u src/sys/arch/mips/include/mips_param.h:1.23.78.2 src/sys/arch/mips/include/mips_param.h:1.23.78.3 --- src/sys/arch/mips/include/mips_param.h:1.23.78.2 Sat Aug 22 06:45:30 2009 +++ src/sys/arch/mips/include/mips_param.h Mon Sep 7 21:50:24 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: mips_param.h,v 1.23.78.2 2009/08/22 06:45:30 matt Exp $ */ +/* $NetBSD: mips_param.h,v 1.23.78.3 2009/09/07 21:50:24 matt Exp $ */ #ifdef _KERNEL #include machine/cpu.h @@ -62,9 +62,9 @@ #define PGSHIFT 12 /* LOG2(NBPG) */ #define NPTEPG (NBPG/4) -#define NBSEG 0x40 /* bytes/segment */ +#define NBSEG (NBPG*NPTEPG) /* bytes/segment */ #define SEGOFSET (NBSEG-1) /* byte offset into segment */ -#define SEGSHIFT 22 /* LOG2(NBSEG) */ +#define SEGSHIFT (2*PGSHIFT-2) /* LOG2(NBSEG) */ /* * Minimum and maximum sizes of the kernel malloc arena in PAGE_SIZE-sized
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/include
Module Name:src Committed By: matt Date: Mon Sep 7 21:51:25 UTC 2009 Modified Files: src/sys/arch/mips/include [matt-nb5-mips64]: asm.h Log Message: Simplify PTR_ case (32 bit or 64 bit) To generate a diff of this commit: cvs rdiff -u -r1.40.38.8 -r1.40.38.9 src/sys/arch/mips/include/asm.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/include/asm.h diff -u src/sys/arch/mips/include/asm.h:1.40.38.8 src/sys/arch/mips/include/asm.h:1.40.38.9 --- src/sys/arch/mips/include/asm.h:1.40.38.8 Sat Sep 5 03:13:51 2009 +++ src/sys/arch/mips/include/asm.h Mon Sep 7 21:51:25 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: asm.h,v 1.40.38.8 2009/09/05 03:13:51 matt Exp $ */ +/* $NetBSD: asm.h,v 1.40.38.9 2009/09/07 21:51:25 matt Exp $ */ /* * Copyright (c) 1992, 1993 @@ -332,7 +332,7 @@ * assembler to prevent the assembler from generating 64-bit style * ABI calls. */ -#if defined(__mips_o32) +#if _MIPS_SZPTR == 32 #define PTR_ADD add #define PTR_ADDI addi #define PTR_ADDU addu @@ -354,33 +354,7 @@ #define PTR_SC sc #define PTR_WORD .word #define PTR_SCALESHIFT 2 -#endif /* __mips_o32 */ - -#if defined(__mips_n32) -#define PTR_ADD add -#define PTR_ADDI addi -#define PTR_ADDU add /* no u */ -#define PTR_ADDIU addi /* no u */ -#define PTR_SUB sub -#define PTR_SUBI subi -#define PTR_SUBU sub /* no u */ -#define PTR_SUBIU sub /* no u */ -#define PTR_L lw -#define PTR_LA la -#define PTR_S sw -#define PTR_SLL sll -#define PTR_SLLV sllv -#define PTR_SRL srl -#define PTR_SRLV srlv -#define PTR_SRA sra -#define PTR_SRAV srav -#define PTR_LL ll -#define PTR_SC sc -#define PTR_WORD .word -#define PTR_SCALESHIFT 2 -#endif /* __mips_n32 */ - -#if defined(__mips_n64) || defined(__mips_o64) +#else /* _MIPS_SZPTR == 64 */ #define PTR_ADD dadd #define PTR_ADDI daddi #define PTR_ADDU daddu @@ -402,7 +376,7 @@ #define PTR_SC scd #define PTR_WORD .dword #define PTR_SCALESHIFT 3 -#endif /* __mips_n64 || __mips_o64 */ +#endif /* _MIPS_SZPTR == 64 */ #if _MIPS_SZINT == 32 #define INT_ADD add
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/mips
Module Name:src Committed By: matt Date: Mon Sep 7 22:05:45 UTC 2009 Modified Files: src/sys/arch/mips/mips [matt-nb5-mips64]: locore.S Log Message: On N32/N64 save/restore gp since it's a callee-saved register. Don't use proc0paddr, use lwp0-l_addr To generate a diff of this commit: cvs rdiff -u -r1.167.38.1 -r1.167.38.2 src/sys/arch/mips/mips/locore.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/mips/locore.S diff -u src/sys/arch/mips/mips/locore.S:1.167.38.1 src/sys/arch/mips/mips/locore.S:1.167.38.2 --- src/sys/arch/mips/mips/locore.S:1.167.38.1 Thu Aug 20 23:27:06 2009 +++ src/sys/arch/mips/mips/locore.S Mon Sep 7 22:05:45 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.167.38.1 2009/08/20 23:27:06 matt Exp $ */ +/* $NetBSD: locore.S,v 1.167.38.2 2009/09/07 22:05:45 matt Exp $ */ /* * Copyright (c) 1992, 1993 @@ -101,7 +101,7 @@ #ifdef NOFPU /* No FPU; avoid touching FPU registers */ #ifdef _LP64 - li t0, MIPS_SR_KX + li t0, MIPS_SR_KX # turn on XKSEG and XKPHYS #else li t0, 0# Disable interrupts and #endif @@ -145,7 +145,7 @@ jal _C_LABEL(mach_init) # mach_init(a0, a1, a2, a3) nop - PTR_L sp, _C_LABEL(proc0paddr) # switch to proc0 stack + PTR_L sp, L_ADDR(MIPS_CURLWP) # switch to lwp0 stack nop PTR_ADDU sp, USPACE - FRAME_SIZ - CALLFRAME_SIZ jal _C_LABEL(main) # main(void) @@ -185,6 +185,9 @@ REG_S s8, U_PCB_CONTEXT+SF_REG_S8(a2) REG_S ra, U_PCB_CONTEXT+SF_REG_RA(a2) REG_S t0, U_PCB_CONTEXT+SF_REG_SR(a2) +#if defined(__mips_n32) || defined(__mips_n64) + REG_S gp, U_PCB_CONTEXT+SF_REG_GP(a2) +#endif #ifdef IPL_ICU_MASK INT_L t0, _C_LABEL(md_imask) INT_S t0, U_PCB_PPL(a2) @@ -244,6 +247,9 @@ REG_L s5, U_PCB_CONTEXT+SF_REG_S5(a0) REG_L s6, U_PCB_CONTEXT+SF_REG_S6(a0) REG_L s7, U_PCB_CONTEXT+SF_REG_S7(a0) +#if defined(__mips_n32) || defined(__mips_n64) + REG_L gp, U_PCB_CONTEXT+SF_REG_GP(a0) +#endif REG_L sp, U_PCB_CONTEXT+SF_REG_SP(a0) REG_L s8, U_PCB_CONTEXT+SF_REG_S8(a0) REG_EPILOGUE @@ -267,6 +273,9 @@ REG_S s5, U_PCB_CONTEXT+SF_REG_S5(a0) REG_S s6, U_PCB_CONTEXT+SF_REG_S6(a0) REG_S s7, U_PCB_CONTEXT+SF_REG_S7(a0) +#if defined(__mips_n32) || defined(__mips_n64) + REG_S gp, U_PCB_CONTEXT+SF_REG_GP(a0) +#endif REG_S sp, U_PCB_CONTEXT+SF_REG_SP(a0) REG_S s8, U_PCB_CONTEXT+SF_REG_S8(a0) REG_S ra, U_PCB_CONTEXT+SF_REG_RA(a0) @@ -292,6 +301,9 @@ REG_S s5, SF_REG_S5(a0) REG_S s6, SF_REG_S6(a0) REG_S s7, SF_REG_S7(a0) +#if defined(__mips_n32) || defined(__mips_n64) + REG_S gp, SF_REG_GP(a0) +#endif REG_S sp, SF_REG_SP(a0) REG_S s8, SF_REG_S8(a0) REG_S ra, SF_REG_RA(a0) @@ -314,6 +326,9 @@ REG_L s5, SF_REG_S5(a0) REG_L s6, SF_REG_S6(a0) REG_L s7, SF_REG_S7(a0) +#if defined(__mips_n32) || defined(__mips_n64) + REG_L gp, SF_REG_GP(a0) +#endif REG_L sp, SF_REG_SP(a0) REG_L s8, SF_REG_S8(a0) REG_EPILOGUE @@ -444,9 +459,8 @@ LEAF(_splnone) mtc0 zero, MIPS_COP_0_CAUSE # clear SOFT_INT bits COP0_SYNC -#if 0 - mfc0 v0, MIPS_COP_0_STATUS # enable all sources - ori v0, (MIPS_INT_MASK | MIPS_SR_INT_IE) +#ifdef _LP64 + li v0, (MIPS_INT_MASK | MIPS_SR_INT_IE | MIPS_SR_KX) #else li v0, (MIPS_INT_MASK | MIPS_SR_INT_IE) #endif
CVS commit: [matt-nb5-mips64] src/sys/arch/mips/mips
Module Name:src Committed By: matt Date: Mon Sep 7 22:06:32 UTC 2009 Modified Files: src/sys/arch/mips/mips [matt-nb5-mips64]: trap.c Log Message: Cleanup fatal trap printfs To generate a diff of this commit: cvs rdiff -u -r1.217.12.8 -r1.217.12.9 src/sys/arch/mips/mips/trap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/mips/trap.c diff -u src/sys/arch/mips/mips/trap.c:1.217.12.8 src/sys/arch/mips/mips/trap.c:1.217.12.9 --- src/sys/arch/mips/mips/trap.c:1.217.12.8 Thu Sep 3 00:10:18 2009 +++ src/sys/arch/mips/mips/trap.c Mon Sep 7 22:06:32 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: trap.c,v 1.217.12.8 2009/09/03 00:10:18 matt Exp $ */ +/* $NetBSD: trap.c,v 1.217.12.9 2009/09/07 22:06:32 matt Exp $ */ /* * Copyright (c) 1992, 1993 @@ -78,7 +78,7 @@ #include sys/cdefs.h /* RCS ID Copyright macro defns */ -__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.217.12.8 2009/09/03 00:10:18 matt Exp $); +__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.217.12.9 2009/09/07 22:06:32 matt Exp $); #include opt_cputype.h /* which mips CPU levels do we support? */ #include opt_ddb.h @@ -227,16 +227,22 @@ default: dopanic: (void)splhigh(); + printf(pid %d(%s): , p-p_pid, p-p_comm); printf(trap: %s in %s mode\n, trap_type[TRAPTYPE(cause)], USERMODE(status) ? user : kernel); printf(status=0x%x, cause=0x%x, epc=%# PRIxVADDR - , vaddr=%# PRIxVADDR \n, status, cause, opc, vaddr); - fp = l-l_md.md_regs; - printf(pid=%d cmd=%s usp=%# PRIxREGISTER - ksp=%p ra=%# PRIxREGISTER \n, - p-p_pid, p-p_comm, fp-f_regs[_R_SP], - status, fp-f_regs[_R_RA]); + , vaddr=%# PRIxVADDR, status, cause, opc, vaddr); + if (USERMODE(status)) { + fp = l-l_md.md_regs; + printf( frame=%p usp=%# PRIxREGISTER + ra=%# PRIxREGISTER \n, + fp, fp-f_regs[_R_SP], fp-f_regs[_R_RA]); + } else { + printf( tf=%p ksp=%p ra=%# PRIxREGISTER \n, + frame, frame+1, frame-tf_regs[TF_RA]); + } + #if defined(DDB) kdb_trap(type, frame-tf_regs); /* XXX force halt XXX */