diff options
-rw-r--r-- | sys/arch/vax/conf/Makefile.vax | 11 | ||||
-rw-r--r-- | sys/arch/vax/conf/files.vax | 3 | ||||
-rw-r--r-- | sys/arch/vax/vax/locore.S (renamed from sys/arch/vax/vax/intvec.s) | 2 | ||||
-rw-r--r-- | sys/arch/vax/vax/locore.c | 395 | ||||
-rw-r--r-- | sys/arch/vax/vax/machdep.c | 351 |
5 files changed, 351 insertions, 411 deletions
diff --git a/sys/arch/vax/conf/Makefile.vax b/sys/arch/vax/conf/Makefile.vax index 58f5bbfc2e1..cfa126f7399 100644 --- a/sys/arch/vax/conf/Makefile.vax +++ b/sys/arch/vax/conf/Makefile.vax @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.vax,v 1.54 2010/05/25 17:27:56 deraadt Exp $ +# $OpenBSD: Makefile.vax,v 1.55 2010/05/26 16:35:27 deraadt Exp $ # For instructions on building kernels consult the config(8) and options(4) # manual pages. @@ -68,7 +68,7 @@ NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< # ${SYSTEM_LD_HEAD} # ${SYSTEM_LD} swapxxx.o # ${SYSTEM_LD_TAIL} -SYSTEM_OBJ= intvec.o subr.o param.o ioconf.o ${OBJS} +SYSTEM_OBJ= locore.o subr.o param.o ioconf.o ${OBJS} SYSTEM_DEP= Makefile ${SYSTEM_OBJ} SYSTEM_LD_HEAD= @rm -f $@ SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_OBJ}' vers.o; \ @@ -124,7 +124,7 @@ lint: tags: @echo "see $S/kern/Makefile for tags" -AFILES= ${_machdir}/${_mach}/intvec.s ${_machdir}/${_mach}/subr.s +AFILES= ${_machdir}/${_mach}/locore.S ${_machdir}/${_mach}/subr.s depend:: .depend .depend: ${AFILES} param.c ioconf.c ${CFILES} ${SFILES} assym.h ${DB_STRUCTINFO} ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${AFILES} @@ -143,9 +143,8 @@ db_structinfo.h: $S/ddb/db_structinfo.c $S/ddb/parse_structinfo.awk objdump -g db_structinfo.o | awk -f $S/ddb/parse_structinfo.awk > $@ rm -f db_structinfo.o -intvec.o: ${_machdir}/${_mach}/intvec.s assym.h -subr.o: ${_machdir}/${_mach}/subr.s assym.h -unimpl_emul.o: assym.h +locore.o: ${_machdir}/${_mach}/locore.S assym.h +subr.o unimpl_emul.o: assym.h # The install target can be redefined by putting a # install-kernel-${MACHINE_NAME} target into /etc/mk.conf diff --git a/sys/arch/vax/conf/files.vax b/sys/arch/vax/conf/files.vax index f0b0cb02e7d..f9f517e2452 100644 --- a/sys/arch/vax/conf/files.vax +++ b/sys/arch/vax/conf/files.vax @@ -1,4 +1,4 @@ -# $OpenBSD: files.vax,v 1.50 2009/03/20 18:39:26 miod Exp $ +# $OpenBSD: files.vax,v 1.51 2010/05/26 16:35:27 deraadt Exp $ # $NetBSD: files.vax,v 1.60 1999/08/27 20:04:32 ragge Exp $ # # new style config file for vax architecture @@ -383,7 +383,6 @@ file arch/vax/vax/ka660.c vax660 file arch/vax/vax/ka670.c vax670 file arch/vax/vax/ka680.c vax680 file arch/vax/vax/ka820.c vax8200 -file arch/vax/vax/locore.c file arch/vax/vax/machdep.c file arch/vax/vax/mem.c file arch/vax/vax/mutex.c diff --git a/sys/arch/vax/vax/intvec.s b/sys/arch/vax/vax/locore.S index 875f922326e..5c61f513dfa 100644 --- a/sys/arch/vax/vax/intvec.s +++ b/sys/arch/vax/vax/locore.S @@ -1,4 +1,4 @@ -/* $OpenBSD: intvec.s,v 1.23 2009/03/20 18:39:30 miod Exp $ */ +/* $OpenBSD: locore.S,v 1.1 2010/05/26 16:35:28 deraadt Exp $ */ /* $NetBSD: intvec.s,v 1.39 1999/06/28 08:20:48 itojun Exp $ */ /* diff --git a/sys/arch/vax/vax/locore.c b/sys/arch/vax/vax/locore.c deleted file mode 100644 index c5f3b984c69..00000000000 --- a/sys/arch/vax/vax/locore.c +++ /dev/null @@ -1,395 +0,0 @@ -/* $OpenBSD: locore.c,v 1.36 2010/04/21 03:11:28 deraadt Exp $ */ -/* $NetBSD: locore.c,v 1.43 2000/03/26 11:39:45 ragge Exp $ */ -/* - * Copyright (c) 1994, 1998 Ludd, University of Lule}, Sweden. - * All rights reserved. - * - * 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed at Ludd, University of Lule}. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. - */ - - /* All bugs are subject to removal without further notice */ - - -#include <sys/param.h> -#include <sys/reboot.h> -#include <sys/device.h> -#include <sys/systm.h> -#include <sys/proc.h> -#include <sys/user.h> - -#include <uvm/uvm_extern.h> - -#include <machine/cpu.h> -#include <machine/sid.h> -#include <machine/param.h> -#include <machine/vmparam.h> -#include <machine/pcb.h> -#include <machine/pte.h> -#include <machine/pmap.h> -#include <machine/nexus.h> -#include <machine/rpb.h> -#include <machine/cca.h> - -void start(struct rpb *); -void main(void); - -extern paddr_t avail_end; -extern int physmem; -paddr_t esym; -u_int proc0paddr; -char cpu_model[100]; - -/* - * The strict cpu-dependent information is set up here, in - * form of a pointer to a struct that is specific for each cpu. - */ -extern struct cpu_dep ka780_calls; -extern struct cpu_dep ka750_calls; -extern struct cpu_dep ka860_calls; -extern struct cpu_dep ka820_calls; -extern struct cpu_dep ka43_calls; -extern struct cpu_dep ka46_calls; -extern struct cpu_dep ka48_calls; -extern struct cpu_dep ka49_calls; -extern struct cpu_dep ka53_calls; -extern struct cpu_dep ka410_calls; -extern struct cpu_dep ka630_calls; -extern struct cpu_dep ka650_calls; -extern struct cpu_dep ka660_calls; -extern struct cpu_dep ka670_calls; -extern struct cpu_dep ka680_calls; -extern struct cpu_dep ka60_calls; -extern struct cpu_dep vxt_calls; - -/* - * Start is called from boot; the first routine that is called - * in kernel. Kernel stack is setup somewhere in a safe place; - * but we need to move it to a better known place. Memory - * management is disabled, and no interrupt system is active. - */ -void -start(struct rpb *prpb) -{ - extern vaddr_t scratch; - int preserve_cca = 0; - - mtpr(AST_NO, PR_ASTLVL); /* Turn off ASTs */ - - findcpu(); /* Set up the CPU identifying variables */ - - if (vax_confdata & 0x80) - strlcpy(cpu_model, "MicroVAX ", sizeof cpu_model); - else - strlcpy(cpu_model, "VAXstation ", sizeof cpu_model); - - switch (vax_boardtype) { -#if VAX780 - case VAX_BTYP_780: - dep_call = &ka780_calls; - strlcpy(cpu_model,"VAX 11/780", sizeof cpu_model); - if (vax_cpudata & 0x100) - cpu_model[9] = '5'; - break; -#endif -#if VAX750 - case VAX_BTYP_750: - dep_call = &ka750_calls; - strlcpy(cpu_model, "VAX 11/750", sizeof cpu_model); - break; -#endif -#if VAX8600 - case VAX_BTYP_790: - dep_call = &ka860_calls; - strlcpy(cpu_model,"VAX 8600", sizeof cpu_model); - if (vax_cpudata & 0x100) - cpu_model[6] = '5'; - break; -#endif -#if VAX410 - case VAX_BTYP_420: /* They are very similar */ - dep_call = &ka410_calls; - strlcat(cpu_model, "3100", sizeof cpu_model); - switch ((vax_siedata >> 8) & 0xff) { - case 0x00: - strlcat(cpu_model, "/m{30,40}", sizeof cpu_model); - break; - case 0x01: - strlcat(cpu_model, "/m{38,48}", sizeof cpu_model); - break; - case 0x02: - strlcat(cpu_model, "/m{10,20}{,e}", sizeof cpu_model); - break; - } - break; - - case VAX_BTYP_410: - dep_call = &ka410_calls; - strlcat(cpu_model, "2000", sizeof cpu_model); - break; -#endif -#if VAX43 - case VAX_BTYP_43: - dep_call = &ka43_calls; - strlcat(cpu_model, "3100/m76", sizeof cpu_model); - break; -#endif -#if VAX46 - case VAX_BTYP_46: - dep_call = &ka46_calls; - switch(vax_siedata & 0xff) { - case VAX_VTYP_47: - strlcpy(cpu_model, "MicroVAX 3100 m80", sizeof cpu_model); - break; - case VAX_VTYP_46: - strlcpy(cpu_model, "VAXstation 4000/60", sizeof cpu_model); - break; - default: - strlcat(cpu_model, " - Unknown Mariah", sizeof cpu_model); - } - break; -#endif -#ifdef VXT - case VAX_BTYP_VXT: - dep_call = &vxt_calls; - strlcpy(cpu_model, "VXT2000", sizeof cpu_model); - break; -#endif -#if VAX48 - case VAX_BTYP_48: - dep_call = &ka48_calls; - switch ((vax_siedata >> 8) & 0xff) { - case VAX_STYP_45: - strlcpy(cpu_model, "MicroVAX 3100/m{30,40}", sizeof cpu_model); - break; - case VAX_STYP_48: - strlcpy(cpu_model, "VAXstation 4000/VLC", sizeof cpu_model); - break; - default: - strlcat(cpu_model, " - Unknown SOC", sizeof cpu_model); - } - break; -#endif -#if VAX49 - case VAX_BTYP_49: - dep_call = &ka49_calls; - strlcpy(cpu_model, "VAXstation 4000/90", sizeof cpu_model); - break; -#endif -#if VAX53 - case VAX_BTYP_1303: - dep_call = &ka53_calls; - switch ((vax_siedata >> 8) & 0xff) { - case VAX_STYP_50: - strlcpy(cpu_model, "MicroVAX 3100 model 85 or 90", sizeof cpu_model); - break; - case VAX_STYP_51: - strlcpy(cpu_model, "MicroVAX 3100 model 90 or 95", sizeof cpu_model); - break; - case VAX_STYP_52: - strlcpy(cpu_model, "VAX 4000 100", sizeof cpu_model); - break; - case VAX_STYP_53: - strlcpy(cpu_model, "VAX 4000 105A", sizeof cpu_model); - break; - default: - strlcpy(cpu_model, "VAX - Unknown Cheetah Class", sizeof cpu_model); - } - break; -#endif -#if VAX630 - case VAX_BTYP_630: - dep_call = &ka630_calls; - strlcpy(cpu_model,"MicroVAX II", sizeof cpu_model); - break; -#endif -#if VAX650 - case VAX_BTYP_650: - dep_call = &ka650_calls; - strlcpy(cpu_model,"MicroVAX ", sizeof cpu_model); - switch ((vax_siedata >> 8) & 255) { - case VAX_SIE_KA640: - strlcat(cpu_model, "3300/3400", sizeof cpu_model); - break; - - case VAX_SIE_KA650: - strlcat(cpu_model, "3500/3600", sizeof cpu_model); - break; - - case VAX_SIE_KA655: - strlcat(cpu_model, "3800/3900", sizeof cpu_model); - break; - - default: - strlcat(cpu_model, "III", sizeof cpu_model); - break; - } - break; -#endif -#if VAX660 - case VAX_BTYP_660: - dep_call = &ka660_calls; - strlcpy(cpu_model,"VAX 4000 200", sizeof cpu_model); - break; -#endif -#if VAX670 - case VAX_BTYP_670: - dep_call = &ka670_calls; - strlcpy(cpu_model,"VAX 4000 300", sizeof cpu_model); - break; -#endif -#if VAX680 - case VAX_BTYP_1301: - dep_call = &ka680_calls; - strlcpy(cpu_model,"VAX 4000 ", sizeof cpu_model); - switch ((vax_siedata >> 8) & 0xff) { - case VAX_STYP_675: - strlcat(cpu_model,"400", sizeof cpu_model); - break; - case VAX_STYP_680: - strlcat(cpu_model,"500", sizeof cpu_model); - break; - case VAX_STYP_690: - strlcat(cpu_model,"600", sizeof cpu_model); - break; - default: - strlcat(cpu_model,"- Unknown Omega Class", sizeof cpu_model); - } - break; - case VAX_BTYP_1305: - dep_call = &ka680_calls; - strlcpy(cpu_model,"VAX 4000 ", sizeof cpu_model); - switch ((vax_siedata >> 8) & 0xff) { - case VAX_STYP_681: - strlcat(cpu_model,"500A", sizeof cpu_model); - break; - case VAX_STYP_691: - strlcat(cpu_model,"605A", sizeof cpu_model); - break; - case VAX_STYP_694: - if (vax_cpudata & 0x1000) - strlcat(cpu_model,"705A", sizeof cpu_model); - else - strlcat(cpu_model,"700A", sizeof cpu_model); - break; - default: - strlcat(cpu_model,"- Unknown Legacy Class", sizeof cpu_model); - } - break; -#endif -#if VAX8200 - case VAX_BTYP_8000: - mastercpu = mfpr(PR_BINID); - dep_call = &ka820_calls; - strlcpy(cpu_model, "VAX 8200", sizeof cpu_model); - break; -#endif -#ifdef VAX60 - case VAX_BTYP_60: - dep_call = &ka60_calls; - preserve_cca = 1; - /* cpu_model will be set in ka60_init */ - break; -#endif - default: - /* CPU not supported, just give up */ - asm("halt"); - } - - /* - * Machines older than MicroVAX II have their boot blocks - * loaded directly or the boot program loaded from console - * media, so we need to figure out their memory size. - * This is not easily done on MicroVAXen, so we get it from - * VMB instead. - * - * In post-1.4 a RPB is always provided from the boot blocks. - */ -#if 1 /* compat with old bootblocks */ - if (prpb == 0) { - bzero((caddr_t)proc0paddr + REDZONEADDR, sizeof(struct rpb)); - prpb = (struct rpb *)(proc0paddr + REDZONEADDR); - prpb->pfncnt = avail_end >> VAX_PGSHIFT; - prpb->rpb_base = (void *)-1; /* RPB is fake */ - } else -#endif - bcopy(prpb, (caddr_t)proc0paddr + REDZONEADDR, sizeof(struct rpb)); - if (prpb->pfncnt) - avail_end = prpb->pfncnt << VAX_PGSHIFT; - else - while (badaddr((caddr_t)avail_end, 4) == 0) - avail_end += VAX_NBPG * 128; - boothowto = prpb->rpb_bootr5; - - physmem = atop(avail_end); - - /* - * If we need to use the Console Communication Area, make sure - * we will not stomp over it. - * - * On KA60 systems, the PROM apparently forgets to keep the CCA - * out of the reported memory size. It's no real surprise, as - * the memory bitmap pointed to by the CCA reports all physical - * memory (including itself and the CCA) as available! - * (which means the bitmap is not worth looking at either) - */ - - if (preserve_cca) { - if (prpb->cca_addr != 0 && avail_end > prpb->cca_addr) { - struct cca *cca = (struct cca *)prpb->cca_addr; - - /* - * XXX Should validate the CCA image here. - */ - - avail_end = prpb->cca_addr; - if (cca->cca_bitmap != 0 && avail_end > cca->cca_bitmap) - avail_end = cca->cca_bitmap; - } - } - - avail_end = trunc_page(avail_end); /* be sure */ - - proc0.p_addr = (struct user *)proc0paddr; /* XXX */ - bzero((struct user *)proc0paddr, sizeof(struct user)); - - /* Clear the used parts of the uarea except for the pcb */ - bzero(&proc0.p_addr->u_stats, sizeof(struct user) - sizeof(struct pcb)); - - pmap_bootstrap(); - - /* Now running virtual. set red zone for proc0 */ - *kvtopte((u_int)proc0.p_addr + REDZONEADDR) &= ~PG_V; - - ((struct pcb *)proc0paddr)->framep = (void *)scratch; - - /* - * Change mode down to userspace is done by faking a stack - * frame that is setup in cpu_set_kpc(). Not done by returning - * from main anymore. - */ - main(); - /* NOTREACHED */ -} diff --git a/sys/arch/vax/vax/machdep.c b/sys/arch/vax/vax/machdep.c index 41e272548d5..5e9e554a3c2 100644 --- a/sys/arch/vax/vax/machdep.c +++ b/sys/arch/vax/vax/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.106 2009/08/11 19:17:17 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.107 2010/05/26 16:35:29 deraadt Exp $ */ /* $NetBSD: machdep.c,v 1.108 2000/09/13 15:00:23 thorpej Exp $ */ /* @@ -95,16 +95,12 @@ #endif #include <machine/sid.h> -#include <machine/pte.h> -#include <machine/mtpr.h> -#include <machine/cpu.h> -#include <machine/macros.h> #include <machine/nexus.h> -#include <machine/trap.h> -#include <machine/reg.h> #include <machine/db_machdep.h> #include <machine/kcore.h> #include <vax/vax/gencons.h> +#include <machine/rpb.h> +#include <machine/cca.h> #ifdef DDB #include <ddb/db_sym.h> @@ -1069,3 +1065,344 @@ splassert_check(int wantipl, const char *func) } } #endif + +void start(struct rpb *); +void main(void); + +extern paddr_t avail_end; +extern int physmem; +paddr_t esym; +u_int proc0paddr; +char cpu_model[100]; + +/* + * The strict cpu-dependent information is set up here, in + * form of a pointer to a struct that is specific for each cpu. + */ +extern struct cpu_dep ka780_calls; +extern struct cpu_dep ka750_calls; +extern struct cpu_dep ka860_calls; +extern struct cpu_dep ka820_calls; +extern struct cpu_dep ka43_calls; +extern struct cpu_dep ka46_calls; +extern struct cpu_dep ka48_calls; +extern struct cpu_dep ka49_calls; +extern struct cpu_dep ka53_calls; +extern struct cpu_dep ka410_calls; +extern struct cpu_dep ka630_calls; +extern struct cpu_dep ka650_calls; +extern struct cpu_dep ka660_calls; +extern struct cpu_dep ka670_calls; +extern struct cpu_dep ka680_calls; +extern struct cpu_dep ka60_calls; +extern struct cpu_dep vxt_calls; + +/* + * Start is called from boot; the first routine that is called + * in kernel. Kernel stack is setup somewhere in a safe place; + * but we need to move it to a better known place. Memory + * management is disabled, and no interrupt system is active. + */ +void +start(struct rpb *prpb) +{ + extern vaddr_t scratch; + int preserve_cca = 0; + + mtpr(AST_NO, PR_ASTLVL); /* Turn off ASTs */ + + findcpu(); /* Set up the CPU identifying variables */ + + if (vax_confdata & 0x80) + strlcpy(cpu_model, "MicroVAX ", sizeof cpu_model); + else + strlcpy(cpu_model, "VAXstation ", sizeof cpu_model); + + switch (vax_boardtype) { +#if VAX780 + case VAX_BTYP_780: + dep_call = &ka780_calls; + strlcpy(cpu_model,"VAX 11/780", sizeof cpu_model); + if (vax_cpudata & 0x100) + cpu_model[9] = '5'; + break; +#endif +#if VAX750 + case VAX_BTYP_750: + dep_call = &ka750_calls; + strlcpy(cpu_model, "VAX 11/750", sizeof cpu_model); + break; +#endif +#if VAX8600 + case VAX_BTYP_790: + dep_call = &ka860_calls; + strlcpy(cpu_model,"VAX 8600", sizeof cpu_model); + if (vax_cpudata & 0x100) + cpu_model[6] = '5'; + break; +#endif +#if VAX410 + case VAX_BTYP_420: /* They are very similar */ + dep_call = &ka410_calls; + strlcat(cpu_model, "3100", sizeof cpu_model); + switch ((vax_siedata >> 8) & 0xff) { + case 0x00: + strlcat(cpu_model, "/m{30,40}", sizeof cpu_model); + break; + case 0x01: + strlcat(cpu_model, "/m{38,48}", sizeof cpu_model); + break; + case 0x02: + strlcat(cpu_model, "/m{10,20}{,e}", sizeof cpu_model); + break; + } + break; + + case VAX_BTYP_410: + dep_call = &ka410_calls; + strlcat(cpu_model, "2000", sizeof cpu_model); + break; +#endif +#if VAX43 + case VAX_BTYP_43: + dep_call = &ka43_calls; + strlcat(cpu_model, "3100/m76", sizeof cpu_model); + break; +#endif +#if VAX46 + case VAX_BTYP_46: + dep_call = &ka46_calls; + switch(vax_siedata & 0xff) { + case VAX_VTYP_47: + strlcpy(cpu_model, "MicroVAX 3100 m80", sizeof cpu_model); + break; + case VAX_VTYP_46: + strlcpy(cpu_model, "VAXstation 4000/60", sizeof cpu_model); + break; + default: + strlcat(cpu_model, " - Unknown Mariah", sizeof cpu_model); + } + break; +#endif +#ifdef VXT + case VAX_BTYP_VXT: + dep_call = &vxt_calls; + strlcpy(cpu_model, "VXT2000", sizeof cpu_model); + break; +#endif +#if VAX48 + case VAX_BTYP_48: + dep_call = &ka48_calls; + switch ((vax_siedata >> 8) & 0xff) { + case VAX_STYP_45: + strlcpy(cpu_model, "MicroVAX 3100/m{30,40}", sizeof cpu_model); + break; + case VAX_STYP_48: + strlcpy(cpu_model, "VAXstation 4000/VLC", sizeof cpu_model); + break; + default: + strlcat(cpu_model, " - Unknown SOC", sizeof cpu_model); + } + break; +#endif +#if VAX49 + case VAX_BTYP_49: + dep_call = &ka49_calls; + strlcpy(cpu_model, "VAXstation 4000/90", sizeof cpu_model); + break; +#endif +#if VAX53 + case VAX_BTYP_1303: + dep_call = &ka53_calls; + switch ((vax_siedata >> 8) & 0xff) { + case VAX_STYP_50: + strlcpy(cpu_model, "MicroVAX 3100 model 85 or 90", sizeof cpu_model); + break; + case VAX_STYP_51: + strlcpy(cpu_model, "MicroVAX 3100 model 90 or 95", sizeof cpu_model); + break; + case VAX_STYP_52: + strlcpy(cpu_model, "VAX 4000 100", sizeof cpu_model); + break; + case VAX_STYP_53: + strlcpy(cpu_model, "VAX 4000 105A", sizeof cpu_model); + break; + default: + strlcpy(cpu_model, "VAX - Unknown Cheetah Class", sizeof cpu_model); + } + break; +#endif +#if VAX630 + case VAX_BTYP_630: + dep_call = &ka630_calls; + strlcpy(cpu_model,"MicroVAX II", sizeof cpu_model); + break; +#endif +#if VAX650 + case VAX_BTYP_650: + dep_call = &ka650_calls; + strlcpy(cpu_model,"MicroVAX ", sizeof cpu_model); + switch ((vax_siedata >> 8) & 255) { + case VAX_SIE_KA640: + strlcat(cpu_model, "3300/3400", sizeof cpu_model); + break; + + case VAX_SIE_KA650: + strlcat(cpu_model, "3500/3600", sizeof cpu_model); + break; + + case VAX_SIE_KA655: + strlcat(cpu_model, "3800/3900", sizeof cpu_model); + break; + + default: + strlcat(cpu_model, "III", sizeof cpu_model); + break; + } + break; +#endif +#if VAX660 + case VAX_BTYP_660: + dep_call = &ka660_calls; + strlcpy(cpu_model,"VAX 4000 200", sizeof cpu_model); + break; +#endif +#if VAX670 + case VAX_BTYP_670: + dep_call = &ka670_calls; + strlcpy(cpu_model,"VAX 4000 300", sizeof cpu_model); + break; +#endif +#if VAX680 + case VAX_BTYP_1301: + dep_call = &ka680_calls; + strlcpy(cpu_model,"VAX 4000 ", sizeof cpu_model); + switch ((vax_siedata >> 8) & 0xff) { + case VAX_STYP_675: + strlcat(cpu_model,"400", sizeof cpu_model); + break; + case VAX_STYP_680: + strlcat(cpu_model,"500", sizeof cpu_model); + break; + case VAX_STYP_690: + strlcat(cpu_model,"600", sizeof cpu_model); + break; + default: + strlcat(cpu_model,"- Unknown Omega Class", sizeof cpu_model); + } + break; + case VAX_BTYP_1305: + dep_call = &ka680_calls; + strlcpy(cpu_model,"VAX 4000 ", sizeof cpu_model); + switch ((vax_siedata >> 8) & 0xff) { + case VAX_STYP_681: + strlcat(cpu_model,"500A", sizeof cpu_model); + break; + case VAX_STYP_691: + strlcat(cpu_model,"605A", sizeof cpu_model); + break; + case VAX_STYP_694: + if (vax_cpudata & 0x1000) + strlcat(cpu_model,"705A", sizeof cpu_model); + else + strlcat(cpu_model,"700A", sizeof cpu_model); + break; + default: + strlcat(cpu_model,"- Unknown Legacy Class", sizeof cpu_model); + } + break; +#endif +#if VAX8200 + case VAX_BTYP_8000: + mastercpu = mfpr(PR_BINID); + dep_call = &ka820_calls; + strlcpy(cpu_model, "VAX 8200", sizeof cpu_model); + break; +#endif +#ifdef VAX60 + case VAX_BTYP_60: + dep_call = &ka60_calls; + preserve_cca = 1; + /* cpu_model will be set in ka60_init */ + break; +#endif + default: + /* CPU not supported, just give up */ + asm("halt"); + } + + /* + * Machines older than MicroVAX II have their boot blocks + * loaded directly or the boot program loaded from console + * media, so we need to figure out their memory size. + * This is not easily done on MicroVAXen, so we get it from + * VMB instead. + * + * In post-1.4 a RPB is always provided from the boot blocks. + */ +#if 1 /* compat with old bootblocks */ + if (prpb == 0) { + bzero((caddr_t)proc0paddr + REDZONEADDR, sizeof(struct rpb)); + prpb = (struct rpb *)(proc0paddr + REDZONEADDR); + prpb->pfncnt = avail_end >> VAX_PGSHIFT; + prpb->rpb_base = (void *)-1; /* RPB is fake */ + } else +#endif + bcopy(prpb, (caddr_t)proc0paddr + REDZONEADDR, sizeof(struct rpb)); + if (prpb->pfncnt) + avail_end = prpb->pfncnt << VAX_PGSHIFT; + else + while (badaddr((caddr_t)avail_end, 4) == 0) + avail_end += VAX_NBPG * 128; + boothowto = prpb->rpb_bootr5; + + physmem = atop(avail_end); + + /* + * If we need to use the Console Communication Area, make sure + * we will not stomp over it. + * + * On KA60 systems, the PROM apparently forgets to keep the CCA + * out of the reported memory size. It's no real surprise, as + * the memory bitmap pointed to by the CCA reports all physical + * memory (including itself and the CCA) as available! + * (which means the bitmap is not worth looking at either) + */ + + if (preserve_cca) { + if (prpb->cca_addr != 0 && avail_end > prpb->cca_addr) { + struct cca *cca = (struct cca *)prpb->cca_addr; + + /* + * XXX Should validate the CCA image here. + */ + + avail_end = prpb->cca_addr; + if (cca->cca_bitmap != 0 && avail_end > cca->cca_bitmap) + avail_end = cca->cca_bitmap; + } + } + + avail_end = trunc_page(avail_end); /* be sure */ + + proc0.p_addr = (struct user *)proc0paddr; /* XXX */ + bzero((struct user *)proc0paddr, sizeof(struct user)); + + /* Clear the used parts of the uarea except for the pcb */ + bzero(&proc0.p_addr->u_stats, sizeof(struct user) - sizeof(struct pcb)); + + pmap_bootstrap(); + + /* Now running virtual. set red zone for proc0 */ + *kvtopte((u_int)proc0.p_addr + REDZONEADDR) &= ~PG_V; + + ((struct pcb *)proc0paddr)->framep = (void *)scratch; + + /* + * Change mode down to userspace is done by faking a stack + * frame that is setup in cpu_set_kpc(). Not done by returning + * from main anymore. + */ + main(); + /* NOTREACHED */ +} |