summaryrefslogtreecommitdiffstats
path: root/sys/boot/arm/at91
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2016-02-09 22:32:24 +0000
committeremaste <emaste@FreeBSD.org>2016-02-09 22:32:24 +0000
commitf1429e95c359a7e76f8385cdd47f887b7d1bbd0e (patch)
tree7afcfe90b96978757e63fae08a8ce479d0affe67 /sys/boot/arm/at91
parent87ab639764a7d4ff24c9e2ecd1f21536e3b9ceb5 (diff)
downloadFreeBSD-src-f1429e95c359a7e76f8385cdd47f887b7d1bbd0e.zip
FreeBSD-src-f1429e95c359a7e76f8385cdd47f887b7d1bbd0e.tar.gz
MFC boot loader path and RBX constant deduplication
r294765 (imp) Move all the separate copies of the same strings into paths.h. There's nothing machine specific about these. r294765 (imp) RBX_ defines are in rbx.h, move it there. r294847 (imp) Remove static from these two. They slipped through the cracks. r294925 (imp) Fix mistake when transitioning to the new defines with ZFS loader. I hate adding yet another define, but it is the lessor of the evil choices available. Kill another evil by removing PATH_BOOT3 and replacing it with PATH_LOADER or PATH_LOADER_ZFS as appropriate. Approved by: re (gjb)
Diffstat (limited to 'sys/boot/arm/at91')
-rw-r--r--sys/boot/arm/at91/boot2/boot2.c44
1 files changed, 4 insertions, 40 deletions
diff --git a/sys/boot/arm/at91/boot2/boot2.c b/sys/boot/arm/at91/boot2/boot2.c
index c3629a5..0388548 100644
--- a/sys/boot/arm/at91/boot2/boot2.c
+++ b/sys/boot/arm/at91/boot2/boot2.c
@@ -1,6 +1,6 @@
/*-
* Copyright (c) 2008 John Hay
- * Copyright (c) 2006 Warner Losh
+ * Copyright (c) 2006 M Warner Losh <imp@freebsd.org>
* Copyright (c) 1998 Robert Nordier
* All rights reserved.
*
@@ -30,52 +30,16 @@ __FBSDID("$FreeBSD$");
#include "lib.h"
#include "board.h"
+#include "paths.h"
+#include "rbx.h"
-#define RBX_ASKNAME 0x0 /* -a */
-#define RBX_SINGLE 0x1 /* -s */
-/* 0x2 is reserved for log2(RB_NOSYNC). */
-/* 0x3 is reserved for log2(RB_HALT). */
-/* 0x4 is reserved for log2(RB_INITNAME). */
-#define RBX_DFLTROOT 0x5 /* -r */
-/* #define RBX_KDB 0x6 -d */
-/* 0x7 is reserved for log2(RB_RDONLY). */
-/* 0x8 is reserved for log2(RB_DUMP). */
-/* 0x9 is reserved for log2(RB_MINIROOT). */
-#define RBX_CONFIG 0xa /* -c */
-#define RBX_VERBOSE 0xb /* -v */
-/* #define RBX_SERIAL 0xc -h */
-/* #define RBX_CDROM 0xd -C */
-/* 0xe is reserved for log2(RB_POWEROFF). */
-#define RBX_GDB 0xf /* -g */
-/* #define RBX_MUTE 0x10 -m */
-/* 0x11 is reserved for log2(RB_SELFTEST). */
-/* 0x12 is reserved for boot programs. */
-/* 0x13 is reserved for boot programs. */
-/* #define RBX_PAUSE 0x14 -p */
-/* #define RBX_QUIET 0x15 -q */
-#define RBX_NOINTR 0x1c /* -n */
-/* 0x1d is reserved for log2(RB_MULTIPLE) and is just misnamed here. */
-/* #define RBX_DUAL 0x1d -D */
-/* 0x1f is reserved for log2(RB_BOOTINFO). */
-
-/* pass: -a, -s, -r, -v, -g */
-#define RBX_MASK (OPT_SET(RBX_ASKNAME) | OPT_SET(RBX_SINGLE) | \
- OPT_SET(RBX_DFLTROOT) | \
- OPT_SET(RBX_VERBOSE) | \
- OPT_SET(RBX_GDB))
-
-#define PATH_DOTCONFIG "/boot.config"
-#define PATH_CONFIG "/boot/config"
-//#define PATH_KERNEL "/boot/kernel/kernel"
+#undef PATH_KERNEL
#define PATH_KERNEL "/boot/kernel/kernel.gz.tramp"
extern uint32_t _end;
#define NOPT 6
-#define OPT_SET(opt) (1 << (opt))
-#define OPT_CHECK(opt) ((opts) & OPT_SET(opt))
-
static const char optstr[NOPT] = "agnrsv";
static const unsigned char flags[NOPT] = {
RBX_ASKNAME,
OpenPOWER on IntegriCloud