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
23 #include <sys/types.h>
29 #include "target-arch-os.h"
30 #include "target-arch.h"
32 #include "pthreads_win32.h"
34 #ifdef LISP_FEATURE_64_BIT
35 /* LPVOID can't be legally used in pointer arithmetic.
36 * (so all the arithmetic in 'validate.h' is technically illegal).
37 * But I can't test 32-bit so let it stay as was */
38 typedef char* os_vm_address_t
;
40 typedef LPVOID os_vm_address_t
;
42 typedef uword_t os_vm_size_t
;
43 typedef intptr_t os_vm_offset_t
;
44 typedef int os_vm_prot_t
;
46 /* These are used as bitfields, but Win32 doesn't work that way, so we do a translation. */
47 #define OS_VM_PROT_READ 1
48 #define OS_VM_PROT_WRITE 2
49 #define OS_VM_PROT_EXECUTE 4
51 extern int os_number_of_processors
;
52 #define HAVE_os_number_of_processors
54 extern ULONG win32_stack_guarantee
;
55 extern DWORD win32_page_size
;
57 // 64-bit uses whatever TLS index the kernels gives us which we store in
58 // 'sbcl_thread_tls_index' to hold our thread-local value of the pointer
60 // 32-bit uses a quasi-arbitrary fixed TLS index that we try to claim on startup.
62 #ifdef LISP_FEATURE_64_BIT
63 extern DWORD sbcl_thread_tls_index
;
64 #define OUR_TLS_INDEX sbcl_thread_tls_index
66 #define OUR_TLS_INDEX 63
69 struct lisp_exception_frame
{
70 struct lisp_exception_frame
*next_frame
;
72 lispobj
*bindstack_pointer
;
75 void wos_install_interrupt_handlers(struct lisp_exception_frame
*handler
);
76 char *dirname(char *path
);
78 bool win32_maybe_interrupt_io(void* thread
);
80 int sb_pthread_sigmask(int how
, const sigset_t
*set
, sigset_t
*oldset
);
82 #endif /* SBCL_INCLUDED_WIN32_OS_H */