svn commit: r243448 - in stable/9/sys/boot/pc98: boot2 btx/btxldr btx/lib cdboot libpc98 loader
Takahashi Yoshihiro
nyan at FreeBSD.org
Fri Nov 23 13:35:19 UTC 2012
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 <bootargs.h>
+
/*
* Prototype BTX loader program, written in a couple of hours. The
* real thing should probably be more flexible, and in C.
*/
-#include <bootargs.h>
-
/*
* 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 <bootargs.h>
+
#
# BTX C startup code (ELF).
#
-#include <bootargs.h>
-
#
# 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 <bootargs.h>
-
#
# 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 <bootargs.h>
+
#
# 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 <stddef.h>
#include <string.h>
#include <machine/bootinfo.h>
+#include <machine/cpufunc.h>
#include <sys/param.h>
#include <sys/reboot.h>
@@ -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 <machine/cpufunc.h> */
-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);
+}
More information about the svn-src-stable-9
mailing list