X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fcoreparse.c;h=1276c077fa3e36ffc94c689a023c6f17ae9e0a8d;hb=3bd7a97d1b11a2b0aee086ef211cae807f3dfc35;hp=80288aa9f0f8b720fb624e0c1bbc3c1ff3668a2f;hpb=d7f6139a91d7d9b0667a597584ae306d958bb2f4;p=sbcl.git diff --git a/src/runtime/coreparse.c b/src/runtime/coreparse.c index 80288aa..1276c07 100644 --- a/src/runtime/coreparse.c +++ b/src/runtime/coreparse.c @@ -15,12 +15,13 @@ */ #include -#include +#include #include +#include +#include #ifdef irix #include -#include #endif #include "os.h" @@ -32,7 +33,7 @@ #include "sbcl.h" static void -process_directory(int fd, long *ptr, int count) +process_directory(int fd, u32 *ptr, int count) { struct ndir_entry *entry; @@ -67,42 +68,45 @@ process_directory(int fd, long *ptr, int count) case DYNAMIC_SPACE_ID: #ifdef GENCGC if (addr != (os_vm_address_t)DYNAMIC_SPACE_START) { - fprintf(stderr, "in core: 0x%x - in runtime: 0x%x \n", - addr, (os_vm_address_t)DYNAMIC_SPACE_START); - fprintf(stderr,"warning: core/runtime address mismatch: DYNAMIC_SPACE_START"); + fprintf(stderr, "in core: 0x%lx; in runtime: 0x%lx \n", + (long)addr, (long)DYNAMIC_SPACE_START); + lose("core/runtime address mismatch: DYNAMIC_SPACE_START"); } #else if ((addr != (os_vm_address_t)DYNAMIC_0_SPACE_START) && (addr != (os_vm_address_t)DYNAMIC_1_SPACE_START)) { - fprintf(stderr, "in core: 0x%x - in runtime: 0x%x or 0x%x\n", - addr, (os_vm_address_t)DYNAMIC_0_SPACE_START, - (os_vm_address_t)DYNAMIC_1_SPACE_START); - fprintf(stderr,"warning: core/runtime address mismatch: DYNAMIC_SPACE_START"); + fprintf(stderr, "in core: 0x%lx; in runtime: 0x%lx or 0x%lx\n", + (long)addr, + (long)DYNAMIC_0_SPACE_START, + (long)DYNAMIC_1_SPACE_START); + lose("warning: core/runtime address mismatch: DYNAMIC_SPACE_START"); } #endif /* FIXME: Should the conditional here be reg_ALLOC instead of - * defined(ibmrt) || defined(__i386__) + * defined(__i386__) * ? */ -#if defined(ibmrt) || defined(__i386__) +#if defined(__i386__) SetSymbolValue(ALLOCATION_POINTER, (lispobj)free_pointer); #else dynamic_space_free_pointer = free_pointer; #endif - /* With GENCGC, this will always be space 0. (We checked - * above that addr==DYNAMIC_SPACE_START.) */ + /* For stop-and-copy GC, this will be whatever the GC was + * using at the time. With GENCGC, this will always be + * space 0. (We checked above that for GENCGC, + * addr==DYNAMIC_SPACE_START.) */ current_dynamic_space = (lispobj *)addr; break; case STATIC_SPACE_ID: if (addr != (os_vm_address_t)STATIC_SPACE_START) { - fprintf(stderr, "in core: 0x%p - in runtime: 0x%x\n", - addr, (os_vm_address_t)STATIC_SPACE_START); + fprintf(stderr, "in core: 0x%lx - in runtime: 0x%lx\n", + (long)addr, (long)STATIC_SPACE_START); lose("core/runtime address mismatch: STATIC_SPACE_START"); } break; case READ_ONLY_SPACE_ID: if (addr != (os_vm_address_t)READ_ONLY_SPACE_START) { - fprintf(stderr, "in core: 0x%x - in runtime: 0x%x\n", - addr, (os_vm_address_t)READ_ONLY_SPACE_START); + fprintf(stderr, "in core: 0x%lx - in runtime: 0x%lx\n", + (long)addr, (long)READ_ONLY_SPACE_START); lose("core/runtime address mismatch: READ_ONLY_SPACE_START"); } break; @@ -115,20 +119,9 @@ process_directory(int fd, long *ptr, int count) lispobj load_core_file(char *file) { + u32 *header, val, len, *ptr, remaining_len; int fd = open(file, O_RDONLY), count; - /* KLUDGE: This kind of conditionalization everywhere that 32-bit - * ints are used is really nasty. It would be much nicer to define - * a typedef like addr_as_int once and for all in each - * architecture file, then use that everywhere. -- WHN 19990904 */ -#ifndef alpha - long *header, val, len, *ptr; - long remaining_len; -#else - u32 *header, val, len, *ptr; - u32 remaining_len; -#endif - lispobj initial_function = NIL; FSHOW((stderr, "/entering load_core_file(%s)\n", file)); if (fd < 0) { @@ -137,7 +130,7 @@ load_core_file(char *file) exit(1); } - header = calloc(os_vm_page_size / sizeof(u32),sizeof(u32)); + header = calloc(os_vm_page_size / sizeof(u32), sizeof(u32)); count = read(fd, header, os_vm_page_size); if (count < os_vm_page_size) {