svn commit: r224405 - in stable/7/sys/boot: common i386/boot2

Marius Strobl marius at FreeBSD.org
Mon Jul 25 21:41:46 UTC 2011


Author: marius
Date: Mon Jul 25 21:41:46 2011
New Revision: 224405
URL: http://svn.freebsd.org/changeset/base/224405

Log:
  MFC: r218713, r218716
  
  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

Modified:
  stable/7/sys/boot/common/ufsread.c
  stable/7/sys/boot/i386/boot2/boot2.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/boot/common/ufsread.c
==============================================================================
--- stable/7/sys/boot/common/ufsread.c	Mon Jul 25 21:39:09 2011	(r224404)
+++ stable/7/sys/boot/common/ufsread.c	Mon Jul 25 21:41:46 2011	(r224405)
@@ -122,7 +122,7 @@ lookup(const char *path)
 	const char *s;
 	ino_t ino;
 	ssize_t n;
-	int dt;
+	uint8_t dt;
 
 	ino = ROOTINO;
 	dt = DT_DIR;

Modified: stable/7/sys/boot/i386/boot2/boot2.c
==============================================================================
--- stable/7/sys/boot/i386/boot2/boot2.c	Mon Jul 25 21:39:09 2011	(r224404)
+++ stable/7/sys/boot/i386/boot2/boot2.c	Mon Jul 25 21:41:46 2011	(r224405)
@@ -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)


More information about the svn-src-stable-7 mailing list