svn commit: r238097 - user/ae/bootcode/sys/boot/uboot/lib

Andrey V. Elsukov ae at FreeBSD.org
Wed Jul 4 12:54:57 UTC 2012


Author: ae
Date: Wed Jul  4 12:54:56 2012
New Revision: 238097
URL: http://svn.freebsd.org/changeset/base/238097

Log:
  Don't build storage.c if LOADER_NO_DISK_SUPPORT is defined.
  Also hide disk_xxx calls under ifdefs.

Modified:
  user/ae/bootcode/sys/boot/uboot/lib/Makefile
  user/ae/bootcode/sys/boot/uboot/lib/devicename.c

Modified: user/ae/bootcode/sys/boot/uboot/lib/Makefile
==============================================================================
--- user/ae/bootcode/sys/boot/uboot/lib/Makefile	Wed Jul  4 12:04:50 2012	(r238096)
+++ user/ae/bootcode/sys/boot/uboot/lib/Makefile	Wed Jul  4 12:54:56 2012	(r238097)
@@ -7,7 +7,7 @@ INTERNALLIB=
 WARNS?=		2
 
 SRCS=	crc32.c console.c copy.c devicename.c elf_freebsd.c glue.c
-SRCS+=	module.c net.c reboot.c storage.c time.c
+SRCS+=	module.c net.c reboot.c time.c
 
 CFLAGS+=	-ffreestanding -msoft-float
 
@@ -19,6 +19,11 @@ CFLAGS+=	-I${.CURDIR}/../../../../sys/co
 # Pick up the bootstrap header for some interface items
 CFLAGS+=	-I${.CURDIR}/../../common -I${.CURDIR}/../../.. -I.
 
+.if !defined(LOADER_NO_DISK_SUPPORT)
+SRCS+=	storage.c
+CFLAGS+= -DLOADER_DISK_SUPPORT
+.endif
+
 .ifdef(BOOT_DISK_DEBUG)
 # Make the disk code more talkative
 CFLAGS+= -DDISK_DEBUG

Modified: user/ae/bootcode/sys/boot/uboot/lib/devicename.c
==============================================================================
--- user/ae/bootcode/sys/boot/uboot/lib/devicename.c	Wed Jul  4 12:04:50 2012	(r238096)
+++ user/ae/bootcode/sys/boot/uboot/lib/devicename.c	Wed Jul  4 12:54:56 2012	(r238097)
@@ -113,11 +113,13 @@ uboot_parsedev(struct uboot_devdesc **de
 	case DEVT_NONE:
 		break;
 
+#ifdef LOADER_DISK_SUPPORT
 	case DEVT_DISK:
 		err = disk_parsedev((struct disk_devdesc *)idev, np, path);
 		if (err != 0)
 			goto fail;
 		break;
+#endif
 
 	case DEVT_NET:
 		unit = 0;
@@ -171,7 +173,9 @@ uboot_fmtdev(void *vdev)
 		break;
 
 	case DEVT_DISK:
+#ifdef LOADER_DISK_SUPPORT
 		return (disk_fmtdev(vdev));
+#endif
 
 	case DEVT_NET:
 		sprintf(buf, "%s%d:", dev->d_dev->dv_name, dev->d_unit);


More information about the svn-src-user mailing list