From owner-svn-src-all@FreeBSD.ORG Mon Jul 25 21:44:36 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 309771065670; Mon, 25 Jul 2011 21:44:36 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 062758FC12; Mon, 25 Jul 2011 21:44:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6PLiZAH078325; Mon, 25 Jul 2011 21:44:35 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6PLiZYx078322; Mon, 25 Jul 2011 21:44:35 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107252144.p6PLiZYx078322@svn.freebsd.org> From: Marius Strobl Date: Mon, 25 Jul 2011 21:44:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224406 - in stable/8/sys/boot: common i386/boot2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2011 21:44:36 -0000 Author: marius Date: Mon Jul 25 21:44:35 2011 New Revision: 224406 URL: http://svn.freebsd.org/changeset/base/224406 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/8/sys/boot/common/ufsread.c stable/8/sys/boot/i386/boot2/boot2.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/geom/label/ (props changed) Modified: stable/8/sys/boot/common/ufsread.c ============================================================================== --- stable/8/sys/boot/common/ufsread.c Mon Jul 25 21:41:46 2011 (r224405) +++ stable/8/sys/boot/common/ufsread.c Mon Jul 25 21:44:35 2011 (r224406) @@ -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/8/sys/boot/i386/boot2/boot2.c ============================================================================== --- stable/8/sys/boot/i386/boot2/boot2.c Mon Jul 25 21:41:46 2011 (r224405) +++ stable/8/sys/boot/i386/boot2/boot2.c Mon Jul 25 21:44:35 2011 (r224406) @@ -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)