This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RedBoot IDE Support EB Fix


With a target of BigEndian, it does not load normally.
Byte swap process increases incorrectly.

Index: packages/redboot/current/include/fs/disk.h
===================================================================
RCS file: /cvs/ecos/ecos/packages/redboot/current/include/fs/disk.h,v
retrieving revision 1.4
diff -u -r1.4 disk.h
--- packages/redboot/current/include/fs/disk.h	9 Jul 2002 20:40:55 -0000	1.4
+++ packages/redboot/current/include/fs/disk.h	30 Aug 2002 16:53:22 -0000
@@ -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)

Index: packages/redboot/current/src/fs/e2fs.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/redboot/current/src/fs/e2fs.c,v
retrieving revision 1.4
diff -u -r1.4 e2fs.c
--- packages/redboot/current/src/fs/e2fs.c	23 May 2002 23:08:33 -0000	1.4
+++ packages/redboot/current/src/fs/e2fs.c	30 Aug 2002 16:53:23 -0000
@@ -226,7 +226,7 @@
 	// 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 @@
 	    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 @@
     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;
 }
 
-- 
Yoshinori Sato
<qzb04471@nifty.ne.jp>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]