Package org.jnode.system.resource

Examples of org.jnode.system.resource.ResourceNotFreeException


        try {
            rm = InitialNaming.lookup(ResourceManager.NAME);
            cmdBlock = claimPorts(rm, device, cmdBlockStart, cmdBlockSize);
            ctrlBlock = claimPorts(rm, device, ctrlBlockStart, ctrlBlockSize);
        } catch (NameNotFoundException ex) {
            throw new ResourceNotFreeException("Cannot find ResourceManager",
                ex);
        } catch (ResourceNotFreeException ex) {
            if (cmdBlock != null) {
                cmdBlock.release();
            }
View Full Code Here


        // Register the irq handler
        final ResourceManager rm;
        try {
            rm = InitialNaming.lookup(ResourceManager.NAME);
        } catch (NameNotFoundException ex) {
            throw new ResourceNotFreeException("Cannot find ResourceManager",
                ex);
        }
        irqRes = rm.claimIRQ(parent, io.getIrq(), this, true);
        // Reset the controller
        softwareReset();
View Full Code Here

            } else {
                table.release();
                return null;
            }
        } catch (ResourceNotFreeException ex1) {
            throw new ResourceNotFreeException(
                "Could not get table header begining memory range: "
                    + MagicUtils.toString(ptr) + "(8 bytes)");
        }

    }
View Full Code Here

        throws ResourceNotFreeException {
        try {
            final ResourceManager rm = InitialNaming.lookup(ResourceManager.NAME);
            this.cmosIO = rm.claimIOResource(owner, CMOS_FIRST_PORT, CMOS_LAST_PORT - CMOS_FIRST_PORT + 1);
        } catch (NameNotFoundException ex) {
            throw new ResourceNotFreeException("Cannot find ResourceManager", ex);
        }
    }
View Full Code Here

            final ResourceManager rm = InitialNaming.lookup(ResourceManager.NAME);
            final ResourceOwner owner = new SimpleResourceOwner("Screen");
            memory = rm.claimMemoryResource(owner, ptr, getWidth()
                    * getHeight() * 2, ResourceManager.MEMMODE_NORMAL);
        } catch (NameNotFoundException ex) {
            throw new ResourceNotFreeException("ResourceManager not found", ex);
        }
    }
View Full Code Here

                }
                driveParams[i] = getDriveParam(cmosType);
                diskChanged[i] = true;
            }
        } catch (NameNotFoundException ex) {
            throw new ResourceNotFreeException("Cannot find CMOSService", ex);
        }

        try {
            final ResourceManager rm = InitialNaming.lookup(ResourceManager.NAME);
            final DMAManager dmaService = InitialNaming.lookup(DMAManager.NAME);
            // PRESERVE THIS CLAIMING ORDER!
            irq = rm.claimIRQ(owner, FLOPPY_IRQ, this, false);
            dma = dmaService.claimDMAChannel(owner, FLOPPY_DMA);
            io1 = claimPorts(rm, owner, startPort + OFFSET_RANGE1, NR_PORTS_RANGE1);
            io2 = claimPorts(rm, owner, startPort + OFFSET_RANGE2, NR_PORTS_RANGE2);
            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) {
View Full Code Here

            final MemoryResourceImpl res = new MemoryResourceImpl(null, owner, start, size);
            if (isFree(resources, res)) {
                resources = add(resources, res);
                return res;
            } else {
                throw new ResourceNotFreeException();
            }
        } else {
            // Find a range
            Address ptr;
            if (mode == ResourceManager.MEMMODE_ALLOC_DMA) {
View Full Code Here

                offset = offset.toWord().add(alignMask).and(alignMask.not()).toOffset();
            }

            // Do we have space left?
            if (offset.toWord().add(size).GT(this.size.toWord())) {
                throw new ResourceNotFreeException();
            }
        }
    }
View Full Code Here

            if (released) {
                throw new IndexOutOfBoundsException("MemoryResource is released");
            }
            if (!allowOverlaps) {
                if (!isFree(this.children, child)) {
                    throw new ResourceNotFreeException();
                }
            }
            this.children = (MemoryResourceImpl) add(this.children, child);
        }
        return child;
View Full Code Here

        if (isFree(resources, res)) {
            resources = add(resources, res);
            return res;
        } else {
            final Object curOwner = get(resources, res).getOwner();
            throw new ResourceNotFreeException("port " + NumberUtils.hex(startPort) + '-' +
                NumberUtils.hex(startPort + length - 1) + " is owned by " + curOwner);
        }
    }
View Full Code Here

TOP

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

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.