Package org.vmmagic.unboxed

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


     */
    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();
    }

    /**
     * Sets the user stack
     *
 
View Full Code Here


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

        final int size = (nrFrames * (RxFDSize + FRAME_SIZE)) + 16;
        this.data = new byte[size];
        this.mem = rm.asMemoryResource(data);

        final Address memAddr = mem.getAddress();
        int addr = memAddr.toInt();
        int offset = 0;
        // Align on 16-byte boundary
        while ((addr & 15) != 0) {
            addr++;
            offset++;
View Full Code Here

                if (child != null) {
                    System.out.print(NumberUtils.hex(ptr.toInt()) + " ");
                    if (VmUtils.getVm().getHeapManager().isObject(child)) {
                        System.out.println(child);
                    } else {
                        System.out.println(NumberUtils.hex(child.toInt()));
                    }
                }
                ptr = ptr.sub(slotSize);
            }
View Full Code Here

                    System.out.print(NumberUtils.hex(ptr.toInt()) + " Arg" + (i + 1) + " = ");
                    Address child = ptr.loadAddress();
                    if (VmUtils.getVm().getHeapManager().isObject(child)) {
                        System.out.println("Class: " + child.getClass() + " Value: " + child);
                    } else {
                        System.out.println(NumberUtils.hex(child.toInt()));
                    }
                    //System.out.println(NumberUtils.hex(ptr.loadInt()));
                }
            } while ((currFrame = sr.getPrevious(currFrame)) != null);
View Full Code Here

                return false;
            }
        } else {
            final Address valuePtr = ObjectReference.fromObject(value).toAddress();
            if (slotLength == 1) {
                statics[idx] = valuePtr.toInt();
            } else {
                final long lvalue = valuePtr.toLong();
                if (lsbFirst) {
                    statics[idx + 0] = (int) (lvalue & 0xFFFFFFFFL);
                    statics[idx + 1] = (int) ((lvalue >>> 32) & 0xFFFFFFFFL);
View Full Code Here

    public static void main(String[] args) {
        final Address a1 = Address.fromIntZeroExtend(0x1234);
        final Address a2 = a1.add(5);

        final int i1 = a1.toInt();
        final int i2 = a2.toInt();

        System.out.println("a1 LE a2 " + a1.LE(a2) + " " + (i1 <= i2));
        System.out.println("a1 LT a2 " + a1.LT(a2) + " " + (i1 < i2));
        System.out.println("a1 EQ a2 " + a1.EQ(a2) + " " + (i1 == i2));
        System.out.println("a1 NE a2 " + a1.NE(a2) + " " + (i1 != i2));
View Full Code Here

        } else {
            final int physBase = getReg32(SVGA_REG_MEM_START);
            address = Address.fromIntZeroExtend(physBase);
        }

        log.debug("Found FIFO at 0x" + NumberUtils.hex(address.toInt()) + ", size 0x" + NumberUtils.hex(size));

        final MemoryResource res = rm.claimMemoryResource(device, address, size, ResourceManager.MEMMODE_NORMAL);
        final int fifoMin = SVGA_FIFO_NUM_REGS * 4;
        res.setInt(SVGA_FIFO_MIN * 4, fifoMin);
        res.setInt(SVGA_FIFO_MAX * 4, size);
View Full Code Here

        final int size = (DPD_SIZE + FRAME_SIZE) + 16 /* alignment */;
        this.data = new byte[size];
        this.mem = rm.asMemoryResource(data);

        final Address memAddr = mem.getAddress();
        int addr = memAddr.toInt();
        int offset = 0;
        // Align on 16-byte boundary
        while ((addr & 15) != 0) {
            addr++;
            offset++;
View Full Code Here

        this.data = new byte[size];
        this.nrFrames = nrFrames;
        this.mem = rm.asMemoryResource(data);

        final Address memAddr = mem.getAddress();
        int addr = memAddr.toInt();
        int offset = 0;
        // Align on 16-byte boundary
        while ((addr & 15) != 0) {
            addr++;
            offset++;
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.