Package org.vmmagic.unboxed

Examples of org.vmmagic.unboxed.Extent


        if (pageCursor.isZero()) {
            Unsafe.debug("pageCursor is zero");
        }

        final Extent pageSize = getPageSize(region);
        while (!size.isZero()) {
            mapPage(start, physAddr, pageSize, (region == ACPI));
            start = start.add(pageSize);
            size = size.sub(pageSize);
            if (!physAddr.isMax()) {
View Full Code Here


            final Word diff = start.sub(alignedStart).toWord();
            start = alignedStart.toAddress();
            size = size.add(diff);
        }
        size = pageAlign(region, size.toWord(), true).toExtent();
        final Extent pageSize = getPageSize(region);

        removeVirtualMMap(start.toWord(), start.add(size).toWord(), pageSize);
        return true;
    }
View Full Code Here

        if (emptyMMap) {
            // Remove all page mappings between AVAILABLE_START-END
            final Word start = Word.fromIntZeroExtend(AVAILABLE_START);
            final Word end = Word.fromIntZeroExtend(AVAILABLE_END);
            final Extent pageSize = Extent.fromIntZeroExtend(AVAILABLE_PAGE_SIZE);
            removeVirtualMMap(start, end, pageSize);
        }
    }
View Full Code Here

        final Address bootImgStart = helper.getBootImageStart();
        final Address bootImgEnd = helper.getBootImageEnd();
        final int bootImgSize = bootImgEnd.sub(bootImgStart.toWord()).toInt();
        LazyMmapper.boot(bootImgStart, bootImgSize);

        final Extent heapSize = helper.getHeapSize();
        HeapGrowthManager.boot(heapSize, heapSize);
        bootPlan();
        SynchronizedCounter.boot();
        initializing = false;
        Unsafe.debug("MmtkHeapManager#initialize done\n");
View Full Code Here

        // Claim the available heap region as resource.
        try {
            final ResourceManager rm = InitialNaming.lookup(ResourceManager.NAME);
            final Address start = Memory.AVAILABLE_START();
            final Extent size = Memory.AVAILABLE_END().toWord().sub(start.toWord()).toExtent();
            heapResource = rm.claimMemoryResource(ResourceOwner.SYSTEM, start,
                    size, ResourceManager.MEMMODE_NORMAL);
        } catch (NameNotFoundException ex) {
            BootLogInstance.get().fatal("Cannot find resource manager", ex);
        } catch (ResourceNotFreeException ex) {
View Full Code Here

        Unsafe.debug("Start end: ");
        Unsafe.debug(startPtr);
        Unsafe.debug(endPtr);
        Unsafe.debug('\n');

        final Extent size = endPtr.toWord().sub(startPtr.toWord()).toExtent();
        Unsafe.debug("Size     : ");
        Unsafe.debug(size);
        Unsafe.debug('\n');

        blockCount = size.toWord().rshl(BLOCK_SIZE_SHIFT);
        // Create a lock (4 bytes) and usage bitmap at the front of the memory
        // region
        final Extent rawBitmapSize = blockCount.rshl(3).toExtent();
        // final long rawBitmapSize = blockCount;
        final Extent bitmapSize = blockAlign(rawBitmapSize.toWord().add(4), true).toExtent();
        if (false) {
            Unsafe.debug("startPtr:");
            Unsafe.debug(startPtr);
        }
        lockPtr = startPtr;
        if (DBG) {
            Unsafe.debug("lockPtr:");
            Unsafe.debug(lockPtr);
            Unsafe.debug("bitmapSize:");
            Unsafe.debug(bitmapSize);
        }
        bitmapPtr = startPtr.add(4);
        // Clear the lock & bitmap size
        clear(lockPtr, bitmapSize);
        // Now shift the startptr.
        startPtr = startPtr.add(bitmapSize);
        blockCount = blockCount.sub(bitmapSize.toWord().rshl(BLOCK_SIZE_SHIFT));
        allocatedBlocks = Word.zero();
        // Mark as initialized
        initialized = true;

        // Unsafe.debug("BitmapPtr ");
View Full Code Here

            throw new DriverException("Memory mapped I/O is not a memory space");
        }

        // Claim the memory mapped I/O region
        final Address regsAddrPtr = Address.fromLong(regsAddr.getMemoryBase());
        final Extent regsSize = Extent.fromIntZeroExtend(regsAddr.getSize());
        try {
            final MemoryResource regs;
            regs = rm.claimMemoryResource(device, regsAddrPtr, regsSize,
                ResourceManager.MEMMODE_NORMAL);
            this.io = new Prism2IO(regs);
View Full Code Here

        if (dstOfs + length > dst.length) {
            throw new IndexOutOfBoundsException("dstOfs + length > dst.length");
        }
        testMemPtr(memPtr, length);
        final Address dstPtr = VmMagic.getArrayData(dst).add(dstOfs);
        final Extent size = Extent.fromIntZeroExtend(length);
        Unsafe.copy(start.add(Offset.fromIntZeroExtend(memPtr)), dstPtr, size);
    }
View Full Code Here

        if (dstOfs + length > dst.length) {
            throw new IndexOutOfBoundsException("dstOfs + length > dst.length");
        }
        testMemPtr(memPtr, length * 2);
        final Address dstPtr = VmMagic.getArrayData(dst).add(dstOfs * 2);
        final Extent size = Extent.fromIntZeroExtend(length * 2);
        Unsafe.copy(start.add(Offset.fromIntZeroExtend(memPtr)), dstPtr, size);
    }
View Full Code Here

        if (dstOfs + length > dst.length) {
            throw new IndexOutOfBoundsException("dstOfs + length > dst.length");
        }
        testMemPtr(memPtr, length * 2);
        final Address dstPtr = VmMagic.getArrayData(dst).add(dstOfs * 2);
        final Extent size = Extent.fromIntZeroExtend(length * 2);
        Unsafe.copy(start.add(Offset.fromIntZeroExtend(memPtr)), dstPtr, size);
    }
View Full Code Here

TOP

Related Classes of org.vmmagic.unboxed.Extent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.