Package org.vmmagic.unboxed

Examples of org.vmmagic.unboxed.Address


                + "$$abstract-end")));

            return cm;
        } else {
            // Set the address of the abstract method code
            final Address errorAddr = Unsafe
                .getJumpTableEntry(X86JumpTable.VM_INVOKE_ABSTRACT_IDX);
            final VmCompiledCode code = VmUtils.getVm().getCompiledMethods()
                .createCompiledCode(null, method, this, null,
                    errorAddr.toAddress(), null, 0, null, null, null);
            method.addCompiledCode(code, level);
            return null;
        }
    }
View Full Code Here


    public boolean accept(ObjectVisitor visitor, VmHeapManager heapManager) {
        if (!super.accept(visitor, heapManager)) {
            return false;
        }
        // Scan registers
        Address addr = r8.toAddress();
        if (heapManager.isObject(addr)) {
            if (!visitor.visit(addr)) {
                return false;
            }
        }
View Full Code Here

    public boolean accept(ObjectVisitor visitor, VmHeapManager heapManager) {
        // For now do it stupid, but safe, just scan the whole stack.
        final int stackSize = getStackSize();
        final Object stack = getStack();
        if (stack != null) {
            final Address stackBottom = ObjectReference.fromObject(stack).toAddress();
            final Address stackTop = stackBottom.add(stackSize);
            final Address stackEnd;
            if (this == currentThread()) {
                stackEnd = stackBottom;
            } else {
                stackEnd = esp;
            }

            Address ptr = stackTop;
            final int slotSize = getReferenceSize();
            while (ptr.GE(stackEnd)) {
                final Address child = ptr.loadAddress();
                if (child != null) {
                    if (heapManager.isObject(child)) {
                        if (!visitor.visit(child)) {
                            return false;
                        }
                    }
                }
                ptr = ptr.sub(slotSize);
            }
        }
        // Scan registers
        Address addr = eax.toAddress();
        if (heapManager.isObject(addr)) {
            if (!visitor.visit(addr)) {
                return false;
            }
        }
View Full Code Here

     * @param vmAddress
     */
    private final void mapPage(Address vmAddress, Address physAddr, Extent pageSize, boolean debug) {
        // Setup the pdir structures
        final Word pdirIdx = vmAddress.toWord().rshl(22);
        final Address pdirEntryPtr = UnsafeX86.getCR3().add(pdirIdx.lsh(2));
        Word entry = pdirEntryPtr.loadWord();
        if (entry.and(Word.fromIntZeroExtend(PF_PRESENT)).isZero()) {
            final Word pagePtr;
            if (physAddr.isMax()) {
                // Get a free page
                pagePtr = pageCursor;
                pageCursor = pageCursor.add(pageSize);
            } else {
                pagePtr = physAddr.toWord();
            }

            // There is currently no present page, so do the mapping
            entry = pagePtr.or(Word.fromIntZeroExtend(PF_DEFAULT));
            pdirEntryPtr.store(entry);

            if (debug) {
                Unsafe.debug("mapPage ");
                Unsafe.debug(entry);
                Unsafe.debug('\n');
View Full Code Here

     *
     * @param start
     * @param end
     */
    private final void removeVirtualMMap(Word start, Word end, Extent pageSize) {
        final Address pdir = UnsafeX86.getCR3();

        for (Word ptr = start; ptr.LT(end); ptr = ptr.add(pageSize)) {
            final Word pdirIdx = ptr.rshl(22);
            pdir.add(pdirIdx.lsh(2)).store(Word.zero());
        }
    }
View Full Code Here

        return true;
    }

    private final boolean initConfigTable(ResourceManager rm,
                                          ResourceOwner owner) {
        final Address tablePtr = getMPConfigTablePtr();
        int size = 0x2C; // Base table length
        try {
            MemoryResource mem = rm.claimMemoryResource(owner, tablePtr, size,
                ResourceManager.MEMMODE_NORMAL);
            // Read the table length
View Full Code Here

     * @return The structure found, or null if not found
     */
    private static MPFloatingPointerStructure find(ResourceManager rm,
                                                   ResourceOwner owner, int startPtr, int endPtr) {
        final MemoryScanner ms = rm.getMemoryScanner();
        Address ptr = Address.fromIntZeroExtend(startPtr);
        int size = endPtr - startPtr;
        final int stepSize = 16;
        while (size > 0) {
            Address res = ms.findInt32(ptr, size, MAGIC, stepSize);
            if (res != null) {
                try {
                    final MemoryResource mem;
                    mem = rm.claimMemoryResource(owner, ptr, 16,
                        ResourceManager.MEMMODE_NORMAL);
View Full Code Here

     *
     * @param stack
     */
    public final void setKernelStack(byte[] stack) {
        this.kernelStack = stack;
        final Address stackBase = VmMagic.getArrayData(stack);
        final Address esp = stackBase.add(stack.length - 4);
        tss[1] = esp.toInt();
    }
View Full Code Here

     *
     * @param stack
     */
    public final void setUserStack(byte[] stack) {
        this.userStack = stack;
        final Address stackBase = VmMagic.getArrayData(stack);
        final Address esp = stackBase.add(stack.length - 4);
        tss[14] = esp.toInt();
    }
View Full Code Here

        // Setup kernel structures
        setupStructures();

        // Setup the boot code
        final Address bootCode = setupBootCode(rm, gdt);

        // Make sure Local APIC is enabled (the local apic of the current CPU!)
        Unsafe.debug("Enabling Local APIC: current state="
            + (localAPIC.isEnabled() ? "enabled" : "disabled") + '\n');
        localAPIC.setEnabled(true);
View Full Code Here

TOP

Related Classes of org.vmmagic.unboxed.Address

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.