diff options
author | jhb <jhb@FreeBSD.org> | 2007-10-26 21:02:31 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2007-10-26 21:02:31 +0000 |
commit | a7b201ee6db690a943f72f7aa1bd186bc167fe2e (patch) | |
tree | ae0ae4a3fd1580506ca25b1f4ffb197a81d3dc02 /sys | |
parent | 69326388218cd5b94b8d74edbdb9fac55920faba (diff) | |
download | FreeBSD-src-a7b201ee6db690a943f72f7aa1bd186bc167fe2e.zip FreeBSD-src-a7b201ee6db690a943f72f7aa1bd186bc167fe2e.tar.gz |
Use the smaller cgbase() macro in ufsread.c if UFS_SMALL_CGBASE is
defined. This lets each boot program choose which version of cgbase() it
wants to use rather than forcing ufsread.c to have that knowledge.
MFC after: 1 week
Discussed with: imp
Diffstat (limited to 'sys')
-rw-r--r-- | sys/boot/arm/at91/boot2/boot2.c | 1 | ||||
-rw-r--r-- | sys/boot/common/ufsread.c | 6 | ||||
-rw-r--r-- | sys/boot/i386/boot2/boot2.c | 1 | ||||
-rw-r--r-- | sys/boot/i386/gptboot/gptboot.c | 1 |
4 files changed, 5 insertions, 4 deletions
diff --git a/sys/boot/arm/at91/boot2/boot2.c b/sys/boot/arm/at91/boot2/boot2.c index 379bfe1..fb2bcfe 100644 --- a/sys/boot/arm/at91/boot2/boot2.c +++ b/sys/boot/arm/at91/boot2/boot2.c @@ -93,6 +93,7 @@ static int parse(void); static int xfsread(ino_t, void *, size_t); static int dskread(void *, unsigned, unsigned); +#define UFS_SMALL_CGBASE #include "ufsread.c" static inline int diff --git a/sys/boot/common/ufsread.c b/sys/boot/common/ufsread.c index da06055..2b778bd 100644 --- a/sys/boot/common/ufsread.c +++ b/sys/boot/common/ufsread.c @@ -48,10 +48,10 @@ __FBSDID("$FreeBSD$"); #include <ufs/ufs/dinode.h> #include <ufs/ffs/fs.h> -#if (defined(__i386__) && !defined(GPTBOOT)) || defined(__arm__) +#ifdef UFS_SMALL_CGBASE /* XXX: Revert to old (broken for over 1.5Tb filesystems) version of cgbase - (see sys/ufs/ffs/fs.h rev 1.39) so that i386 boot loader (boot2) can - support both UFS1 and UFS2 again. */ + (see sys/ufs/ffs/fs.h rev 1.39) so that small boot loaders (e.g. boot2) can + support both UFS1 and UFS2. */ #undef cgbase #define cgbase(fs, c) ((ufs2_daddr_t)((fs)->fs_fpg * (c))) #endif diff --git a/sys/boot/i386/boot2/boot2.c b/sys/boot/i386/boot2/boot2.c index f227233..364fe6d 100644 --- a/sys/boot/i386/boot2/boot2.c +++ b/sys/boot/i386/boot2/boot2.c @@ -168,6 +168,7 @@ strcmp(const char *s1, const char *s2) return (unsigned char)*s1 - (unsigned char)*s2; } +#define UFS_SMALL_CGBASE #include "ufsread.c" static inline int diff --git a/sys/boot/i386/gptboot/gptboot.c b/sys/boot/i386/gptboot/gptboot.c index 401328b..d5f5450 100644 --- a/sys/boot/i386/gptboot/gptboot.c +++ b/sys/boot/i386/gptboot/gptboot.c @@ -167,7 +167,6 @@ strcmp(const char *s1, const char *s2) return (unsigned char)*s1 - (unsigned char)*s2; } -#define GPTBOOT #include "ufsread.c" static inline int |