diff options
author | dim <dim@FreeBSD.org> | 2011-02-15 20:18:52 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2011-02-15 20:18:52 +0000 |
commit | f94cf905fb258e0de23e22179042ea6c7ab028a7 (patch) | |
tree | 37d9c6ad8b2d3269033675c39ec26971fb6e358f /sys | |
parent | fd358eea37448bed8de4728001309e0b63427039 (diff) | |
download | FreeBSD-src-f94cf905fb258e0de23e22179042ea6c7ab028a7.zip FreeBSD-src-f94cf905fb258e0de23e22179042ea6c7ab028a7.tar.gz |
Apply a few small optimizations to boot2's code, to make it shrink a
little further. This gets us further on the way to be able to build it
successfully with clang. Using in-tree gcc, this shrinks boot2.bin with
60 bytes, the in-tree clang shaves off 72 bytes, and ToT clang 84 bytes.
Submitted by: rdivacky
Reviewed by: imp
Diffstat (limited to 'sys')
-rw-r--r-- | sys/boot/common/ufsread.c | 2 | ||||
-rw-r--r-- | sys/boot/i386/boot2/boot2.c | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/sys/boot/common/ufsread.c b/sys/boot/common/ufsread.c index 5d0e8af..68fdec9 100644 --- a/sys/boot/common/ufsread.c +++ b/sys/boot/common/ufsread.c @@ -122,7 +122,7 @@ lookup(const char *path) const char *s; ino_t ino; ssize_t n; - int dt; + u_int8_t dt; ino = ROOTINO; dt = DT_DIR; diff --git a/sys/boot/i386/boot2/boot2.c b/sys/boot/i386/boot2/boot2.c index 307d4c5..9e1b617 100644 --- a/sys/boot/i386/boot2/boot2.c +++ b/sys/boot/i386/boot2/boot2.c @@ -132,7 +132,7 @@ static struct dsk { } dsk; static char cmd[512], cmddup[512]; static char kname[1024]; -static uint32_t opts; +static uint16_t opts; static int comspeed = SIOSPD; static struct bootinfo bootinfo; static uint8_t ioctrl = IO_KEYBOARD; @@ -233,7 +233,7 @@ putc(int c) int main(void) { - int autoboot; + uint8_t autoboot; ino_t ino; dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); @@ -320,7 +320,8 @@ load(void) caddr_t p; ino_t ino; uint32_t addr, x; - int fmt, i, j; + int i, j; + uint8_t fmt; if (!(ino = lookup(kname))) { if (!ls) |