summaryrefslogtreecommitdiffstats
path: root/sys/boot
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2008-12-20 01:29:19 +0000
committersam <sam@FreeBSD.org>2008-12-20 01:29:19 +0000
commitc3f1faeb23e27c2ffda030cf892c5df698734622 (patch)
tree0b964e87f3cbd93269e72d591d2eb44bc6ace51c /sys/boot
parentcd99ae6c06463359389c703ff069f25d28878ad7 (diff)
parent3fcef6d9c20b6c3577c741e4a0fe24807fd08a66 (diff)
downloadFreeBSD-src-c3f1faeb23e27c2ffda030cf892c5df698734622.zip
FreeBSD-src-c3f1faeb23e27c2ffda030cf892c5df698734622.tar.gz
MFH @ 186335
Diffstat (limited to 'sys/boot')
-rw-r--r--sys/boot/Makefile2
-rw-r--r--sys/boot/i386/gptzfsboot/Makefile2
-rw-r--r--sys/boot/i386/zfsboot/Makefile2
-rw-r--r--sys/boot/powerpc/uboot/conf.c8
-rw-r--r--sys/boot/uboot/common/main.c1
-rw-r--r--sys/boot/uboot/lib/devicename.c17
-rw-r--r--sys/boot/zfs/zfsimpl.c13
7 files changed, 21 insertions, 24 deletions
diff --git a/sys/boot/Makefile b/sys/boot/Makefile
index 27cb7e3..7020ebb 100644
--- a/sys/boot/Makefile
+++ b/sys/boot/Makefile
@@ -12,7 +12,7 @@ SUBDIR+= ficl
.endif
# Build EFI library.
-.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "ia64"
+.if ${MACHINE_ARCH} == "amd64" || ${MACHINE} == "i386" || ${MACHINE_ARCH} == "ia64"
SUBDIR+= efi
.endif
diff --git a/sys/boot/i386/gptzfsboot/Makefile b/sys/boot/i386/gptzfsboot/Makefile
index 930061f..467d312 100644
--- a/sys/boot/i386/gptzfsboot/Makefile
+++ b/sys/boot/i386/gptzfsboot/Makefile
@@ -60,7 +60,7 @@ gptzfsboot.bin: gptzfsboot.out
objcopy -S -O binary gptzfsboot.out ${.TARGET}
gptzfsboot.out: ${BTXCRT} zfsboot.o sio.o
- ${LD} ${LDFLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC}
+ ${LD} ${LDFLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSTAND}
zfsboot.o: ${.CURDIR}/../../zfs/zfsimpl.c
diff --git a/sys/boot/i386/zfsboot/Makefile b/sys/boot/i386/zfsboot/Makefile
index 41f1672..1653534 100644
--- a/sys/boot/i386/zfsboot/Makefile
+++ b/sys/boot/i386/zfsboot/Makefile
@@ -80,7 +80,7 @@ zfsboot.bin: zfsboot.out
objcopy -S -O binary zfsboot.out ${.TARGET}
zfsboot.out: ${BTXCRT} zfsboot.o sio.o
- ${LD} ${LDFLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC}
+ ${LD} ${LDFLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSTAND}
zfsboot.o: zfsboot.s
diff --git a/sys/boot/powerpc/uboot/conf.c b/sys/boot/powerpc/uboot/conf.c
index 8bc307a..5a9515a 100644
--- a/sys/boot/powerpc/uboot/conf.c
+++ b/sys/boot/powerpc/uboot/conf.c
@@ -94,8 +94,8 @@ struct netif_driver *netif_drivers[] = {
*/
struct file_format *file_formats[] = {
- &uboot_elf,
- NULL
+ &uboot_elf,
+ NULL
};
/*
@@ -104,6 +104,6 @@ struct file_format *file_formats[] = {
extern struct console uboot_console;
struct console *consoles[] = {
- &uboot_console,
- NULL
+ &uboot_console,
+ NULL
};
diff --git a/sys/boot/uboot/common/main.c b/sys/boot/uboot/common/main.c
index f7a0745..1ebb097 100644
--- a/sys/boot/uboot/common/main.c
+++ b/sys/boot/uboot/common/main.c
@@ -216,6 +216,7 @@ COMMAND_SET(reboot, "reboot", "reboot the system", command_reboot);
static int
command_reboot(int argc, char *argv[])
{
+
printf("Resetting...\n");
ub_reset();
diff --git a/sys/boot/uboot/lib/devicename.c b/sys/boot/uboot/lib/devicename.c
index 3183ae1..5d91550 100644
--- a/sys/boot/uboot/lib/devicename.c
+++ b/sys/boot/uboot/lib/devicename.c
@@ -35,7 +35,8 @@ __FBSDID("$FreeBSD$");
#include "bootstrap.h"
#include "libuboot.h"
-static int uboot_parsedev(struct uboot_devdesc **dev, const char *devspec, const char **path);
+static int uboot_parsedev(struct uboot_devdesc **dev, const char *devspec,
+ const char **path);
/*
* Point (dev) at an allocated device specifier for the device matching the
@@ -178,11 +179,11 @@ uboot_parsedev(struct uboot_devdesc **dev, const char *devspec,
} else {
*dev = idev;
}
- return(0);
+ return (0);
fail:
free(idev);
- return(err);
+ return (err);
}
@@ -191,7 +192,7 @@ uboot_fmtdev(void *vdev)
{
struct uboot_devdesc *dev = (struct uboot_devdesc *)vdev;
char *cp;
- static char buf[128]; /* XXX device length constant? */
+ static char buf[128];
switch(dev->d_type) {
case DEVT_NONE:
@@ -220,12 +221,12 @@ uboot_fmtdev(void *vdev)
int
uboot_setcurrdev(struct env_var *ev, int flags, const void *value)
{
- struct uboot_devdesc *ncurr;
- int rv;
+ struct uboot_devdesc *ncurr;
+ int rv;
if ((rv = uboot_parsedev(&ncurr, value, NULL)) != 0)
- return(rv);
+ return (rv);
free(ncurr);
env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL);
- return(0);
+ return (0);
}
diff --git a/sys/boot/zfs/zfsimpl.c b/sys/boot/zfs/zfsimpl.c
index a6dc99e..e6695cf 100644
--- a/sys/boot/zfs/zfsimpl.c
+++ b/sys/boot/zfs/zfsimpl.c
@@ -873,17 +873,12 @@ dnode_read(spa_t *spa, const dnode_phys_t *dnode, off_t offset, void *buf, size_
int i, rc;
/*
- * We truncate the offset to 32bits, mainly so that I don't
- * have to find a copy of __divdi3 to put into the bootstrap.
- * I don't think the bootstrap needs to access anything bigger
- * than 2G anyway. Note that block addresses are still 64bit
- * so it doesn't affect the possible size of the media.
- * We still use 64bit block numbers so that the bitshifts
- * work correctly. Note: bsize may not be a power of two here.
+ * Note: bsize may not be a power of two here so we need to do an
+ * actual divide rather than a bitshift.
*/
while (buflen > 0) {
- uint64_t bn = ((int) offset) / bsize;
- int boff = ((int) offset) % bsize;
+ uint64_t bn = offset / bsize;
+ int boff = offset % bsize;
int ibn;
const blkptr_t *indbp;
blkptr_t bp;
OpenPOWER on IntegriCloud