PERFORCE change 96330 for review
Warner Losh
imp at FreeBSD.org
Fri Apr 28 22:00:54 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=96330
Change 96330 by imp at imp_hammer on 2006/04/28 22:00:03
Trim a bit.
Affected files ...
.. //depot/projects/arm/src/sys/boot/arm/at91/Makefile.inc#13 edit
.. //depot/projects/arm/src/sys/boot/arm/at91/boot2/Makefile#2 edit
.. //depot/projects/arm/src/sys/boot/arm/at91/boot2/boot2.c#2 edit
Differences ...
==== //depot/projects/arm/src/sys/boot/arm/at91/Makefile.inc#13 (text+ko) ====
@@ -1,6 +1,8 @@
# $FreeBSD: src/sys/boot/arm/at91/Makefile.inc,v 1.2 2006/04/21 07:41:36 imp Exp $
.if !target(__at91_boot_Makefile.inc__)
+.PATH: ${.CURDIR}/../../../../libkern ${.CURDIR}/../../../../libkern/arm
+
__at91_boot_Makefile.inc__:
CFLAGS=-O2 -mcpu=arm9 -ffreestanding \
==== //depot/projects/arm/src/sys/boot/arm/at91/boot2/Makefile#2 (text+ko) ====
@@ -1,13 +1,10 @@
# $FreeBSD: src/sys/boot/arm/at91/bootspi/Makefile,v 1.1 2006/04/19 17:16:48 imp Exp $
-# A value of 0x80 enables LBA support.
-BOOT_BOOT1_FLAGS?= 0x80
-
BOOT_COMCONSOLE_SPEED?= 9600
P=boot2
FILES=${P}
-SRCS=arm_init.s boot2.c divsi3.S ashldi3.c
+SRCS=arm_init.s boot2.c ashldi3.c divsi3.S
NO_MAN=
LDFLAGS=-e 0 -T ${.CURDIR}/../linker.cfg
OBJS+= ${SRCS:N*.h:R:S/$/.o/g}
@@ -18,7 +15,5 @@
-I${.CURDIR}/../../../common \
-I${.CURDIR}/../../../.. \
-D_KERNEL \
- -DFLAGS=${BOOT_BOOT1_FLAGS} \
- -DSIOPRT=${BOOT_COMCONSOLE_PORT} \
- -DSIOFMT=${B2SIOFMT} \
+ -DUFS1_ONLY \
-DSIOSPD=${BOOT_COMCONSOLE_SPEED} \
==== //depot/projects/arm/src/sys/boot/arm/at91/boot2/boot2.c#2 (text+ko) ====
@@ -68,7 +68,6 @@
OPT_SET(RBX_PAUSE) | OPT_SET(RBX_DUAL))
#define PATH_CONFIG "/boot.config"
-#define PATH_BOOT3 "/boot/loader"
#define PATH_KERNEL "/boot/kernel/kernel"
#define ARGS 0x900
@@ -90,7 +89,7 @@
extern uint32_t _end;
-static const char optstr[NOPT] = "DhaCgmnpqrsv"; /* Also 'P', 'S' */
+static const char optstr[NOPT] = "DhaCgmnpqrsv"; /* Also 'P' */
static const unsigned char flags[NOPT] = {
RBX_DUAL,
RBX_SERIAL,
@@ -113,7 +112,7 @@
static char cmd[512];
static char kname[1024];
static uint32_t opts;
-static int comspeed = SIOSPD;
+//static int comspeed = SIOSPD;
void exit(int);
static void load(void);
@@ -213,24 +212,11 @@
*cmd = 0;
}
- /*
- * Try to exec stage 3 boot loader. If interrupted by a keypress,
- * or in case of failure, try to load a kernel directly instead.
- */
-
- if (autoboot && !*kname) {
- memcpy(kname, PATH_BOOT3, sizeof(PATH_BOOT3));
- if (getc(3) == -1) {
- load();
- memcpy(kname, PATH_KERNEL, sizeof(PATH_KERNEL));
- }
- }
-
/* Present the user with the boot2 prompt. */
for (;;) {
if (!autoboot || !OPT_CHECK(RBX_QUIET))
- printf("\nFreeBSD/i386 boot\n"
+ printf("\nFreeBSD/arm boot\n"
"Default: %s\n"
"boot: ", kname);
if (!autoboot || getc(5) == -1)
@@ -252,12 +238,14 @@
struct exec ex;
Elf32_Ehdr eh;
} hdr;
+#if 0
static Elf32_Phdr ep[2];
static Elf32_Shdr es[2];
+#endif
caddr_t p;
ino_t ino;
uint32_t addr, x;
- int fmt, i, j;
+ int fmt/*, i, j*/;
if (!(ino = lookup(kname))) {
if (!ls)
@@ -338,7 +326,7 @@
{
char *arg = cmd;
char *ep, *p;
- int c, i, j;
+ int c, i;
while ((c = *arg++)) {
if (c == ' ' || c == '\t' || c == '\n')
@@ -349,16 +337,6 @@
*p++ = 0;
if (c == '-') {
while ((c = *arg++)) {
- if (c == 'S') {
- j = 0;
- while ((unsigned int)(i = *arg++ - '0') <= 9)
- j = j * 10 + i;
- if (j > 0 && i == -'0') {
- comspeed = j;
- break;
- }
- /* Fall through to error below ('S' not in optstr[]). */
- }
for (i = 0; c != optstr[i]; i++)
if (i == NOPT - 1)
return -1;
More information about the p4-projects
mailing list