Skip to content
sunos-os.h 1.35 KiB
Newer Older
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.

*/

#ifndef _SUNOS_OS_H_
#define _SUNOS_OS_H_

ram's avatar
ram committed
#ifdef SOLARIS
#undef boolean
#endif /* SOLARIS */

wlott's avatar
wlott committed
#include <sys/types.h>
ram's avatar
ram committed

#ifdef SOLARIS
#define boolean int
#include <signal.h>
#include <unistd.h>
#include <sys/fcntl.h>
#endif /* SOLARIS */

wlott's avatar
wlott committed
#include <sys/mman.h>

ram's avatar
ram committed
#ifdef SOLARIS
#include <ucontext.h>
#define sigcontext ucontext

#endif /* SOLARIS */

wlott's avatar
wlott committed
typedef unsigned long os_vm_address_t;
typedef long os_vm_size_t;
typedef off_t os_vm_offset_t;
typedef int os_vm_prot_t;

#define OS_VM_PROT_READ PROT_READ
#define OS_VM_PROT_WRITE PROT_WRITE
#define OS_VM_PROT_EXECUTE PROT_EXEC

#ifdef i386
#define OS_VM_DEFAULT_PAGESIZE	4096
#else
wlott's avatar
wlott committed
#define OS_VM_DEFAULT_PAGESIZE	8192
ram's avatar
ram committed

#ifdef SOLARIS
#include <ucontext.h>
#define HANDLER_ARGS int signal, siginfo_t *code, void *context
ram's avatar
ram committed
#define CODE(code)  ((code) ? code->si_code : 0)
typedef struct ucontext os_context_t__;
#define os_context_t os_context_t__
ram's avatar
ram committed
#define SAVE_CONTEXT() save_context()
ram's avatar
ram committed

#ifdef NULL
#undef NULL
#define NULL 0
#endif

extern void flush_icache(unsigned int *, unsigned int);
rtoy's avatar
rtoy committed
extern void save_context(void);

ram's avatar
ram committed
#endif /* SOLARIS */

#define PROTECTION_VIOLATION_SIGNAL SIGSEGV