Skip to content
Snippets Groups Projects
Commit c0c1a60b authored by wlott's avatar wlott
Browse files

Added some changes from Miles.

parent cf52846d
No related branches found
No related tags found
No related merge requests found
/* /*
* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/ldb/Attic/sunos-os.c,v 1.1 1991/05/24 18:43:45 wlott Exp $ * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/ldb/Attic/sunos-os.c,v 1.2 1991/09/04 15:01:36 wlott Exp $
* *
* OS-dependent routines. This file (along with os.h) exports an * OS-dependent routines. This file (along with os.h) exports an
* OS-independent interface to the operating system VM facilities. * OS-independent interface to the operating system VM facilities.
...@@ -35,6 +35,8 @@ ...@@ -35,6 +35,8 @@
#define MAX_SEGS 64 #define MAX_SEGS 64
extern char *getenv();
/* ---------------------------------------------------------------- */ /* ---------------------------------------------------------------- */
#define ADJ_OFFSET(off,adj) (((off)==OFFSET_NONE) ? OFFSET_NONE : ((off)+(adj))) #define ADJ_OFFSET(off,adj) (((off)==OFFSET_NONE) ? OFFSET_NONE : ((off)+(adj)))
...@@ -58,12 +60,15 @@ static os_vm_size_t real_page_size_difference=0; ...@@ -58,12 +60,15 @@ static os_vm_size_t real_page_size_difference=0;
void os_init() void os_init()
{ {
void sunos_segv_handler(); char *empty_file=getenv("CMUCL_EMPTYFILE");
zero_fd=open(ZEROFILE,O_RDONLY); if(empty_file==NULL)
empty_file=EMPTYFILE;
empty_fd=open(EMPTYFILE,O_RDONLY|O_CREAT); empty_fd=open(empty_file,O_RDONLY|O_CREAT);
unlink(EMPTYFILE); unlink(empty_file);
zero_fd=open(ZEROFILE,O_RDONLY);
os_vm_page_size=getpagesize(); os_vm_page_size=getpagesize();
...@@ -660,15 +665,33 @@ caddr_t addr; ...@@ -660,15 +665,33 @@ caddr_t addr;
* note that we check for a gc-trigger hit even if it's not a PROT error * note that we check for a gc-trigger hit even if it's not a PROT error
*/ */
else if(!maybe_gc(context)){ else if(!maybe_gc(context)){
if(code == SEGV_NOMAP) static int nomap_count=0;
fprintf(stderr, "segv_handler: No mapping fault: 0x%08x\n",addr);
else if (SEGV_CODE(code) == SEGV_OBJERR) { if(code==SEGV_NOMAP){
if(nomap_count==0){
fprintf(stderr,
"segv_handler: No mapping fault: 0x%08x\n",addr);
nomap_count++;
}else{
/*
* There should be higher-level protection against stack
* overflow somewhere, but at least this prevents infinite
* puking of error messages...
*/
fprintf(stderr,
"segv_handler: Recursive no mapping fault (stack overflow?)\n");
exit(-1);
}
}else if(SEGV_CODE(code)==SEGV_OBJERR){
extern int errno; extern int errno;
errno=SEGV_ERRNO(code); errno=SEGV_ERRNO(code);
perror("segv_handler: Object error"); perror("segv_handler: Object error");
} }
interrupt_handle_now(sig,code,context); interrupt_handle_now(sig,code,context);
if(code==SEGV_NOMAP)
nomap_count--;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment