svn commit: r201340 - in head/sys/boot: common pc98

Takahashi Yoshihiro nyan at FreeBSD.org
Thu Dec 31 12:17:39 UTC 2009


Author: nyan
Date: Thu Dec 31 12:17:38 2009
New Revision: 201340
URL: http://svn.freebsd.org/changeset/base/201340

Log:
  Don't use 15M-16M area on pc98.  It's reserved for some devices.
  
  MFC after:	2 week

Modified:
  head/sys/boot/common/module.c
  head/sys/boot/pc98/Makefile.inc

Modified: head/sys/boot/common/module.c
==============================================================================
--- head/sys/boot/common/module.c	Thu Dec 31 12:05:48 2009	(r201339)
+++ head/sys/boot/common/module.c	Thu Dec 31 12:17:38 2009	(r201340)
@@ -351,6 +351,9 @@ file_loadraw(char *type, char *name)
     char			*cp;
     int				fd, got;
     vm_offset_t			laddr;
+#ifdef PC98
+    struct stat			st;
+#endif
 
     /* We can't load first */
     if ((file_findfile(NULL, NULL)) == NULL) {
@@ -372,6 +375,14 @@ file_loadraw(char *type, char *name)
 	return(CMD_ERROR);
     }
 
+#ifdef PC98
+    /* We cannot use 15M-16M area on pc98. */
+    if (loadaddr < 0x1000000 &&
+	fstat(fd, &st) == 0 &&
+	(st.st_size == -1 || loadaddr + st.st_size > 0xf00000))
+	loadaddr = 0x1000000;
+#endif
+
     laddr = loadaddr;
     for (;;) {
 	/* read in 4k chunks; size is not really important */
@@ -477,6 +488,14 @@ mod_loadkld(const char *kldname, int arg
 	;
 
     do {
+#ifdef PC98
+	/* We cannot use 15M-16M area on pc98. */
+	struct stat st;
+	if (loadaddr < 0x1000000 &&
+	    stat(filename, &st) == 0 &&
+	    (st.st_size == -1 || loadaddr + st.st_size > 0xf00000))
+	    loadaddr = 0x1000000;
+#endif
 	err = file_load(filename, loadaddr, &fp);
 	if (err)
 	    break;

Modified: head/sys/boot/pc98/Makefile.inc
==============================================================================
--- head/sys/boot/pc98/Makefile.inc	Thu Dec 31 12:05:48 2009	(r201339)
+++ head/sys/boot/pc98/Makefile.inc	Thu Dec 31 12:17:38 2009	(r201340)
@@ -7,7 +7,7 @@ BINDIR?=	/boot
 LOADER_ADDRESS?=0x200000
 CFLAGS+=	-ffreestanding -mpreferred-stack-boundary=2 \
 		-mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 \
-		-Os
+		-Os -DPC98
 LDFLAGS+=	-nostdlib
 
 # BTX components


More information about the svn-src-all mailing list