Package org.jnode.system.resource

Examples of org.jnode.system.resource.MemoryResource.release()


        try {
            MemoryResource mem = rm.claimMemoryResource(owner, tablePtr, size,
                ResourceManager.MEMMODE_NORMAL);
            // Read the table length
            int baseTableLen = mem.getChar(4);
            mem.release();
            // Claim the full table.
            // BootLogInstance.get().info("baseTableLength " + baseTableLen);
            size = baseTableLen;
            mem = rm.claimMemoryResource(owner, tablePtr, size,
                ResourceManager.MEMMODE_NORMAL);
View Full Code Here


            } else if (signature.equals("FACS")) {
                return new FirmwareAcpiControlStructure(drv, rm, table);
            } else if (signature.equals("FACP")) {
                return new FixedAcpiDescriptionTable(drv, rm, table);
            } else {
                table.release();
                return null;
            }
        } catch (ResourceNotFreeException ex1) {
            throw new ResourceNotFreeException(
                "Could not get table header begining memory range: "
View Full Code Here

            dmaMem = rm.claimMemoryResource(owner, null, 64 * 1024, ResourceManager.MEMMODE_ALLOC_DMA);
        } catch (NameNotFoundException ex) {
            throw new ResourceNotFreeException("Cannot find ResourceManager or DMAService", ex);
        } catch (ResourceNotFreeException ex) {
            if (dmaMem != null) {
                dmaMem.release();
            }
            if (io2 != null) {
                io2.release();
            }
            if (io1 != null) {
View Full Code Here

            return 1;
        }
        try {
            return res.getByte(15);
        } finally {
            res.release();
        }
    }
}
View Full Code Here

            for (int i = 0; i < size; i++) {
                buffer.put(resource.getByte(i));
            }
            buffer.rewind();
        } finally {
            resource.release();
        }
       
        return buffer;
    }
View Full Code Here

            Extent mmioSize = Extent.fromIntZeroExtend(1024); // 1K
            MemoryResource mmio0 = deviceRam.claimChildResource(block0Ofs, mmioSize, false);
            Mach64VgaIO io = new Mach64VgaIO(deviceRam, mmio0);
            if ((io.getReg32(CONFIG_CHIP_ID) & CFG_CHIP_TYPE) != pciCfg.getDeviceID()) {
                // Try for 4Mb framebuffers.
                mmio0.release();
                block0Ofs = Offset.fromIntZeroExtend(0x3ffc00);
                mmio0 = deviceRam.claimChildResource(block0Ofs, mmioSize, false);
                io = new Mach64VgaIO(deviceRam, mmio0);
                if ((io.getReg32(CONFIG_CHIP_ID) & CFG_CHIP_TYPE) != pciCfg.getDeviceID()) {
                    throw new DriverException("Cannot find block0 registers.");
View Full Code Here

                            rm.claimMemoryResource(device, Address.fromIntZeroExtend(romAddr
                                    .getRomBase()), romAddr.getSize(),
                                    ResourceManager.MEMMODE_NORMAL);
                    if (!verifyBiosSignature(rom)) {
                        log.info("Signature mismatch");
                        rom.release();
                        rom = null;
                    }
                } else {
                    log.debug("Failed to enabled expansion ROM");
                }
View Full Code Here

            // Claim a small region, so we can read the size.
            MemoryResource mem;
            mem = rm.claimMemoryResource(owner, romAddr, 4, ResourceManager.MEMMODE_NORMAL);
            final int blocks = mem.getByte(2) & 0xFF;
            final int romSize = blocks * 512;
            mem.release();

            log.info("Found ATI ROM at 0x" + NumberUtils.hex(romAddr.toInt()) + " size=" +
                    NumberUtils.toBinaryByte(romSize));
            return rm.claimMemoryResource(owner, romAddr, romSize, ResourceManager.MEMMODE_NORMAL);
        }
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.