diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2011-09-29 18:02:42 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2011-09-29 18:02:42 +0000 |
commit | 0e328f183e606cb69d230296096c3d594b6849c1 (patch) | |
tree | 29cc1b18d0d059f71382fe7a333b24cbf1186930 /sys | |
parent | c4ad09d10b9bdbdd80e929e4eda28aed10ce9aad (diff) |
Get size of struct disklabel for the sake of the assembly code with a
genassym script, instead of relying upon <sys/disklabel.h> to provide them
as proper .set statements if _LOCORE is defined.
Requested by weingart@ long ago; ok jsing@ krw@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/vax/stand/xxboot/Makefile | 10 | ||||
-rw-r--r-- | sys/arch/vax/stand/xxboot/genassym.cf | 21 | ||||
-rw-r--r-- | sys/arch/vax/stand/xxboot/start.S | 10 |
3 files changed, 33 insertions, 8 deletions
diff --git a/sys/arch/vax/stand/xxboot/Makefile b/sys/arch/vax/stand/xxboot/Makefile index 4b3a10f5b4a..33b400b52cb 100644 --- a/sys/arch/vax/stand/xxboot/Makefile +++ b/sys/arch/vax/stand/xxboot/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.8 2011/07/06 18:32:59 miod Exp $ +# $OpenBSD: Makefile,v 1.9 2011/09/29 18:02:41 miod Exp $ # $NetBSD: Makefile,v 1.12 2002/02/24 01:04:25 matt Exp $ S= ${.CURDIR}/../../../../ @@ -35,9 +35,15 @@ machine-links: @[ -h machine ] || ln -s ${S}/arch/${MACHINE}/include machine @[ -h ${MACHINE_ARCH} ] || ln -s ${S}/arch/${MACHINE_ARCH}/include ${MACHINE_ARCH} .NOPATH: machine ${MACHINE_ARCH} -CLEANFILES+= machine ${MACHINE_ARCH} ${PROG}.out +CLEANFILES+= machine ${MACHINE_ARCH} ${PROG}.out assym.h .endif +start.o: assym.h + +assym.h: $S/kern/genassym.sh Makefile ${.CURDIR}/genassym.cf + sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} \ + < ${.CURDIR}/genassym.cf | sort -u > assym.h + ${PROG}: ${OBJS} ${LIBSA} ${LD} -N -Ttext 100000 -o ${PROG}.out ${OBJS} ${LIBSA} /usr/bin/strip ${PROG}.out diff --git a/sys/arch/vax/stand/xxboot/genassym.cf b/sys/arch/vax/stand/xxboot/genassym.cf new file mode 100644 index 00000000000..da511b58c0d --- /dev/null +++ b/sys/arch/vax/stand/xxboot/genassym.cf @@ -0,0 +1,21 @@ +# $OpenBSD: genassym.cf,v 1.1 2011/09/29 18:02:41 miod Exp $ +# +# Copyright (c) 2011 Miodrag Vallat. +# +# Permission to use, copy, modify, and distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +include <sys/param.h> +include <sys/disklabel.h> + +struct disklabel +export LABELOFFSET diff --git a/sys/arch/vax/stand/xxboot/start.S b/sys/arch/vax/stand/xxboot/start.S index df019026dc9..6d8347e0d19 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.3 2011/07/06 18:32:59 miod Exp $ */ +/* $OpenBSD: start.S,v 1.4 2011/09/29 18:02:41 miod Exp $ */ /* $NetBSD: start.S,v 1.1 2002/02/24 01:04:26 matt Exp $ */ /* * Copyright (c) 1995 Ludd, University of Lule}, Sweden. @@ -37,13 +37,11 @@ /* All bugs are subject to removal without further notice */ -#define _LOCORE - -#include "sys/disklabel.h" - #include "../include/mtpr.h" #include "../include/asm.h" +#include "assym.h" + _C_LABEL(_start): _C_LABEL(start): .globl _C_LABEL(start) # this is the symbolic name for the start @@ -84,7 +82,7 @@ from_0x08: # Any machine from VMB _C_LABEL(romlabel): .long 0 -.org LABELOFFSET + d_end_ +.org LABELOFFSET + DISKLABEL_SIZEOF start_vmb: /* * Read in block 1-15. |