24 |
|
// Note: this file must be #include'd only in video_x.cpp |
25 |
|
#ifdef ENABLE_VOSF |
26 |
|
|
27 |
– |
#include <fcntl.h> |
28 |
– |
#include <sys/mman.h> |
27 |
|
#include "sigsegv.h" |
28 |
|
#include "vm_alloc.h" |
29 |
+ |
#ifdef _WIN32 |
30 |
+ |
#include "util_windows.h" |
31 |
+ |
#endif |
32 |
|
|
33 |
|
// Glue for SDL and X11 support |
34 |
|
#ifdef USE_SDL_VIDEO |
157 |
|
static spinlock_t vosf_lock = SPIN_LOCK_UNLOCKED; // Mutex to protect frame buffer (dirtyPages in fact) |
158 |
|
#define LOCK_VOSF spin_lock(&vosf_lock) |
159 |
|
#define UNLOCK_VOSF spin_unlock(&vosf_lock) |
160 |
+ |
#elif defined(_WIN32) |
161 |
+ |
static mutex_t vosf_lock; // Mutex to protect frame buffer (dirtyPages in fact) |
162 |
+ |
#define LOCK_VOSF vosf_lock.lock(); |
163 |
+ |
#define UNLOCK_VOSF vosf_lock.unlock(); |
164 |
|
#elif defined(HAVE_PTHREADS) |
165 |
|
static pthread_mutex_t vosf_lock = PTHREAD_MUTEX_INITIALIZER; // Mutex to protect frame buffer (dirtyPages in fact) |
166 |
|
#define LOCK_VOSF pthread_mutex_lock(&vosf_lock); |
184 |
|
// Extend size to page boundary |
185 |
|
static uint32 page_extend(uint32 size) |
186 |
|
{ |
187 |
< |
const uint32 page_size = getpagesize(); |
187 |
> |
const uint32 page_size = vm_page_size(); |
188 |
|
const uint32 page_mask = page_size - 1; |
189 |
|
return (size + page_mask) & ~page_mask; |
190 |
|
} |
232 |
|
{ |
233 |
|
VIDEO_MODE_INIT_MONITOR; |
234 |
|
|
235 |
< |
const uintptr page_size = getpagesize(); |
235 |
> |
const uintptr page_size = vm_page_size(); |
236 |
|
const uintptr page_mask = page_size - 1; |
237 |
|
|
238 |
|
// Round up frame buffer base to page boundary |