cleanup ifdef chain syntax
make the ifdef chain more readable
Fix CrashReporter poping up when PPC is not emulated on pre-10.5 systems.
[Michael Schmitt] SheepShaver includes the C errno string in many error messages. One case is when it calls the memory allocation routines in the Basilisk II vm_alloc.cpp program. This works when the memory allocation routine uses functions that set errno (such as mmap or malloc). For example, running SheepShaver on a Linux hosts produces meaningful error messages. The problem is that when run on an OS X host, the memory allocation uses Mach routines such as vm_allocate, which do not set errno. So when SheepShaver reported the error, it used a stale value of errno, which happened to be 17. The result was an extremely misleading error message: "Cannot map RAM: File already exists". The fix is to change vm_alloc so that it translates Mac return codes into POSIX errno values. It also initializes errno to 0 at the start of the memory allocation routine, so that no matter what path it takes, it won't return a stale value.
HP-UX does support 32-bit memory mappings.
Fix build on 64-bit Vista.
Wrap the Windows write-watch API.
LLP64 fixes (64-bit Windows)
Happy New Year!
Remove the 33-bit addressing hack as it's overly complex for not much gain. Rather, use an address override prefix (0x67) though Intel Core optimization reference guide says to avoid LCP prefixes. In practise, impact on performance is measurably marginal on e.g. Speedometer tests.
Fix remove_shm_range() to actually return something
fix rev 1.22 commit for windows (extraneous return -1 left)
Start allocating memory from 0x10000000 with linker scripts since the system sometimes has a problem to make a decision when next_address == 0. NOTE: this makes it possible to allocate up to 1 GB with DIRECT_ADDRESSING
Memory allocated through win32 VirtualAlloc() is zero-filled. Likewise for memory mmap()'ed with MAP_ANONYMOUS (equivalent to /dev/zero mapping but faster)
add 33-bit addressing support to vm_acquire_fixed()
Get real page size on Windows for vm_get_page_size() [64 KB]
Robustify: only close zero_fd if actually allocated
Gracefully catch SIGSEGV & SIGBUS for TEST_VM_PROT_* test cases. This should avoid dumping core, and especially Windows fault alerts when natively configuring with MinGW32.
Happy New Year!
s/vm_page_size/vm_get_page_size/ to avoid name clash on MacOS X
implement vm_page_size() to get the actual size of a page
Windows memory allocators
Enable 33-bit memory addressing on 64-bit JIT capable platforms (e.g. x86-64). This is useful to get rid of address offset sign extensions. It uses POSIX shared memory to create aliased regions, fallback to usual sign-extension way if shm_open et al. don't work (e.g. no /dev/shm mounted)
Happy New Year! :)
Fix build with DEC C++ compiler on Tru64.
Enable possibility to manually pass VM_MAP_32BIT & friends. This is needed for the PowerPC "JIT1" engine.
Make sure a 32-bit B2/JIT works reasonnably well on AMD64 too. This implies to force RAMBaseHost < 0x80000000. This is empirically determined to work on Linux/x86 and Linux/amd64.
Fix check against return value of memset() in vm_acquire_fixed
- Check for caddr_t. On some systems like Solaris/SPARC, mmap() address type (first parameter) is caddr_t instead of void *. Explicitly cast address to (caddr_t) type and C++ implicit pointer conversion rules will do the rest. aka. caddr_t -> void * is OK unlike the opposite.
- vm_acquire_fixed: Fix memset() and vm_protect() calls so that the address is really the one specified instead of always zero.
- documentation updates - 2001 -> 2002 - version 0.9 -> 1.0
- video_x.cpp: the_buffer shall always be mapped through vm_alloc() so that it can be vm_protect()'ed at will afterwards - video_x.cpp: let driver_base free() the_buffer_copy and the_host_buffer, if necessary - video_vosf.h: reverted to use malloc() for mainBuffer.dirtyPages and mainBuffer.pageInfo - vm_alloc.cpp: small cleanups - fixed typos
- Try to map memory contiguously with base addresses returned in increasing order. No host memory region used for Mac emulation (ScratchMem, RAM, ROM, frame buffer) shall be allocated below the RAM space. Actually, MEMBaseDiff should be set to the min(above-mentioned address spaces). ==> Temporary fix for 64-bit addressing systems (e.g. Linux/ia64)
fixed memory leaks in video mode switching
- added SIGSEGV support for Linux/Alpha (to be checked), Darwin/PPC - added uniform virtual memory allocation (supports mmap(), vm_allocate(), or fallbacks to malloc()/free()) - cleaned up memory allocation in main_unix.cpp
This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, select a symbolic revision name using the selection box, or choose 'Use Text Field' and enter a numeric revision.