diff options
author | Steve Murphree <smurph@cvs.openbsd.org> | 2001-01-14 20:25:26 +0000 |
---|---|---|
committer | Steve Murphree <smurph@cvs.openbsd.org> | 2001-01-14 20:25:26 +0000 |
commit | d468113ddc0c5ba8e16ecb9db979c3b98e031714 (patch) | |
tree | 7cdff44637fd7b9f5d0f433cdfd94a1a0e4fc6ea /sys/arch | |
parent | 9e571f43f415bf69545d34b77b15070b97bd0397 (diff) |
Complete move to UVM virtual memory system. More header fixes.
Diffstat (limited to 'sys/arch')
44 files changed, 577 insertions, 201 deletions
diff --git a/sys/arch/mvme88k/conf/GENERIC b/sys/arch/mvme88k/conf/GENERIC index 1944db44d80..9bf6bb19b25 100644 --- a/sys/arch/mvme88k/conf/GENERIC +++ b/sys/arch/mvme88k/conf/GENERIC @@ -1,13 +1,17 @@ -# $OpenBSD: GENERIC,v 1.11 2000/01/09 22:00:21 itojun Exp $ +# $OpenBSD: GENERIC,v 1.12 2001/01/14 20:25:22 smurph Exp $ machine mvme88k include "../../../conf/GENERIC" -options "M88000" # support for 88K -options MVME187 # support for 187 -options MVME188 # support for 188 -options MVME197 # support for 197 +option "M88000" # support for 88K +option MVME187 # support for 187 +option MVME188 # support for 188 +option MVME197 # support for 197 +option UVM # use the UVM virtual memory system +option FFS_SOFTUPDATES # Soft Updates +option "NCPUS=1" # number of CPUs supported (max 4) +option BUGMAP # use the Bug ROM VME mappings maxusers 64 @@ -78,6 +82,7 @@ st* at scsibus? target ? lun ? cd* at scsibus? target ? lun ? # ------------------------------ pseudo devices ------------------------ +#pseudo-device raid 4 pseudo-device rd 2 # for IPv6 pseudo-device gif 4 diff --git a/sys/arch/mvme88k/conf/M187 b/sys/arch/mvme88k/conf/M187 index 293875c4905..21a60b19ad4 100644 --- a/sys/arch/mvme88k/conf/M187 +++ b/sys/arch/mvme88k/conf/M187 @@ -1,4 +1,4 @@ -# $OpenBSD: M187,v 1.5 2001/01/13 05:18:57 smurph Exp $ +# $OpenBSD: M187,v 1.6 2001/01/14 20:25:22 smurph Exp $ machine mvme88k @@ -11,6 +11,7 @@ option TIMEZONE=300, DST=1 option "M88000" # support for 88K option MVME187 # support for 187 option "NCPUS=1" # Number of cpus supported (max 4) +option UVM # use the UVM virtual memory system option BUGMAP # use Bug Rom VME Mappings diff --git a/sys/arch/mvme88k/conf/M188 b/sys/arch/mvme88k/conf/M188 index 82be976d255..629e60f8e53 100644 --- a/sys/arch/mvme88k/conf/M188 +++ b/sys/arch/mvme88k/conf/M188 @@ -1,4 +1,4 @@ -# $OpenBSD: M188,v 1.1 1999/09/27 21:21:15 smurph Exp $ +# $OpenBSD: M188,v 1.2 2001/01/14 20:25:22 smurph Exp $ machine mvme88k @@ -58,13 +58,13 @@ option GATEWAY # IP packet forwarding # Support for various kernel options -#option DIAGNOSTIC # Add additional error checking code +option DIAGNOSTIC # Add additional error checking code #option "NKMEMCLUSTERS=512" # Size of kernel malloc area # Misc. debuging options option PANICWAIT # Require keystroke to dump/reboot -#option DEBUG # Add debugging statements +option DEBUG # Add debugging statements option DDB # Kernel debugger #option SYSCALL_DEBUG # debug all syscalls. option KTRACE # debug all syscalls. diff --git a/sys/arch/mvme88k/conf/RAMDISK b/sys/arch/mvme88k/conf/RAMDISK index 022004849cc..d8134f8ca67 100644 --- a/sys/arch/mvme88k/conf/RAMDISK +++ b/sys/arch/mvme88k/conf/RAMDISK @@ -1,13 +1,17 @@ -# $OpenBSD: RAMDISK,v 1.3 1999/09/27 21:21:15 smurph Exp $ +# $OpenBSD: RAMDISK,v 1.4 2001/01/14 20:25:22 smurph Exp $ machine mvme88k include "../../../conf/GENERIC" -options "M88000" # support for 88K -options MVME187 # support for 187 -options MVME188 # support for 188 -options MVME197 # support for 197 +option "M88000" # support for 88K +option MVME187 # support for 187 +option MVME188 # support for 188 +option MVME197 # support for 197 + +option UVM # use the UVM virtual memory system +option "NCPUS=1" # number of CPUs supported (max 4) +option BUGMAP # use the Bug ROM VME mappings maxusers 8 diff --git a/sys/arch/mvme88k/dev/vme.c b/sys/arch/mvme88k/dev/vme.c index c9700227779..cb5c4726620 100644 --- a/sys/arch/mvme88k/dev/vme.c +++ b/sys/arch/mvme88k/dev/vme.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vme.c,v 1.5 2000/03/26 23:32:00 deraadt Exp $ */ +/* $OpenBSD: vme.c,v 1.6 2001/01/14 20:25:22 smurph Exp $ */ /* * Copyright (c) 1999 Steve Murphree, Jr. * Copyright (c) 1995 Theo de Raadt @@ -452,7 +452,7 @@ vmesyscon_init(sc) ctl = vme2->vme2_masterctl; printf("%s: using BUG parameters\n", sc->sc_dev.dv_xname); - printf("%s: 1phys 0x%08x-0x%08x to VME 0x%08x-0x%08x master\n", + printf("%s: 1phys 0x%08x-0x%08x to VME 0x%08x-0x%08x master\n", sc->sc_dev.dv_xname, vme2->vme2_master1 << 16, vme2->vme2_master1 & 0xffff0000, vme2->vme2_master1 << 16, vme2->vme2_master1 & 0xffff0000); @@ -473,7 +473,7 @@ vmesyscon_init(sc) } #endif /* NSYSCON */ -#if defined(MVME162) || defined(MVME167) || defined(MVME177) || defined (MVME187) || defined (MVME197) +#if defined(MVME162) || defined(MVME167) || defined(MVME177) || defined(MVME188) || defined (MVME187) || defined (MVME197) /* * A32 accesses on the MVME1[6789]x require setting up mappings in diff --git a/sys/arch/mvme88k/dev/vx.c b/sys/arch/mvme88k/dev/vx.c index ad6bd2c2636..030265f1aba 100644 --- a/sys/arch/mvme88k/dev/vx.c +++ b/sys/arch/mvme88k/dev/vx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vx.c,v 1.2 2000/03/26 23:32:00 deraadt Exp $ */ +/* $OpenBSD: vx.c,v 1.3 2001/01/14 20:25:22 smurph Exp $ */ /* * Copyright (c) 1999 Steve Murphree, Jr. * All rights reserved. @@ -84,7 +84,9 @@ struct vxsoftc { void *sc_bppwait_pktp; struct intrhand sc_ih_c; struct intrhand sc_ih_s; +#if defined(MVME187) || defined(MVME197) struct vme2reg *sc_vme2; +#endif int sc_ipl; int sc_vec; int sc_flags; @@ -214,7 +216,9 @@ void *aux; /* set up dual port memory and registers and init*/ sc->vx_reg = (struct vxreg *)ca->ca_vaddr; sc->channel = (struct channel *)(ca->ca_vaddr + 0x0100); +#if defined(MVME187) || defined(MVME197) sc->sc_vme2 = ca->ca_master; +#endif sc->sc_ipl = ca->ca_ipl; sc->sc_vec = ca->ca_vec; sc->board_addr = (unsigned int)ca->ca_vaddr; @@ -1089,11 +1093,13 @@ struct vxsoftc *sc; int valid, i; short cmd; u_char port; +#if defined(MVME187) || defined(MVME197) struct vme2reg *vme2 = (struct vme2reg *)sc->sc_vme2; if (vme2->vme2_vbr & VME2_SYSFAIL){ /* do something... print_dump(sc); */ } +#endif /* defined(MVME187) || defined(MVME197) */ if (!cold) sc->sc_intrcnt.ev_count++; while (env_isvalid(get_status_head(sc))) { @@ -1564,7 +1570,6 @@ bpp_send(struct vxsoftc *sc, void *pkt, int wait_flag) struct envelope *envp; struct init_packet init, *initp; struct packet *wpktp, *pktp, *testpktp; - struct vme2reg *vme2 = (struct vme2reg *)sc->sc_vme2; unsigned long newenv; int i, s; diff --git a/sys/arch/mvme88k/dev/vxreg.h b/sys/arch/mvme88k/dev/vxreg.h index f328b9dcdd9..81f57542fc2 100644 --- a/sys/arch/mvme88k/dev/vxreg.h +++ b/sys/arch/mvme88k/dev/vxreg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vxreg.h,v 1.1 1999/05/29 04:41:45 smurph Exp $ */ +/* $OpenBSD: vxreg.h,v 1.2 2001/01/14 20:25:23 smurph Exp $ */ /* * Copyright (c) 1999 Steve Murphree, Jr. All rights reserved. @@ -214,7 +214,7 @@ struct termio { volatile unsigned char c_cc[VNCC]; }; -struct sgttyb { /* 6 bytes */ +struct vx_sgttyb { /* 6 bytes */ volatile char sg_ispeed; volatile char sg_ospeed; volatile char sg_erase; @@ -276,7 +276,7 @@ struct packet { /* 68 bytes */ union { struct termio tio; struct termcb tcb; - struct sgttyb sgt; + struct vx_sgttyb sgt; struct dl_info dl; long param; } parameter_block; diff --git a/sys/arch/mvme88k/include/ansi.h b/sys/arch/mvme88k/include/ansi.h index c2e2c3ac2db..13cb418602a 100644 --- a/sys/arch/mvme88k/include/ansi.h +++ b/sys/arch/mvme88k/include/ansi.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ansi.h,v 1.9 2000/03/03 00:54:53 todd Exp $ */ +/* $OpenBSD: ansi.h,v 1.10 2001/01/14 20:25:23 smurph Exp $ */ /*- * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. @@ -34,8 +34,8 @@ * from: @(#)ansi.h 8.2 (Berkeley) 1/4/94 */ -#ifndef _ANSI_H_ -#define _ANSI_H_ +#ifndef __MACHINE_ANSI_H__ +#define __MACHINE_ANSI_H__ /* * Types which are fundamental to the implementation and may appear in @@ -85,4 +85,4 @@ */ #define _BSD_OFF_T_ long long /* file offset */ -#endif /* _ANSI_H_ */ +#endif __MACHINE_ANSI_H__ diff --git a/sys/arch/mvme88k/include/asm.h b/sys/arch/mvme88k/include/asm.h index 60e4b5ae9bb..a72fcdaf82f 100644 --- a/sys/arch/mvme88k/include/asm.h +++ b/sys/arch/mvme88k/include/asm.h @@ -25,8 +25,8 @@ * rights to redistribute these changes. */ -#ifndef __M88K_ASM_H__ -#define __M88K_ASM_H__ +#ifndef __MACHINE_M88K_ASM_H__ +#define __MACHINE_M88K_ASM_H__ #ifdef __STDC__ # define FUNC(NAME) _##NAME @@ -324,4 +324,4 @@ #define VME_CMMU_D3 0xFFF7F000 /* MVME188 data CMMU 3 */ #endif /* CMMU_DEFS */ -#endif /* __M88K_ASM_H__ */ +#endif __MACHINE_M88K_ASM_H__ diff --git a/sys/arch/mvme88k/include/asm_macro.h b/sys/arch/mvme88k/include/asm_macro.h index 385ce20475d..522db6e0e85 100644 --- a/sys/arch/mvme88k/include/asm_macro.h +++ b/sys/arch/mvme88k/include/asm_macro.h @@ -1,4 +1,4 @@ -/* $OpenBSD: asm_macro.h,v 1.6 1999/09/27 20:46:16 smurph Exp $ */ +/* $OpenBSD: asm_macro.h,v 1.7 2001/01/14 20:25:23 smurph Exp $ */ /* * Mach Operating System * Copyright (c) 1993-1991 Carnegie Mellon University @@ -26,8 +26,8 @@ * rights to redistribute these changes. */ -#ifndef __M88K_ASM_MACRO_H__ -#define __M88K_ASM_MACRO_H__ +#ifndef __MACHINE_M88K_ASM_MACRO_H__ +#define __MACHINE_M88K_ASM_MACRO_H__ /* ** Various compiler macros used for speed and efficiency. @@ -101,4 +101,4 @@ static inline void flush_pipeline() } #define db_flush_pipeline flush_pipeline -#endif /* __M88K_ASM_MACRO_H__ */ +#endif __MACHINE_M88K_ASM_MACRO_H__ diff --git a/sys/arch/mvme88k/include/assert.h b/sys/arch/mvme88k/include/assert.h index fcdbab19465..7d7568de671 100644 --- a/sys/arch/mvme88k/include/assert.h +++ b/sys/arch/mvme88k/include/assert.h @@ -1,4 +1,6 @@ -/* $OpenBSD: assert.h,v 1.4 1999/02/09 06:36:25 smurph Exp $ */ +/* $OpenBSD: assert.h,v 1.5 2001/01/14 20:25:23 smurph Exp $ */ +#ifndef __MACHINE_ASSERT_H__ +#define __MACHINE_ASSERT_H__ #define assert(x) \ ({\ if (!(x)) {\ @@ -7,3 +9,4 @@ panic("assertion"); \ } \ }) +#endif __MACHINE_ASSERT_H__ diff --git a/sys/arch/mvme88k/include/board.h b/sys/arch/mvme88k/include/board.h index 8ac89b00195..7890c04b7f5 100644 --- a/sys/arch/mvme88k/include/board.h +++ b/sys/arch/mvme88k/include/board.h @@ -1,4 +1,4 @@ -/* $OpenBSD: board.h,v 1.6 1999/09/27 20:46:17 smurph Exp $ */ +/* $OpenBSD: board.h,v 1.7 2001/01/14 20:25:23 smurph Exp $ */ /* * Copyright (c) 1996 Nivas Madhur * All rights reserved. @@ -42,8 +42,8 @@ * thereof, and that both notices appear in supporting documentation. * */ -#ifndef _MACHINE_BOARD_H -#define _MACHINE_BOARD_H +#ifndef __MACHINE_BOARD_H__ +#define __MACHINE_BOARD_H__ /* * VME187 CPU board constants - derived from Luna88k */ @@ -118,6 +118,6 @@ #include <machine/mvme188.h> #endif -#endif /* _MACHINE_BOARD_H */ +#endif __MACHINE_BOARD_H__ diff --git a/sys/arch/mvme88k/include/bug.h b/sys/arch/mvme88k/include/bug.h index fe7e392948a..c13c6527f62 100644 --- a/sys/arch/mvme88k/include/bug.h +++ b/sys/arch/mvme88k/include/bug.h @@ -1,4 +1,6 @@ -/* $OpenBSD: bug.h,v 1.4 1999/02/09 06:36:25 smurph Exp $ */ +/* $OpenBSD: bug.h,v 1.5 2001/01/14 20:25:23 smurph Exp $ */ +#ifndef __MACHINE_BUG_H__ +#define __MACHINE_BUG_H__ #include <machine/bugio.h> struct bugenv { @@ -11,3 +13,4 @@ struct bugenv { char *argstart; char *argend; }; +#endif __MACHINE_BUG_H__ diff --git a/sys/arch/mvme88k/include/bugio.h b/sys/arch/mvme88k/include/bugio.h index da2d1a7dbef..8c196174930 100644 --- a/sys/arch/mvme88k/include/bugio.h +++ b/sys/arch/mvme88k/include/bugio.h @@ -1,4 +1,6 @@ -/* $OpenBSD: bugio.h,v 1.6 1999/04/11 03:26:28 smurph Exp $ */ +/* $OpenBSD: bugio.h,v 1.7 2001/01/14 20:25:23 smurph Exp $ */ +#ifndef __MACHINE_BUGIO_H__ +#define __MACHINE_BUGIO_H__ #include "sys/cdefs.h" struct bugdisk_io { @@ -94,3 +96,5 @@ int bugrtcrd __P((struct bugrtc *)); int bugreturn __P((void)); int bugbrdid __P((struct bugbrdid *)); int bugnetctrl __P((struct bugniocall *)); +#endif __MACHINE_BUGIO_H__ + diff --git a/sys/arch/mvme88k/include/cdefs.h b/sys/arch/mvme88k/include/cdefs.h index 6b6bc88ea82..ffd48ba3a8d 100644 --- a/sys/arch/mvme88k/include/cdefs.h +++ b/sys/arch/mvme88k/include/cdefs.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cdefs.h,v 1.5 1999/02/09 06:36:26 smurph Exp $ */ +/* $OpenBSD: cdefs.h,v 1.6 2001/01/14 20:25:23 smurph Exp $ */ /* $NetBSD: cdefs.h,v 1.2 1995/03/23 20:10:48 jtc Exp $ */ /* @@ -6,8 +6,8 @@ * Public domain. */ -#ifndef _MACHINE_CDEFS_H_ -#define _MACHINE_CDEFS_H_ +#ifndef __MACHINE_CDEFS_H__ +#define __MACHINE_CDEFS_H__ #ifdef __STDC__ #define _C_LABEL(x) _STRING(_ ## x) @@ -33,4 +33,4 @@ #endif #endif -#endif /* !_MACHINE_CDEFS_H_ */ +#endif __MACHINE_CDEFS_H__ diff --git a/sys/arch/mvme88k/include/cpu.h b/sys/arch/mvme88k/include/cpu.h index d2146c1156b..40105299fe1 100644 --- a/sys/arch/mvme88k/include/cpu.h +++ b/sys/arch/mvme88k/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.6 1999/09/27 20:46:17 smurph Exp $ */ +/* $OpenBSD: cpu.h,v 1.7 2001/01/14 20:25:23 smurph Exp $ */ /* * Copyright (c) 1996 Nivas Madhur * Copyright (c) 1992, 1993 @@ -42,8 +42,8 @@ * SUCH DAMAGE. */ -#ifndef _CPU_H_ -#define _CPU_H_ +#ifndef __MACHINE_CPU_H__ +#define __MACHINE_CPU_H__ /* * CTL_MACHDEP definitinos. @@ -194,4 +194,4 @@ struct funcp { extern struct funcp mdfp; #endif /* _KERNEL */ -#endif /* _CPU_H_ */ +#endif __MACHINE_CPU_H__ diff --git a/sys/arch/mvme88k/include/cpu_number.h b/sys/arch/mvme88k/include/cpu_number.h index e26ddfe6eb4..b72b79ca210 100644 --- a/sys/arch/mvme88k/include/cpu_number.h +++ b/sys/arch/mvme88k/include/cpu_number.h @@ -28,21 +28,20 @@ #define _M88K_CPU_NUMBER_ #ifdef KERNEL +#ifndef ASSEMBLER #include <machine/param.h> extern unsigned number_cpus; -#define cpu_number() 0 -#if 0 /* This seems to not work correctly. Hmm.... smurph */ -unsigned cpu_number(void); -static inline unsigned cpu_number(void) +static __inline__ unsigned cpu_number(void); + +static __inline__ unsigned cpu_number(void) { - unsigned cpu; - extern int cputyp; + register unsigned cpu; + extern int cputyp; if (cputyp != CPU_188 || number_cpus == 1) return 0; - asm("ldcr %0, cr18" : "=r" (cpu)); - asm("clr %0, %0, 0<4>" : "=r" (cpu)); + asm("ldcr %0, cr18" : "=r" (cpu)); return (cpu & 3); } -#endif /* 0 */ +#endif /* ASSEMBLER */ #endif /* KERNEL */ #endif /* _M88K_CPU_NUMBER_ */ diff --git a/sys/arch/mvme88k/include/cpus.h b/sys/arch/mvme88k/include/cpus.h index d41e7211469..658308f33b8 100644 --- a/sys/arch/mvme88k/include/cpus.h +++ b/sys/arch/mvme88k/include/cpus.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpus.h,v 1.5 1999/09/27 20:46:17 smurph Exp $ */ +/* $OpenBSD: cpus.h,v 1.6 2001/01/14 20:25:23 smurph Exp $ */ /* * Mach Operating System * Copyright (c) 1993-1992 Carnegie Mellon University @@ -32,8 +32,8 @@ Versions Idents for 88k family chips */ -#ifndef _M88K_CPUS_ -#define _M88K_CPUS_ +#ifndef __MACHINE_CPUS_H__ +#define __MACHINE_CPUS_H__ /* * cpu Processor Identification Register (PID). @@ -62,4 +62,4 @@ union cpupid { #define M88200 5 #define M88204 6 -#endif _M88K_CPUS_ +#endif __MACHINE_CPUS_H__ diff --git a/sys/arch/mvme88k/include/disklabel.h b/sys/arch/mvme88k/include/disklabel.h index 2d9dba98585..2f1427a8eba 100644 --- a/sys/arch/mvme88k/include/disklabel.h +++ b/sys/arch/mvme88k/include/disklabel.h @@ -1,4 +1,4 @@ -/* $OpenBSD: disklabel.h,v 1.5 2000/04/07 13:39:02 deraadt Exp $ */ +/* $OpenBSD: disklabel.h,v 1.6 2001/01/14 20:25:23 smurph Exp $ */ /* * Copyright (c) 1996 Nivas Madhur * Copyright (c) 1995 Dale Rahn. @@ -30,8 +30,8 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef _MACHINE_DISKLABEL_H_ -#define _MACHINE_DISKLABEL_H_ +#ifndef __MACHINE_DISKLABEL_H__ +#define __MACHINE_DISKLABEL_H__ /* number of boot pieces , ie xxboot bootxx */ #define NUMBOOT 2 @@ -132,4 +132,4 @@ struct cpu_disklabel { u_long magic2; u_char cfg_4[192]; }; -#endif _MACHINE_DISKLABEL_H_ +#endif __MACHINE_DISKLABEL_H__ diff --git a/sys/arch/mvme88k/include/endian.h b/sys/arch/mvme88k/include/endian.h index b778f03ca3e..b565cad78d9 100644 --- a/sys/arch/mvme88k/include/endian.h +++ b/sys/arch/mvme88k/include/endian.h @@ -1,4 +1,4 @@ -/* $OpenBSD: endian.h,v 1.9 1999/05/10 16:02:13 espie Exp $ */ +/* $OpenBSD: endian.h,v 1.10 2001/01/14 20:25:23 smurph Exp $ */ /*- * Copyright (c) 1997 Niklas Hallqvist. All rights reserved. @@ -29,10 +29,11 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef _MVME88K_ENDIAN_H_ -#define _MVME88K_ENDIAN_H_ +#ifndef __MVME88K_ENDIAN_H__ +#define __MVME88K_ENDIAN_H__ #define BYTE_ORDER BIG_ENDIAN #include <sys/endian.h> -#endif /* _MVME88K_ENDIAN_H_ */ +#endif __MVME88K_ENDIAN_H__ + diff --git a/sys/arch/mvme88k/include/exception_vectors.h b/sys/arch/mvme88k/include/exception_vectors.h index 29a2f4fe731..4dd65941e46 100644 --- a/sys/arch/mvme88k/include/exception_vectors.h +++ b/sys/arch/mvme88k/include/exception_vectors.h @@ -1,4 +1,4 @@ -/* $OpenBSD: exception_vectors.h,v 1.6 1999/09/27 20:46:17 smurph Exp $ */ +/* $OpenBSD: exception_vectors.h,v 1.7 2001/01/14 20:25:23 smurph Exp $ */ /* * Mach Operating System * Copyright (c) 1991, 1992 Carnegie Mellon University @@ -25,6 +25,8 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. */ +#ifndef __MACHINE_EXECPTION_VECTORS_H__ +#define __MACHINE_EXECPTION_VECTORS_H__ #define UNDEFINED PREDEFINED_BY_ROM #ifndef UNDEFINED @@ -167,4 +169,4 @@ /* vector 0x85 (#133) */ word user_raw_putstr /* for USER raw_printf() */ /* vector 0x85 (#134) */ word user_raw_xpr /* for USER raw_xpr() */ #endif - +#endif __MACHINE_EXECPTION_VECTORS_H__ diff --git a/sys/arch/mvme88k/include/exception_vectors2.h b/sys/arch/mvme88k/include/exception_vectors2.h index 6cc623cd816..8a03127b5e8 100644 --- a/sys/arch/mvme88k/include/exception_vectors2.h +++ b/sys/arch/mvme88k/include/exception_vectors2.h @@ -1,4 +1,4 @@ -/* $OpenBSD: exception_vectors2.h,v 1.1 1999/09/27 20:46:17 smurph Exp $ */ +/* $OpenBSD: exception_vectors2.h,v 1.2 2001/01/14 20:25:24 smurph Exp $ */ /* * Mach Operating System * Copyright (c) 1991, 1992 Carnegie Mellon University @@ -26,6 +26,8 @@ * rights to redistribute these changes. */ /*#define M197_UNDEFINED PREDEFINED_BY_ROM*/ +#ifndef __MACHINE_EXECPTION_VECTORS2_H__ +#define __MACHINE_EXECPTION_VECTORS2_H__ #ifndef M197_M197_UNDEFINED #define M197_UNDEFINED _m197_unknown_handler #endif @@ -162,4 +164,4 @@ /* vector 0x82 (#130) */ word _m197_break /* vector 0x83 (#131) */ word _m197_trace /* vector 0x84 (#132) */ word _m197_entry - +#endif __MACHINE_EXECPTION_VECTORS2_H__ diff --git a/sys/arch/mvme88k/include/exec.h b/sys/arch/mvme88k/include/exec.h index f599b77eb16..8adb5fc2072 100644 --- a/sys/arch/mvme88k/include/exec.h +++ b/sys/arch/mvme88k/include/exec.h @@ -1,6 +1,6 @@ -/* $OpenBSD: exec.h,v 1.7 1999/05/29 04:41:45 smurph Exp $ */ -#ifndef _MACHINE_EXEC_H_ -#define _MACHINE_EXEC_H_ +/* $OpenBSD: exec.h,v 1.8 2001/01/14 20:25:24 smurph Exp $ */ +#ifndef __MACHINE_EXEC_H__ +#define __MACHINE_EXEC_H__ #define __LDPGSZ 4096 @@ -27,4 +27,4 @@ struct relocation_info_m88k { #define _KERN_DO_AOUT #define _KERN_DO_ELF -#endif _MACHINE_EXEC_H_ +#endif __MACHINE_EXEC_H__ diff --git a/sys/arch/mvme88k/include/float.h b/sys/arch/mvme88k/include/float.h index 61c2fb97bef..cd67401ef77 100644 --- a/sys/arch/mvme88k/include/float.h +++ b/sys/arch/mvme88k/include/float.h @@ -1,4 +1,4 @@ -/* $OpenBSD: float.h,v 1.3 1999/02/09 06:36:26 smurph Exp $ */ +/* $OpenBSD: float.h,v 1.4 2001/01/14 20:25:24 smurph Exp $ */ /* * Copyright (c) 1989 Regents of the University of California. @@ -35,8 +35,8 @@ * @(#)float.h 7.1 (Berkeley) 5/8/90 */ -#ifndef _M88K_FLOAT_H_ -#define _M88K_FLOAT_H_ +#ifndef __M88K_FLOAT_H__ +#define __M88K_FLOAT_H__ #include <sys/cdefs.h> @@ -77,4 +77,4 @@ __END_DECLS #define LDBL_MAX DBL_MAX #define LDBL_MAX_10_EXP DBL_MAX_10_EXP -#endif /* !_M88K_FLOAT_H_ */ +#endif __M88K_FLOAT_H__ diff --git a/sys/arch/mvme88k/include/ieee.h b/sys/arch/mvme88k/include/ieee.h index 8dab48a930e..a4801ecd5b2 100644 --- a/sys/arch/mvme88k/include/ieee.h +++ b/sys/arch/mvme88k/include/ieee.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee.h,v 1.2 1999/02/09 06:36:26 smurph Exp $ */ +/* $OpenBSD: ieee.h,v 1.3 2001/01/14 20:25:24 smurph Exp $ */ /* * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -80,6 +80,8 @@ * * -149 == -127 - 23 + 1. */ +#ifndef __MACHINE_IEEE_H__ +#define __MACHINE_IEEE_H__ #define SNG_EXPBITS 8 #define SNG_FRACBITS 23 @@ -141,3 +143,4 @@ struct ieee_ext { #define SNG_EXP_BIAS 127 #define DBL_EXP_BIAS 1023 #define EXT_EXP_BIAS 16383 +#endif __MACHINE_IEEE_H__ diff --git a/sys/arch/mvme88k/include/m88100.h b/sys/arch/mvme88k/include/m88100.h index c29497bab98..88739cbc908 100644 --- a/sys/arch/mvme88k/include/m88100.h +++ b/sys/arch/mvme88k/include/m88100.h @@ -1,4 +1,4 @@ -/* $OpenBSD: m88100.h,v 1.4 1999/02/09 06:36:26 smurph Exp $ */ +/* $OpenBSD: m88100.h,v 1.5 2001/01/14 20:25:24 smurph Exp $ */ /* * Mach Operating System * Copyright (c) 1993-1992 Carnegie Mellon University @@ -31,8 +31,8 @@ * M88100 flags */ -#ifndef _M88100_H_ -#define _M88100_H_ +#ifndef __MACHINE_M88100_H__ +#define __MACHINE_M88100_H__ /* @@ -67,4 +67,4 @@ struct dmt_reg { }; #endif -#endif _M88100_H_ +#endif __MACHINE_M88100_H__ diff --git a/sys/arch/mvme88k/include/m88110.h b/sys/arch/mvme88k/include/m88110.h index 9d15b060fc0..21f96cbf894 100644 --- a/sys/arch/mvme88k/include/m88110.h +++ b/sys/arch/mvme88k/include/m88110.h @@ -1,4 +1,4 @@ -/* $OpenBSD: m88110.h,v 1.1 1999/09/27 20:46:18 smurph Exp $ */ +/* $OpenBSD: m88110.h,v 1.2 2001/01/14 20:25:24 smurph Exp $ */ #ifndef __MACHINE_M88110_H__ #define __MACHINE_M88110_H__ @@ -226,4 +226,4 @@ unsigned get_dpar (void); #endif /* ASSEMBLER */ -#endif /* __MACHINE_M88110_H__ */ +#endif __MACHINE_M88110_H__ diff --git a/sys/arch/mvme88k/include/mmu.h b/sys/arch/mvme88k/include/mmu.h index ae9f453dc20..0a6bef314c4 100644 --- a/sys/arch/mvme88k/include/mmu.h +++ b/sys/arch/mvme88k/include/mmu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: mmu.h,v 1.5 2001/01/13 05:18:59 smurph Exp $ */ +/* $OpenBSD: mmu.h,v 1.6 2001/01/14 20:25:24 smurph Exp $ */ /* * Ashura Project */ @@ -9,8 +9,8 @@ * @(#)mmu.h 1.22 90/09/20 19:13:34 */ -#ifndef _MACHINE_MMU_ -#define _MACHINE_MMU_ +#ifndef __MACHINE_MMU_H__ +#define __MACHINE_MMU_H__ /* for m88k_pgbytes, m8kk_pgshift */ #include <machine/vmparam.h> @@ -314,5 +314,5 @@ extern vm_offset_t kmapva; #define DMA_CACHE_INV 0x3 extern void dma_cachectl(vm_offset_t, int, int); -#endif -/* endif _MACHINE_MMU_ */ +#endif __MACHINE_MMU_H__ + diff --git a/sys/arch/mvme88k/include/mvme188.h b/sys/arch/mvme88k/include/mvme188.h index e64198e232f..3bb14c0ff5e 100644 --- a/sys/arch/mvme88k/include/mvme188.h +++ b/sys/arch/mvme88k/include/mvme188.h @@ -1,4 +1,4 @@ -/* $OpenBSD: mvme188.h,v 1.1 1999/09/27 20:46:18 smurph Exp $ */ +/* $OpenBSD: mvme188.h,v 1.2 2001/01/14 20:25:24 smurph Exp $ */ /* * Copyright (c) 1999 Steve Murphree, Jr. * All rights reserved. @@ -43,8 +43,8 @@ * */ -#ifndef _MACHINE_MVME188_H -#define _MACHINE_MVME188_H +#ifndef __MACHINE_MVME188_H__ +#define __MACHINE_MVME188_H__ /* * Something to put append a 'U' to a long constant if it's C so that @@ -394,6 +394,6 @@ void unblock_obio_interrupt(unsigned mask); #endif #define M188_IACK U(0xFFF85000) -#endif /* _MACHINE_MVME188_H */ +#endif __MACHINE_MVME188_H__ diff --git a/sys/arch/mvme88k/include/mvme1x7.h b/sys/arch/mvme88k/include/mvme1x7.h index d65d59726c2..c296c59bb98 100644 --- a/sys/arch/mvme88k/include/mvme1x7.h +++ b/sys/arch/mvme88k/include/mvme1x7.h @@ -1,4 +1,4 @@ -/* $OpenBSD: mvme1x7.h,v 1.1 1999/09/27 20:46:18 smurph Exp $ */ +/* $OpenBSD: mvme1x7.h,v 1.2 2001/01/14 20:25:24 smurph Exp $ */ /* * Copyright (c) 1996 Nivas Madhur * Copyright (c) 1999 Steve Murphree, Jr. @@ -43,8 +43,8 @@ * thereof, and that both notices appear in supporting documentation. * */ -#ifndef _MACHINE_MVME1X7_H -#define _MACHINE_MVME1X7_H +#ifndef __MACHINE_MVME1X7_H__ +#define __MACHINE_MVME1X7_H__ /* * VME1x7 CPU board constants - derived from Luna88k */ @@ -100,6 +100,4 @@ #define M187_IACK U(0xFFFE0000) #define M197_IACK U(0xFFF00100) -#endif /* _MACHINE_MVME1X7_H */ - - +#endif __MACHINE_MVME1X7_H__ diff --git a/sys/arch/mvme88k/include/param.h b/sys/arch/mvme88k/include/param.h index 20de45cd71c..fb169df5b33 100644 --- a/sys/arch/mvme88k/include/param.h +++ b/sys/arch/mvme88k/include/param.h @@ -1,4 +1,4 @@ -/* $OpenBSD: param.h,v 1.11 2000/02/22 19:27:55 deraadt Exp $ */ +/* $OpenBSD: param.h,v 1.12 2001/01/14 20:25:24 smurph Exp $ */ /* * Copyright (c) 1999 Steve Murphree, Jr. * Copyright (c) 1988 University of Utah. @@ -40,7 +40,7 @@ * from: Utah $Hdr: machparam.h 1.11 89/08/14$ * * @(#)param.h 7.8 (Berkeley) 6/28/91 - * $Id: param.h,v 1.11 2000/02/22 19:27:55 deraadt Exp $ + * $Id: param.h,v 1.12 2001/01/14 20:25:24 smurph Exp $ */ #ifndef _MACHINE_PARAM_H_ #define _MACHINE_PARAM_H_ @@ -114,10 +114,11 @@ * clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple * of the hardware page size. */ -#define MSIZE 128 /* size of an mbuf */ -#define MCLBYTES 1024 -#define MCLSHIFT 10 -#define MCLOFSET (MCLBYTES - 1) +#define MSIZE 128 /* size of an mbuf */ +#define MCLSHIFT 11 /* convert bytes to m_buf clusters */ +#define MCLBYTES (1 << MCLSHIFT) /* size of a m_buf cluster */ +#define MCLOFSET (MCLBYTES - 1) /* offset within a m_buf cluster */ + #ifndef NMBCLUSTERS #ifdef GATEWAY #define NMBCLUSTERS 1024 /* map size, max cluster allocation */ diff --git a/sys/arch/mvme88k/include/pmap_table.h b/sys/arch/mvme88k/include/pmap_table.h index 61b606bcefc..56753d3e85f 100644 --- a/sys/arch/mvme88k/include/pmap_table.h +++ b/sys/arch/mvme88k/include/pmap_table.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap_table.h,v 1.5 1999/09/27 20:46:19 smurph Exp $ */ +/* $OpenBSD: pmap_table.h,v 1.6 2001/01/14 20:25:24 smurph Exp $ */ /* * Mach Operating System * Copyright (c) 1992 Carnegie Mellon University @@ -32,7 +32,8 @@ /* an entry is considered invalid if pm_size = 0 */ /* end of list is indicated by pm_size 0xffffffff */ - +#ifndef __MACHINE_PAMP_TABLE_H__ +#define __MACHINE_PAMP_TABLE_H__ typedef struct { vm_offset_t phys_start; /* in bytes */ vm_offset_t virt_start; /* in bytes */ @@ -44,6 +45,5 @@ typedef struct { typedef pmap_table_entry *pmap_table_t; pmap_table_t pmap_table_build __P((unsigned memory_size)); - - +#endif __MACHINE_PAMP_TABLE_H__ diff --git a/sys/arch/mvme88k/include/proc.h b/sys/arch/mvme88k/include/proc.h index 8dbe04ff142..7a5dbb54e3b 100644 --- a/sys/arch/mvme88k/include/proc.h +++ b/sys/arch/mvme88k/include/proc.h @@ -1,4 +1,4 @@ -/* $OpenBSD: proc.h,v 1.6 1999/09/27 20:46:19 smurph Exp $ */ +/* $OpenBSD: proc.h,v 1.7 2001/01/14 20:25:24 smurph Exp $ */ /* * Copyright (c) 1992, 1993 * The Regents of the University of California. All rights reserved. @@ -43,9 +43,11 @@ * @(#)proc.h 8.1 (Berkeley) 6/11/93 * * from: Header: proc.h,v 1.6 92/11/26 02:04:41 torek Exp (LBL) - * $Id: proc.h,v 1.6 1999/09/27 20:46:19 smurph Exp $ + * $Id: proc.h,v 1.7 2001/01/14 20:25:24 smurph Exp $ */ +#ifndef __MACHINE_PROC_H__ +#define __MACHINE_PROC_H__ #include <machine/pcb.h> #include <machine/mmu.h> @@ -61,3 +63,5 @@ struct mdproc { unsigned md_ss_taken_addr; /* single step address for ptrace */ unsigned md_ss_taken_instr; /* single step instruction for ptrace */ }; +#endif __MACHINE_PROC_H__ + diff --git a/sys/arch/mvme88k/include/profile.h b/sys/arch/mvme88k/include/profile.h index 646f49dda03..afc807b45cd 100644 --- a/sys/arch/mvme88k/include/profile.h +++ b/sys/arch/mvme88k/include/profile.h @@ -1,4 +1,4 @@ -/* $OpenBSD: profile.h,v 1.7 1999/02/09 06:36:27 smurph Exp $ */ +/* $OpenBSD: profile.h,v 1.8 2001/01/14 20:25:24 smurph Exp $ */ /* * Copyright (c) 1996 Nivas Madhur * Copyright (c) 1992, 1993 @@ -33,9 +33,10 @@ * SUCH DAMAGE. * * from: @(#)profile.h 8.1 (Berkeley) 6/11/93 - * $Id: profile.h,v 1.7 1999/02/09 06:36:27 smurph Exp $ + * $Id: profile.h,v 1.8 2001/01/14 20:25:24 smurph Exp $ */ - +#ifndef __MACHINE_PROFILE_H__ +#define __MACHINE_PROFILE_H__ #define _MCOUNT_DECL static inline void _mcount #define MCOUNT \ @@ -72,3 +73,4 @@ mcount() \ #define MCOUNT_ENTER s = splhigh() #define MCOUNT_EXIT splx(s) #endif /* KERNEL */ +#endif __MACHINE_PROFILE_H__ diff --git a/sys/arch/mvme88k/include/prom.h b/sys/arch/mvme88k/include/prom.h index 2f1650c85be..c8a8a13eac8 100644 --- a/sys/arch/mvme88k/include/prom.h +++ b/sys/arch/mvme88k/include/prom.h @@ -1,4 +1,4 @@ -/* $OpenBSD: prom.h,v 1.4 1999/05/29 04:41:45 smurph Exp $ */ +/* $OpenBSD: prom.h,v 1.5 2001/01/14 20:25:24 smurph Exp $ */ /* * Copyright (c) 1998 Steve Murphree, Jr. * Copyright (c) 1996 Nivas Madhur @@ -30,6 +30,8 @@ * (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_PROM_H__ +#define __MACHINE_PROM_H__ #define MVMEPROM_INCHR 0x00 #define MVMEPROM_INSTAT 0x01 @@ -175,4 +177,4 @@ struct mvmeprom_args { #ifndef RB_NOSYM #define RB_NOSYM 0x400 #endif - +#endif __MACHINE_PROM_H__ diff --git a/sys/arch/mvme88k/include/ptrace.h b/sys/arch/mvme88k/include/ptrace.h index 347494aaa76..73648c842de 100644 --- a/sys/arch/mvme88k/include/ptrace.h +++ b/sys/arch/mvme88k/include/ptrace.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ptrace.h,v 1.4 1999/02/09 06:36:27 smurph Exp $ */ +/* $OpenBSD: ptrace.h,v 1.5 2001/01/14 20:25:24 smurph Exp $ */ /* * Copyright (c) 1999, Steve Murphree, Jr. * Copyright (c) 1992, 1993 @@ -44,15 +44,17 @@ * @(#)ptrace.h 8.1 (Berkeley) 6/11/93 * * from: Header: ptrace.h,v 1.6 92/11/26 02:04:43 torek Exp (LBL) - * $Id: ptrace.h,v 1.4 1999/02/09 06:36:27 smurph Exp $ + * $Id: ptrace.h,v 1.5 2001/01/14 20:25:24 smurph Exp $ */ /* * m88k-dependent ptrace definitions. */ - +#ifndef __MACHINE_PTRACE_H__ +#define __MACHINE_PTRACE_H__ #define PT_STEP (PT_FIRSTMACH + 0) #define PT_GETREGS (PT_FIRSTMACH + 1) #define PT_SETREGS (PT_FIRSTMACH + 2) #define PT_GETFPREGS (PT_FIRSTMACH + 3) #define PT_SETFPREGS (PT_FIRSTMACH + 4) +#endif __MACHINE_PTRACE_H__ diff --git a/sys/arch/mvme88k/include/setjmp.h b/sys/arch/mvme88k/include/setjmp.h index 156329b3b38..86d1247430c 100644 --- a/sys/arch/mvme88k/include/setjmp.h +++ b/sys/arch/mvme88k/include/setjmp.h @@ -1,7 +1,9 @@ -/* $OpenBSD: setjmp.h,v 1.4 1999/02/09 06:36:27 smurph Exp $ */ +/* $OpenBSD: setjmp.h,v 1.5 2001/01/14 20:25:24 smurph Exp $ */ /* * machine/setjmp.h: machine dependent setjmp-related information. */ - +#ifndef __MACHINE_SETJMP_H__ +#define __MACHINE_SETJMP_H__ #define _JBLEN 22 /* size, in longs, of a jmp_buf */ +#endif __MACHINE_SETJMP_H__ diff --git a/sys/arch/mvme88k/include/signal.h b/sys/arch/mvme88k/include/signal.h index 0f7c9f26b9c..70aa8af7172 100644 --- a/sys/arch/mvme88k/include/signal.h +++ b/sys/arch/mvme88k/include/signal.h @@ -1,4 +1,4 @@ -/* $OpenBSD: signal.h,v 1.4 1999/02/09 06:36:27 smurph Exp $ */ +/* $OpenBSD: signal.h,v 1.5 2001/01/14 20:25:24 smurph Exp $ */ /* * Copyright (c) 1996 Nivas Madhur * All rights reserved. @@ -29,6 +29,8 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ +#ifndef __MACHINE_SIGNAL_H__ +#define __MACHINE_SIGNAL_H__ typedef int sig_atomic_t; /* @@ -73,3 +75,4 @@ struct sigcontext { int sc_fpit; int sc_xxxx; /* padd to double word boundary */ }; +#endif __MACHINE_SIGNAL_H__ diff --git a/sys/arch/mvme88k/include/trap.h b/sys/arch/mvme88k/include/trap.h index 14eea437121..ea39c46f055 100644 --- a/sys/arch/mvme88k/include/trap.h +++ b/sys/arch/mvme88k/include/trap.h @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.h,v 1.5 1999/09/27 20:46:19 smurph Exp $ */ +/* $OpenBSD: trap.h,v 1.6 2001/01/14 20:25:24 smurph Exp $ */ /* * Mach Operating System * Copyright (c) 1992 Carnegie Mellon University @@ -27,9 +27,8 @@ /* * Trap codes */ - -#ifndef _M88K_TRAP_H -#define _M88K_TRAP_H 1 +#ifndef __MACHINE_TRAP_H__ +#define __MACHINE_TRAP_H__ /* * Trap type values @@ -73,5 +72,5 @@ #define T_INT 28 /* interrupt exception */ #define T_USER 29 /* user mode fault */ -#endif _M88K_TRAP_H +#endif __MACHINE_TRAP_H__ diff --git a/sys/arch/mvme88k/include/vid.h b/sys/arch/mvme88k/include/vid.h index acaa280dace..518da55de15 100644 --- a/sys/arch/mvme88k/include/vid.h +++ b/sys/arch/mvme88k/include/vid.h @@ -1,3 +1,6 @@ +#ifndef __MACHINE_VID_H__ +#define __MACHINE_VID_H__ + #define START_BLOCK 1 #define LOADER_SIZE 2 #define LOADER_ADDRESS 0x1F0000 @@ -54,3 +57,4 @@ struct cfg { unsigned char cfg_4[196]; }; #endif +#endif __MACHINE_VID_H__ diff --git a/sys/arch/mvme88k/mvme88k/locore_asm_routines.S b/sys/arch/mvme88k/mvme88k/locore_asm_routines.S index 2a5df3f23d4..e4784270152 100644 --- a/sys/arch/mvme88k/mvme88k/locore_asm_routines.S +++ b/sys/arch/mvme88k/mvme88k/locore_asm_routines.S @@ -1,4 +1,4 @@ -/* $OpenBSD: locore_asm_routines.S,v 1.8 2001/01/13 05:18:59 smurph Exp $ */ +/* $OpenBSD: locore_asm_routines.S,v 1.9 2001/01/14 20:25:25 smurph Exp $ */ /* * Mach Operating System * Copyright (c) 1993-1992 Carnegie Mellon University @@ -735,7 +735,7 @@ ENTRY(copyin) /*bcnd ne0, LEN, 1f ; XXX optimize len = 0 case */ /*;or r2, r0, 0 */ /*;br .Lcidone */ - /*;1: ;bcnd lt0, LEN, .Lciflt ; EFAULT if len < 0 */ + /*;1: ;bcnd lt0, LEN, .Lciflt ; EFAULT if len < 0 */ /* If it's a small length (less than 8), then do byte-by-byte */ cmp r9, LEN, 8 @@ -1237,12 +1237,315 @@ ENTRY(copyoutstr) ENTRY(kcopy) or.u r5, r0, hi16(_curpcb) ld r6, r5, lo16(_curpcb) + or.u r5, r0, hi16(kcopy_fault) + or r5, r5, lo16(kcopy_fault) + st r5, r6, PCB_ONFAULT /* pcb_onfault = kcopy_fault */ + bcnd le0,r4,kcopy_out /* nothing to do if count <= 0 */ +/* + * check position of source and destination data + */ + cmp r9,r2,r3 /* compare source address to destination */ + bb1 eq,r9,kcopy_out /* nothing to do if addresses are equal */ + bb1 lo,r9,kcopy_reverse /* copy in reverse if src < destination */ +/* + * source address is greater than destination address, copy forward + */ + cmp r9,r4,16 /* see if we have at least 16 bytes */ + bb1 lt,r9,kf_byte_copy /* copy bytes for small data length */ +/* + * determine copy strategy based on alignment of source and destination + */ + mask r6,r2,3 /* get 2 low order bits of source address */ + mask r7,r3,3 /* get 2 low order bits of destintation addr */ + mak r6,r6,0<4> /* convert source bits to table offset */ + mak r7,r7,0<2> /* convert destination bits to table offset */ + or.u r12,r0,hi16(kf_strat) /* forward strategy table address (high) */ + or r12,r12,lo16(kf_strat) /* forward strategy table address (low) */ + addu r6,r6,r7 /* compute final table offset for strategy */ + ld r12,r12,r6 /* load the strategy routine */ + jmp r12 /* branch to strategy routine */ + +/* + * Copy three bytes from src to destination then copy words + */ +_LABEL(kf_3byte_word_copy) + ld.bu r6,r2,0 /* load byte from source */ + ld.bu r7,r2,1 /* load byte from source */ + ld.bu r8,r2,2 /* load byte from source */ + st.b r6,r3,0 /* store byte to destination */ + st.b r7,r3,1 /* store byte to destination */ + st.b r8,r3,2 /* store byte to destination */ + addu r2,r2,3 /* increment source pointer */ + addu r3,r3,3 /* increment destination pointer */ + br.n kf_word_copy /* copy full words */ + subu r4,r4,3 /* decrement length */ + +/* + * Copy 1 halfword from src to destination then copy words + */ +_LABEL(kf_1half_word_copy) + ld.hu r6,r2,0 /* load half-word from source */ + st.h r6,r3,0 /* store half-word to destination */ + addu r2,r2,2 /* increment source pointer */ + addu r3,r3,2 /* increment destination pointer */ + br.n kf_word_copy /* copy full words */ + subu r4,r4,2 /* decrement remaining length */ + +/* + * Copy 1 byte from src to destination then copy words + */ +_LABEL(kf_1byte_word_copy) + ld.bu r6,r2,0 /* load 1 byte from source */ + st.b r6,r3,0 /* store 1 byte to destination */ + addu r2,r2,1 /* increment source pointer */ + addu r3,r3,1 /* increment destination pointer */ + subu r4,r4,1 /* decrement remaining length */ + /* fall through to word copy */ +/* + * Copy as many full words as possible, 4 words per loop + */ +_LABEL(kf_word_copy) + cmp r10,r4,16 /* see if we have 16 bytes remaining */ + bb1 lo,r10,kf_byte_copy /* not enough left, copy bytes */ + ld r6,r2,0 /* load first word */ + ld r7,r2,4 /* load second word */ + ld r8,r2,8 /* load third word */ + ld r9,r2,12 /* load fourth word */ + st r6,r3,0 /* store first word */ + st r7,r3,4 /* store second word */ + st r8,r3,8 /* store third word */ + st r9,r3,12 /* store fourth word */ + addu r2,r2,16 /* increment source pointer */ + addu r3,r3,16 /* increment destination pointer */ + br.n kf_word_copy /* branch to copy another block */ + subu r4,r4,16 /* decrement remaining length */ + +_LABEL(kf_1byte_half_copy) + ld.bu r6,r2,0 /* load 1 byte from source */ + st.b r6,r3,0 /* store 1 byte to destination */ + addu r2,r2,1 /* increment source pointer */ + addu r3,r3,1 /* increment destination pointer */ + subu r4,r4,1 /* decrement remaining length */ + /* fall through to half copy */ + +_LABEL(kf_half_copy) + cmp r10,r4,16 /* see if we have 16 bytes remaining */ + bb1 lo,r10,kf_byte_copy /* not enough left, copy bytes */ + ld.hu r6,r2,0 /* load first half-word */ + ld.hu r7,r2,2 /* load second half-word */ + ld.hu r8,r2,4 /* load third half-word */ + ld.hu r9,r2,6 /* load fourth half-word */ + ld.hu r10,r2,8 /* load fifth half-word */ + ld.hu r11,r2,10 /* load sixth half-word */ + ld.hu r12,r2,12 /* load seventh half-word */ + ld.hu r13,r2,14 /* load eighth half-word */ + st.h r6,r3,0 /* store first half-word */ + st.h r7,r3,2 /* store second half-word */ + st.h r8,r3,4 /* store third half-word */ + st.h r9,r3,6 /* store fourth half-word */ + st.h r10,r3,8 /* store fifth half-word */ + st.h r11,r3,10 /* store sixth half-word */ + st.h r12,r3,12 /* store seventh half-word */ + st.h r13,r3,14 /* store eighth half-word */ + addu r2,r2,16 /* increment source pointer */ + addu r3,r3,16 /* increment destination pointer */ + br.n kf_half_copy /* branch to copy another block */ + subu r4,r4,16 /* decrement remaining length */ + +_LABEL(kf_byte_copy) + bcnd eq0,r4,kcopy_out /* branch if nothing left to copy */ + ld.bu r6,r2,0 /* load byte from source */ + st.b r6,r3,0 /* store byte in destination */ + addu r2,r2,1 /* increment source pointer */ + addu r3,r3,1 /* increment destination pointer */ + br.n kf_byte_copy /* branch for next byte */ + subu r4,r4,1 /* decrement remaining length */ + +/* + * source address is less than destination address, copy in reverse + */ +_LABEL(kcopy_reverse) +/* + * start copy pointers at end of data + */ + addu r2,r2,r4 /* start source at end of data */ + addu r3,r3,r4 /* start destination at end of data */ +/* + * check for short data + */ + cmp r9,r4,16 /* see if we have at least 16 bytes */ + bb1 lt,r9,kr_byte_copy /* copy bytes for small data length */ +/* + * determine copy strategy based on alignment of source and destination + */ + mask r6,r2,3 /* get 2 low order bits of source address */ + mask r7,r3,3 /* get 2 low order bits of destintation addr */ + mak r6,r6,0<4> /* convert source bits to table offset */ + mak r7,r7,0<2> /* convert destination bits to table offset */ + or.u r12,r0,hi16(kr_strat) /* reverse strategy table address (high) */ + or r12,r12,lo16(kr_strat) /* reverse strategy table address (low) */ + addu r6,r6,r7 /* compute final table offset for strategy */ + ld r12,r12,r6 /* load the strategy routine */ + jmp r12 /* branch to strategy routine */ + +/* + * Copy three bytes from src to destination then copy words + */ +_LABEL(kr_3byte_word_copy) + subu r2,r2,3 /* decrement source pointer */ + subu r3,r3,3 /* decrement destination pointer */ + ld.bu r6,r2,0 /* load byte from source */ + ld.bu r7,r2,1 /* load byte from source */ + ld.bu r8,r2,2 /* load byte from source */ + st.b r6,r3,0 /* store byte to destination */ + st.b r7,r3,1 /* store byte to destination */ + st.b r8,r3,2 /* store byte to destination */ + br.n kr_word_copy /* copy full words */ + subu r4,r4,3 /* decrement length */ + +/* + * Copy 1 halfword from src to destination then copy words + */ +_LABEL(kr_1half_word_copy) + subu r2,r2,2 /* decrement source pointer */ + subu r3,r3,2 /* decrement destination pointer */ + ld.hu r6,r2,0 /* load half-word from source */ + st.h r6,r3,0 /* store half-word to destination */ + br.n kr_word_copy /* copy full words */ + subu r4,r4,2 /* decrement remaining length */ + +/* + * Copy 1 byte from src to destination then copy words + */ +_LABEL(kr_1byte_word_copy) + subu r2,r2,1 /* decrement source pointer */ + subu r3,r3,1 /* decrement destination pointer */ + ld.bu r6,r2,0 /* load 1 byte from source */ + st.b r6,r3,0 /* store 1 byte to destination */ + subu r4,r4,1 /* decrement remaining length */ + /* fall through to word copy */ +/* + * Copy as many full words as possible, 4 words per loop + */ +_LABEL(kr_word_copy) + cmp r10,r4,16 /* see if we have 16 bytes remaining */ + bb1 lo,r10,kr_byte_copy /* not enough left, copy bytes */ + subu r2,r2,16 /* decrement source pointer */ + subu r3,r3,16 /* decrement destination pointer */ + ld r6,r2,0 /* load first word */ + ld r7,r2,4 /* load second word */ + ld r8,r2,8 /* load third word */ + ld r9,r2,12 /* load fourth word */ + st r6,r3,0 /* store first word */ + st r7,r3,4 /* store second word */ + st r8,r3,8 /* store third word */ + st r9,r3,12 /* store fourth word */ + br.n kr_word_copy /* branch to copy another block */ + subu r4,r4,16 /* decrement remaining length */ + +_LABEL(kr_1byte_half_copy) + subu r2,r2,1 /* decrement source pointer */ + subu r3,r3,1 /* decrement destination pointer */ + ld.bu r6,r2,0 /* load 1 byte from source */ + st.b r6,r3,0 /* store 1 byte to destination */ + subu r4,r4,1 /* decrement remaining length */ + /* fall through to half copy */ + +_LABEL(kr_half_copy) + cmp r10,r4,16 /* see if we have 16 bytes remaining */ + bb1 lo,r10,kr_byte_copy /* not enough left, copy bytes */ + subu r2,r2,16 /* decrement source pointer */ + subu r3,r3,16 /* decrement destination pointer */ + ld.hu r6,r2,0 /* load first half-word */ + ld.hu r7,r2,2 /* load second half-word */ + ld.hu r8,r2,4 /* load third half-word */ + ld.hu r9,r2,6 /* load fourth half-word */ + ld.hu r10,r2,8 /* load fifth half-word */ + ld.hu r11,r2,10 /* load sixth half-word */ + ld.hu r12,r2,12 /* load seventh half-word */ + ld.hu r13,r2,14 /* load eighth half-word */ + st.h r6,r3,0 /* store first half-word */ + st.h r7,r3,2 /* store second half-word */ + st.h r8,r3,4 /* store third half-word */ + st.h r9,r3,6 /* store fourth half-word */ + st.h r10,r3,8 /* store fifth half-word */ + st.h r11,r3,10 /* store sixth half-word */ + st.h r12,r3,12 /* store seventh half-word */ + st.h r13,r3,14 /* store eighth half-word */ + br.n kr_half_copy /* branch to copy another block */ + subu r4,r4,16 /* decrement remaining length */ + +_LABEL(kr_byte_copy) + bcnd eq0,r4,kcopy_out /* branch if nothing left to copy */ + subu r2,r2,1 /* decrement source pointer */ + subu r3,r3,1 /* decrement destination pointer */ + ld.bu r6,r2,0 /* load byte from source */ + st.b r6,r3,0 /* store byte in destination */ + br.n kr_byte_copy /* branch for next byte */ + subu r4,r4,1 /* decrement remaining length */ + +_LABEL(kcopy_out) + or r2, r0, 0 /* return success */ +_LABEL(kcopy_out_fault) + or.u r5,r0,hi16(_curpcb) + ld r6,r5,lo16(_curpcb) + st r0,r6,PCB_ONFAULT /* clear the handler */ + jmp r1 /* all done, return to caller */ + +_LABEL(kcopy_fault) + or r2, r0, EFAULT /* return fault */ + br kcopy_out_fault + + data + align 4 +_LABEL(kf_strat) + word kf_word_copy + word kf_byte_copy + word kf_half_copy + word kf_byte_copy + word kf_byte_copy + word kf_3byte_word_copy + word kf_byte_copy + word kf_1byte_half_copy + word kf_half_copy + word kf_byte_copy + word kf_1half_word_copy + word kf_byte_copy + word kf_byte_copy + word kf_1byte_half_copy + word kf_byte_copy + word kf_1byte_word_copy + +_LABEL(kr_strat) + word kr_word_copy + word kr_byte_copy + word kr_half_copy + word kr_byte_copy + word kr_byte_copy + word kr_1byte_word_copy + word kr_byte_copy + word kr_1byte_half_copy + word kr_half_copy + word kr_byte_copy + word kr_1half_word_copy + word kr_byte_copy + word kr_byte_copy + word kr_1byte_half_copy + word kr_byte_copy + word kr_3byte_word_copy + + text +#ifdef notyet /* This give a stack problem. For now, use the above */ +ENTRY(kcopy) + or.u r5, r0, hi16(_curpcb) + ld r6, r5, lo16(_curpcb) or.u r5, r0, hi16(kcfault) or r5, r5, lo16(kcfault) - bsr.n _ovbcopy /* call ovbcopy */ st r5, r6, PCB_ONFAULT /* pcb_onfault = kcfault */ + subu r31, r31, 40 + bsr _ovbcopy /* call ovbcopy */ + addu r31, r31, 40 or r2, r0, 0 /* return success */ - br kcdone kcdone: or.u r5,r0,hi16(_curpcb) ld r6,r5,lo16(_curpcb) @@ -1251,6 +1554,7 @@ kcdone: kcfault: or r2, r0, EFAULT /* return fault */ br kcdone +#endif /* 0 */ #endif /* UVM */ /* @@ -1267,7 +1571,6 @@ ENTRY(memcpy) or r2, r0, r3 /* src -> 1st arg */ br.n _ovbcopy /* call ovbcopy */ or r3, r0, r5 /* dst -> 2nd arg */ - /* * void bcopy(source, destination, count) @@ -1868,13 +2171,17 @@ ENTRY(spln) cmp r4, r3, 0x188 bb1 ne, r4, 2f or.u r2, r0, hi16(IEN0_REG) - bsr.n _m188_get_mask or r2, r2, lo16(IEN0_REG) + bsr.n _m188_get_mask + subu r31, r31, 40 + addu r31, r31, 40 or r4,r2,r0 /* old mask in r4 */ or r3,r5,r0 /* new mask in r3 */ or.u r2, r0, hi16(IEN0_REG) - bsr.n _m188_set_mask or r2, r2, lo16(IEN0_REG) + bsr.n _m188_set_mask + subu r31, r31, 40 + addu r31, r31, 40 or r2,r4,r0 /* old mask in r2 */ br m188_spln_done #endif /* MVME188 */ @@ -1907,8 +2214,11 @@ ENTRY(spl) bb1 ne, r4, 2f /* get the current mask value mvme188 */ or.u r2, r0, hi16(IEN0_REG) - bsr.n _m188_get_mask or r2, r2, lo16(IEN0_REG) + bsr.n _m188_get_mask + subu r31, r31, 40 + addu r31, r31, 40 + br m188_spl_done #endif /* MVME188 */ 2: @@ -1944,12 +2254,16 @@ ENTRY(setipl) or r3, r0, r2 /* r3 now new mask value */ /* get the current mask value mvme188 */ or.u r2,r0,hi16(IEN0_REG) - bsr.n _m188_get_mask or r2,r2,lo16(IEN0_REG) + bsr.n _m188_get_mask + subu r31, r31, 40 + addu r31, r31, 40 or r4, r0, r2 /* r4 now current mask value */ or.u r2,r0,hi16(IEN0_REG) - bsr.n _m188_set_mask or r2,r2,lo16(IEN0_REG) + bsr.n _m188_set_mask + subu r31, r31, 40 + addu r31, r31, 40 or r2, r0, r4 /* r2 now the old value */ br m188_setipl_done #endif /* MVME188 */ @@ -1981,13 +2295,17 @@ ENTRY(db_spln) cmp r4, r3, 0x188 bb1 ne, r4, 2f or.u r2,r0,hi16(IEN0_REG) - bsr.n _m188_get_mask or r2,r2,lo16(IEN0_REG) + bsr.n _m188_get_mask + subu r31, r31, 40 + addu r31, r31, 40 or r4,r2,r0 /* old mask in r4 */ or r3,r5,r0 /* new mask in r3 */ or.u r2,r0,hi16(IEN0_REG) - bsr.n _m188_set_mask or r2,r2,lo16(IEN0_REG) + bsr.n _m188_set_mask + subu r31, r31, 40 + addu r31, r31, 40 or r2,r4,r0 /* old mask in r2 */ br m188_db_spln_done #endif /* MVME188 */ @@ -2020,8 +2338,10 @@ ENTRY(db_spl) bb1 ne, r4, 2f /* get the current mask value mvme188 */ or.u r2,r0,hi16(IEN0_REG) - bsr.n _m188_get_mask or r2,r2,lo16(IEN0_REG) + bsr.n _m188_get_mask + subu r31, r31, 40 + addu r31, r31, 40 br m188_db_spl_done #endif /* MVME188 */ 2: @@ -2050,12 +2370,16 @@ ENTRY(db_setipl) or r3, r0, r2 /* r3 now new mask value */ /* get the current mask value mvme188 */ or.u r2,r0,hi16(IEN0_REG) - bsr.n _m188_get_mask or r2,r2,lo16(IEN0_REG) + bsr.n _m188_get_mask + subu r31, r31, 40 + addu r31, r31, 40 or r4, r0, r2 /* r4 now current mask value */ or.u r2,r0,hi16(IEN0_REG) - bsr.n _m188_set_mask or r2,r2,lo16(IEN0_REG) + bsr.n _m188_set_mask + subu r31, r31, 40 + addu r31, r31, 40 or r2, r0, r4 /* r2 now the old value */ br m188_db_setipl_done #endif /* MVME188 */ @@ -2194,7 +2518,7 @@ ENTRY(set_cpu_number) or.u r2, r0, hi16(1f) bsr.n _panic or r2, r2, lo16(1f) - 1: string "bad CPU number\0" + 1: string "set_cpu_number: bad CPU number\0" align 4 /* will not return */ diff --git a/sys/arch/mvme88k/mvme88k/locore_c_routines.c b/sys/arch/mvme88k/mvme88k/locore_c_routines.c index ab494b2b335..654dc5ee87a 100644 --- a/sys/arch/mvme88k/mvme88k/locore_c_routines.c +++ b/sys/arch/mvme88k/mvme88k/locore_c_routines.c @@ -1,4 +1,4 @@ -/* $OpenBSD: locore_c_routines.c,v 1.6 1999/09/27 19:13:22 smurph Exp $ */ +/* $OpenBSD: locore_c_routines.c,v 1.7 2001/01/14 20:25:25 smurph Exp $ */ /* * Mach Operating System * Copyright (c) 1993-1991 Carnegie Mellon University @@ -421,7 +421,7 @@ setlevel(int level) { m88k_psr_type psr; register unsigned int mask; - register int cpu = 0; /* cpu_number(); */ + register int cpu = cpu_number(); mask = int_mask_val[level]; @@ -444,7 +444,7 @@ db_setlevel(int level) { m88k_psr_type psr; register unsigned int mask; - register int cpu = 0; /* cpu_number(); */ + register int cpu = cpu_number(); mask = int_mask_val[level]; @@ -483,7 +483,7 @@ unsigned spl(void) switch (cputyp) { #ifdef MVME188 case CPU_188: - /*cpu = cpu_number();*/ + cpu = cpu_number(); curspl = m188_curspl[cpu]; break; #endif /* MVME188 */ @@ -511,7 +511,7 @@ unsigned db_spl(void) switch (cputyp) { #ifdef MVME188 case CPU_188: - /*cpu = cpu_number();*/ + cpu = cpu_number(); curspl = m188_curspl[cpu]; break; #endif /* MVME188 */ @@ -551,7 +551,7 @@ unsigned setipl(unsigned level) switch (cputyp) { #ifdef MVME188 case CPU_188: - /*cpu = cpu_number();*/ + cpu = cpu_number(); curspl = m188_curspl[cpu]; setlevel(level); break; @@ -588,7 +588,7 @@ unsigned db_setipl(unsigned level) switch (cputyp) { #ifdef MVME188 case CPU_188: - /*cpu = cpu_number();*/ + cpu = cpu_number(); curspl = m188_curspl[cpu]; db_setlevel(level); break; @@ -639,5 +639,3 @@ __volatile int *lock; return 0; } #endif - - diff --git a/sys/arch/mvme88k/mvme88k/machdep.c b/sys/arch/mvme88k/mvme88k/machdep.c index 5c195ae114a..fac6a04c108 100644 --- a/sys/arch/mvme88k/mvme88k/machdep.c +++ b/sys/arch/mvme88k/mvme88k/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.23 2001/01/13 05:18:59 smurph Exp $ */ +/* $OpenBSD: machdep.c,v 1.24 2001/01/14 20:25:25 smurph Exp $ */ /* * Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr. * Copyright (c) 1996 Nivas Madhur @@ -145,10 +145,13 @@ volatile unsigned int *int_mask_reg[MAX_CPUS] = { (volatile unsigned int *)IEN2_REG, (volatile unsigned int *)IEN3_REG }; -#endif /* MVME188 */ +#endif +#if defined(MVME187) || defined(MVME197) u_char *int_mask_level = (u_char *)INT_MASK_LEVEL; u_char *int_pri_level = (u_char *)INT_PRI_LEVEL; +#endif /* MVME188 */ + u_char *iackaddr; volatile u_char *pcc2intr_mask; volatile u_char *pcc2intr_ipl; @@ -473,7 +476,8 @@ cpu_startup() vm_size_t size; int base, residual; #if defined(UVM) - vaddr_t minaddr, maxaddr, uarea_pages; + vaddr_t minaddr, maxaddr, uarea_pages, addr; + extern char *kernel_text, *etext; #else vm_offset_t minaddr, maxaddr, uarea_pages; #endif @@ -725,13 +729,6 @@ cpu_startup() /* * Allocate map for external I/O XXX new code - smurph */ - /* - * IOMAP_MAP_START was used for the base address of this map, but - * IOMAP_MAP_START == 0xEF000000, which is larger than a signed - * long (int on 88k). This causes rminit() to break when DIAGNOSTIC is - * defined, as it checks (long)addr < 0. So as a workaround, I use - * 0x10000000 as a base address. XXX smurph - */ #if defined(UVM) iomap_map = uvm_km_suballoc(kernel_map, &iomapbase, &maxaddr, IOMAP_SIZE, 0, FALSE, NULL); @@ -758,6 +755,7 @@ cpu_startup() mb_map = kmem_suballoc(kernel_map, (vm_offset_t *)&mbutl, &maxaddr, VM_MBUF_SIZE, FALSE); #endif + /* * Initialize timeouts */ @@ -845,21 +843,38 @@ register caddr_t v; valloc(msqids, struct msqid_ds, msginfo.msgmni); #endif +#ifndef BUFCACHEPERCENT +#define BUFCACHEPERCENT 5 +#endif /* - * Determine how many buffers to allocate (enough to - * hold 5% of total physical memory, but at least 16). - * Allocate 1/2 as many swap buffer headers as file i/o buffers. + * Determine how many buffers to allocate. We use 10% of the + * first 2MB of memory, and 5% of the rest, with a minimum of 16 + * buffers. We allocate 1/2 as many swap buffer headers as file + * i/o buffers. */ - if (bufpages == 0) + if (bufpages == 0) { if (physmem < btoc(2 * 1024 * 1024)) - bufpages = (physmem / 10) / CLSIZE; + bufpages = physmem / (10 * CLSIZE); else - bufpages = (physmem / 20) / CLSIZE; + bufpages = (btoc(2 * 1024 * 1024) + physmem) * + BUFCACHEPERCENT / (100 * CLSIZE); + } if (nbuf == 0) { nbuf = bufpages; if (nbuf < 16) nbuf = 16; } + + /* Restrict to at most 70% filled kvm */ + if (nbuf > + (VM_MAX_KERNEL_ADDRESS-VM_MIN_KERNEL_ADDRESS) / MAXBSIZE * 7 / 10) + nbuf = (VM_MAX_KERNEL_ADDRESS-VM_MIN_KERNEL_ADDRESS) / + MAXBSIZE * 7 / 10; + + /* More buffer pages than fits into the buffers is senseless. */ + if (bufpages > nbuf * MAXBSIZE / CLBYTES) + bufpages = nbuf * MAXBSIZE / CLBYTES; + if (nswbuf == 0) { nswbuf = (nbuf / 2) &~ 1; /* force even */ if (nswbuf > 256) diff --git a/sys/arch/mvme88k/mvme88k/pmap.c b/sys/arch/mvme88k/mvme88k/pmap.c index e5a1a274607..0b3ca8e17d5 100644 --- a/sys/arch/mvme88k/mvme88k/pmap.c +++ b/sys/arch/mvme88k/mvme88k/pmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pmap.c,v 1.17 2001/01/13 05:18:59 smurph Exp $ */ +/* $OpenBSD: pmap.c,v 1.18 2001/01/14 20:25:25 smurph Exp $ */ /* * Copyright (c) 1996 Nivas Madhur * All rights reserved. @@ -96,7 +96,7 @@ extern int max_cpus; */ #ifdef DEBUG #define STATIC - + #define DBG /* * conditional debugging */ @@ -130,7 +130,7 @@ extern int max_cpus; #define CD_CHKPM 0x2000000 /* check_pmap_consistency */ #define CD_CHKM 0x4000000 /* check_map */ #define CD_ALL 0x0FFFFFC -int pmap_con_dbg = CD_FULL | CD_ALL; +int pmap_con_dbg = CD_NORM; /* int pmap_con_dbg = CD_FULL| CD_NORM | CD_PROT | CD_BOOT | CD_CHKPV | CD_CHKPM | CD_CHKM; int pmap_con_dbg = CD_NORM;*/ @@ -170,8 +170,11 @@ STATIC kpdt_entry_t kpdt_free; /* * Size of kernel page tables for mapping onboard IO space. */ -#define OBIO_PDT_SIZE (M88K_BTOP(OBIO_SIZE) * sizeof(pt_entry_t)) - +#if defined(MVME188) && !(defined(MVME187) || defined(MVME197)) +#define OBIO_PDT_SIZE 0 +#else +#define OBIO_PDT_SIZE ((cputyp == CPU_188) ? 0 : (M88K_BTOP(OBIO_SIZE) * sizeof(pt_entry_t))) +#endif #define MAX_KERNEL_PDT_SIZE (KERNEL_PDT_SIZE + OBIO_PDT_SIZE) /* @@ -261,8 +264,7 @@ static vm_offset_t pmap_phys_end = (vm_offset_t) 0; bank_ = vm_physseg_find(atop((pa)), &pg_); \ vm_physmem[bank_].pmseg.attrs[pg_] = (attr); \ }) - -#endif +#endif /* !defined(MACHINE_NEW_NONCONTIG) */ /* * Locking and TLB invalidation primitives @@ -1995,7 +1997,7 @@ pmap_release(register pmap_t p) { pmap_free_tables(p); #ifdef DBG - DEBUG ((pmap_con_dbg & (CD_DESTR | CD_NORM)) == (CD_DESTR | CD_NORM)) + if ((pmap_con_dbg & (CD_DESTR | CD_NORM)) == (CD_DESTR | CD_NORM)) printf("(pmap_destroy :%x) ref_count = 0\n", curproc); /* unlink from list of pmap structs */ p->prev->next = p->next; @@ -2326,7 +2328,7 @@ pmap_remove(pmap_t map, vm_offset_t s, vm_offset_t e) return; } -#if DEBUG +#ifdef DEBUG if ((pmap_con_dbg & (CD_RM | CD_NORM)) == (CD_RM | CD_NORM)) printf("(pmap_remove :%x) map %x s %x e %x\n", curproc, map, s, e); #endif @@ -2430,7 +2432,6 @@ pmap_remove_all(vm_offset_t phys) UNLOCK_PVH(phys); goto remove_all_Retry; } - users = pmap->cpus_using; if (pmap == kernel_pmap) { kflush = 1; @@ -2489,6 +2490,7 @@ pmap_remove_all(vm_offset_t phys) * Do not free any page tables, * leaves that for when VM calls pmap_collect(). */ + simple_unlock(&pmap->lock); dbgcnt++; } @@ -2580,7 +2582,6 @@ copy_on_write_Retry: goto copy_on_write_Retry; } - users = pmap->cpus_using; if (pmap == kernel_pmap) { kflush = 1; @@ -3035,7 +3036,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_offset_t pa, * the allocated entry later (if we no longer need it). */ pv_e = PV_ENTRY_NULL; - Retry: +Retry: PMAP_LOCK(pmap, spl); @@ -3526,7 +3527,7 @@ pmap_collect(pmap_t pmap) CHECK_PMAP_CONSISTENCY ("pmap_collect"); -#if DBG +#ifdef DBG if ((pmap_con_dbg & (CD_COL | CD_NORM)) == (CD_COL | CD_NORM)) printf ("(pmap_collect :%x) pmap %x\n", curproc, pmap); #endif @@ -3597,7 +3598,7 @@ pmap_collect(pmap_t pmap) PMAP_UNLOCK(pmap, spl); -#if DBG +#ifdef DBG if ((pmap_con_dbg & (CD_COL | CD_NORM)) == (CD_COL | CD_NORM)) printf ("(pmap_collect :%x) done \n", curproc); #endif @@ -3605,8 +3606,6 @@ pmap_collect(pmap_t pmap) CHECK_PMAP_CONSISTENCY("pmap_collect"); } /* pmap collect() */ - - /* * Routine: PMAP_ACTIVATE * @@ -3638,8 +3637,8 @@ pmap_activate(struct proc *p) /* * Lock the pmap to put this cpu in its active set. */ - simple_lock(&pmap->lock); + simple_lock(&pmap->lock); apr_data.bits = 0; apr_data.field.st_base = M88K_BTOP(pmap->sdt_paddr); apr_data.field.wt = 0; @@ -3674,7 +3673,6 @@ pmap_activate(struct proc *p) SETBIT_CPUSET(my_cpu, &(pmap->cpus_using)); simple_unlock(&pmap->lock); - } else { /* @@ -4093,7 +4091,7 @@ pmap_clear_modify(vm_offset_t phys) SPLVM(spl); - clear_modify_Retry: +clear_modify_Retry: pvl = PA_TO_PVH(phys); CHECK_PV_LIST (phys, pvl, "pmap_clear_modify"); LOCK_PVH(phys); @@ -4121,7 +4119,6 @@ pmap_clear_modify(vm_offset_t phys) UNLOCK_PVH(phys); goto clear_modify_Retry; } - users = pmap->cpus_using; if (pmap == kernel_pmap) { kflush = 1; @@ -4149,9 +4146,7 @@ pmap_clear_modify(vm_offset_t phys) pte++; va += M88K_PGBYTES; } - simple_unlock(&pmap->lock); - pvep = pvep->next; } @@ -4274,7 +4269,6 @@ is_mod_Retry: ptep++; } simple_unlock(&pvep->pmap->lock); - pvep = pvep->next; } @@ -4344,7 +4338,7 @@ pmap_clear_reference(vm_offset_t phys) SPLVM(spl); - clear_reference_Retry: +clear_reference_Retry: LOCK_PVH(phys); pvl = PA_TO_PVH(phys); CHECK_PV_LIST(phys, pvl, "pmap_clear_reference"); @@ -4369,7 +4363,6 @@ pmap_clear_reference(vm_offset_t phys) UNLOCK_PVH(phys); goto clear_reference_Retry; } - users = pmap->cpus_using; if (pmap == kernel_pmap) { kflush = 1; @@ -4399,7 +4392,6 @@ pmap_clear_reference(vm_offset_t phys) } simple_unlock(&pmap->lock); - pvep = pvep->next; } @@ -4477,7 +4469,6 @@ is_ref_Retry: UNLOCK_PVH(phys); goto is_ref_Retry; } - ptep = pmap_pte(pvep->pmap, pvep->va); if (ptep == PT_ENTRY_NULL) panic("pmap_is_referenced: bad pv list entry."); @@ -4491,7 +4482,6 @@ is_ref_Retry: ptep++; } simple_unlock(&pvep->pmap->lock); - pvep = pvep->next; } @@ -5645,7 +5635,7 @@ pmap_range_add(pmap_range_t *ranges, vm_offset_t start, vm_offset_t end) range->start = start; - start_overlaps: +start_overlaps: assert((range->start <= start) && (start <= range->end)); /* delete redundant ranges */ |