# HG changeset patch # User msalter # Date 1031057331 0 # Node ID e46ccba0c5f13cee9d124a7c8e24f277a0edc694 # Parent 28d0fbc110489c8d5cdc45fa09ae9f430e720e58 redboot/fs endianess tweak diff --git a/packages/redboot/current/ChangeLog b/packages/redboot/current/ChangeLog --- a/packages/redboot/current/ChangeLog +++ b/packages/redboot/current/ChangeLog @@ -1,3 +1,9 @@ +2002-09-03 Yoshinori Sato +2002-09-03 Mark Salter + + * include/fs/disk.h (__SWAB32): Fix incorrect masking. + * src/fs/e2fs.c (e2fs_inode_block): Fix endianess of block numbers. + 2002-08-29 Mark Salter * src/net/net_io.c (net_init): Initialize dns before showing addresses. diff --git a/packages/redboot/current/include/fs/disk.h b/packages/redboot/current/include/fs/disk.h --- a/packages/redboot/current/include/fs/disk.h +++ b/packages/redboot/current/include/fs/disk.h @@ -66,7 +66,7 @@ #define __SWAB32(x) \ ((((x) & 0xff) << 24) | \ (((x) & 0xff00) << 8) | \ - (((x) >> 8) & 0xff) | \ + (((x) >> 8) & 0xff00) | \ (((x) >> 24) & 0xff)) #if (CYG_BYTEORDER == CYG_MSBFIRST) diff --git a/packages/redboot/current/src/fs/e2fs.c b/packages/redboot/current/src/fs/e2fs.c --- a/packages/redboot/current/src/fs/e2fs.c +++ b/packages/redboot/current/src/fs/e2fs.c @@ -226,7 +226,7 @@ e2fs_inode_block(e2fs_desc_t *e2fs, e2fs // Indirect block if (!__READ_BLOCK(SWAB_LE32(inode->block[E2FS_IND_BLOCK]))) return 0; - *pblknr = blockbuf[bindex]; + *pblknr = SWAB_LE32(blockbuf[bindex]); return 1; } bindex -= e2fs->nr_ind_blocks; @@ -237,7 +237,7 @@ e2fs_inode_block(e2fs_desc_t *e2fs, e2fs return 0; if (!__READ_BLOCK(SWAB_LE32(blockbuf[bindex / e2fs->nr_ind_blocks]))) return 0; - *pblknr = blockbuf[bindex % e2fs->nr_ind_blocks]; + *pblknr = SWAB_LE32(blockbuf[bindex % e2fs->nr_ind_blocks]); return 1; } bindex -= e2fs->nr_dind_blocks; @@ -250,7 +250,7 @@ e2fs_inode_block(e2fs_desc_t *e2fs, e2fs bindex %= e2fs->nr_dind_blocks; if (!__READ_BLOCK(SWAB_LE32(blockbuf[bindex / e2fs->nr_ind_blocks]))) return 0; - *pblknr = blockbuf[bindex % e2fs->nr_ind_blocks]; + *pblknr = SWAB_LE32(blockbuf[bindex % e2fs->nr_ind_blocks]); return 1; }