[OpenBIOS] r31 - in openbios-devel: fs/grubfs libc

svn@openbios.org svn at openbios.org
Wed May 24 13:10:55 CEST 2006


Author: stepan
Date: 2006-05-24 13:10:55 +0200 (Wed, 24 May 2006)
New Revision: 31

Modified:
   openbios-devel/fs/grubfs/fsys_ext2fs.c
   openbios-devel/fs/grubfs/grubfs_fs.c
   openbios-devel/fs/grubfs/iso9660.h
   openbios-devel/libc/diskio.c
Log:
some filesystem fixes (mostly remainder from blueswirl's -15)


Modified: openbios-devel/fs/grubfs/fsys_ext2fs.c
===================================================================
--- openbios-devel/fs/grubfs/fsys_ext2fs.c	2006-05-24 10:59:54 UTC (rev 30)
+++ openbios-devel/fs/grubfs/fsys_ext2fs.c	2006-05-24 11:10:55 UTC (rev 31)
@@ -19,10 +19,15 @@
 
 #ifdef FSYS_EXT2FS
 
+#include "openbios/config.h"
 #include "shared.h"
 #include "filesys.h"
 #include <libc/byteorder.h>
 
+#ifdef CONFIG_DEBUG_EXT2FS
+#define E2DEBUG
+#endif
+
 static int mapblock1, mapblock2;
 
 /* sizes are always in bytes, BLOCK values are always in DEV_BSIZE (sectors) */

Modified: openbios-devel/fs/grubfs/grubfs_fs.c
===================================================================
--- openbios-devel/fs/grubfs/grubfs_fs.c	2006-05-24 10:59:54 UTC (rev 30)
+++ openbios-devel/fs/grubfs/grubfs_fs.c	2006-05-24 11:10:55 UTC (rev 31)
@@ -303,7 +303,7 @@
 {
 	if (filepos < 0 || filepos > filemax)
 		filepos = filemax;
-	if (len < 0 || len > filemax-filepos)
+	if (len > filemax-filepos)
 		len = filemax - filepos;
 	errnum = 0;
 	return curfs->fsys->read_func( buf, len );

Modified: openbios-devel/fs/grubfs/iso9660.h
===================================================================
--- openbios-devel/fs/grubfs/iso9660.h	2006-05-24 10:59:54 UTC (rev 30)
+++ openbios-devel/fs/grubfs/iso9660.h	2006-05-24 11:10:55 UTC (rev 31)
@@ -158,10 +158,13 @@
 
 #define	RRMAGIC(c1, c2)	((c1)|(c2) << 8)
 
-#define	CHECK2(ptr, c1, c2) \
-	(*(unsigned short *)(ptr) == (((c1) | (c2) << 8) & 0xFFFF))
-#define	CHECK4(ptr, c1, c2, c3, c4) \
-	(*(unsigned long *)(ptr) == ((c1) | (c2)<<8 | (c3)<<16 | (c4)<<24))
+#define	CHECK2(ptr, c1, c2)                     \
+    (*(ptr) == (c1) && *(ptr + 1) == (c2))
+#define	CHECK4(ptr, c1, c2, c3, c4)                                     \
+    (*(unsigned char *)(ptr) == (c1) &&                                 \
+     *((unsigned char *)(ptr) + 1) == (c2) &&                           \
+     *((unsigned char *)(ptr) + 2) == (c3) &&                           \
+     *((unsigned char *)(ptr) + 3) == (c4))
 
 #endif /* !ASM_FILE */
 

Modified: openbios-devel/libc/diskio.c
===================================================================
--- openbios-devel/libc/diskio.c	2006-05-24 10:59:54 UTC (rev 30)
+++ openbios-devel/libc/diskio.c	2006-05-24 11:10:55 UTC (rev 31)
@@ -184,7 +184,7 @@
 
 	DPUSH( offs );
 	call_package( fdp->seek_xt, fdp->ih );
-	return ((POP() >= 0)? 0 : -1);
+	return ((((cell)POP()) >= 0)? 0 : -1);
 }
 
 llong




More information about the OpenBIOS mailing list