From ccaf04f4bb2a93a41db1352978899ff3191f9193 Mon Sep 17 00:00:00 2001 From: Mats O Jansson Date: Wed, 10 Sep 1997 11:47:13 +0000 Subject: Sync with NetBSD 970516. -moj --- sys/arch/vax/include/clock.h | 38 +++++++++------- sys/arch/vax/include/cpu.h | 22 ++++++--- sys/arch/vax/include/db_machdep.h | 4 +- sys/arch/vax/include/disklabel.h | 6 +-- sys/arch/vax/include/ka410.h | 8 ++-- sys/arch/vax/include/ka43.h | 95 ++++++++++++++++++++++++++++----------- sys/arch/vax/include/ka650.h | 12 ++++- sys/arch/vax/include/ka750.h | 5 +-- sys/arch/vax/include/macros.h | 8 ++-- sys/arch/vax/include/param.h | 15 +++++-- sys/arch/vax/include/rpb.h | 26 ++++++++++- sys/arch/vax/include/sid.h | 17 ++++--- sys/arch/vax/include/trap.h | 42 ++++++++--------- sys/arch/vax/include/uvax.h | 21 ++++----- sys/arch/vax/include/vmparam.h | 58 +++++++----------------- 15 files changed, 221 insertions(+), 156 deletions(-) diff --git a/sys/arch/vax/include/clock.h b/sys/arch/vax/include/clock.h index 5e55f4d56d8..cd496e6bdd5 100644 --- a/sys/arch/vax/include/clock.h +++ b/sys/arch/vax/include/clock.h @@ -1,5 +1,5 @@ -/* $OpenBSD: clock.h,v 1.2 1997/05/29 00:04:36 niklas Exp $ */ -/* $NetBSD: clock.h,v 1.1 1996/07/20 17:35:42 ragge Exp $ */ +/* $OpenBSD: clock.h,v 1.3 1997/09/10 11:47:04 maja Exp $ */ +/* $NetBSD: clock.h,v 1.2 1997/05/04 19:13:33 ragge Exp $ */ /* * Copyright (c) 1996 Ludd, University of Lule}, Sweden. * All rights reserved. @@ -31,19 +31,6 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -/* - * Conversion structure. - */ -struct chiptime { - long sec; - long min; - long hour; - long day; - long mon; - long year; -}; - /* * Time constants. These are unlikely to change. */ @@ -61,10 +48,27 @@ struct chiptime { #define TODRBASE (1 << 28) /* Rumours says it comes from VMS */ +#define SEC_OFF 0 +#define MIN_OFF 2 +#define HR_OFF 4 +#define WDAY_OFF 6 +#define DAY_OFF 7 +#define MON_OFF 8 +#define YR_OFF 9 +#define CSRA_OFF 10 +#define CSRB_OFF 11 +#define CSRD_OFF 13 + +#define CSRA_UIP 0200 +#define CSRB_SET 0200 +#define CSRB_24 0002 +#define CSRB_DM 0004 +#define CSRD_VRT 0200 + /* Prototypes */ -long chiptotime __P((struct chiptime *)); -void timetochip __P((struct chiptime *)); void generic_clock __P((void)); void no_nicr_clock __P((void)); int generic_clkread __P((time_t)); void generic_clkwrite __P((void)); +int chip_clkread __P((time_t)); +void chip_clkwrite __P((void)); diff --git a/sys/arch/vax/include/cpu.h b/sys/arch/vax/include/cpu.h index dce472921b9..510e8d857b3 100644 --- a/sys/arch/vax/include/cpu.h +++ b/sys/arch/vax/include/cpu.h @@ -1,5 +1,5 @@ -/* $OpenBSD: cpu.h,v 1.6 1997/05/29 00:04:37 niklas Exp $ */ -/* $NetBSD: cpu.h,v 1.19 1996/07/20 17:58:12 ragge Exp $ */ +/* $OpenBSD: cpu.h,v 1.7 1997/09/10 11:47:05 maja Exp $ */ +/* $NetBSD: cpu.h,v 1.23 1997/03/15 15:09:41 ragge Exp $ */ /* * Copyright (c) 1994 Ludd, University of Lule}, Sweden @@ -31,20 +31,21 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - /* All bugs are subject to removal without further notice */ - #include #include #include #include +#include #define enablertclock() #define cpu_wait(p) #define cpu_swapout(p) -extern struct cpu_dep cpu_calls[]; - +/* + * All cpu-dependent info is kept in this struct. Pointer to the + * struct for the current cpu is set up in locore.c. + */ struct cpu_dep { void (*cpu_steal_pages) __P((void)); /* pmap init before mm is on */ void (*cpu_clock) __P((void)); /* CPU dep RT clock start */ @@ -54,15 +55,24 @@ struct cpu_dep { void (*cpu_conf) __P((struct device *, struct device *, void *)); int (*cpu_clkread) __P((time_t)); /* Read cpu clock time */ void (*cpu_clkwrite) __P((void)); /* Write system time to cpu */ + int cpu_vups; /* speed of cpu */ + u_char *cpu_intreq; /* Used on some VAXstations */ + u_char *cpu_intclr; /* Used on some VAXstations */ + u_char *cpu_intmsk; /* Used on some VAXstations */ + struct uc_map *cpu_map; /* Map containing important addresses */ }; +extern struct cpu_dep *dep_call; /* Holds pointer to current CPU struct. */ + struct clockframe { int pc; int ps; }; +extern struct device *booted_from; extern int cold; extern int mastercpu; +extern int bootdev; #define setsoftnet() mtpr(12,PR_SIRR) #define setsoftclock() mtpr(8,PR_SIRR) diff --git a/sys/arch/vax/include/db_machdep.h b/sys/arch/vax/include/db_machdep.h index 45dfd366168..3058fa98d7a 100644 --- a/sys/arch/vax/include/db_machdep.h +++ b/sys/arch/vax/include/db_machdep.h @@ -1,5 +1,5 @@ -/* $OpenBSD: db_machdep.h,v 1.4 1997/05/29 00:04:37 niklas Exp $ */ -/* $NetBSD: db_machdep.h,v 1.2 1996/04/08 18:35:47 ragge Exp $ */ +/* $OpenBSD: db_machdep.h,v 1.5 1997/09/10 11:47:05 maja Exp $ */ +/* $NetBSD: db_machdep.h,v 1.3 1997/02/06 21:17:05 gwr Exp $ */ /* * Mach Operating System diff --git a/sys/arch/vax/include/disklabel.h b/sys/arch/vax/include/disklabel.h index 7f87620df1c..b0f1ebff8bd 100644 --- a/sys/arch/vax/include/disklabel.h +++ b/sys/arch/vax/include/disklabel.h @@ -1,5 +1,5 @@ -/* $OpenBSD: disklabel.h,v 1.4 1997/05/29 00:04:38 niklas Exp $ */ -/* $NetBSD: disklabel.h,v 1.3 1996/02/01 22:33:26 mycroft Exp $ */ +/* $OpenBSD: disklabel.h,v 1.5 1997/09/10 11:47:06 maja Exp $ */ +/* $NetBSD: disklabel.h,v 1.4 1997/03/09 15:55:58 ragge Exp $ */ /* * Copyright (c) 1994 Christopher G. Demetriou @@ -37,7 +37,7 @@ #define LABELSECTOR 0 /* sector containing label */ #define LABELOFFSET 64 /* offset of label in sector */ #define MAXPARTITIONS 8 /* number of partitions */ -#define RAW_PART 3 /* raw partition: xx?c (XXX) */ +#define RAW_PART 2 /* raw partition: xx?c */ /* Just a dummy */ #ifndef _LOCORE diff --git a/sys/arch/vax/include/ka410.h b/sys/arch/vax/include/ka410.h index 2010d50ba4a..68686573936 100644 --- a/sys/arch/vax/include/ka410.h +++ b/sys/arch/vax/include/ka410.h @@ -1,5 +1,5 @@ -/* $OpenBSD: ka410.h,v 1.2 1997/05/29 00:04:40 niklas Exp $ */ -/* $NetBSD: ka410.h,v 1.1 1996/07/20 17:58:14 ragge Exp $ */ +/* $OpenBSD: ka410.h,v 1.3 1997/09/10 11:47:06 maja Exp $ */ +/* $NetBSD: ka410.h,v 1.2 1997/02/19 10:06:05 ragge Exp $ */ /* * Copyright (c) 1996 Ludd, University of Lule}, Sweden. * All rights reserved. @@ -65,7 +65,7 @@ /* * Other fixed addresses which should be mapped */ -#define KA410_CPU_BASE 0x20080000 +#define KA410_CPU_BASE ((struct ka410_cpu *)0x20080000) #define KA410_CPU_END 0x200800FF #define KA410_CPU_SIZE 0x100 #define KA410_NWA_BASE 0x20090000 /* Network Address ROM */ @@ -74,7 +74,7 @@ #define KA410_SER_BASE 0x200A0000 /* Serial line controller */ #define KA410_SER_END 0x200A000F #define KA410_SER_SIZE 0x10 -#define KA410_WAT_BASE 0x200B0000 /* TOY clock and NV-RAM */ +#define KA410_WAT_BASE ((struct ka410_clock *)0x200B0000)/* TOY clock */ #define KA410_WAT_END 0x200B00FF #define KA410_WAT_SIZE 0x100 #define KA410_DKC_BASE 0x200C0000 /* Disk Controller Ports */ diff --git a/sys/arch/vax/include/ka43.h b/sys/arch/vax/include/ka43.h index b40c51f34cc..323015b1d8a 100644 --- a/sys/arch/vax/include/ka43.h +++ b/sys/arch/vax/include/ka43.h @@ -1,5 +1,5 @@ -/* $OpenBSD: ka43.h,v 1.2 1997/05/29 00:04:41 niklas Exp $ */ -/* $NetBSD: ka43.h,v 1.1 1996/07/20 17:58:16 ragge Exp $ */ +/* $OpenBSD: ka43.h,v 1.3 1997/09/10 11:47:07 maja Exp $ */ +/* $NetBSD: ka43.h,v 1.2 1997/04/18 18:53:40 ragge Exp $ */ /* * Copyright (c) 1996 Ludd, University of Lule}, Sweden. * All rights reserved. @@ -55,7 +55,6 @@ #define KA43_CT2_END 0x2101FFFF #define KA43_CT2_SIZE 0x20000 #define KA43_CH2_CREG 0x21100000 /* 2nd level cache control register */ -#define KA43_SESR 0x21100000 /* ??? */ #define KA43_ROM_BASE 0x20040000 /* System module ROM */ #define KA43_ROM_END 0x2007FFFF @@ -66,45 +65,78 @@ #define KA43_IVN_SIZE 0x20 #define KA43_HLTCOD 0x20080000 /* Halt Code Register */ -#define KA43_MSER 0x20080004 /* Memory System Error register */ -#define KA43_MEAR 0x20080008 /* Memory Error Address register */ +/* #define KA43_MSER 0x20080004 /* Memory System Error register */ +/* #define KA43_MEAR 0x20080008 /* Memory Error Address register */ #define KA43_INTMSK 0x2008000C /* Interrupt Mask register */ #define KA43_VDCORG 0x2008000D /* Video Controller Origin Register */ #define KA43_VDCSEL 0x2008000E /* Video Controller Select Register */ #define KA43_INTREQ 0x2008000F /* Interrupt Request register */ #define KA43_INTCLR 0x2008000F /* Interrupt Request clear register */ -#define KA43_DIAGDSP 0x20080010 +#define KA43_DIAGDSP 0x20080010 /* Diagnostic display register */ #define KA43_PARCTL 0x20080014 /* Parity Control Register */ -#define KA43_DIAGTME 0x2008001E +#define KA43_DIAGTME 0x2008001E /* diagnostic time register */ #define KA43_PCTL_DPEN 0x00000001 /* DMA parity enable (bit 0) */ #define KA43_PCTL_CPEN 0x00000002 /* CPU Parity enable (bit 1) */ #define KA43_PCTL_DMA 0x01000000 /* LANCE DMA control (bit 24) */ -#define KA43_SESR_CENB 0x00000001 +/* + * "CH2" and "SESR" are two common names related to Secondary Cache + */ +#define KA43_SESR 0x21100000 /* same as KA43_CH2_CREG */ + +#define KA43_SESR_CENB 0x00000001 /* Cache Enable */ #define KA43_SESR_SERR 0x00000002 #define KA43_SESR_LERR 0x00000004 #define KA43_SESR_CERR 0x00000008 #define KA43_SESR_DIRTY 0x00000010 #define KA43_SESR_MISS 0x00000020 -#define KA43_SESR_DPE 0x00000040 -#define KA43_SESR_TPE 0x00000080 +#define KA43_SESR_DPE 0x00000040 /* Dal Parity Error */ +#define KA43_SESR_TPE 0x00000080 /* Tag Parity Error */ #define KA43_SESR_WSB 0x00010000 #define KA43_SESR_CIEA 0x7FFC0000 -#define KA43_PCS_FORCEHIT (1<<0) /* Force hit */ -#define KA43_PCS_ENABLE (1<<1) /* Enable primary cache */ -#define KA43_PCS_FLUSH (1<<2) /* Flush cache */ -#define KA43_PCS_REFRESH (1<<3) /* Enable refresh */ -#define KA43_PCS_HIT (1<<4) /* Cache hit */ -#define KA43_PCS_INTERRUPT (1<<5) /* Interrupt pending */ -#define KA43_PCS_TRAP2 (1<<6) /* Trap while trap */ -#define KA43_PCS_TRAP1 (1<<7) /* Micro trap / machine check */ -#define KA43_PCS_TPERR (1<<8) /* Tag parity error */ -#define KA43_PCS_DPERR (1<<9) /* Dal data parity error */ -#define KA43_PCS_PPERR (1<<10) /* P data parity error */ -#define KA43_PCS_BUSERR (1<<11) /* Bus error */ -#define KA43_PCS_BCHIT (1<<12) /* B cache hit */ +#define KA43_SESR_BITS \ + "\020\010TPE\007DPE\006MISS\005DIRTY\004CERR\003LERR\002SERR\001ENABLE" + +/* + * The following values refer to bits/bitfields within the 4 internal + * registers controlling primary cache: + * PR_PCTAG(124, tag-register) PR_PCIDX(125, index-register) + * PR_PCERR(126, error-register) PR_PCSTS(127, status-register) + */ +#define KA43_PCTAG_TAG 0x1FFFF800 /* bits 11-29 */ +#define KA43_PCTAG_PARITY 0x40000000 +#define KA43_PCTAG_VALID 0x80000000 + +#define KA43_PCIDX_INDEX 0x000007F8 /* 0x100 Q-word entries */ + +#define KA43_PCERR_ADDR 0x3FFFFFFF + +#define KA43_PCS_FORCEHIT 0x00000001 /* Force hit */ +#define KA43_PCS_ENABLE 0x00000002 /* Enable primary cache */ +#define KA43_PCS_FLUSH 0x00000004 /* Flush cache */ +#define KA43_PCS_REFRESH 0x00000008 /* Enable refresh */ +#define KA43_PCS_HIT 0x00000010 /* Cache hit */ +#define KA43_PCS_INTERRUPT 0x00000020 /* Interrupt pending */ +#define KA43_PCS_TRAP2 0x00000040 /* Trap while trap */ +#define KA43_PCS_TRAP1 0x00000080 /* Micro trap/machine check */ +#define KA43_PCS_TPERR 0x00000100 /* Tag parity error */ +#define KA43_PCS_DPERR 0x00000200 /* Dal data parity error */ +#define KA43_PCS_PPERR 0x00000400 /* P data parity error */ +#define KA43_PCS_BUSERR 0x00000800 /* Bus error */ +#define KA43_PCS_BCHIT 0x00001000 /* B cache hit */ + +#define KA43_PCSTS_BITS \ + "\020\015BCHIT\014BUSERR\013PPERR\012DPERR\011TPERR\010TRAP1" \ + "\007TRAP2\006INTR\005HIT\004REFRESH\003FLUSH\002ENABLE\001FORCEHIT" + +/* + * Bits in PR_ACCS (Floating Point Accelerator Register) + */ +#define KA43_ACCS_VECTOR (1<<0) /* Vector Unit Present */ +#define KA43_ACCS_FCHIP (1<<1) /* FPU chip present */ +#define KA43_ACCS_WEP (1<<31) /* Write Even Parity */ /* * Other fixed addresses which should be mapped @@ -143,6 +175,8 @@ #define KA43_VME_END 0x3003FFFF #define KA43_VME_SIZE 0x40000 +#define KA43_DIAGMEM 0x28000000 /* start of diagnostic memory */ + #define KA43_SC1_DADR 0x200C00A0 /* (1st SCSI) DMA address register */ #define KA43_SC1_DCNT 0x200C00C0 /* (1st SCSI) DMA byte count reg. */ #define KA43_SC1_DDIR 0x200C00C4 /* (1st SCSI) DMA transfer direction */ @@ -181,10 +215,17 @@ #define KA43_RESERVED 0x200B00C0 /* Reserved (16 bytes) */ struct ka43_cpu { - u_long ka43_hltcod; - u_long ka43_mser; - u_long ka43_cear; - u_long ka43_intmsk; + u_long hltcod; /* Halt Code Register */ + u_long pad2; + u_long pad3; + u_char intreg[4]; /* Four 1-byte registers */ + u_short diagdsp; /* Diagnostic display register */ + u_short pad4; + u_long parctl; /* Parity Control Register */ + u_short pad5; + u_short pad6; + u_short pad7; + u_short diagtme; /* Diagnostic time register */ }; struct ka43_clock { diff --git a/sys/arch/vax/include/ka650.h b/sys/arch/vax/include/ka650.h index 51984b1cea0..8833438dc99 100644 --- a/sys/arch/vax/include/ka650.h +++ b/sys/arch/vax/include/ka650.h @@ -1,5 +1,5 @@ -/* $OpenBSD: ka650.h,v 1.5 1997/05/29 00:04:42 niklas Exp $ */ -/* $NetBSD: ka650.h,v 1.4 1996/05/19 16:43:20 ragge Exp $ */ +/* $OpenBSD: ka650.h,v 1.6 1997/09/10 11:47:07 maja Exp $ */ +/* $NetBSD: ka650.h,v 1.5 1997/02/12 17:50:36 ragge Exp $ */ /* * Copyright (c) 1988 The Regents of the University of California. * All rights reserved. @@ -235,6 +235,14 @@ struct ka650_ipcr { #define KA650ROM_GETS 0x20060010 /* (jsb) read string with prompt */ #define KA650_CONSTYPE 0x20140401 /* byte at which console type resides */ +/* + * Some useful macros + */ +#define GETCPUTYPE(x) ((x >> 24) & 0xff) +#define GETSYSSUBT(x) ((x >> 8) & 0xff) +#define GETFRMREV(x) ((x >> 16) & 0xff) +#define GETCODREV(x) (x & 0xff) + /* prototypes */ struct sbi_attach_args; diff --git a/sys/arch/vax/include/ka750.h b/sys/arch/vax/include/ka750.h index 52e8d63cadc..b0567b0dc5f 100644 --- a/sys/arch/vax/include/ka750.h +++ b/sys/arch/vax/include/ka750.h @@ -1,5 +1,5 @@ -/* $NetBSD: ka750.h,v 1.7 1996/07/20 17:58:17 ragge Exp $ */ -/* $OpenBSD: ka750.h,v 1.6 1997/05/28 23:14:03 niklas Exp $ */ +/* $NetBSD: ka750.h,v 1.8 1997/02/12 17:58:56 ragge Exp $ */ +/* $OpenBSD: ka750.h,v 1.7 1997/09/10 11:47:08 maja Exp $ */ /* * Copyright (c) 1994 Ludd, University of Lule}, Sweden. @@ -45,7 +45,6 @@ /* 11/750 specific prototypes */ void ka750_conf __P((struct device *, struct device *, void *)); -void ka750_memenable __P((struct device *, struct device *, void *)); void ka750_memerr __P((void)); int ka750_mchk __P((caddr_t)); void ka750_steal_pages __P((void)); diff --git a/sys/arch/vax/include/macros.h b/sys/arch/vax/include/macros.h index 5701bcc5acb..4422e6d540e 100644 --- a/sys/arch/vax/include/macros.h +++ b/sys/arch/vax/include/macros.h @@ -1,5 +1,5 @@ -/* $OpenBSD: macros.h,v 1.6 1997/05/29 00:04:44 niklas Exp $ */ -/* $NetBSD: macros.h,v 1.10 1997/01/11 11:07:52 ragge Exp $ */ +/* $OpenBSD: macros.h,v 1.7 1997/09/10 11:47:08 maja Exp $ */ +/* $NetBSD: macros.h,v 1.11 1997/03/15 15:08:23 ragge Exp $ */ /* * Copyright (c) 1994 Ludd, University of Lule}, Sweden. @@ -33,8 +33,8 @@ /* All bugs are subject to removal without further notice */ -#if !defined(_VAX_MACROS_H_) && (defined(STANDALONE) || \ - (!defined(_LOCORE) && defined(_VAX_INLINE_))) +#if !defined(_VAX_MACROS_H_) && !defined(STANDALONE) && \ + (!defined(_LOCORE) && defined(_VAX_INLINE_)) #define _VAX_MACROS_H_ /* Here general macros are supposed to be stored */ diff --git a/sys/arch/vax/include/param.h b/sys/arch/vax/include/param.h index ef99aae85d8..ea2c9f5b78e 100644 --- a/sys/arch/vax/include/param.h +++ b/sys/arch/vax/include/param.h @@ -1,5 +1,5 @@ -/* $OpenBSD: param.h,v 1.7 1997/01/16 14:26:25 maja Exp $ */ -/* $NetBSD: param.h,v 1.22 1997/01/11 11:06:17 ragge Exp $ */ +/* $OpenBSD: param.h,v 1.8 1997/09/10 11:47:09 maja Exp $ */ +/* $NetBSD: param.h,v 1.23 1997/02/24 23:23:06 fvdl Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -58,10 +58,17 @@ * Round p (pointer or byte index) up to a correctly-aligned value * for all data types (int, long, ...). The result is u_int and * must be cast to any desired pointer type. + * + * ALIGNED_POINTER is a boolean macro that checks whether an address + * is valid to fetch data elements of type t from on this architecture. + * This does not reflect the optimal alignment, just the possibility + * (within reasonable limits). + * */ -#define ALIGNBYTES (sizeof(int) - 1) -#define ALIGN(p) (((u_int)(p) + ALIGNBYTES) &~ ALIGNBYTES) +#define ALIGNBYTES (sizeof(int) - 1) +#define ALIGN(p) (((u_int)(p) + ALIGNBYTES) &~ ALIGNBYTES) +#define ALIGNED_POINTER(p,t) ((((u_long)(p)) & (sizeof(t)-1)) == 0) #define PGSHIFT 9 /* LOG2(NBPG) */ #define NBPG (1<> PGSHIFT) * maxproc) -#define KALLOCMEM (((1*1024*1024*maxproc)>>PGSHIFT)/4) -#define SYSPTSIZE (((USRPTSIZE * 4) >> PGSHIFT) + UPAGES * maxproc + \ - KALLOCMEM) - /* * The time for a process to be blocked before being very swappable. * This is a number of seconds which the system takes as being a non-trivial @@ -146,29 +141,6 @@ #define SAFERSS 8 /* nominal ``small'' resident set size protected against replacement */ -/* - * There are two clock hands, initially separated by HANDSPREAD bytes - * (but at most all of user memory). The amount of time to reclaim - * a page once the pageout process examines it increases with this - * distance and decreases as the scan rate rises. - */ - -#define HANDSPREAD (2 * 1024 * 1024) - -/* - * The number of times per second to recompute the desired paging rate - * and poke the pagedaemon. - */ - -#define RATETOSCHEDPAGING 4 - -/* - * Believed threshold (in megabytes) for which interleaved - * swapping area is desirable. - */ - -#define LOTSOFMEM 2 - #define mapin(pte, v, pfnum, prot) \ {(*(int *)(pte) = ((pfnum)<