Package org.jnode.system.resource

Examples of org.jnode.system.resource.ResourceManager


        this.tx_active = false;

        // Get the start of the IO address space
        iobase = getIOBase(device, flags);
        final int iolength = getIOLength(device, flags);
        final ResourceManager rm;
        try {
            rm = InitialNaming.lookup(ResourceManager.NAME);
        } catch (NameNotFoundException ex) {
            throw new DriverException("Cannot find ResourceManager");
        }
        this.irq = rm.claimIRQ(owner, irq, this, true);
        try {
            io = claimPorts(rm, owner, iobase, iolength);
        } catch (ResourceNotFreeException ex) {
            this.irq.release();
            throw ex;
View Full Code Here


        final int iolength = getIOLength(device, this.flags);
        log.info("BCM570x driver iobase " + iobase + " irq " + irq);
        log.debug("BCM570x driver iobase " + iobase + " irq " + irq);

        final ResourceManager rm;

        try {
            rm = InitialNaming.lookup(ResourceManager.NAME);
        } catch (NameNotFoundException ex) {
            throw new DriverException("Cannot find ResourceManager");
        }

        this.irq = rm.claimIRQ(owner, irq, this, true);

        try {
            io = claimPorts(rm, owner, iobase, iolength);
        } catch (ResourceNotFreeException ex) {
            this.irq.release();
View Full Code Here

        this.driver = driver;
        this.device = device;
        this.flags = (Prism2Flags) flags;

        final ResourceManager rm;
        try {
            rm = InitialNaming.lookup(ResourceManager.NAME);
        } catch (NameNotFoundException ex) {
            throw new DriverException("Cannot find ResourceManager");
        }

        final PCIHeaderType0 pciCfg = device.getConfig().asHeaderType0();
        final PCIBaseAddress[] baseAddrs = pciCfg.getBaseAddresses();
        if (baseAddrs.length < 1) {
            throw new DriverException(
                "No memory mapped I/O region in PCI config");
        }
        final PCIBaseAddress regsAddr = pciCfg.getBaseAddresses()[0];
        if (!regsAddr.isMemorySpace()) {
            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);
        } catch (ResourceNotFreeException ex) {
            throw new DriverException("Cannot claim memory mapped I/O", ex);
        }

        // Claim IRQ
        final int irqNo = pciCfg.getInterruptLine();
        try {
            this.irq = rm.claimIRQ(device, irqNo, this, true);
        } catch (ResourceNotFreeException ex) {
            // Release IO
            io.release();
            io = null;
            // re-throw exception
View Full Code Here

            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);
            return rm;
        } catch (NamingException ex) {
            throw new Error("Cannot initialize ResourceManager");
        } catch (ResourceNotFreeException ex) {
View Full Code Here

            // Initialize BootLog
            BootLogImpl.initialize();

            // Initialize resource manager
            final ResourceManager rm = ResourceManagerImpl.initialize();

            /* Initialize the system classloader */
            VmSystemClassLoader loader = (VmSystemClassLoader) (getVmClass(VmProcessor.current()).getLoader());
            systemLoader = loader;
            loader.initialize();
View Full Code Here

        this.basePort = basePort;
    }

    protected void startDevice() throws DriverException {
        try {
            final ResourceManager rm = InitialNaming.lookup(ResourceManager.NAME);
            port = claimPorts(rm, getDevice(), basePort, 8);
            configure(BAUD9600);
            getDevice().registerAPI(SerialPortAPI.class, this);
        } catch (NameNotFoundException nnfex) {
            throw new DriverException(nnfex);
View Full Code Here

        device.writeConfigByte(0xd2, 0x9);
        /*int config =*/
        device.readConfigByte(0xd2);

        try {
            final ResourceManager rm = InitialNaming.lookup(ResourceManager.NAME);
            try {
                ioRes = claimPorts(rm, device, hostStatusIORegister, 14);
            } catch (ResourceNotFreeException ex1) {
                //todo empty?
            }
View Full Code Here

     * Create a new instance
     *
     * @throws DMAException
     */
    public DMA() throws DMAException {
        final ResourceManager rm;
        try {
            rm = InitialNaming.lookup(ResourceManager.NAME);
        } catch (NameNotFoundException ex) {
            throw new DMAException("Cannot find ResourceManager", ex);
        }
View Full Code Here

    protected void startDevice() throws DriverException {
        final Device dev = getDevice();

        // Find the ACPI info
        try {
            final ResourceManager rm;
            rm = InitialNaming.lookup(ResourceManager.NAME);
            info = findAcpiRSDTPTR(rm);
        } catch (NameNotFoundException ex) {
            throw new DriverException("Cannot find the resource manager");
        } catch (ResourceNotFreeException ex) {
View Full Code Here

    /** A routine that claims all the resources nessasary to run the PCSpeaker. * */
    public void startDevice() throws DriverException {
        try {
            final Device dev = getDevice();
            final ResourceManager rm = InitialNaming.lookup(ResourceManager.NAME);
            speakIO = claimPorts(rm, dev, SPEAKER_PORT, 1);
            pitIO = claimPorts(rm, dev, CHANNEL2_PORT, 2);
            getDevice().registerAPI(SpeakerAPI.class, this);
            // do a test beep during startup
            // beep();
View Full Code Here

TOP

Related Classes of org.jnode.system.resource.ResourceManager

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.