diff --git a/sys/arch/macppc/stand/ofwboot/Makefile b/sys/arch/macppc/stand/ofwboot/Makefile index af49707b0817..2b6a545b8ca1 100644 --- a/sys/arch/macppc/stand/ofwboot/Makefile +++ b/sys/arch/macppc/stand/ofwboot/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.46 2008/05/22 19:49:43 hauke Exp $ +# $NetBSD: Makefile,v 1.47 2009/01/12 07:05:22 tsutsui Exp $ S= ${.CURDIR}/../../../.. @@ -7,7 +7,8 @@ FILES= ${PROG}.elf ${PROG}.xcf SRCS= Locore.c boot.c ofdev.c hfs.c net.c netif_of.c alloc.c vers.c XCOFFXTRA= Xcoffxtra.c XCOFFXTRAOBJ= Xcoffxtra.o -CFLAGS+= -Wno-main -msoft-float -mmultiple -ffreestanding +CFLAGS+= -msoft-float -mmultiple -ffreestanding +CFLAGS+= -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith #CPPFLAGS+= -DDEBUG -DNETIF_DEBUG CPPFLAGS+= -D_STANDALONE -DSUPPORT_DHCP CPPFLAGS+= -DSUPPORT_USTARFS -DHAVE_CHANGEDISK_HOOK diff --git a/sys/arch/macppc/stand/ofwboot/boot.h b/sys/arch/macppc/stand/ofwboot/boot.h index cd126715832a..fa422d7660b2 100644 --- a/sys/arch/macppc/stand/ofwboot/boot.h +++ b/sys/arch/macppc/stand/ofwboot/boot.h @@ -13,4 +13,6 @@ struct open_file; void changedisk_hook(struct open_file *of); #endif +void freeall(void); + #endif /* BOOT_H_ */ diff --git a/sys/arch/macppc/stand/ofwboot/netif_of.c b/sys/arch/macppc/stand/ofwboot/netif_of.c index 1bcd78696cb4..22d34db2b100 100644 --- a/sys/arch/macppc/stand/ofwboot/netif_of.c +++ b/sys/arch/macppc/stand/ofwboot/netif_of.c @@ -1,4 +1,4 @@ -/* $NetBSD: netif_of.c,v 1.11 2006/01/27 04:01:04 uwe Exp $ */ +/* $NetBSD: netif_of.c,v 1.12 2009/01/12 07:05:22 tsutsui Exp $ */ /* * Copyright (C) 1995 Wolfgang Solfrank. @@ -70,6 +70,7 @@ int netif_of_open(struct of_dev *op) { struct iodesc *io; + int rv; #ifdef NETIF_DEBUG printf("netif_open..."); @@ -88,10 +89,11 @@ netif_of_open(struct of_dev *op) io->io_netif = (void *)op; /* Put our ethernet address in io->myea */ - OF_getprop(OF_instance_to_package(op->handle), - "local-mac-address", io->myea, sizeof io->myea) == -1 && - OF_getprop(OF_instance_to_package(op->handle), - "mac-address", io->myea, sizeof io->myea); + rv = OF_getprop(OF_instance_to_package(op->handle), + "local-mac-address", io->myea, sizeof io->myea); + if (rv == -1) + OF_getprop(OF_instance_to_package(op->handle), + "mac-address", io->myea, sizeof io->myea); #ifdef NETIF_DEBUG printf("OK\n"); diff --git a/sys/arch/macppc/stand/ofwboot/ofdev.c b/sys/arch/macppc/stand/ofwboot/ofdev.c index b0df2f4b868e..2888874a1f98 100644 --- a/sys/arch/macppc/stand/ofwboot/ofdev.c +++ b/sys/arch/macppc/stand/ofwboot/ofdev.c @@ -1,4 +1,4 @@ -/* $NetBSD: ofdev.c,v 1.20 2008/05/22 19:49:43 hauke Exp $ */ +/* $NetBSD: ofdev.c,v 1.21 2009/01/12 07:05:22 tsutsui Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -189,7 +189,7 @@ get_long(const void *p) * Find a valid disklabel. */ static int -search_label(struct of_dev *devp, u_long off, u_char *buf, struct disklabel *lp, +search_label(struct of_dev *devp, u_long off, char *buf, struct disklabel *lp, u_long off0) { size_t nread;