From owner-svn-src-stable-9@FreeBSD.ORG Fri Nov 23 13:35:18 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EBFB08C1; Fri, 23 Nov 2012 13:35:18 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CC50E8FC12; Fri, 23 Nov 2012 13:35:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qANDZId9022951; Fri, 23 Nov 2012 13:35:18 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qANDZIL1022945; Fri, 23 Nov 2012 13:35:18 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201211231335.qANDZIL1022945@svn.freebsd.org> From: Takahashi Yoshihiro Date: Fri, 23 Nov 2012 13:35:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r243448 - in stable/9/sys/boot/pc98: boot2 btx/btxldr btx/lib cdboot libpc98 loader X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2012 13:35:19 -0000 Author: nyan Date: Fri Nov 23 13:35:17 2012 New Revision: 243448 URL: http://svnweb.freebsd.org/changeset/base/243448 Log: MFC: r239063, r239064, r239069, r240852, r240854 - boot2: bunch of variables are turned into uint8_t. - boot2: Remove unnecessary initializations. - loader: replace ugly inb/outb re-implementations with cpufunc.h. - Reduce diffs against i386. Modified: stable/9/sys/boot/pc98/boot2/boot2.c stable/9/sys/boot/pc98/btx/btxldr/btxldr.S stable/9/sys/boot/pc98/btx/lib/btxcsu.S stable/9/sys/boot/pc98/cdboot/cdboot.S stable/9/sys/boot/pc98/libpc98/Makefile stable/9/sys/boot/pc98/loader/main.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) Modified: stable/9/sys/boot/pc98/boot2/boot2.c ============================================================================== --- stable/9/sys/boot/pc98/boot2/boot2.c Fri Nov 23 13:18:26 2012 (r243447) +++ stable/9/sys/boot/pc98/boot2/boot2.c Fri Nov 23 13:35:17 2012 (r243448) @@ -126,13 +126,13 @@ static struct dsk { unsigned unit; unsigned head; unsigned sec; - unsigned slice; - unsigned part; + uint8_t slice; + uint8_t part; unsigned start; } dsk; static char cmd[512], cmddup[512], knamebuf[1024]; -static const char *kname = NULL; -static uint32_t opts = 0; +static const char *kname; +static uint32_t opts; static int comspeed = SIOSPD; static struct bootinfo bootinfo; static uint8_t ioctrl = IO_KEYBOARD; @@ -618,7 +618,8 @@ dskread(void *buf, unsigned lba, unsigne struct pc98_partition *dp; struct disklabel *d; char *sec; - unsigned sl, i; + unsigned i; + uint8_t sl; u_char *p; if (!dsk_meta) { Modified: stable/9/sys/boot/pc98/btx/btxldr/btxldr.S ============================================================================== --- stable/9/sys/boot/pc98/btx/btxldr/btxldr.S Fri Nov 23 13:18:26 2012 (r243447) +++ stable/9/sys/boot/pc98/btx/btxldr/btxldr.S Fri Nov 23 13:35:17 2012 (r243448) @@ -15,13 +15,13 @@ * $FreeBSD$ */ +#include + /* * Prototype BTX loader program, written in a couple of hours. The * real thing should probably be more flexible, and in C. */ -#include - /* * Memory locations. */ Modified: stable/9/sys/boot/pc98/btx/lib/btxcsu.S ============================================================================== --- stable/9/sys/boot/pc98/btx/lib/btxcsu.S Fri Nov 23 13:18:26 2012 (r243447) +++ stable/9/sys/boot/pc98/btx/lib/btxcsu.S Fri Nov 23 13:35:17 2012 (r243448) @@ -15,12 +15,12 @@ # $FreeBSD$ +#include + # # BTX C startup code (ELF). # -#include - # # Globals. # Modified: stable/9/sys/boot/pc98/cdboot/cdboot.S ============================================================================== --- stable/9/sys/boot/pc98/cdboot/cdboot.S Fri Nov 23 13:18:26 2012 (r243447) +++ stable/9/sys/boot/pc98/cdboot/cdboot.S Fri Nov 23 13:35:17 2012 (r243448) @@ -30,14 +30,14 @@ # $FreeBSD$ -#include - # # Basically, we first create a set of boot arguments to pass to the loaded # binary. Then we attempt to load /boot/loader from the CD we were booted # off of. # +#include + # # Memory locations. # Modified: stable/9/sys/boot/pc98/libpc98/Makefile ============================================================================== --- stable/9/sys/boot/pc98/libpc98/Makefile Fri Nov 23 13:18:26 2012 (r243447) +++ stable/9/sys/boot/pc98/libpc98/Makefile Fri Nov 23 13:35:17 2012 (r243448) @@ -37,7 +37,8 @@ CFLAGS+= -DTERM_EMU # XXX: make alloca() useable CFLAGS+= -Dalloca=__builtin_alloca -CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../btx/lib \ +CFLAGS+= -I${.CURDIR}/../../common \ + -I${.CURDIR}/../btx/lib \ -I${.CURDIR}/../../i386/libi386 \ -I${.CURDIR}/../../.. -I. # the location of libstand Modified: stable/9/sys/boot/pc98/loader/main.c ============================================================================== --- stable/9/sys/boot/pc98/loader/main.c Fri Nov 23 13:18:26 2012 (r243447) +++ stable/9/sys/boot/pc98/loader/main.c Fri Nov 23 13:35:17 2012 (r243448) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -207,9 +208,9 @@ main(void) static void extract_currdev(void) { - struct i386_devdesc new_currdev; - int major; - int biosdev = -1; + struct i386_devdesc new_currdev; + int major; + int biosdev = -1; /* Assume we are booting from a BIOS disk by default */ new_currdev.d_dev = &biosdisk; @@ -255,7 +256,7 @@ extract_currdev(void) } } new_currdev.d_type = new_currdev.d_dev->dv_type; - + /* * If we are booting off of a BIOS disk and we didn't succeed in determining * which one we booted off of, just use disk0: as a reasonable default. @@ -266,6 +267,7 @@ extract_currdev(void) "Guessed BIOS device 0x%x not found by probes, defaulting to disk0:\n", biosdev); new_currdev.d_unit = 0; } + env_setenv("currdev", EV_VOLATILE, i386_fmtdev(&new_currdev), i386_setcurrdev, env_nounset); env_setenv("loaddev", EV_VOLATILE, i386_fmtdev(&new_currdev), env_noset, @@ -306,33 +308,17 @@ command_heap(int argc, char *argv[]) return(CMD_OK); } -/* ISA bus access functions for PnP, derived from */ -static int +/* ISA bus access functions for PnP. */ +static int isa_inb(int port) { - u_char data; - - if (__builtin_constant_p(port) && - (((port) & 0xffff) < 0x100) && - ((port) < 0x10000)) { - __asm __volatile("inb %1,%0" : "=a" (data) : "id" ((u_short)(port))); - } else { - __asm __volatile("inb %%dx,%0" : "=a" (data) : "d" (port)); - } - return(data); + + return (inb(port)); } static void isa_outb(int port, int value) { - u_char al = value; - - if (__builtin_constant_p(port) && - (((port) & 0xffff) < 0x100) && - ((port) < 0x10000)) { - __asm __volatile("outb %0,%1" : : "a" (al), "id" ((u_short)(port))); - } else { - __asm __volatile("outb %0,%%dx" : : "a" (al), "d" (port)); - } -} + outb(port, value); +}