2 * This software is part of the SBCL system. See the README file for
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.
12 #ifndef SBCL_INCLUDED_WIN32_OS_H
13 #define SBCL_INCLUDED_WIN32_OS_H
15 #define WIN32_LEAN_AND_MEAN
22 #include <sys/types.h>
28 #include "target-arch-os.h"
29 #include "target-arch.h"
31 #ifdef LISP_FEATURE_SB_THREAD
32 #include "pthreads_win32.h"
33 /* prevent inclusion of a mingw semaphore.h */
34 #define CANNOT_USE_POSIX_SEM_T
35 typedef sem_t os_sem_t
;
37 typedef void *siginfo_t
;
40 typedef LPVOID os_vm_address_t
;
41 typedef uword_t os_vm_size_t
;
42 typedef intptr_t os_vm_offset_t
;
43 typedef int os_vm_prot_t
;
45 /* These are used as bitfields, but Win32 doesn't work that way, so we do a translation. */
46 #define OS_VM_PROT_READ 1
47 #define OS_VM_PROT_WRITE 2
48 #define OS_VM_PROT_EXECUTE 4
50 #define os_open_core(file,mode) win32_open_for_mmap(file)
51 #define HAVE_os_open_core
53 #define os_fopen_runtime(file,mode) win32_fopen_runtime()
54 #define HAVE_os_fopen_runtime
56 extern int os_number_of_processors
;
57 #define HAVE_os_number_of_processors
59 extern int win32_open_for_mmap(const char* file
);
60 extern FILE* win32_fopen_runtime();
62 #define OUR_TLS_INDEX 63
63 #define SIG_MEMORY_FAULT SIGSEGV
65 #define SIG_STOP_FOR_GC (SIGRTMIN+1)
66 #define SIG_DEQUEUE (SIGRTMIN+2)
67 #define SIG_THREAD_EXIT (SIGRTMIN+3)
69 #define FPU_STATE_SIZE 27
71 struct lisp_exception_frame
{
72 struct lisp_exception_frame
*next_frame
;
74 lispobj
*bindstack_pointer
;
77 void wos_install_interrupt_handlers(struct lisp_exception_frame
*handler
);
78 char *dirname(char *path
);
80 void os_invalidate_free(os_vm_address_t addr
, os_vm_size_t len
);
82 boolean
win32_maybe_interrupt_io(void* thread
);
84 #define bcopy(src,dest,n) memmove(dest,src,n)
87 void** os_get_csp(struct thread
* th
);
90 #endif /* SBCL_INCLUDED_WIN32_OS_H */