Examples of toWord()


Examples of org.vmmagic.unboxed.Address.toWord()

        // 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

Examples of org.vmmagic.unboxed.Address.toWord()

     *         available.
     */
    private static MemoryResource loadInitJar(ResourceManager rm) {
        final Address start = Unsafe.getInitJarStart();
        final Address end = Unsafe.getInitJarEnd();
        final Extent size = end.toWord().sub(start.toWord()).toExtent();
        if (size.toWord().isZero()) {
            // No initial jarfile
            BootLogInstance.get().info("No initial jarfile found");
            return null;
        } else {
View Full Code Here

Examples of org.vmmagic.unboxed.Address.toWord()

    protected static ResourceManager initialize() {
        try {
            final Address kernelStart = Unsafe.getKernelStart();
            final Address kernelEnd = Unsafe.getKernelEnd();
            final Extent kernelSize = kernelEnd.toWord().sub(kernelStart.toWord()).toExtent();
            MemoryResourceImpl
                .claimMemoryResource(new SimpleResourceOwner("kernel"), kernelStart, kernelSize, MEMMODE_NORMAL);

            final Address bootHeapStart = Unsafe.getBootHeapStart();
            final Address bootHeapEnd = Unsafe.getBootHeapEnd();
View Full Code Here

Examples of org.vmmagic.unboxed.Address.toWord()

            MemoryResourceImpl
                .claimMemoryResource(new SimpleResourceOwner("kernel"), kernelStart, kernelSize, MEMMODE_NORMAL);

            final Address bootHeapStart = Unsafe.getBootHeapStart();
            final Address bootHeapEnd = Unsafe.getBootHeapEnd();
            final Extent bootHeapSize = bootHeapEnd.toWord().sub(bootHeapStart.toWord()).toExtent();
            MemoryResourceImpl
                .claimMemoryResource(new SimpleResourceOwner("bootheap"), bootHeapStart, bootHeapSize, MEMMODE_NORMAL);

            ResourceManager rm = new ResourceManagerImpl();
            InitialNaming.bind(NAME, rm);
View Full Code Here

Examples of org.vmmagic.unboxed.Address.toWord()

                    }
                });

        final Address start = Address.fromIntZeroExtend(0xC0000);
        final Address end = Address.fromIntZeroExtend(0xF0000);
        final int size = end.toWord().sub(start.toWord()).toInt();
        final int stepSize = 0x1000;
        int offset = 0;
        while (offset < size) {
            final Address romAddr;
            // Search for BIOS expansion
View Full Code Here

Examples of org.vmmagic.unboxed.Address.toWord()

                    scanner.findInt8Array(start.add(offset), size - offset, BIOS_ROM_SIGNATURE, 0,
                            BIOS_ROM_SIGNATURE.length, stepSize);
            if (romAddr == null) {
                return null;
            } else {
                offset = romAddr.toWord().sub(start.toWord()).toInt() + stepSize;
            }
            // Search for ATI signature
            final Address atiSigAddr;
            atiSigAddr =
                    scanner.findInt8Array(romAddr, 128, ATI_ROM_SIGNATURE, 0,
View Full Code Here

Examples of org.vmmagic.unboxed.Address.toWord()

        final Address addr = ObjectReference.fromObject(object).toAddress();
        if (addr.LT(start) || addr.GE(end)) {
            return;
        }

        final int offset = addr.toWord().sub(start.toWord()).toInt();
        final int bit = offset / ObjectLayout.OBJECT_ALIGN;
        final Offset idx = Offset.fromIntZeroExtend(bit / 8);
        final int mask = 1 << (bit & 7);
        final Address bitmapPtr = this.allocationBitmapPtr;
        int value = bitmapPtr.loadByte(idx);
View Full Code Here

Examples of org.vmmagic.unboxed.Address.toWord()

     * @param instrPtr
     * @return The index, or -1 is not found.
     */
    public final int getAddressMapIndex(Address instrPtr) {
        final Address codeAddr = Address.fromAddress(nativeCode);
        final int offset = instrPtr.toWord().sub(codeAddr.toWord()).toInt();
        return addressTable.getIndexForOffset(offset);
    }

    /**
     * Gets the address of the start of the native code.
View Full Code Here

Examples of org.vmmagic.unboxed.Address.toWord()

        });

        final Address acpiStart = arch.getStart(ACPI);
        final Address acpiEnd = arch.getEnd(ACPI);
        // First unmap the entire ACPI region
        arch.munmap(ACPI, acpiStart, acpiEnd.toWord().sub(acpiStart.toWord()).toExtent());
        this.acpiVirtStart = acpiStart;

        MemoryMapEntry lastAcpiEntry = null;
        Address start = acpiStart;
        for (MemoryMapEntry e : mmap) {
View Full Code Here

Examples of org.vmmagic.unboxed.Address.toWord()

        Address start = acpiStart;
        for (MemoryMapEntry e : mmap) {
            if (e.isAcpi() || e.isAcpiNVS()) {
                // Calculate page aligned boundaries & sizes
                final Address alignedPhysStart = arch.pageAlign(ACPI, e.getStart(), false);
                final Word diff = e.getStart().toWord().sub(alignedPhysStart.toWord());
                final Extent size = e.getSize().add(diff);

                // Check for adjacent memory blocks
                if (lastAcpiEntry != null) {
                    Address expected = lastAcpiEntry.getStart().add(lastAcpiEntry.getSize());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.