ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/SheepShaver/src/Unix/main_unix.cpp
(Generate patch)

Comparing SheepShaver/src/Unix/main_unix.cpp (file contents):
Revision 1.30 by gbeauche, 2004-02-15T17:20:36Z vs.
Revision 1.31 by gbeauche, 2004-02-24T11:12:52Z

# Line 273 | Line 273 | static sigregs sigsegv_regs;                           // Regis
273   static const char *crash_reason = NULL;         // Reason of the crash (SIGSEGV, SIGBUS, SIGILL)
274   #endif
275  
276 + uint32  SheepMem::page_size;                            // Size of a native page
277   uintptr SheepMem::zero_page = 0;                        // Address of ro page filled in with zeros
278   uintptr SheepMem::base = 0x60000000;            // Address of SheepShaver data
279   uintptr SheepMem::top = 0;                                      // Top of SheepShaver data (stack like storage)
# Line 1659 | Line 1660 | static void sigsegv_handler(int sig, sig
1660   #endif
1661                  }
1662          
1663 <                // Ignore ROM writes
1664 <                if (transfer_type == TYPE_STORE && addr >= ROM_BASE && addr < ROM_BASE + ROM_SIZE) {
1663 >                // Ignore ROM writes (including to the zero page, which is read-only)
1664 >                if (transfer_type == TYPE_STORE &&
1665 >                        ((addr >= ROM_BASE && addr < ROM_BASE + ROM_SIZE) ||
1666 >                         (addr >= SheepMem::ZeroPage() && addr < SheepMem::ZeroPage() + SheepMem::PageSize()))) {
1667   //                      D(bug("WARNING: %s write access to ROM at %08lx, pc %08lx\n", transfer_size == SIZE_BYTE ? "Byte" : transfer_size == SIZE_HALFWORD ? "Halfword" : "Word", addr, r->pc()));
1668                          if (addr_mode == MODE_U || addr_mode == MODE_UX)
1669                                  r->gpr(ra) = addr;
# Line 1904 | Line 1907 | rti:;
1907  
1908   bool SheepMem::Init(void)
1909   {
1910 <        const int page_size = getpagesize();
1910 >        // Size of a native page
1911 >        page_size = getpagesize();
1912  
1913          // Allocate SheepShaver globals
1914          if (vm_acquire_fixed((char *)base, size) < 0)
# Line 1932 | Line 1936 | bool SheepMem::Init(void)
1936   void SheepMem::Exit(void)
1937   {
1938          if (top) {
1935                const int page_size = getpagesize();
1936
1939                  // Delete SheepShaver globals
1940                  vm_release((void *)base, size);
1941  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines