Skip to content
Snippets Groups Projects
Commit 27bc1a7b authored by cshapiro's avatar cshapiro
Browse files

Minor changes to support the latest betas of FreeBSD 7.

* Update the Config file to detect the GCC version at build time and
  use -iquote instead of -I- if we are not using GCC 2 or 3.  This
  silences the unsilenceable deprecation message emitted by GCC 4.

* Check the FreeBSD version at compile time and switch the protection
  violation signal to SIGSEGV if we are on a version of FreeBSD 7 that
  will deliver a SIGSEGV instead of a SIGBUS for access errors.

* Install sigbus_handler to handle whatever UNIX signal the macro
  PROTECTION_VIOLATION_SIGNAL expands to.  Get rid of the useless
  sigsegv_handler.  Add the PROTECTION_VIOLATION_CODE macro so we do
  not have to conditionalize the check that guards the write barrier
  code.
parent 909ee789
No related branches found
No related tags found
No related merge requests found
......@@ -2,10 +2,14 @@ PATH1 = ../../src/lisp
vpath %.h $(PATH1)
vpath %.c $(PATH1)
vpath %.S $(PATH1)
CPPFLAGS = -I. -I$(PATH1) -I- -I/usr/X11R6/include
CC = gcc
LD = ld
CPP = cpp
ifneq (,$(filter 2% 3%, $(shell $(CC) -dumpversion)))
CPPFLAGS = -I. -I$(PATH1) -I- -I/usr/X11R6/include
else
CPPFLAGS = -iquote . -iquote $(PATH1) -I/usr/X11R6/include
endif
CFLAGS = -Wstrict-prototypes -Wall -O2 -g -DGENCGC -DLINKAGE_TABLE
ASFLAGS = -g -DGENCGC -DLINKAGE_TABLE
NM = nm -gp
......
......@@ -12,7 +12,7 @@
* Much hacked by Paul Werkowski
* GENCGC support by Douglas Crosher, 1996, 1997.
*
* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/FreeBSD-os.c,v 1.20 2007/07/31 10:08:47 cshapiro Exp $
* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/FreeBSD-os.c,v 1.21 2007/12/06 13:51:21 cshapiro Exp $
*
*/
......@@ -159,7 +159,7 @@ sigbus_handler(int signal, siginfo_t *info, ucontext_t *context)
#endif
#if defined GENCGC
if (info->si_code == BUS_PAGE_FAULT) {
if (info->si_code == PROTECTION_VIOLATION_CODE) {
page_index = find_page_index(info->si_addr);
/* Check if the fault is within the dynamic space. */
......@@ -183,19 +183,11 @@ sigbus_handler(int signal, siginfo_t *info, ucontext_t *context)
interrupt_handle_now(signal, info, context);
}
static void
sigsegv_handler(int signal, siginfo_t *info, ucontext_t *context)
{
interrupt_handle_now(signal, info, context);
}
void
os_install_interrupt_handlers(void)
{
interrupt_install_low_level_handler
(SIGSEGV, (void (*)(HANDLER_ARGS)) sigsegv_handler);
interrupt_install_low_level_handler
(SIGBUS, (void (*)(HANDLER_ARGS)) sigbus_handler);
(PROTECTION_VIOLATION_SIGNAL, sigbus_handler);
}
void *
......
/*
$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/FreeBSD-os.h,v 1.18 2007/07/15 21:33:14 cshapiro Exp $
$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/FreeBSD-os.h,v 1.19 2007/12/06 13:51:21 cshapiro Exp $
This code was written as part of the CMU Common Lisp project at
Carnegie Mellon University, and has been placed in the public domain.
......@@ -15,6 +15,7 @@
#include <sys/mman.h>
#include <sys/signal.h>
#include <osreldate.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
......@@ -39,7 +40,13 @@ typedef int os_vm_prot_t;
int *sc_reg(ucontext_t *, int);
#if __FreeBSD_version < 700004
#define PROTECTION_VIOLATION_SIGNAL SIGBUS
#define PROTECTION_VIOLATION_CODE BUS_PAGE_FAULT
#else
#define PROTECTION_VIOLATION_SIGNAL SIGSEGV
#define PROTECTION_VIOLATION_CODE SEGV_ACCERR
#endif
#undef PAGE_SIZE
......
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