diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2013-07-05 21:13:08 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2013-07-05 21:13:08 +0000 |
commit | 62465d6de97acefc325394b64ef4b8abe42f4f3e (patch) | |
tree | 613e22d5485019492e260b281c0bc79921c1012f | |
parent | 98defd7c9b1d873b74b0dfee58df1c7da7367380 (diff) |
VAX ELF boot block bits, and version crank.
-rw-r--r-- | sys/arch/vax/stand/boot/Makefile | 38 | ||||
-rw-r--r-- | sys/arch/vax/stand/boot/autoconf.c | 8 | ||||
-rw-r--r-- | sys/arch/vax/stand/boot/boot.c | 16 | ||||
-rw-r--r-- | sys/arch/vax/stand/boot/consio2.S | 90 | ||||
-rw-r--r-- | sys/arch/vax/stand/boot/version | 3 | ||||
-rw-r--r-- | sys/arch/vax/stand/common/romread.S | 40 | ||||
-rw-r--r-- | sys/arch/vax/stand/common/srt0.S | 45 | ||||
-rw-r--r-- | sys/arch/vax/stand/common/str.S | 100 | ||||
-rw-r--r-- | sys/arch/vax/stand/xxboot/Makefile | 4 | ||||
-rw-r--r-- | sys/arch/vax/stand/xxboot/bootxx.c | 38 | ||||
-rw-r--r-- | sys/arch/vax/stand/xxboot/start.S | 52 |
11 files changed, 207 insertions, 227 deletions
diff --git a/sys/arch/vax/stand/boot/Makefile b/sys/arch/vax/stand/boot/Makefile index 85237404e86..cbbf63841b3 100644 --- a/sys/arch/vax/stand/boot/Makefile +++ b/sys/arch/vax/stand/boot/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.10 2012/08/21 14:46:20 pascal Exp $ +# $OpenBSD: Makefile,v 1.11 2013/07/05 21:13:06 miod Exp $ # $NetBSD: Makefile,v 1.27 2002/04/07 07:00:25 matt Exp $ S!= cd ${.CURDIR}/../../../../; pwd @@ -12,7 +12,6 @@ DEVS= ra.c mfm.c if_qe.c if_le.c if_ze.c if_de.c SRCS= srt0.S boot.c devopen.c conf.c autoconf.c netio.c rom.c romread.S \ urem.s udiv.s consio.c consio2.S str.S ${DEVS} findcpu.c -CLEANFILES+=${PROG} ${PROG}.sym ${PROG}.mop CPPFLAGS+=-DSUPPORT_BOOTPARAMS -DSUPPORT_DHCP -D_STANDALONE \ -DNO_MID_CHECK #CPPFLAGS+=-DBOOTP_DEBUG -DNETIF_DEBUG -DETHER_DEBUG -DNFS_DEBUG -DDEV_DEBUG \ @@ -35,32 +34,25 @@ LIBZ= ${ZLIB} SRCS+= moddi3.c negdi2.c .if ${MACHINE} == "vax" -.PHONY: machine-links -beforedepend: machine-links -machine-links: - @rm -f machine && ln -s ${S}/arch/${MACHINE}/include machine - @rm -f ${MACHINE_ARCH} && ln -s ${S}/arch/${MACHINE_ARCH}/include ${MACHINE_ARCH} -.NOPATH: machine ${MACHINE_ARCH} -CLEANFILES+= machine ${MACHINE_ARCH} -CPPFLAGS+= -I${.OBJDIR} +.if !make(obj) +.BEGIN: + @([ -h machine ] || ln -s ${.CURDIR}/../../../${MACHINE}/include machine) +.NOPATH: machine +CLEANFILES+= machine +.endif .endif -START=nisse +START=start +STRIP?=strip +CLEANFILES+= ${PROG}.sym -${PROG}: machine-links ${OBJS} ${LIBSA} ${LIBZ} - ${LD} -N -Ttext ${RELOC} -e ${START} -o ${PROG}.sym -Llib/sa -L. ${OBJS} \ - ${LIBSA} ${LIBZ} ${LIBSA} - /usr/sbin/mopa.out ${PROG}.sym ${PROG}.mop - /bin/cp ${PROG}.sym ${PROG} - /usr/bin/strip ${PROG} - /usr/bin/size ${PROG} +${PROG}: ${OBJS} ${LIBSA} ${LIBZ} + ${LD} -N -Ttext ${RELOC} -e ${START} -o ${PROG}.sym ${OBJS} \ + -Llib/sa -L. ${LIBSA} ${LIBZ} ${LIBSA} + ${STRIP} -o ${PROG} ${PROG}.sym -clean:: +clean:: rm -f a.out [Ee]rrs mklog core *.core ${PROG} ${OBJS} ${LOBJS} \ ${CLEANFILES} -#install: -# ${INSTALL_FILE} -o ${BINOWN} -g ${BINGRP} -m 555 \ -# ${PROG} ${DESTDIR}${MDEC_DIR}/${PROG} - .include <bsd.prog.mk> diff --git a/sys/arch/vax/stand/boot/autoconf.c b/sys/arch/vax/stand/boot/autoconf.c index 356b0038f35..1871ceb1c0f 100644 --- a/sys/arch/vax/stand/boot/autoconf.c +++ b/sys/arch/vax/stand/boot/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.13 2008/08/18 23:20:43 miod Exp $ */ +/* $OpenBSD: autoconf.c,v 1.14 2013/07/05 21:13:06 miod Exp $ */ /* $NetBSD: autoconf.c,v 1.19 2002/06/01 15:33:22 ragge Exp $ */ /* * Copyright (c) 1994, 1998 Ludd, University of Lule}, Sweden. @@ -252,9 +252,9 @@ asm(" " EIDSPTCH ": " CMN_IDSPTCH ": - movl (sp)+,r0 - pushl 4(r0) - calls $1,*(r0) + movl (%sp)+,%r0 + pushl 4(%r0) + calls $1,*(%r0) popr $0x3f rei "); diff --git a/sys/arch/vax/stand/boot/boot.c b/sys/arch/vax/stand/boot/boot.c index 17aec75e436..ee5f908be3c 100644 --- a/sys/arch/vax/stand/boot/boot.c +++ b/sys/arch/vax/stand/boot/boot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: boot.c,v 1.21 2011/09/19 21:53:02 miod Exp $ */ +/* $OpenBSD: boot.c,v 1.22 2013/07/05 21:13:06 miod Exp $ */ /* $NetBSD: boot.c,v 1.18 2002/05/31 15:58:26 ragge Exp $ */ /*- * Copyright (c) 1982, 1986 The Regents of the University of California. @@ -138,17 +138,7 @@ Xmain(void) errno = 0; printf("> boot bsd\n"); - marks[MARK_START] = 0; - err = loadfile("bsd", marks, - LOAD_KERNEL|COUNT_KERNEL); - if (err == 0) { - machdep_start((char *)marks[MARK_ENTRY], - marks[MARK_NSYM], - (void *)marks[MARK_START], - (void *)marks[MARK_SYM], - (void *)marks[MARK_END]); - } - printf("bsd: boot failed: %s\n", strerror(errno)); + boot(NULL); } /* If any key pressed, or autoboot failed, go to conversational boot */ @@ -238,7 +228,7 @@ load: (void *)marks[MARK_SYM], (void *)marks[MARK_END]); } - printf("Boot failed: %s\n", strerror(errno)); + printf("%s: boot failed: %s\n", fn, strerror(errno)); } void diff --git a/sys/arch/vax/stand/boot/consio2.S b/sys/arch/vax/stand/boot/consio2.S index 77e42e11a8a..689b08da3a2 100644 --- a/sys/arch/vax/stand/boot/consio2.S +++ b/sys/arch/vax/stand/boot/consio2.S @@ -1,4 +1,4 @@ -/* $OpenBSD: consio2.S,v 1.2 2008/08/12 17:23:21 miod Exp $ */ +/* $OpenBSD: consio2.S,v 1.3 2013/07/05 21:13:06 miod Exp $ */ /* $NetBSD: consio2.S,v 1.1 2002/02/24 01:04:24 matt Exp $ */ /* * Copyright (c) 1994, 1998 Ludd, University of Lule}, Sweden. @@ -36,7 +36,7 @@ * int rom_putchar (int c) ==> putchar() using ROM-routines */ ENTRY(rom_putchar, R2) - movl 4(ap), r2 # move argument to R2 + movl 4(%ap), %r2 # move argument to R2 jsb *_C_LABEL(rom_putc) # write it ret # that is all @@ -47,17 +47,17 @@ ENTRY(rom_putchar, R2) ENTRY(rom_getchar, R1) loop: # do { jsb *_C_LABEL(rom_getc) # call the getc-routine - tstl r0 # check if char ready + tstl %r0 # check if char ready beql loop # } while (R0 == 0) - movl r1, r0 # R1 holds char + movl %r1, %r0 # R1 holds char ret # we are done ENTRY(rom_testchar, 0) - mnegl $1,r0 + mnegl $1,%r0 jsb *_C_LABEL(rom_getc) - tstl r0 + tstl %r0 beql 1f - movl r1,r0 + movl %r1,%r0 1: ret ENTRY(_rtt, 0) @@ -68,63 +68,63 @@ ENTRY(_rtt, 0) * int ka630_rom_getchar (void) ==> getchar() using ROM-routines on KA630 */ ENTRY(ka630_rom_getchar, R11|R1) - movl _C_LABEL(ka630_conspage),r11 # load location of console page + movl _C_LABEL(ka630_conspage),%r11 # load location of console page 1: # do { - jsb *0x1C(r11) # call the getc-routine (KA630_GETC) - blbc r0,1b # } while (R0 == 0) - movl r1,r0 # R1 holds char + jsb *0x1C(%r11) # call the getc-routine (KA630_GETC) + blbc %r0,1b # } while (R0 == 0) + movl %r1,%r0 # R1 holds char ret # we are done ENTRY(ka630_rom_testchar, R3|R1) - movl _C_LABEL(ka630_conspage),r3 - jsb *0x1C(r3) - blbc r0,1f - movl r1,r0 + movl _C_LABEL(ka630_conspage),%r3 + jsb *0x1C(%r3) + blbc %r0,1f + movl %r1,%r0 1: ret /* * int ka630_rom_putchar (int c) ==> putchar() using ROM-routines on KA630 */ ENTRY(ka630_rom_putchar, R11|R1) - movl _C_LABEL(ka630_conspage),r11 + movl _C_LABEL(ka630_conspage),%r11 # load location of console page 1: # do { - jsb *0x20(r11) # is rom ready? (KA630_PUTC_POLL) - blbc r0,1b # } while (R0 == 0) - movl 4(ap),r1 # R1 holds char - jsb *0x24(r11) # output character (KA630_PUTC) + jsb *0x20(%r11) # is rom ready? (KA630_PUTC_POLL) + blbc %r0,1b # } while (R0 == 0) + movl 4(%ap),%r1 # R1 holds char + jsb *0x24(%r11) # output character (KA630_PUTC) ret # we are done /* * int ka53_rom_getchar (void) ==> getchar() using ROM-routines on KA53 */ ENTRY(ka53_rom_getchar, R11|R1) - movl _C_LABEL(ka53_conspage),r11 + movl _C_LABEL(ka53_conspage),%r11 # load location of console page 1: # do { - jsb *0x64(r11) # test for char - blbc r0,1b # } while (R0 == 0) - jsb *0x6c(r11) # get the char + jsb *0x64(%r11) # test for char + blbc %r0,1b # } while (R0 == 0) + jsb *0x6c(%r11) # get the char ret # we are done ENTRY(ka53_rom_testchar, R3|R1) - movl _C_LABEL(ka53_conspage),r3 - jsb *0x64(r3) - blbc r0,1f - jsb *0x6c(r3) # get the char + movl _C_LABEL(ka53_conspage),%r3 + jsb *0x64(%r3) + blbc %r0,1f + jsb *0x6c(%r3) # get the char 1: ret /* * int ka53_rom_putchar (int c) ==> putchar() using ROM-routines on KA53 */ ENTRY(ka53_rom_putchar, R11|R1) - movl _C_LABEL(ka53_conspage),r11 + movl _C_LABEL(ka53_conspage),%r11 # load location of console page 1: # do { - jsb *0x20(r11) # is rom ready? - blbc r0,1b # } whi le (R0 == 0) - movl 4(ap),r1 # R1 holds char - jsb *0x24(r11) # output character + jsb *0x20(%r11) # is rom ready? + blbc %r0,1b # } whi le (R0 == 0) + movl 4(%ap),%r1 # R1 holds char + jsb *0x24(%r11) # output character ret # we are done /* @@ -132,19 +132,19 @@ ENTRY(ka53_rom_putchar, R11|R1) */ ENTRY(ka60_rom_getchar, R11|R10|R9|R8|R7|R6|R5|R4|R3|R2|R1) 1: - movl _C_LABEL(ka60_conspage),r0 + movl _C_LABEL(ka60_conspage),%r0 # load location of console page # do { - jsb *0xfc(r0) # get the char, if any - blbc r0,1b # } while (R0 == 0) - movl r1,r0 + jsb *0xfc(%r0) # get the char, if any + blbc %r0,1b # } while (R0 == 0) + movl %r1,%r0 ret # we are done ENTRY(ka60_rom_testchar, R11|R10|R9|R8|R7|R6|R5|R4|R3|R2|R1) - movl _C_LABEL(ka60_conspage),r0 - jsb *0xfc(r0) - blbc r0,1f - movl r1,r0 + movl _C_LABEL(ka60_conspage),%r0 + jsb *0xfc(%r0) + blbc %r0,1f + movl %r1,%r0 1: ret /* @@ -152,9 +152,9 @@ ENTRY(ka60_rom_testchar, R11|R10|R9|R8|R7|R6|R5|R4|R3|R2|R1) */ ENTRY(ka60_rom_putchar, R11|R10|R9|R8|R7|R6|R5|R4|R3|R2|R1) 1: - movl _C_LABEL(ka60_conspage),r0 + movl _C_LABEL(ka60_conspage),%r0 # load location of console page - movl 4(ap),r1 # R1 holds char - jsb *0x114(r0) # output character - blbc r0, 1b # failed? retry + movl 4(%ap),%r1 # R1 holds char + jsb *0x114(%r0) # output character + blbc %r0, 1b # failed? retry ret # we are done diff --git a/sys/arch/vax/stand/boot/version b/sys/arch/vax/stand/boot/version index fafc63cb8a6..2bb0e5e259b 100644 --- a/sys/arch/vax/stand/boot/version +++ b/sys/arch/vax/stand/boot/version @@ -1,4 +1,4 @@ -$OpenBSD: version,v 1.9 2011/07/06 18:32:59 miod Exp $ +$OpenBSD: version,v 1.10 2013/07/05 21:13:06 miod Exp $ $NetBSD: version,v 1.4 2001/11/09 19:53:15 scw Exp $ NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE. The format of this @@ -38,3 +38,4 @@ is taken as the current. 1.15: Restore boot sd()... functionality on machines with asc(4) or sii(4) controllers. 1.16: Remove support for VAX 11/7x0, VAX6000 and VAX8000 +1.17: ELF bootblocks. diff --git a/sys/arch/vax/stand/common/romread.S b/sys/arch/vax/stand/common/romread.S index 18772e4cc7c..1e44ac0ff27 100644 --- a/sys/arch/vax/stand/common/romread.S +++ b/sys/arch/vax/stand/common/romread.S @@ -1,4 +1,4 @@ -/* $OpenBSD: romread.S,v 1.2 2011/07/06 18:32:59 miod Exp $ */ +/* $OpenBSD: romread.S,v 1.3 2013/07/05 21:13:06 miod Exp $ */ /* $NetBSD: romread.S,v 1.1 2002/02/24 01:04:25 matt Exp $ */ /* * Copyright (c) 1995 Ludd, University of Lule}, Sweden. @@ -44,31 +44,31 @@ * romread_uvax (int lbn, int size, void *buf, struct rpb *rpb) */ ENTRY(romread_uvax, 0xFFE) - movl 16(ap),r11 # restore boot-contents of %r11 (rpb) - movl 52(r11), r7 # load iovec/bqo into %r7 - addl3 (r7), r7, r6 # load qio into %r6 - pushl r11 # base of rpb + movl 16(%ap),%r11 # restore boot-contents of %r11 (rpb) + movl 52(%r11), %r7 # load iovec/bqo into %r7 + addl3 (%r7), %r7, %r6 # load qio into %r6 + pushl %r11 # base of rpb pushl $0 # virtual-flag pushl $33 # read-logical-block - pushl 4(ap) # lbn to start reading - pushl 8(ap) # number of bytes to read - pushl 12(ap) # buffer-address - calls $6, (r6) # call the qio-routine + pushl 4(%ap) # lbn to start reading + pushl 8(%ap) # number of bytes to read + pushl 12(%ap) # buffer-address + calls $6, (%r6) # call the qio-routine ret # %r0 holds the result /* * romwrite_uvax (int lbn, int size, void *buf, struct rpb *rpb) */ ENTRY(romwrite_uvax, 0xFFE) - movl 16(ap), r11 # restore boot-contents of %r11 (rpb) - movl 52(r11), r7 # load iovec/bqo into %r7 - addl3 (r7), r7, r6 # load qio into %r6 - pushl r11 # base of rpb - pushl $0 # virtual-flag - pushl $32 # write-logical-block - pushl 4(ap) # lbn to start reading - pushl 8(ap) # number of bytes to read - pushl 12(ap) # buffer-address - calls $6, (r6) # call the qio-routine - ret # %r0 holds the result + movl 16(%ap), %r11 # restore boot-contents of %r11 (rpb) + movl 52(%r11), %r7 # load iovec/bqo into %r7 + addl3 (%r7), %r7, %r6 # load qio into %r6 + pushl %r11 # base of rpb + pushl $0 # virtual-flag + pushl $32 # write-logical-block + pushl 4(%ap) # lbn to start reading + pushl 8(%ap) # number of bytes to read + pushl 12(%ap) # buffer-address + calls $6, (%r6) # call the qio-routine + ret # %r0 holds the result diff --git a/sys/arch/vax/stand/common/srt0.S b/sys/arch/vax/stand/common/srt0.S index 093d3324a30..751d965e57f 100644 --- a/sys/arch/vax/stand/common/srt0.S +++ b/sys/arch/vax/stand/common/srt0.S @@ -1,4 +1,4 @@ -/* $OpenBSD: srt0.S,v 1.2 2011/07/06 18:32:59 miod Exp $ */ +/* $OpenBSD: srt0.S,v 1.3 2013/07/05 21:13:06 miod Exp $ */ /* $NetBSD: srt0.S,v 1.2 2002/03/31 00:11:14 matt Exp $ */ /* * Copyright (c) 1994 Ludd, University of Lule}, Sweden. @@ -42,43 +42,40 @@ * position set in a.out header. */ - .globl nisse # pass -e nisse to ld gives OK start addr - .set nisse,0 - ALTENTRY(start) nop;nop; - movl $_C_LABEL(start), sp # Probably safe place for stack + movl $_C_LABEL(start), %sp # Probably safe place for stack pushr $0x1fff # save for later usage - subl3 $_C_LABEL(start), $_C_LABEL(edata), r0 - movab _C_LABEL(start), r1 # get where we are - movl $_C_LABEL(start), r3 # get where we want to be - cmpl r1,r3 # are we where we want to be? + subl3 $_C_LABEL(start), $_C_LABEL(edata), %r0 + movab _C_LABEL(start), %r1 # get where we are + movl $_C_LABEL(start), %r3 # get where we want to be + cmpl %r1,%r3 # are we where we want to be? beql relocated # already relocated, skip copy - movc3 r0,(r1),(r3) # copy - subl3 $_C_LABEL(edata), $_C_LABEL(end), r2 - movc5 $0,(r3),$0,r2,(r3) # Zero bss + movc3 %r0,(%r1),(%r3) # copy + subl3 $_C_LABEL(edata), $_C_LABEL(end), %r2 + movc5 $0,(%r3),$0,%r2,(%r3) # Zero bss - movpsl -(sp) + movpsl -(%sp) pushl $relocated rei relocated: # now relocation is done !!! - movl sp,_C_LABEL(bootregs) # *bootregs + movl %sp,_C_LABEL(bootregs) # *bootregs calls $0, _C_LABEL(Xmain) # Were here! halt # no return ENTRY(machdep_start, 0) mtpr $0x1f,$0x12 # Block all interrupts mtpr $0,$0x18 # stop real time interrupt clock - movl 4(ap), r6 - movl 20(ap), r9 # end of symbol table - pushl 8(ap) # number of symbols - pushl 16(ap) # start of symbols - movab _C_LABEL(bootrpb),r10 # get RPB address - pushl r10 # argument for new boot - ashl $9,76(r10),r8 # memory size (COMPAT) - movl $3,r11 # ask boot (COMPAT) - clrl r10 # no boot dev (COMPAT) + movl 4(%ap), %r6 + movl 20(%ap), %r9 # end of symbol table + pushl 8(%ap) # number of symbols + pushl 16(%ap) # start of symbols + movab _C_LABEL(bootrpb),%r10 # get RPB address + pushl %r10 # argument for new boot + ashl $9,76(%r10),%r8 # memory size (COMPAT) + movl $3,%r11 # ask boot (COMPAT) + clrl %r10 # no boot dev (COMPAT) - calls $3,(r6) + calls $3,(%r6) halt diff --git a/sys/arch/vax/stand/common/str.S b/sys/arch/vax/stand/common/str.S index 4a0ab80fb63..e6967467d8b 100644 --- a/sys/arch/vax/stand/common/str.S +++ b/sys/arch/vax/stand/common/str.S @@ -1,4 +1,4 @@ -/* $OpenBSD: str.S,v 1.3 2011/06/06 07:54:33 jasper Exp $ */ +/* $OpenBSD: str.S,v 1.4 2013/07/05 21:13:06 miod Exp $ */ /* $NetBSD: str.S,v 1.1 2002/02/24 01:04:25 matt Exp $ */ /* * Copyright (c) 1996 Ludd, University of Lule}, Sweden. @@ -42,17 +42,17 @@ * atoi() used in devopen. */ ENTRY(atoi, 0) - movl 4(ap),r1 - clrl r0 + movl 4(%ap),%r1 + clrl %r0 -2: movzbl (r1)+,r2 - cmpb r2,$48 +2: movzbl (%r1)+,%r2 + cmpb %r2,$48 blss 1f - cmpb r2,$57 + cmpb %r2,$57 bgtr 1f - subl2 $48,r2 - mull2 $10,r0 - addl2 r2,r0 + subl2 $48,%r2 + mull2 $10,%r0 + addl2 %r2,%r0 brb 2b 1: ret @@ -61,24 +61,24 @@ ENTRY(atoi, 0) * doesnt work if we search for null. */ ENTRY(index, 0) - movq 4(ap),r0 -1: cmpb (r0), r1 + movq 4(%ap),%r0 +1: cmpb (%r0), %r1 beql 2f - tstb (r0)+ + tstb (%r0)+ bneq 1b - clrl r0 + clrl %r0 2: ret /* * cmpc3 is emulated on MVII. */ ENTRY(bcmp, 0) - movl 4(ap), r2 - movl 8(ap), r1 - movl 12(ap), r0 -2: cmpb (r2)+, (r1)+ + movl 4(%ap), %r2 + movl 8(%ap), %r1 + movl 12(%ap), %r0 +2: cmpb (%r2)+, (%r1)+ bneq 1f - decl r0 + decl %r0 bneq 2b 1: ret @@ -86,66 +86,66 @@ ENTRY(bcmp, 0) * Is movc3/movc5 emulated on any CPU? I dont think so; use them here. */ ENTRY(bzero,0) - movc5 $0,*4(ap),$0,8(ap),*4(ap) + movc5 $0,*4(%ap),$0,8(%ap),*4(%ap) ret ENTRY(bcopy,0) - movc3 12(ap), *4(ap), *8(ap) + movc3 12(%ap), *4(%ap), *8(%ap) ret ENTRY(strlen, 0) - movl 4(ap), r0 -1: tstb (r0)+ + movl 4(%ap), %r0 +1: tstb (%r0)+ bneq 1b - decl r0 - subl2 4(ap), r0 + decl %r0 + subl2 4(%ap), %r0 ret ENTRY(strcmp, 0) - movl $250, r3 # max string len to compare -5: movl 4(ap), r2 - movl 8(ap), r1 - movl $1, r0 + movl $250, %r3 # max string len to compare +5: movl 4(%ap), %r2 + movl 8(%ap), %r1 + movl $1, %r0 -2: cmpb (r2),(r1)+ +2: cmpb (%r2),(%r1)+ bneq 1f # something differ - tstb (r2)+ + tstb (%r2)+ beql 4f # continue, strings unequal - decl r3 # max string len encountered? + decl %r3 # max string len encountered? bneq 2b -4: clrl r0 # We are done, strings equal. +4: clrl %r0 # We are done, strings equal. ret 1: bgtr 3f - mnegl r0, r0 + mnegl %r0, %r0 3: ret ENTRY(strncpy, 0) - movl 4(ap), r1 - movl 8(ap), r2 - movl 12(ap), r3 + movl 4(%ap), %r1 + movl 8(%ap), %r2 + movl 12(%ap), %r3 bleq 2f -1: movb (r2)+, (r1)+ +1: movb (%r2)+, (%r1)+ beql 2f - decl r3 + decl %r3 bneq 1b 2: ret ENTRY(setjmp, 0) - movl 4(ap), r0 - movl 8(fp), (r0) - movl 12(fp), 4(r0) - movl 16(fp), 8(r0) - addl3 fp,$28,12(r0) - clrl r0 + movl 4(%ap), %r0 + movl 8(%fp), (%r0) + movl 12(%fp), 4(%r0) + movl 16(%fp), 8(%r0) + addl3 %fp,$28,12(%r0) + clrl %r0 ret ENTRY(longjmp, 0) - movl 4(ap), r1 - movl $1, r0 - movl (r1), ap - movl 4(r1), fp - movl 12(r1), sp - jmp *8(r1) + movl 4(%ap), %r1 + movl $1, %r0 + movl (%r1), %ap + movl 4(%r1), %fp + movl 12(%r1), %sp + jmp *8(%r1) diff --git a/sys/arch/vax/stand/xxboot/Makefile b/sys/arch/vax/stand/xxboot/Makefile index e797feceb36..b1d30c3f4e8 100644 --- a/sys/arch/vax/stand/xxboot/Makefile +++ b/sys/arch/vax/stand/xxboot/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.11 2013/06/29 12:59:24 miod Exp $ +# $OpenBSD: Makefile,v 1.12 2013/07/05 21:13:07 miod Exp $ # $NetBSD: Makefile,v 1.12 2002/02/24 01:04:25 matt Exp $ S= ${.CURDIR}/../../../../ @@ -50,7 +50,7 @@ ${PROG}: ${OBJS} ${LIBSA} ${LD} -N -Ttext 100000 -o ${PROG}.out ${OBJS} ${LIBSA} /usr/bin/strip ${PROG}.out /usr/bin/size ${PROG}.out - /bin/dd if=${PROG}.out of=${PROG} bs=32 skip=1 + /usr/bin/objcopy -O binary ${PROG}.out ${PROG} clean:: rm -f a.out [Ee]rrs mklog core *.core ${PROG} ${OBJS} ${LOBJS} \ diff --git a/sys/arch/vax/stand/xxboot/bootxx.c b/sys/arch/vax/stand/xxboot/bootxx.c index fb13641dae2..702376080a0 100644 --- a/sys/arch/vax/stand/xxboot/bootxx.c +++ b/sys/arch/vax/stand/xxboot/bootxx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bootxx.c,v 1.12 2011/07/06 18:32:59 miod Exp $ */ +/* $OpenBSD: bootxx.c,v 1.13 2013/07/05 21:13:07 miod Exp $ */ /* $NetBSD: bootxx.c,v 1.16 2002/03/29 05:45:08 matt Exp $ */ /*- @@ -32,29 +32,29 @@ * @(#)boot.c 7.15 (Berkeley) 5/4/91 */ -#include "sys/param.h" -#include "sys/reboot.h" -#include "sys/disklabel.h" -#include "sys/exec.h" -#include "sys/exec_elf.h" +#include <sys/param.h> +#include <sys/reboot.h> +#include <sys/disklabel.h> +#include <sys/exec.h> +#include <sys/exec_elf.h> -#include "lib/libsa/stand.h" -#include "lib/libsa/ufs.h" -#include "lib/libsa/cd9660.h" +#include <lib/libsa/stand.h> +#include <lib/libsa/ufs.h> +#include <lib/libsa/cd9660.h> -#include "machine/pte.h" -#include "machine/sid.h" -#include "machine/mtpr.h" -#include "machine/reg.h" -#include "machine/rpb.h" -#include "../vax/gencons.h" +#include <machine/pte.h> +#include <machine/sid.h> +#include <machine/mtpr.h> +#include <machine/reg.h> +#include <machine/rpb.h> +#include <arch/vax/vax/gencons.h> #define NRSP 1 /* Kludge */ #define NCMD 1 /* Kludge */ #define LIBSA_TOO_OLD -#include "arch/vax/mscp/mscp.h" -#include "arch/vax/mscp/mscpreg.h" +#include <arch/vax/mscp/mscp.h> +#include <arch/vax/mscp/mscpreg.h> #include "../boot/data.h" @@ -125,7 +125,7 @@ Xmain(void) if (io < 0) io = open("/boot", 0); if (io < 0) - asm("movl $0xbeef1, r0; halt"); + asm("movl $0xbeef1, %r0; halt"); read(io, (void *)&hdr.aout, sizeof(hdr.aout)); if (N_GETMAGIC(hdr.aout) == OMAGIC && N_GETMID(hdr.aout) == MID_VAX) { @@ -168,7 +168,7 @@ Xmain(void) } hoppabort(entry); die: - asm("movl $0xbeef2, r0; halt"); + asm("movl $0xbeef2, %r0; halt"); } /* diff --git a/sys/arch/vax/stand/xxboot/start.S b/sys/arch/vax/stand/xxboot/start.S index 6d8347e0d19..0c0620d4256 100644 --- a/sys/arch/vax/stand/xxboot/start.S +++ b/sys/arch/vax/stand/xxboot/start.S @@ -1,4 +1,4 @@ -/* $OpenBSD: start.S,v 1.4 2011/09/29 18:02:41 miod Exp $ */ +/* $OpenBSD: start.S,v 1.5 2013/07/05 21:13:07 miod Exp $ */ /* $NetBSD: start.S,v 1.1 2002/02/24 01:04:26 matt Exp $ */ /* * Copyright (c) 1995 Ludd, University of Lule}, Sweden. @@ -87,15 +87,15 @@ start_vmb: /* * Read in block 1-15. */ - movl 52(r11), r7 # load iovec/bqo into %r7 - addl3 (r7), r7, r6 # load qio into %r6 - pushl r11 # base of rpb + movl 52(%r11), %r7 # load iovec/bqo into %r7 + addl3 (%r7), %r7, %r6 # load qio into %r6 + pushl %r11 # base of rpb pushl $0 # virtual-flag pushl $33 # read-logical-block pushl $1 # lbn to start reading pushl $7680 # number of bytes to read pushab start_uvax # buffer-address - calls $6, (r6) # call the qio-routine + calls $6, (%r6) # call the qio-routine brw start_uvax /* @@ -124,7 +124,7 @@ start_vmb: .long (SISIZE + SILOAD + SIOFF) # sum of previous 3 - .align 2 + .p2align 2 .globl _C_LABEL(from) _C_LABEL(from): .long 0 @@ -144,22 +144,22 @@ start_uvax: * to RELOC and loads boot. */ start_all: - movl $_C_LABEL(start), sp # move stack to a better + movl $_C_LABEL(start), %sp # move stack to a better pushr $0x1fff # save all regs, used later. - subl3 $_C_LABEL(start), $_C_LABEL(edata), r0 + subl3 $_C_LABEL(start), $_C_LABEL(edata), %r0 # get size of text+data (w/o bss) - moval _C_LABEL(start), r1 # get actual base-address of code - subl3 $_C_LABEL(start), $_C_LABEL(end), r2 + moval _C_LABEL(start), %r1 # get actual base-address of code + subl3 $_C_LABEL(start), $_C_LABEL(end), %r2 # get complete size (incl. bss) - movl $_C_LABEL(start), r3 # get relocated base-address of code - movc5 r0, (r1), $0, r2, (r3) # copy code to new location + movl $_C_LABEL(start), %r3 # get relocated base-address of code + movc5 %r0, (%r1), $0, %r2, (%r3) # copy code to new location - movpsl -(sp) - movl $relocated, -(sp) # return-address on top of stack + movpsl -(%sp) + movl $relocated, -(%sp) # return-address on top of stack rei # can be replaced with new address relocated: # now relocation is done !!! - movl sp, _C_LABEL(bootregs) + movl %sp, _C_LABEL(bootregs) calls $0, _C_LABEL(Xmain) # call Xmain (gcc workaround)which is halt # not intended to return ... @@ -167,22 +167,22 @@ relocated: # now relocation is done !!! * hoppabort() is called when jumping to the newly loaded program. */ ENTRY(hoppabort, 0) - movl 4(ap),r6 - movl _C_LABEL(rpb),r11 - mnegl $1,ap # Hack to figure out boot device. - movpsl -(sp) - pushab 2(r6) + movl 4(%ap),%r6 + movl _C_LABEL(rpb),%r11 + mnegl $1,%ap # Hack to figure out boot device. + movpsl -(%sp) + pushab 2(%r6) mnegl $1,_C_LABEL(vax_load_failure) rei -# calls $0,(r6) +# calls $0,(%r6) halt ENTRY(unit_init, R6|R7|R8|R9|R10|R11) - mfpr $17,r7 # Wanted bu KDB - movl 4(ap),r0 # init routine address - movl 8(ap),r9 # RPB in %r9 - movl 12(ap),r1 # VMB argument list - callg (r1),(r0) + mfpr $17,%r7 # Wanted bu KDB + movl 4(%ap),%r0 # init routine address + movl 8(%ap),%r9 # RPB in %r9 + movl 12(%ap),%r1 # VMB argument list + callg (%r1),(%r0) ret # A bunch of functions unwanted in boot blocks. |