diff options
author | tmm <tmm@FreeBSD.org> | 2002-04-02 17:08:37 +0000 |
---|---|---|
committer | tmm <tmm@FreeBSD.org> | 2002-04-02 17:08:37 +0000 |
commit | 2025cfe33a35d796a177e3f93852b49106277093 (patch) | |
tree | 6ffaab462e6581998e670bb71d265f8cf8b3bac4 /sys/boot/sparc64 | |
parent | 77dc513737a6b44f27588d8bf80ff46b0d70a7c6 (diff) | |
download | FreeBSD-src-2025cfe33a35d796a177e3f93852b49106277093.zip FreeBSD-src-2025cfe33a35d796a177e3f93852b49106277093.tar.gz |
1.) Rename locore.s to locore.S (by repocopy), to be able to remove
special-case make rule
2.) Cleanups, remove superfluous expicit rules, add -nostdlib to LDFLAGS,
remove -X and -g, remove -g from CFLAGS
3.) Add BINDIR
4.) Build install the loader help file, add an empty help.sparc64
5.) Change the default configuration to only support booting from disk
6.) Get libofw.a from a path relative ${.OBJDIR}, not ${.CURDIR}
Submitted by: jake (1 - 5), obrien (6)
Diffstat (limited to 'sys/boot/sparc64')
-rw-r--r-- | sys/boot/sparc64/loader/Makefile | 47 | ||||
-rw-r--r-- | sys/boot/sparc64/loader/help.sparc64 | 0 | ||||
-rw-r--r-- | sys/boot/sparc64/loader/locore.s | 118 |
3 files changed, 21 insertions, 144 deletions
diff --git a/sys/boot/sparc64/loader/Makefile b/sys/boot/sparc64/loader/Makefile index 0fda8d4..83076be 100644 --- a/sys/boot/sparc64/loader/Makefile +++ b/sys/boot/sparc64/loader/Makefile @@ -3,15 +3,17 @@ BASE= loader PROG= ${BASE} NEWVERSWHAT= "bootstrap loader" sparc64 +BINDIR?= /boot +INSTALLFLAGS= -b CFLAGS= -mno-app-regs -LOADER_DISK_SUPPORT?= no -LOADER_UFS_SUPPORT?= no +LOADER_DISK_SUPPORT?= yes +LOADER_UFS_SUPPORT?= yes LOADER_CD9660_SUPPORT?= no -LOADER_NET_SUPPORT?= yes -LOADER_NFS_SUPPORT?= yes -LOADER_TFTP_SUPPORT?= yes +LOADER_NET_SUPPORT?= no +LOADER_NFS_SUPPORT?= no +LOADER_TFTP_SUPPORT?= no .if ${LOADER_DISK_SUPPORT} == "yes" CFLAGS+= -DLOADER_DISK_SUPPORT @@ -33,7 +35,7 @@ CFLAGS+= -DLOADER_TFTP_SUPPORT .endif # Architecture-specific loader code -SRCS= locore.s main.c metadata.c +SRCS= locore.S main.c metadata.c # Always add MI sources .PATH: ${.CURDIR}/../../common @@ -41,10 +43,11 @@ SRCS= locore.s main.c metadata.c CFLAGS+= -I${.CURDIR}/../../common CFLAGS+= -I${.CURDIR}/../../.. -I. -CLEANFILES+= ${PROG} +CLEANFILES+= ${PROG}.help CFLAGS+= -W -Wall -ffreestanding -LDFLAGS= -X -static +LDFLAGS= -nostdlib -static +LDADD= ${LIBSTAND} ${LIBOFW} # where to get libstand from #XXX need a better way to do this @@ -55,33 +58,25 @@ LIBSTAND= ${.OBJDIR}/../../../../lib/libstand/libstand.a LIBSTAND= -lstand .endif .endif -LIBOFW= ${.CURDIR}/../../ofw/libofw/libofw.a +LIBOFW= ${.OBJDIR}/../../ofw/libofw/libofw.a CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ CFLAGS+= -I${.CURDIR}/../../ofw/libofw/ -# Debug me! -#CFLAGS+= -g -#LDFLAGS+= -g +${BASE}.help: help.common help.sparc64 + cat ${.ALLSRC} | \ + awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET} -${PROG}: ${OBJS} - ${LD} -o ${.TARGET} ${OBJS} ${LIBOFW} ${LIBSTAND} ${LDFLAGS} - -locore.o: locore.s - ${CC} ${CFLAGS} -D_LOCORE -xassembler-with-cpp -c locore.s -o locore.o -main.o: main.c - ${CC} ${CFLAGS} -c main.c -o main.o - -beforeinstall: +beforeinstall: ${PROG}.help .if exists(${DESTDIR}/boot/loader) mv ${DESTDIR}/boot/loader ${DESTDIR}/boot/loader.old .endif -.if exists(${.OBJDIR}/loader.help) +#.if exists(${.OBJDIR}/loader.help) ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \ ${.OBJDIR}/${BASE}.help ${DESTDIR}/boot -.else - ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \ - ${.CURDIR}/${BASE}.help ${DESTDIR}/boot -.endif +#.else +# ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \ +# ${.CURDIR}/${BASE}.help ${DESTDIR}/boot +#.endif .if !exists(${DESTDIR}/boot/loader.rc) ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \ ${.CURDIR}/../../forth/loader.rc ${DESTDIR}/boot diff --git a/sys/boot/sparc64/loader/help.sparc64 b/sys/boot/sparc64/loader/help.sparc64 new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/sys/boot/sparc64/loader/help.sparc64 diff --git a/sys/boot/sparc64/loader/locore.s b/sys/boot/sparc64/loader/locore.s deleted file mode 100644 index 920171a..0000000 --- a/sys/boot/sparc64/loader/locore.s +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Initial implementation: - * Copyright (c) 2001 Robert Drehmel - * All rights reserved. - * - * As long as the above copyright statement and this notice remain - * unchanged, you can do what ever you want with this file. - * - * $FreeBSD$ - */ - -#define LOCORE - -#include <machine/asi.h> -#include <machine/asm.h> -#include <machine/pstate.h> -#include <machine/smp.h> -#include <machine/upa.h> - -#define PAGE_SIZE 8192 -#define PAGE_SHIFT 13 - -#define SPOFF 2047 -#define STACK_SIZE (2 * PAGE_SIZE) - -ENTRY(_start) - /* limit interrupts */ - wrpr %g0, 13, %pil - - /* - * PSTATE: privileged, interrupts enabled, floating point - * unit enabled - */ - wrpr %g0, PSTATE_PRIV|PSTATE_IE|PSTATE_PEF, %pstate - wr %g0, 0x4, %fprs - - setx stack + STACK_SIZE - SPOFF - CCFSZ, %l7, %l6 - mov %l6, %sp - call main - mov %o4, %o0 - sir - -/* - * %o0 input VA constant - * %o1 current iTLB offset - * %o2 current iTLB TTE tag - */ -ENTRY(itlb_va_to_pa) - clr %o1 -0: ldxa [%o1] ASI_ITLB_TAG_READ_REG, %o2 - cmp %o2, %o0 - bne,a %xcc, 1f - nop - /* return PA of matching entry */ - ldxa [%o1] ASI_ITLB_DATA_ACCESS_REG, %o0 - sllx %o0, 23, %o0 - srlx %o0, PAGE_SHIFT+23, %o0 - sllx %o0, PAGE_SHIFT, %o0 - retl - mov %o0, %o1 -1: cmp %o1, 63<<3 - blu %xcc, 0b - add %o1, 8, %o1 - clr %o0 - retl - not %o0 - -ENTRY(dtlb_va_to_pa) - clr %o1 -0: ldxa [%o1] ASI_DTLB_TAG_READ_REG, %o2 - cmp %o2, %o0 - bne,a %xcc, 1f - nop - /* return PA of matching entry */ - ldxa [%o1] ASI_DTLB_DATA_ACCESS_REG, %o0 - sllx %o0, 23, %o0 - srlx %o0, PAGE_SHIFT+23, %o0 - sllx %o0, PAGE_SHIFT, %o0 - retl - mov %o0, %o1 -1: cmp %o1, 63<<3 - blu %xcc, 0b - add %o1, 8, %o1 - clr %o0 - retl - not %o0 - -/* - * %o0 = slot number - * %o1 = vpn - * %o2 = tte data - */ -ENTRY(itlb_enter) - rdpr %pstate, %o4 - wrpr %o4, PSTATE_IE, %pstate - sllx %o0, 3, %o0 - sllx %o1, PAGE_SHIFT, %o1 - mov AA_IMMU_TAR, %o3 - stxa %o1, [%o3] ASI_IMMU - stxa %o2, [%o0] ASI_ITLB_DATA_ACCESS_REG - membar #Sync - retl - wrpr %o4, 0, %pstate - -ENTRY(dtlb_enter) - rdpr %pstate, %o4 - wrpr %o4, PSTATE_IE, %pstate - sllx %o0, 3, %o0 - sllx %o1, PAGE_SHIFT, %o1 - mov AA_DMMU_TAR, %o3 - stxa %o1, [%o3] ASI_DMMU - stxa %o2, [%o0] ASI_DTLB_DATA_ACCESS_REG - membar #Sync - retl - wrpr %o4, 0, %pstate - - .comm stack, STACK_SIZE, 32 - .comm smp_stack, STACK_SIZE, 32 |