0.9.8.7:
[sbcl.git] / src / runtime / win32-os.h
1 /*
2  * This software is part of the SBCL system. See the README file for
3  * more information.
4  *
5  * This software is derived from the CMU CL system, which was
6  * written at Carnegie Mellon University and released into the
7  * public domain. The software is in the public domain and is
8  * provided with absolutely no warranty. See the COPYING and CREDITS
9  * files for more information.
10  */
11
12 #include <stdlib.h>
13 #include <sys/types.h>
14 #include <string.h>
15 #include <sys/time.h>
16 #include <sys/stat.h>
17 #include <unistd.h>
18
19 #define WIN32_LEAN_AND_MEAN
20 #include <windows.h>
21 #include "target-arch-os.h"
22 #include "target-arch.h"
23
24 typedef LPVOID os_vm_address_t;
25 typedef size_t os_vm_size_t;
26 typedef off_t os_vm_offset_t;
27 typedef int os_vm_prot_t;
28
29 typedef void *siginfo_t;
30
31 /* These are used as bitfields, but Win32 doesn't work that way, so we do a translation. */
32 #define OS_VM_PROT_READ    1
33 #define OS_VM_PROT_WRITE   2
34 #define OS_VM_PROT_EXECUTE 4
35
36 #define SIG_MEMORY_FAULT SIGSEGV
37
38 #define SIG_INTERRUPT_THREAD (SIGRTMIN)
39 #define SIG_STOP_FOR_GC (SIGRTMIN+1)
40 #define SIG_DEQUEUE (SIGRTMIN+2)
41 #define SIG_THREAD_EXIT (SIGRTMIN+3)
42
43 struct lisp_exception_frame {
44     struct lisp_exception_frame *next_frame;
45     void *handler;
46     CONTEXT context;
47     EXCEPTION_RECORD exception;
48 };
49
50 void wos_install_interrupt_handlers(struct lisp_exception_frame *handler);