HP300 fixes from Mike Hibler
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Fri, 8 Jun 1990 02:37:47 +0000 (18:37 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Fri, 8 Jun 1990 02:37:47 +0000 (18:37 -0800)
SCCS-vsn: usr.sbin/kvm_mkdb/kvm_mkdb.c 5.4

usr/src/usr.sbin/kvm_mkdb/kvm_mkdb.c

index 9562c96..488f53b 100644 (file)
@@ -12,7 +12,7 @@ char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)kvm_mkdb.c 5.3 (Berkeley) %G%";
+static char sccsid[] = "@(#)kvm_mkdb.c 5.4 (Berkeley) %G%";
 #endif /* not lint */
 
 #include <sys/param.h>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -88,7 +88,7 @@ rmdb(file)
                syserrexit("can't unlink %s", file);
        *(file+len) = '\0';
 }
                syserrexit("can't unlink %s", file);
        *(file+len) = '\0';
 }
-       
+
 mvdb(from, to)
        char *from;
        char *to;
 mvdb(from, to)
        char *from;
        char *to;
@@ -186,12 +186,15 @@ create_knlist(name, db)
                        long versoff;
                        long reloffset;
 
                        long versoff;
                        long reloffset;
 
+                       /* offset relative to start of text image in VM. */
+#ifdef hp300
+                       reloffset = s->n_value;
+#endif
+#ifdef tahoe
                        /*
                        /*
-                        * Offset relative to start of text image in VM.
-                        * On tahoe, first 0x800 is reserved for
-                        * communication with the console processor.
+                        * on tahoe, first 0x800 is reserved for communication
+                        * with the console processor.
                         */
                         */
-#ifdef tahoe
                        reloffset = ((s->n_value & ~KERNBASE) - 0x800);
 #endif
 #ifdef vax
                        reloffset = ((s->n_value & ~KERNBASE) - 0x800);
 #endif
 #ifdef vax
@@ -199,9 +202,9 @@ create_knlist(name, db)
 #endif
                        /*
                         * When loaded, data is rounded
 #endif
                        /*
                         * When loaded, data is rounded
-                        * to next 1024 after text, but not in file.
+                        * to next page cluster after text, but not in file.
                         */
                         */
-                       reloffset -= 1024 - (ebuf.a_text % 1024);
+                       reloffset -= CLBYTES - (ebuf.a_text % CLBYTES);
                        versoff = N_TXTOFF(ebuf) + reloffset;
                        if (fseek(fstr, versoff, SEEK_SET) == -1)
                                syserrexit("seek (version): %x", s->n_value);
                        versoff = N_TXTOFF(ebuf) + reloffset;
                        if (fseek(fstr, versoff, SEEK_SET) == -1)
                                syserrexit("seek (version): %x", s->n_value);