Date: Sun, 05 Jun 2011 16:20:10 +0000 From: gk@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r222839 - in soc2011/gk/ino64-head/sys/boot: arm/at91/boot2 arm/ixp425/boot2 common i386/boot2 i386/gptboot pc98/boot2 powerpc/boot1.chrp sparc64/boot1 Message-ID: <20110605162010.A938F1065686@hub.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: gk Date: Sun Jun 5 16:20:10 2011 New Revision: 222839 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=222839 Log: boot: Use 32 bit ufs_ino_t to keep boot2 small Modified: soc2011/gk/ino64-head/sys/boot/arm/at91/boot2/boot2.c soc2011/gk/ino64-head/sys/boot/arm/ixp425/boot2/boot2.c soc2011/gk/ino64-head/sys/boot/common/ufsread.c soc2011/gk/ino64-head/sys/boot/i386/boot2/boot2.c soc2011/gk/ino64-head/sys/boot/i386/gptboot/gptboot.c soc2011/gk/ino64-head/sys/boot/pc98/boot2/boot2.c soc2011/gk/ino64-head/sys/boot/powerpc/boot1.chrp/boot1.c soc2011/gk/ino64-head/sys/boot/sparc64/boot1/boot1.c Modified: soc2011/gk/ino64-head/sys/boot/arm/at91/boot2/boot2.c ============================================================================== --- soc2011/gk/ino64-head/sys/boot/arm/at91/boot2/boot2.c Sun Jun 5 16:19:46 2011 (r222838) +++ soc2011/gk/ino64-head/sys/boot/arm/at91/boot2/boot2.c Sun Jun 5 16:20:10 2011 (r222839) @@ -93,7 +93,6 @@ static void load(void); static int parse(void); -static int xfsread(ino_t, void *, size_t); static int dskread(void *, unsigned, unsigned); #ifdef FIXUP_BOOT_DRV static void fixup_boot_drv(caddr_t, int, int, int); @@ -109,7 +108,7 @@ #endif static inline int -xfsread(ino_t inode, void *buf, size_t nbyte) +xfsread(ufs_ino_t inode, void *buf, size_t nbyte) { if ((size_t)fsread(inode, buf, nbyte) != nbyte) return -1; @@ -152,7 +151,7 @@ main(void) { int autoboot, c = 0; - ino_t ino; + ufs_ino_t ino; dmadat = (void *)(0x20000000 + (16 << 20)); board_init(); @@ -196,7 +195,7 @@ Elf32_Ehdr eh; static Elf32_Phdr ep[2]; caddr_t p; - ino_t ino; + ufs_ino_t ino; uint32_t addr; int i, j; #ifdef FIXUP_BOOT_DRV Modified: soc2011/gk/ino64-head/sys/boot/arm/ixp425/boot2/boot2.c ============================================================================== --- soc2011/gk/ino64-head/sys/boot/arm/ixp425/boot2/boot2.c Sun Jun 5 16:19:46 2011 (r222838) +++ soc2011/gk/ino64-head/sys/boot/arm/ixp425/boot2/boot2.c Sun Jun 5 16:20:10 2011 (r222839) @@ -97,7 +97,6 @@ static void load(void); static int parse(void); -static int xfsread(ino_t, void *, size_t); static int dskread(void *, unsigned, unsigned); static int drvread(void *, unsigned, unsigned); #ifdef FIXUP_BOOT_DRV @@ -113,7 +112,7 @@ #endif static inline int -xfsread(ino_t inode, void *buf, size_t nbyte) +xfsread(ufs_ino_t inode, void *buf, size_t nbyte) { if ((size_t)fsread(inode, buf, nbyte) != nbyte) return -1; @@ -157,7 +156,7 @@ { const char *bt; int autoboot, c = 0; - ino_t ino; + ufs_ino_t ino; dmadat = (void *)(0x1c0000); p_memset((char *)dmadat, 0, 32 * 1024); @@ -205,7 +204,7 @@ Elf32_Ehdr eh; static Elf32_Phdr ep[2]; caddr_t p; - ino_t ino; + ufs_ino_t ino; uint32_t addr; int i, j; #ifdef FIXUP_BOOT_DRV Modified: soc2011/gk/ino64-head/sys/boot/common/ufsread.c ============================================================================== --- soc2011/gk/ino64-head/sys/boot/common/ufsread.c Sun Jun 5 16:19:46 2011 (r222838) +++ soc2011/gk/ino64-head/sys/boot/common/ufsread.c Sun Jun 5 16:20:10 2011 (r222839) @@ -57,6 +57,8 @@ #define cgbase(fs, c) ((ufs2_daddr_t)((fs)->fs_fpg * (c))) #endif +typedef uint32_t ufs_ino_t; + /* * We use 4k `virtual' blocks for filesystem data, whatever the actual * filesystem block size. FFS blocks are always a multiple of 4k. @@ -84,14 +86,14 @@ }; static struct dmadat *dmadat; -static ino_t lookup(const char *); -static ssize_t fsread(ino_t, void *, size_t); +static ufs_ino_t lookup(const char *); +static ssize_t fsread(ufs_ino_t, void *, size_t); static uint8_t ls, dsk_meta; static uint32_t fs_off; static __inline int -fsfind(const char *name, ino_t * ino) +fsfind(const char *name, ufs_ino_t * ino) { char buf[DEV_BSIZE]; struct direct *d; @@ -115,12 +117,12 @@ return 0; } -static ino_t +static ufs_ino_t lookup(const char *path) { char name[MAXNAMLEN + 1]; const char *s; - ino_t ino; + ufs_ino_t ino; ssize_t n; uint8_t dt; @@ -162,7 +164,7 @@ #endif static ssize_t -fsread(ino_t inode, void *buf, size_t nbyte) +fsread(ufs_ino_t inode, void *buf, size_t nbyte) { #ifndef UFS2_ONLY static struct ufs1_dinode dp1; @@ -170,7 +172,7 @@ #ifndef UFS1_ONLY static struct ufs2_dinode dp2; #endif - static ino_t inomap; + static ufs_ino_t inomap; char *blkbuf; void *indbuf; struct fs *fs; Modified: soc2011/gk/ino64-head/sys/boot/i386/boot2/boot2.c ============================================================================== --- soc2011/gk/ino64-head/sys/boot/i386/boot2/boot2.c Sun Jun 5 16:19:46 2011 (r222838) +++ soc2011/gk/ino64-head/sys/boot/i386/boot2/boot2.c Sun Jun 5 16:20:10 2011 (r222839) @@ -140,7 +140,6 @@ void exit(int); static void load(void); static int parse(void); -static int xfsread(ino_t, void *, size_t); static int dskread(void *, unsigned, unsigned); static void printf(const char *,...); static void putchar(int); @@ -172,7 +171,7 @@ #include "ufsread.c" static inline int -xfsread(ino_t inode, void *buf, size_t nbyte) +xfsread(ufs_ino_t inode, void *buf, size_t nbyte) { if ((size_t)fsread(inode, buf, nbyte) != nbyte) { printf("Invalid %s\n", "format"); @@ -224,7 +223,7 @@ main(void) { uint8_t autoboot; - ino_t ino; + ufs_ino_t ino; kname = NULL; dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); @@ -306,7 +305,7 @@ static Elf32_Phdr ep[2]; static Elf32_Shdr es[2]; caddr_t p; - ino_t ino; + ufs_ino_t ino; uint32_t addr; int i, j; Modified: soc2011/gk/ino64-head/sys/boot/i386/gptboot/gptboot.c ============================================================================== --- soc2011/gk/ino64-head/sys/boot/i386/gptboot/gptboot.c Sun Jun 5 16:19:46 2011 (r222838) +++ soc2011/gk/ino64-head/sys/boot/i386/gptboot/gptboot.c Sun Jun 5 16:20:10 2011 (r222839) @@ -89,14 +89,13 @@ void exit(int); static void load(void); static int parse(char *, int *); -static int xfsread(ino_t, void *, size_t); static int dskread(void *, daddr_t, unsigned); static uint32_t memsize(void); #include "ufsread.c" static inline int -xfsread(ino_t inode, void *buf, size_t nbyte) +xfsread(ufs_ino_t inode, void *buf, size_t nbyte) { if ((size_t)fsread(inode, buf, nbyte) != nbyte) { @@ -137,7 +136,7 @@ { char cmd[512], cmdtmp[512]; int autoboot, dskupdated; - ino_t ino; + ufs_ino_t ino; dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); v86.ctl = V86_FLAGS; @@ -246,7 +245,7 @@ static Elf32_Phdr ep[2]; static Elf32_Shdr es[2]; caddr_t p; - ino_t ino; + ufs_ino_t ino; uint32_t addr, x; int fmt, i, j; Modified: soc2011/gk/ino64-head/sys/boot/pc98/boot2/boot2.c ============================================================================== --- soc2011/gk/ino64-head/sys/boot/pc98/boot2/boot2.c Sun Jun 5 16:19:46 2011 (r222838) +++ soc2011/gk/ino64-head/sys/boot/pc98/boot2/boot2.c Sun Jun 5 16:20:10 2011 (r222839) @@ -142,7 +142,6 @@ void exit(int); static void load(void); static int parse(void); -static int xfsread(ino_t, void *, size_t); static int dskread(void *, unsigned, unsigned); static void printf(const char *,...); static void putchar(int); @@ -174,7 +173,7 @@ #include "ufsread.c" static inline int -xfsread(ino_t inode, void *buf, size_t nbyte) +xfsread(ufs_ino_t inode, void *buf, size_t nbyte) { if ((size_t)fsread(inode, buf, nbyte) != nbyte) { printf("Invalid %s\n", "format"); @@ -353,7 +352,7 @@ int i; #endif uint8_t autoboot; - ino_t ino; + ufs_ino_t ino; dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); v86.ctl = V86_FLAGS; @@ -444,7 +443,7 @@ static Elf32_Phdr ep[2]; static Elf32_Shdr es[2]; caddr_t p; - ino_t ino; + ufs_ino_t ino; uint32_t addr; int i, j; Modified: soc2011/gk/ino64-head/sys/boot/powerpc/boot1.chrp/boot1.c ============================================================================== --- soc2011/gk/ino64-head/sys/boot/powerpc/boot1.chrp/boot1.c Sun Jun 5 16:19:46 2011 (r222838) +++ soc2011/gk/ino64-head/sys/boot/powerpc/boot1.chrp/boot1.c Sun Jun 5 16:20:10 2011 (r222839) @@ -45,7 +45,6 @@ static ofwh_t bootdev; static struct fs fs; -static ino_t inomap; static char blkbuf[BSIZEMAX]; static unsigned int fsblks; @@ -490,7 +489,7 @@ Elf32_Ehdr eh; Elf32_Phdr ph; caddr_t p; - ino_t ino; + ufs_ino_t ino; int i; if ((ino = lookup(fname)) == 0) { Modified: soc2011/gk/ino64-head/sys/boot/sparc64/boot1/boot1.c ============================================================================== --- soc2011/gk/ino64-head/sys/boot/sparc64/boot1/boot1.c Sun Jun 5 16:19:46 2011 (r222838) +++ soc2011/gk/ino64-head/sys/boot/sparc64/boot1/boot1.c Sun Jun 5 16:20:10 2011 (r222839) @@ -385,7 +385,7 @@ Elf64_Ehdr eh; Elf64_Phdr ph; caddr_t p; - ino_t ino; + ufs_ino_t ino; int i; if ((ino = lookup(fname)) == 0) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110605162010.A938F1065686>