xref: /netbsd/sys/arch/vax/include/rpb.h (revision 2d5d8524)
1 /*	$NetBSD: rpb.h,v 1.10 2017/05/22 17:12:11 ragge Exp $ */
2 /*
3  * Copyright (c) 1995 Ludd, University of Lule}, Sweden.
4  * All rights reserved.
5  *
6  * This code is derived from software contributed to Ludd by Bertram Barth.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  * 1. Redistributions of source code must retain the above copyright
12  *    notice, this list of conditions and the following disclaimer.
13  * 2. Redistributions in binary form must reproduce the above copyright
14  *    notice, this list of conditions and the following disclaimer in the
15  *    documentation and/or other materials provided with the distribution.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  */
28 #ifndef _VAX_RPB_H_
29 #define _VAX_RPB_H_
30 
31 /*
32  * Look at "VAX/VMS Internals and Data Structures" around page 907
33  * to get more info about RPB.
34  */
35 
36 struct rpb {		/* size		description */
37 	struct rpb *rpb_base;	/* 4  physical base address of block */
38 	void  (*rpb_restart)(void);/* 4  physical address of restart routine */
39 	long	rpb_chksum;/* 4  checksum of first 31 longwords of restart */
40 	long	rpb_rstflg;	/* 4  Restart in progress flag */
41 	long	rpb_haltpc;	/* 4  PC at HALT/restart */
42 			/* offset: 20 */
43 	long	rpb_haltpsl;/* 4  PSL at HALT/restart */
44 	long	rpb_haltcode;/* 4  reason for restart */
45 	long	rpb_bootr0;/* 24  Saved bootstrap parameters (R0 through R5) */
46 	long	rpb_bootr1;
47 	long	rpb_bootr2;
48 	long	rpb_bootr3;
49 	long	rpb_bootr4;
50 	long	rpb_bootr5;
51 	long	iovec;	/* 4  Address of bootstrap driver */
52 	long	iovecsz;/* 4  Size (in bytes) of bootstrap driver */
53 			/* offset: 60 */
54 	long	fillbn;	/* 4  LBN of seconday bootstrap file */
55 	long	filsiz;	/* 4  Size (in blocks) of seconday bootstrap file */
56 	long	pfnmap[2];	/* 8  Descriptor of PFN bitmap */
57 	long	pfncnt;	/* 4  Count of physical pages */
58 			/* offset: 80 */
59 	long	svaspt;	/* 4  system virtual address of system page table */
60 	long	csrphy;	/* 4  Physical Address of UBA device CSR */
61 	long	csrvir;	/* 4  Virtual Address of UBA device CSR */
62 	long	adpphy;	/* 4  Physical Address of adapter configurate reg. */
63 	long	adpvir;	/* 4  Virtual Address of adapter configurate reg. */
64 			/* offset: 100 */
65 	short	unit;	/* 2  Bootstrap device unit number */
66 	u_char	devtyp;	/* 1  Bootstrap device type code */
67 	u_char	slave;	/* 1  Bootstrap device slave unit number */
68 	char	file[40];	/* 40  Secondary bootstrap file name */
69 	u_char	confreg[16];	/* 16  Byte array of adapter types */
70 			/* offset: 160 */
71 #if 0
72 	u_char	hdrpgcnt; /* 1  Count of header pages in 2nd bootstrap image */
73 	short	bootndt;/* 2  Type of boot adapter */
74 	u_char	flags;	/* 1  Miscellaneous flag bits */
75 #else
76 	long	align;	/* if the compiler doesnt proper alignment */
77 #endif
78 	long	max_pfn;/* 4  Absolute highest PFN */
79 	long	sptep;	/* 4  System space PTE prototype register */
80 	long	sbr;	/* 4  Saved system base register */
81 	long	cpudbvec;/* 4  Physical address of per-CPU database vector */
82 			/* offset: 180 */
83 	long	cca_addr;	/* 4  Physical address of CCA */
84 	long	slr;	/* 4  Saved system length register */
85 	long	memdesc[16];	/* 64  Longword array of memory descriptors */
86 	long	smp_pc;	/* 4  SMP boot page physical address */
87 	long	wait;	/* 4  Bugcheck loop code for attached processor */
88 			/* offset: 260 */
89 	long	badpgs;	/* 4  Number of bad pages found in memory scan */
90 	u_char	ctrlltr;/* 1  Controller letter designation */
91 	u_char	scbpagct;	/* 1  SCB page count */
92 	u_char	reserved[6];	/* 6  -- */
93 	long	vmb_revision;	/* 4  VMB revision label */
94 };
95 
96 /*
97  * Bootstrap device number encoding.
98  */
99 #define	BDEV_HP		0
100 #define	BDEV_RK		1
101 #define	BDEV_RL		2
102 #define	BDEV_IDC	3
103 #define	BDEV_UDA	17
104 #define	BDEV_TK		18
105 #define	BDEV_HSC	32
106 #define	BDEV_KDB	33
107 #define	BDEV_KRB	34
108 #define	BDEV_NK		35
109 #define	BDEV_RD		36	/* ST506/MFM disk on HDC9224 */
110 #define	BDEV_ST		37	/* SCSI tape on NCR5380 */
111 #define	BDEV_SD		42	/* SCSI disk on NCR5380 */
112 #define	BDEV_SDN	46	/* SCSI disk on NCR5394 (VS4000) */
113 #define	BDEV_CNSL	64
114 #define	BDEV_QE		96
115 #define	BDEV_DE		97
116 #define	BDEV_NI		98
117 #define	BDEV_LE		99
118 #define	BDEV_ZE		100
119 
120 #ifdef _KERNEL
121 extern struct rpb rpb;
122 #endif
123 
124 #endif /* _VAX_RPB_H_ */
125