Skip to content
Snippets Groups Projects
Commit 6f4a04e5 authored by hallgren's avatar hallgren
Browse files

Updated for the Alpha.

parent ee82c29e
No related branches found
No related tags found
No related merge requests found
/* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/alloc.c,v 1.1 1992/07/28 20:14:02 wlott Exp $ */ /* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/alloc.c,v 1.2 1994/03/27 15:19:55 hallgren Exp $ */
#include "lisp.h" #include "lisp.h"
#include "internals.h" #include "internals.h"
...@@ -108,8 +108,11 @@ lispobj alloc_string(char *str) ...@@ -108,8 +108,11 @@ lispobj alloc_string(char *str)
lispobj alloc_sap(void *ptr) lispobj alloc_sap(void *ptr)
{ {
#ifndef alpha
struct sap *sap = (struct sap *)alloc_unboxed(type_Sap, 1); struct sap *sap = (struct sap *)alloc_unboxed(type_Sap, 1);
#else
struct sap *sap = (struct sap *)alloc_unboxed(type_Sap, 3);
#endif
sap->pointer = ptr; sap->pointer = ptr;
return (lispobj) sap | type_OtherPointer; return (lispobj) sap | type_OtherPointer;
......
/* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/backtrace.c,v 1.2 1993/01/10 17:22:33 wlott Exp $ /* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/backtrace.c,v 1.3 1994/03/27 15:19:14 hallgren Exp $
* *
* Simple backtrace facility. More or less from Rob's lisp version. * Simple backtrace facility. More or less from Rob's lisp version.
*/ */
...@@ -17,16 +17,28 @@ ...@@ -17,16 +17,28 @@
better not change. */ better not change. */
struct call_frame { struct call_frame {
#ifndef alpha
struct call_frame *old_cont; struct call_frame *old_cont;
#else
u32 old_cont;
#endif
lispobj saved_lra; lispobj saved_lra;
lispobj code; lispobj code;
lispobj other_state[5]; lispobj other_state[5];
}; };
struct call_info { struct call_info {
#ifndef alpha
struct call_frame *frame; struct call_frame *frame;
#else
u32 frame;
#endif
int interrupted; int interrupted;
#ifndef alpha
struct code *code; struct code *code;
#else
u32 code;
#endif
lispobj lra; lispobj lra;
int pc; /* Note: this is the trace file offset, not the actual pc. */ int pc; /* Note: this is the trace file offset, not the actual pc. */
}; };
...@@ -104,7 +116,11 @@ info_from_sigcontext(struct call_info *info, struct sigcontext *csp) ...@@ -104,7 +116,11 @@ info_from_sigcontext(struct call_info *info, struct sigcontext *csp)
} }
if (info->code != NULL) if (info->code != NULL)
info->pc = pc - (unsigned long) info->code - info->pc = pc - (unsigned long) info->code -
#ifndef alpha
(HEADER_LENGTH(info->code->header) * sizeof(lispobj)); (HEADER_LENGTH(info->code->header) * sizeof(lispobj));
#else
(HEADER_LENGTH(((struct code *)info->code)->header) * sizeof(lispobj));
#endif
else else
info->pc = 0; info->pc = 0;
} }
...@@ -145,7 +161,11 @@ previous_info(struct call_info *info) ...@@ -145,7 +161,11 @@ previous_info(struct call_info *info)
if (info->code != NULL) if (info->code != NULL)
info->pc = (unsigned long)PTR(info->lra) - info->pc = (unsigned long)PTR(info->lra) -
(unsigned long)info->code - (unsigned long)info->code -
#ifndef alpha
(HEADER_LENGTH(info->code->header) * sizeof(lispobj)); (HEADER_LENGTH(info->code->header) * sizeof(lispobj));
#else
(HEADER_LENGTH(((struct code *)info->code)->header) * sizeof(lispobj));
#endif
else else
info->pc = 0; info->pc = 0;
} }
...@@ -169,7 +189,11 @@ backtrace(int nframes) ...@@ -169,7 +189,11 @@ backtrace(int nframes)
printf("CODE: 0x%08X, ", (unsigned long) info.code | type_OtherPointer); printf("CODE: 0x%08X, ", (unsigned long) info.code | type_OtherPointer);
#ifndef alpha
function = info.code->entry_points; function = info.code->entry_points;
#else
function = ((struct code *)info.code)->entry_points;
#endif
while (function != NIL) { while (function != NIL) {
struct function *header; struct function *header;
lispobj name; lispobj name;
......
/* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/core.h,v 1.2 1993/04/28 01:58:30 wlott Exp $ */ /* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/core.h,v 1.3 1994/03/27 15:17:54 hallgren Exp $ */
#ifndef _CORE_H_ #ifndef _CORE_H_
#define _CORE_H_ #define _CORE_H_
...@@ -19,11 +19,19 @@ ...@@ -19,11 +19,19 @@
#define READ_ONLY_SPACE_ID (3) #define READ_ONLY_SPACE_ID (3)
struct ndir_entry { struct ndir_entry {
#ifndef alpha
long identifier; long identifier;
long nwords; long nwords;
long data_page; long data_page;
long address; long address;
long page_count; long page_count;
#else
u32 identifier;
u32 nwords;
u32 data_page;
u32 address;
u32 page_count;
#endif
}; };
extern lispobj load_core_file(char *file); extern lispobj load_core_file(char *file);
......
/* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/coreparse.c,v 1.2 1993/04/28 01:58:31 wlott Exp $ */ /* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/coreparse.c,v 1.3 1994/03/27 15:26:25 hallgren Exp $ */
#include <stdio.h> #include <stdio.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/file.h> #include <sys/file.h>
...@@ -40,7 +40,7 @@ static void process_directory(int fd, long *ptr, int count) ...@@ -40,7 +40,7 @@ static void process_directory(int fd, long *ptr, int count)
addr); addr);
} }
#if 0 #ifdef 0
printf("Space ID = %d, free pointer = 0x%08x.\n", id, free_pointer); printf("Space ID = %d, free pointer = 0x%08x.\n", id, free_pointer);
#endif #endif
...@@ -73,7 +73,11 @@ static void process_directory(int fd, long *ptr, int count) ...@@ -73,7 +73,11 @@ static void process_directory(int fd, long *ptr, int count)
lispobj load_core_file(char *file) lispobj load_core_file(char *file)
{ {
int fd = open(file, O_RDONLY), count; int fd = open(file, O_RDONLY), count;
#ifndef alpha
long header[CORE_PAGESIZE / sizeof(long)], val, len, *ptr; long header[CORE_PAGESIZE / sizeof(long)], val, len, *ptr;
#else
u32 header[CORE_PAGESIZE / sizeof(u32)], val, len, *ptr;
#endif
lispobj initial_function = NIL; lispobj initial_function = NIL;
if (fd < 0) { if (fd < 0) {
...@@ -121,7 +125,11 @@ lispobj load_core_file(char *file) ...@@ -121,7 +125,11 @@ lispobj load_core_file(char *file)
case CORE_NDIRECTORY: case CORE_NDIRECTORY:
process_directory(fd, ptr, process_directory(fd, ptr,
#ifndef alpha
(len-2) / (sizeof(struct ndir_entry) / sizeof(long))); (len-2) / (sizeof(struct ndir_entry) / sizeof(long)));
#else
(len-2) / (sizeof(struct ndir_entry) / sizeof(u32)));
#endif
break; break;
case CORE_INITIAL_FUNCTION: case CORE_INITIAL_FUNCTION:
......
/* /*
* Stop and Copy GC based on Cheney's algorithm. * Stop and Copy GC based on Cheney's algorithm.
* *
* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/gc.c,v 1.6 1993/07/27 15:00:59 hallgren Exp $ * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/gc.c,v 1.7 1994/03/27 15:17:01 hallgren Exp $
* *
* Written by Christopher Hoover. * Written by Christopher Hoover.
*/ */
...@@ -143,20 +143,31 @@ static double tv_diff(struct timeval *x, struct timeval *y) ...@@ -143,20 +143,31 @@ static double tv_diff(struct timeval *x, struct timeval *y)
static void zero_stack(void) static void zero_stack(void)
{ {
#ifndef alpha
unsigned long *ptr = (unsigned long *)current_control_stack_pointer; unsigned long *ptr = (unsigned long *)current_control_stack_pointer;
#else
u32 *ptr = (u32 *)current_control_stack_pointer;
#endif
search: search:
do { do {
if (*ptr) if (*ptr)
goto fill; goto fill;
ptr++; ptr++;
#ifndef alpha
} while (((unsigned long)ptr) & (BYTES_ZERO_BEFORE_END-1)); } while (((unsigned long)ptr) & (BYTES_ZERO_BEFORE_END-1));
#else
} while (((u32)ptr) & (BYTES_ZERO_BEFORE_END-1));
#endif
return; return;
fill: fill:
do { do {
*ptr++ = 0; *ptr++ = 0;
#ifndef alpha
} while (((unsigned long)ptr) & (BYTES_ZERO_BEFORE_END-1)); } while (((unsigned long)ptr) & (BYTES_ZERO_BEFORE_END-1));
#else
} while (((u32)ptr) & (BYTES_ZERO_BEFORE_END-1));
#endif
goto search; goto search;
} }
......
/* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/interrupt.c,v 1.2 1992/09/08 20:25:46 wlott Exp $ */ /* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/interrupt.c,v 1.3 1994/03/27 15:32:03 hallgren Exp $ */
/* Interrupt handing magic. */ /* Interrupt handing magic. */
...@@ -47,6 +47,12 @@ void fake_foreign_function_call(struct sigcontext *context) ...@@ -47,6 +47,12 @@ void fake_foreign_function_call(struct sigcontext *context)
/* Get current LISP state from context */ /* Get current LISP state from context */
#ifdef reg_ALLOC #ifdef reg_ALLOC
current_dynamic_space_free_pointer = (lispobj *)SC_REG(context, reg_ALLOC); current_dynamic_space_free_pointer = (lispobj *)SC_REG(context, reg_ALLOC);
#ifdef alpha
if((long) current_dynamic_space_free_pointer & 1) {
printf("Dead in fake_foriegn_function-call, context = %x\n",context);
lose("");
}
#endif
#endif #endif
#ifdef reg_BSP #ifdef reg_BSP
current_binding_stack_pointer = (lispobj *)SC_REG(context, reg_BSP); current_binding_stack_pointer = (lispobj *)SC_REG(context, reg_BSP);
......
/* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/lisp.h,v 1.1 1992/07/28 20:14:40 wlott Exp $ */ /* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/lisp.h,v 1.2 1994/03/27 15:27:35 hallgren Exp $ */
#ifndef _LISP_H_ #ifndef _LISP_H_
#define _LISP_H_ #define _LISP_H_
...@@ -18,7 +18,13 @@ ...@@ -18,7 +18,13 @@
#define SYMBOL(obj) ((struct symbol *)((obj)-type_OtherPointer)) #define SYMBOL(obj) ((struct symbol *)((obj)-type_OtherPointer))
#define FDEFN(obj) ((struct fdefn *)((obj)-type_OtherPointer)) #define FDEFN(obj) ((struct fdefn *)((obj)-type_OtherPointer))
#ifndef alpha
typedef unsigned long lispobj; typedef unsigned long lispobj;
#else
typedef unsigned int u32;
typedef signed int s32;
typedef u32 lispobj;
#endif
#define make_fixnum(n) ((lispobj)((n)<<2)) #define make_fixnum(n) ((lispobj)((n)<<2))
#define fixnum_value(n) (((long)n)>>2) #define fixnum_value(n) (((long)n)>>2)
......
/* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/lispregs.h,v 1.1 1992/07/28 20:14:41 wlott Exp $ */ /* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/lispregs.h,v 1.2 1994/03/27 15:20:39 hallgren Exp $ */
#ifdef mips #ifdef mips
#include "mips-lispregs.h" #include "mips-lispregs.h"
...@@ -20,6 +20,10 @@ ...@@ -20,6 +20,10 @@
#include "hppa-lispregs.h" #include "hppa-lispregs.h"
#endif #endif
#ifdef alpha
#include "alpha-lispregs.h"
#endif
#ifndef LANGUAGE_ASSEMBLY #ifndef LANGUAGE_ASSEMBLY
extern char *lisp_register_names[]; extern char *lisp_register_names[];
#endif #endif
/* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/monitor.c,v 1.3 1993/04/28 01:59:00 wlott Exp $ */ /* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/monitor.c,v 1.4 1994/03/27 15:21:16 hallgren Exp $ */
#include <stdio.h> #include <stdio.h>
#include <sys/types.h> #include <sys/types.h>
...@@ -101,9 +101,17 @@ static void dump_cmd(char **ptr) ...@@ -101,9 +101,17 @@ static void dump_cmd(char **ptr)
} }
while (count-- > 0) { while (count-- > 0) {
printf("0x%08X: ", (unsigned long)addr); #ifndef alpha
printf("0x%08X: ", (unsigned long) addr);
#else
printf("0x%08X: ", (u32) addr);
#endif
if (valid_addr((os_vm_address_t)addr)) { if (valid_addr((os_vm_address_t)addr)) {
#ifndef alpha
unsigned long *lptr = (unsigned long *)addr; unsigned long *lptr = (unsigned long *)addr;
#else
u32 *lptr = (unsigned long *)addr;
#endif
unsigned short *sptr = (unsigned short *)addr; unsigned short *sptr = (unsigned short *)addr;
unsigned char *cptr = (unsigned char *)addr; unsigned char *cptr = (unsigned char *)addr;
......
/* /*
* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/os.h,v 1.2 1993/07/27 15:40:17 hallgren Exp $ * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/os.h,v 1.3 1994/03/27 15:22:39 hallgren Exp $
* *
* Common interface for os-dependent functions. * Common interface for os-dependent functions.
* *
...@@ -19,6 +19,10 @@ ...@@ -19,6 +19,10 @@
#else #else
#ifdef hpux #ifdef hpux
#include "hpux-os.h" #include "hpux-os.h"
#else
#ifdef osf1
#include "osf1-os.h"
#endif
#endif #endif
#endif #endif
#endif #endif
......
/* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/print.c,v 1.2 1993/02/26 09:02:05 ram Exp $ */ /* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/print.c,v 1.3 1994/03/27 15:18:07 hallgren Exp $ */
#include <stdio.h> #include <stdio.h>
#include "print.h" #include "print.h"
...@@ -124,12 +124,20 @@ static void newline(char *label) ...@@ -124,12 +124,20 @@ static void newline(char *label)
static void brief_fixnum(lispobj obj) static void brief_fixnum(lispobj obj)
{ {
#ifndef alpha
printf("%d", ((long)obj)>>2); printf("%d", ((long)obj)>>2);
#else
printf("%d", ((s32)obj)>>2);
#endif
} }
static void print_fixnum(lispobj obj) static void print_fixnum(lispobj obj)
{ {
#ifndef alpha
printf(": %d", ((long)obj)>>2); printf(": %d", ((long)obj)>>2);
#else
printf(": %d", ((s32)obj)>>2);
#endif
} }
static void brief_otherimm(lispobj obj) static void brief_otherimm(lispobj obj)
...@@ -348,9 +356,15 @@ static void print_otherptr(lispobj obj) ...@@ -348,9 +356,15 @@ static void print_otherptr(lispobj obj)
if (!valid_addr(obj)) if (!valid_addr(obj))
printf("(invalid address)"); printf("(invalid address)");
else { else {
#ifndef alpha
unsigned long *ptr; unsigned long *ptr;
unsigned long header; unsigned long header;
unsigned long length; unsigned long length;
#else
u32 *ptr;
u32 header;
u32 length;
#endif
int count, type, index; int count, type, index;
char *cptr, buffer[16]; char *cptr, buffer[16];
...@@ -458,7 +472,11 @@ static void print_otherptr(lispobj obj) ...@@ -458,7 +472,11 @@ static void print_otherptr(lispobj obj)
case type_Sap: case type_Sap:
NEWLINE; NEWLINE;
#ifndef alpha
printf("0x%08x", *ptr); printf("0x%08x", *ptr);
#else
printf("0x%016lx", *(long*)(ptr+1));
#endif
break; break;
case type_WeakPointer: case type_WeakPointer:
......
/* Routines that must be linked into the core for lisp to work. */ /* Routines that must be linked into the core for lisp to work. */
/* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/undefineds.h,v 1.2 1993/07/27 15:11:19 hallgren Exp $ */ /* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/undefineds.h,v 1.3 1994/03/27 15:24:12 hallgren Exp $ */
/* Pick up all the syscalls. */ /* Pick up all the syscalls. */
accept, accept,
...@@ -71,7 +71,7 @@ open, ...@@ -71,7 +71,7 @@ open,
pipe, pipe,
profil, profil,
ptrace, ptrace,
#if !defined(SUNOS) && !defined(parisc) #if !defined(SUNOS) && !defined(parisc) && !defined(osf1)
quota, quota,
#endif #endif
read, read,
...@@ -96,7 +96,7 @@ sethostname, ...@@ -96,7 +96,7 @@ sethostname,
setitimer, setitimer,
setpgrp, setpgrp,
setpriority, setpriority,
#if !defined(SUNOS) && !defined(parisc) #if !defined(SUNOS) && !defined(parisc) && !defined(osf1)
setquota, setquota,
#endif #endif
#ifndef hpux #ifndef hpux
...@@ -139,7 +139,9 @@ unlink, ...@@ -139,7 +139,9 @@ unlink,
utimes, utimes,
#endif #endif
vfork, vfork,
#ifndef osf1
vhangup, vhangup,
#endif
wait, wait,
wait3, wait3,
write, write,
...@@ -184,3 +186,4 @@ gethostbyaddr, ...@@ -184,3 +186,4 @@ gethostbyaddr,
/* Other random things. */ /* Other random things. */
getwd, getwd,
ttyname ttyname
/* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/validate.h,v 1.1 1992/07/28 20:15:37 wlott Exp $ */ /* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/validate.h,v 1.2 1994/03/27 15:22:16 hallgren Exp $ */
#if !defined(_INCLUDE_VALIDATE_H_) #if !defined(_INCLUDE_VALIDATE_H_)
#define _INCLUDE_VALIDATE_H_ #define _INCLUDE_VALIDATE_H_
...@@ -23,6 +23,10 @@ ...@@ -23,6 +23,10 @@
#include "x86-validate.h" #include "x86-validate.h"
#endif #endif
#ifdef alpha
#include "alpha-validate.h"
#endif
extern void validate(void); extern void validate(void);
#endif #endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment