Skip to content
Snippets Groups Projects
Commit 042fdad7 authored by cshapiro's avatar cshapiro
Browse files

Remove conditionally-compiled code to support old Linux versions.

parent 37100312
No related branches found
No related tags found
No related merge requests found
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
* GENCGC support by Douglas Crosher, 1996, 1997. * GENCGC support by Douglas Crosher, 1996, 1997.
* Alpha support by Julian Dolby, 1999. * Alpha support by Julian Dolby, 1999.
* *
* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/Linux-os.c,v 1.28 2007/07/13 05:03:03 cshapiro Exp $ * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/Linux-os.c,v 1.29 2007/07/13 08:34:21 cshapiro Exp $
* *
*/ */
...@@ -56,17 +56,13 @@ size_t os_vm_page_size; ...@@ -56,17 +56,13 @@ size_t os_vm_page_size;
#include "gencgc.h" #include "gencgc.h"
#endif #endif
#if ((LINUX_VERSION_CODE >= linuxversion(2,1,0)) || (__GNU_LIBRARY__ >= 6))
int PVE_stub_errno; int PVE_stub_errno;
#endif
#if ((LINUX_VERSION_CODE >= linuxversion(2,1,0)) || (__GNU_LIBRARY__ >= 6))
void void
update_errno(void) update_errno(void)
{ {
PVE_stub_errno = errno; PVE_stub_errno = errno;
} }
#endif
void void
...@@ -101,11 +97,7 @@ os_init(void) ...@@ -101,11 +97,7 @@ os_init(void)
#ifdef i386 #ifdef i386
int * int *
#if (LINUX_VERSION_CODE >= linuxversion(2,1,0)) || (__GNU_LIBRARY__ >= 6)
sc_reg(struct sigcontext *c, int offset) sc_reg(struct sigcontext *c, int offset)
#else
sc_reg(struct sigcontext_struct *c, int offset)
#endif
{ {
switch (offset) { switch (offset) {
case 0: case 0:
...@@ -288,11 +280,7 @@ void ...@@ -288,11 +280,7 @@ void
sigsegv_handler(HANDLER_ARGS) sigsegv_handler(HANDLER_ARGS)
{ {
GET_CONTEXT GET_CONTEXT
#if (LINUX_VERSION_CODE >= linuxversion(2,1,0)) || (__GNU_LIBRARY__ >= 6)
int fault_addr = ((struct sigcontext *) (&contextstruct))->cr2; int fault_addr = ((struct sigcontext *) (&contextstruct))->cr2;
#else
int fault_addr = ((struct sigcontext_struct *) (&contextstruct))->cr2;
#endif
int page_index = find_page_index((void *) fault_addr); int page_index = find_page_index((void *) fault_addr);
#ifdef RED_ZONE_HIT #ifdef RED_ZONE_HIT
......
/* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/Linux-os.h,v 1.22 2007/07/09 16:03:51 fgilham Exp $ /* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/Linux-os.h,v 1.23 2007/07/13 08:34:21 cshapiro Exp $
This code was written as part of the CMU Common Lisp project at This code was written as part of the CMU Common Lisp project at
Carnegie Mellon University, and has been placed in the public domain. Carnegie Mellon University, and has been placed in the public domain.
...@@ -25,9 +25,6 @@ ...@@ -25,9 +25,6 @@
#include <sys/syscall.h> #include <sys/syscall.h>
#include <asm/unistd.h> #include <asm/unistd.h>
#include <errno.h> #include <errno.h>
#include <linux/version.h>
#define linuxversion(a, b, c) (((a)<<16)+((b)<<8)+(c))
typedef caddr_t os_vm_address_t; /* like hpux */ typedef caddr_t os_vm_address_t; /* like hpux */
typedef size_t os_vm_size_t; /* like hpux */ typedef size_t os_vm_size_t; /* like hpux */
...@@ -44,20 +41,12 @@ typedef int os_vm_prot_t; /* like hpux */ ...@@ -44,20 +41,12 @@ typedef int os_vm_prot_t; /* like hpux */
#define OS_VM_DEFAULT_PAGESIZE 8192 /* like hpux */ #define OS_VM_DEFAULT_PAGESIZE 8192 /* like hpux */
#endif #endif
#if (LINUX_VERSION_CODE >= linuxversion(2,1,0)) || (__GNU_LIBRARY__ >= 6)
int *sc_reg(struct sigcontext *, int); int *sc_reg(struct sigcontext *, int);
#else
int *sc_reg(struct sigcontext_struct *, int);
#endif
void os_save_context(void); void os_save_context(void);
#define SAVE_CONTEXT os_save_context #define SAVE_CONTEXT os_save_context
#if (LINUX_VERSION_CODE >= linuxversion(2,1,0)) || (__GNU_LIBRARY__ >= 6)
typedef struct sigcontext sigcontext; typedef struct sigcontext sigcontext;
#else
typedef struct sigcontext_struct sigcontext;
#endif
/* Don't want the SIGINFO flag on linux as it causes the creation /* Don't want the SIGINFO flag on linux as it causes the creation
of real-time interrupt frames. of real-time interrupt frames.
...@@ -70,13 +59,8 @@ typedef struct sigcontext_struct sigcontext; ...@@ -70,13 +59,8 @@ typedef struct sigcontext_struct sigcontext;
*/ */
#if (defined(i386) || defined(__x86_64)) #if (defined(i386) || defined(__x86_64))
#if (LINUX_VERSION_CODE >= linuxversion(2,1,0)) || (__GNU_LIBRARY__ >= 6)
#define HANDLER_ARGS int signal, struct sigcontext contextstruct #define HANDLER_ARGS int signal, struct sigcontext contextstruct
#define GET_CONTEXT int code=0; struct sigcontext *context=&contextstruct; #define GET_CONTEXT int code=0; struct sigcontext *context=&contextstruct;
#else
#define HANDLER_ARGS int signal, struct sigcontext_struct contextstruct
#define GET_CONTEXT int code=0; struct sigcontext_struct *context=&contextstruct;
#endif
#include <fpu_control.h> #include <fpu_control.h>
#define setfpucw(cw) {fpu_control_t cw_tmp=cw;_FPU_SETCW(cw_tmp);} #define setfpucw(cw) {fpu_control_t cw_tmp=cw;_FPU_SETCW(cw_tmp);}
...@@ -90,11 +74,7 @@ typedef struct sigcontext_struct sigcontext; ...@@ -90,11 +74,7 @@ typedef struct sigcontext_struct sigcontext;
#define sc_sp esp #define sc_sp esp
#endif #endif
#define sc_mask oldmask #define sc_mask oldmask
#if (LINUX_VERSION_CODE >= linuxversion(2,1,0)) || (__GNU_LIBRARY__ >= 6)
#define sigcontext sigcontext #define sigcontext sigcontext
#else
#define sigcontext sigcontext_struct
#endif
#define sc_efl eflags #define sc_efl eflags
#ifdef __x86_64 #ifdef __x86_64
......
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