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

Comparing BasiliskII/src/Unix/sigsegv.cpp (file contents):
Revision 1.2 by gbeauche, 2001-05-21T03:21:54Z vs.
Revision 1.3 by gbeauche, 2001-06-05T12:16:34Z

# Line 250 | Line 250 | void sigsegv_deinstall_handler(void)
250   #include <fcntl.h>
251   #include <sys/mman.h>
252  
253 static caddr_t page = 0;
253   static int page_size;
254 < static int handler_called = 0;
254 > static volatile char * page = 0;
255 > static volatile int handler_called = 0;
256  
257   static bool sigsegv_test_handler(sigsegv_address_t fault_address, sigsegv_address_t instruction_address)
258   {
259          handler_called++;
260          if ((fault_address - 123) != page)
261                  exit(1);
262 <        if (mprotect((caddr_t)((unsigned long)fault_address & -page_size), page_size, PROT_READ | PROT_WRITE) != 0)
262 >        if (mprotect((char *)((unsigned long)fault_address & -page_size), page_size, PROT_READ | PROT_WRITE) != 0)
263                  exit(1);
264          return true;
265   }
# Line 271 | Line 271 | int main(void)
271                  return 1;
272  
273          page_size = getpagesize();
274 <        page = (caddr_t)mmap(0, page_size, PROT_READ, MAP_PRIVATE, zero_fd, 0);
274 >        page = (char *)mmap(0, page_size, PROT_READ, MAP_PRIVATE, zero_fd, 0);
275          if (page == MAP_FAILED)
276                  return 1;
277          

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines