Пример #1
0
 /**
  * Allows access to an area of virtual memory.
  *
  * @param start the address of the start of the area to be mapped
  * @param size the size, in bytes, of the area to be mapped
  * @return <code>true</code> if successful, otherwise <code>false</code>
  */
 public final boolean munprotect(Address start, int size) {
   return org.jikesrvm.runtime.Memory.mprotect(
       start,
       Extent.fromIntZeroExtend(size),
       org.jikesrvm.runtime.Memory.PROT_READ
           | org.jikesrvm.runtime.Memory.PROT_WRITE
           | org.jikesrvm.runtime.Memory.PROT_EXEC);
 }
Пример #2
0
 /**
  * Demand zero mmaps an area of virtual memory.
  *
  * @param start the address of the start of the area to be mapped
  * @param size the size, in bytes, of the area to be mapped
  * @return 0 if successful, otherwise the system errno
  */
 public final int dzmmap(Address start, int size) {
   Address result = org.jikesrvm.runtime.Memory.dzmmap(start, Extent.fromIntZeroExtend(size));
   if (result.EQ(start)) return 0;
   if (result.GT(Address.fromIntZeroExtend(127))) {
     VM.sysWrite("demand zero mmap with MAP_FIXED on ", start);
     VM.sysWriteln(" returned some other address", result);
     VM.sysFail("mmap with MAP_FIXED has unexpected behavior");
   }
   return result.toInt();
 }
Пример #3
0
 /**
  * Logs the contents of an address and the surrounding memory to the error output.
  *
  * @param start the address of the memory to be dumped
  * @param beforeBytes the number of bytes before the address to be included
  * @param afterBytes the number of bytes after the address to be included
  */
 public final void dumpMemory(Address start, int beforeBytes, int afterBytes) {
   org.jikesrvm.runtime.Memory.dumpMemory(start, beforeBytes, afterBytes);
 }
Пример #4
0
 /**
  * Zero a range of pages of memory.
  *
  * @param start Start of address range (must be a page address)
  * @param len Length in bytes of range (must be multiple of page size)
  */
 public final void zeroPages(Address start, int len) {
   /* AJG: Add assertions to check conditions documented above. */
   org.jikesrvm.runtime.Memory.zeroPages(start, len);
 }
Пример #5
0
 /**
  * Zero a region of memory.
  *
  * @param start Start of address range (inclusive)
  * @param len Length in bytes of range to zero Returned: nothing
  */
 public final void zero(Address start, Extent len) {
   org.jikesrvm.runtime.Memory.zero(start, len);
 }
Пример #6
0
 /**
  * Protects access to an area of virtual memory.
  *
  * @param start the address of the start of the area to be mapped
  * @param size the size, in bytes, of the area to be mapped
  * @return <code>true</code> if successful, otherwise <code>false</code>
  */
 public final boolean mprotect(Address start, int size) {
   return org.jikesrvm.runtime.Memory.mprotect(
       start, Extent.fromIntZeroExtend(size), org.jikesrvm.runtime.Memory.PROT_NONE);
 }