Skip to content
Linux-os.h 1.34 KiB
Newer Older
Raymond Toy's avatar
Raymond Toy committed
/* 
ram's avatar
ram committed

 This code was written as part of the CMU Common Lisp project at
 Carnegie Mellon University, and has been placed in the public domain.

 Morfed from the FreeBSD file by Peter Van Eynde (July 1996)
dtc's avatar
dtc committed
 Alpha support by Julian Dolby, 1999.

ram's avatar
ram committed
*/

#ifndef _LINUX_OS_H_
#define _LINUX_OS_H_

ram's avatar
ram committed
#include <stdlib.h>
ram's avatar
ram committed
#include <sys/types.h>
#include <sys/mman.h>
#include <sys/signal.h>
ram's avatar
ram committed
#include <sys/time.h>
#include <sys/stat.h>
#include <unistd.h>
#include <sys/syscall.h>
#include <asm/unistd.h>
#include <errno.h>
pw's avatar
pw committed

typedef caddr_t os_vm_address_t;	/* like hpux */
typedef size_t os_vm_size_t;	/* like hpux */
typedef off_t os_vm_offset_t;	/* like hpux */
typedef int os_vm_prot_t;	/* like hpux */
#define os_context_t ucontext_t
ram's avatar
ram committed

#define OS_VM_PROT_READ PROT_READ	/* like hpux */
#define OS_VM_PROT_WRITE PROT_WRITE	/* like hpux */
#define OS_VM_PROT_EXECUTE PROT_EXEC	/* like hpux */
#ifndef __alpha__
#define OS_VM_DEFAULT_PAGESIZE	4096	/* like hpux */
pw's avatar
pw committed
#else
#define OS_VM_DEFAULT_PAGESIZE	8192	/* like hpux */
pw's avatar
pw committed
#endif
ram's avatar
ram committed

void restore_fpu(ucontext_t *);
#define HANDLER_ARGS int signal, siginfo_t *code, void *context
#define CODE(code) ((code) ? code->si_code : 0)
#define RESTORE_FPU(context) restore_fpu(context)
#define PROTECTION_VIOLATION_SIGNAL SIGSEGV