Make this play with gcc 3.3. Add -ffreestanding. Cleanup bootxx.
This commit is contained in:
parent
a94f9407dc
commit
a391bf2e06
|
@ -1,10 +1,10 @@
|
||||||
# $NetBSD: Makefile,v 1.8 2003/02/03 23:35:39 matt Exp $
|
# $NetBSD: Makefile,v 1.9 2003/02/28 05:24:56 matt Exp $
|
||||||
|
|
||||||
PROG= bootxx
|
PROG= bootxx
|
||||||
NOMAN= # defined
|
NOMAN= # defined
|
||||||
BINMODE= 444
|
BINMODE= 444
|
||||||
|
|
||||||
CFLAGS= -Os -mmultiple -Wall -msoft-float
|
CFLAGS= -Os -mmultiple -Wall -msoft-float -ffreestanding
|
||||||
CPPFLAGS+= -D_STANDALONE -DPPC_OEA
|
CPPFLAGS+= -D_STANDALONE -DPPC_OEA
|
||||||
STRIPFLAG=
|
STRIPFLAG=
|
||||||
LINKFLAGS= -x -N -Ttext 4000 -e _start
|
LINKFLAGS= -x -N -Ttext 4000 -e _start
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: bootxx.c,v 1.10 2002/10/31 21:31:08 matt Exp $ */
|
/* $NetBSD: bootxx.c,v 1.11 2003/02/28 05:24:56 matt Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
|
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
|
||||||
|
@ -231,7 +231,7 @@ OF_seek(handle, pos)
|
||||||
static __inline int
|
static __inline int
|
||||||
OF_write(handle, addr, len)
|
OF_write(handle, addr, len)
|
||||||
int handle;
|
int handle;
|
||||||
void *addr;
|
const void *addr;
|
||||||
int len;
|
int len;
|
||||||
{
|
{
|
||||||
static struct {
|
static struct {
|
||||||
|
@ -239,7 +239,7 @@ OF_write(handle, addr, len)
|
||||||
int nargs;
|
int nargs;
|
||||||
int nreturns;
|
int nreturns;
|
||||||
int ihandle;
|
int ihandle;
|
||||||
void *addr;
|
const void *addr;
|
||||||
int len;
|
int len;
|
||||||
int actual;
|
int actual;
|
||||||
} args = {
|
} args = {
|
||||||
|
@ -273,7 +273,8 @@ startup(arg1, arg2, openfirm)
|
||||||
int arg1, arg2;
|
int arg1, arg2;
|
||||||
void *openfirm;
|
void *openfirm;
|
||||||
{
|
{
|
||||||
int fd, blk, chosen, options, i;
|
int fd, blk, chosen, options, j;
|
||||||
|
size_t i;
|
||||||
char *addr;
|
char *addr;
|
||||||
char bootpath[128];
|
char bootpath[128];
|
||||||
|
|
||||||
|
@ -307,10 +308,10 @@ startup(arg1, arg2, openfirm)
|
||||||
|
|
||||||
addr = (char *)entry_point;
|
addr = (char *)entry_point;
|
||||||
putstr("\r\nread stage 2 blocks: ");
|
putstr("\r\nread stage 2 blocks: ");
|
||||||
for (i = 0; i < bbinfo.bbi_block_count; i++) {
|
for (j = 0; j < bbinfo.bbi_block_count; j++) {
|
||||||
if ((blk = bbinfo.bbi_block_table[i]) == 0)
|
if ((blk = bbinfo.bbi_block_table[j]) == 0)
|
||||||
break;
|
break;
|
||||||
putc('0' + i % 10);
|
putc('0' + j % 10);
|
||||||
OF_seek(fd, (u_quad_t)blk * 512);
|
OF_seek(fd, (u_quad_t)blk * 512);
|
||||||
OF_read(fd, addr, bbinfo.bbi_block_size);
|
OF_read(fd, addr, bbinfo.bbi_block_size);
|
||||||
addr += bbinfo.bbi_block_size;
|
addr += bbinfo.bbi_block_size;
|
||||||
|
@ -320,14 +321,14 @@ startup(arg1, arg2, openfirm)
|
||||||
/*
|
/*
|
||||||
* enable D/I cache
|
* enable D/I cache
|
||||||
*/
|
*/
|
||||||
asm("
|
asm(
|
||||||
mtdbatu 3,%0
|
"mtdbatu 3,%0\n\t"
|
||||||
mtdbatl 3,%1
|
"mtdbatl 3,%1\n\t"
|
||||||
mtibatu 3,%0
|
"mtibatu 3,%0\n\t"
|
||||||
mtibatl 3,%1
|
"mtibatl 3,%1\n\t"
|
||||||
isync
|
"isync"
|
||||||
" :: "r"(BATU(0, BAT_BL_256M, BAT_Vs)),
|
:: "r"(BATU(0, BAT_BL_256M, BAT_Vs)),
|
||||||
"r"(BATL(0, 0, BAT_PP_RW)));
|
"r"(BATL(0, 0, BAT_PP_RW)));
|
||||||
|
|
||||||
entry_point(0, 0, openfirm);
|
entry_point(0, 0, openfirm);
|
||||||
for (;;); /* just in case */
|
for (;;); /* just in case */
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# $NetBSD: Makefile,v 1.36 2002/12/09 16:30:40 thorpej Exp $
|
# $NetBSD: Makefile,v 1.37 2003/02/28 05:24:57 matt Exp $
|
||||||
|
|
||||||
S= ${.CURDIR}/../../../..
|
S= ${.CURDIR}/../../../..
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ FILES= ${PROG}.elf ${PROG}.xcf
|
||||||
SRCS= Locore.c ofdev.c hfs.c net.c netif_of.c alloc.c vers.c
|
SRCS= Locore.c ofdev.c hfs.c net.c netif_of.c alloc.c vers.c
|
||||||
XCOFFXTRA= Xcoffxtra.c
|
XCOFFXTRA= Xcoffxtra.c
|
||||||
XCOFFXTRAOBJ= Xcoffxtra.o
|
XCOFFXTRAOBJ= Xcoffxtra.o
|
||||||
CFLAGS+= -Wno-main -msoft-float -mmultiple
|
CFLAGS+= -Wno-main -msoft-float -mmultiple -ffreestanding
|
||||||
#CPPFLAGS+= -DDEBUG -DNETIF_DEBUG
|
#CPPFLAGS+= -DDEBUG -DNETIF_DEBUG
|
||||||
CPPFLAGS+= -D_STANDALONE -DSUPPORT_DHCP
|
CPPFLAGS+= -D_STANDALONE -DSUPPORT_DHCP
|
||||||
CPPFLAGS+= -DSUPPORT_USTARFS -DHAVE_CHANGEDISK_HOOK
|
CPPFLAGS+= -DSUPPORT_USTARFS -DHAVE_CHANGEDISK_HOOK
|
||||||
|
|
Loading…
Reference in New Issue