X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fwin32-os.h;h=acc8b10e9d3edf4799dc64baef9535427d91c21f;hb=eac461c1f1ca91cfe282c779291d582ed6b336cb;hp=a09c37f909bf461b25c8dfa7f0e62d577b71ae78;hpb=ae09f8fd7765f6cab6ad317a13e27ff22ab0c11e;p=sbcl.git diff --git a/src/runtime/win32-os.h b/src/runtime/win32-os.h index a09c37f..acc8b10 100644 --- a/src/runtime/win32-os.h +++ b/src/runtime/win32-os.h @@ -9,36 +9,69 @@ * files for more information. */ +#ifndef SBCL_INCLUDED_WIN32_OS_H +#define SBCL_INCLUDED_WIN32_OS_H + +#define WIN32_LEAN_AND_MEAN +#include +#include + #include +#include +#include #include #include #include #include #include -#define WIN32_LEAN_AND_MEAN -#include #include "target-arch-os.h" #include "target-arch.h" +#ifdef LISP_FEATURE_SB_THREAD +#include "pthreads_win32.h" +/* prevent inclusion of a mingw semaphore.h */ +#define CANNOT_USE_POSIX_SEM_T +typedef sem_t os_sem_t; +#else +typedef void *siginfo_t; +#endif + +/* Note: This typedef will moved to runtime.h when AMD64 changes are being + * merged. */ +typedef unsigned long uword_t; + typedef LPVOID os_vm_address_t; -typedef size_t os_vm_size_t; -typedef off_t os_vm_offset_t; +typedef uword_t os_vm_size_t; +typedef intptr_t os_vm_offset_t; typedef int os_vm_prot_t; -typedef void *siginfo_t; - /* These are used as bitfields, but Win32 doesn't work that way, so we do a translation. */ #define OS_VM_PROT_READ 1 #define OS_VM_PROT_WRITE 2 #define OS_VM_PROT_EXECUTE 4 +#define os_open_core(file,mode) win32_open_for_mmap(file) +#define HAVE_os_open_core + +#define os_fopen_runtime(file,mode) win32_fopen_runtime() +#define HAVE_os_fopen_runtime + +extern int os_number_of_processors; +#define HAVE_os_number_of_processors + +extern int win32_open_for_mmap(const char* file); +extern FILE* win32_fopen_runtime(); + +#define OUR_TLS_INDEX 63 #define SIG_MEMORY_FAULT SIGSEGV #define SIG_STOP_FOR_GC (SIGRTMIN+1) #define SIG_DEQUEUE (SIGRTMIN+2) #define SIG_THREAD_EXIT (SIGRTMIN+3) +#define FPU_STATE_SIZE 27 + struct lisp_exception_frame { struct lisp_exception_frame *next_frame; void *handler; @@ -48,3 +81,14 @@ struct lisp_exception_frame { void wos_install_interrupt_handlers(struct lisp_exception_frame *handler); char *dirname(char *path); +void os_invalidate_free(os_vm_address_t addr, os_vm_size_t len); + +boolean win32_maybe_interrupt_io(void* thread); + +#define bcopy(src,dest,n) memmove(dest,src,n) + +struct thread; +void** os_get_csp(struct thread* th); + + +#endif /* SBCL_INCLUDED_WIN32_OS_H */