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.26 by gbeauche, 2004-01-18T22:14:31Z vs.
Revision 1.27 by gbeauche, 2004-01-18T22:22:28Z

# Line 561 | Line 561 | int main(int argc, char **argv)
561                  ErrorAlert(str);
562                  goto quit;
563          }
564 < #if !EMULATED_PPC || defined(__powerpc__)
564 > #if !EMULATED_PPC
565          if (vm_protect((char *)ROM_BASE, ROM_AREA_SIZE, VM_PAGE_READ | VM_PAGE_WRITE | VM_PAGE_EXECUTE) < 0) {
566                  sprintf(str, GetString(STR_ROM_MMAP_ERR), strerror(errno));
567                  ErrorAlert(str);
# Line 1627 | Line 1627 | static void sigsegv_handler(int sig, sig
1627                                  transfer_type = TYPE_STORE; transfer_size = SIZE_HALFWORD; addr_mode = MODE_U; break;
1628   #if EMULATE_UNALIGNED_LOADSTORE_MULTIPLE
1629                          case 46:        // lmw
1630 <                                if (sig == SIGBUS) {
1631 <                                        uint32 ea = (ra == 0 ? 0 : r->gpr(ra)) + imm;
1630 >                                if ((addr % 4) != 0) {
1631 >                                        uint32 ea = addr;
1632                                          D(bug("WARNING: unaligned lmw to EA=%08x from IP=%08x\n", ea, r->pc()));
1633                                          for (int i = rd; i <= 31; i++) {
1634                                                  r->gpr(i) = ReadMacInt32(ea);
# Line 1639 | Line 1639 | static void sigsegv_handler(int sig, sig
1639                                  }
1640                                  break;
1641                          case 47:        // stmw
1642 <                                if (sig == SIGBUS) {
1643 <                                        uint32 ea = (ra == 0 ? 0 : r->gpr(ra)) + imm;
1642 >                                if ((addr % 4) != 0) {
1643 >                                        uint32 ea = addr;
1644                                          D(bug("WARNING: unaligned stmw to EA=%08x from IP=%08x\n", ea, r->pc()));
1645                                          for (int i = rd; i <= 31; i++) {
1646                                                  WriteMacInt32(ea, r->gpr(i));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines