*/
#include <stdio.h>
-#include <sys/types.h>
+#include <stdlib.h>
#include <sys/file.h>
+#include <sys/types.h>
+#include <unistd.h>
#ifdef irix
#include <fcntl.h>
-#include <stdlib.h>
#endif
#include "os.h"
#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;
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;
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) {
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) {