#ifdef __QNXNTO__

#include <sys/rsrcdbmgr.h>
#include <sys/rsrcdbmsg.h>

#include "io.h"

int check_region(int port, int size)
{
#if 0
	int ret, scanedport = port;
	rsrc_alloc_t list;
	
	while( (ret = rsrcdbmgr_query(&list, 1, scanedport, RSRCDBMGR_IO_PORT)) > 0 ) {
		if ((scanedport += list.end) >= (port + size))
			return 1;
	}
	return ret;
#else 
	return 0;
#endif
}

int request_region(int port, int size)
{
#if 0
	rsrc_request_t res;
	
	res.start = port;
	res.end = port + size - 1;	
	res.flags = RSRCDBMGR_IO_PORT;
	return rsrcdbmgr_attach(&res, 1);
#else 
	return 0;
#endif
}

int release_region(int port, int size)
{
#if 0
	rsrc_request_t res;
	
	res.start = port;
	res.end = port + size - 1;	
	res.flags = RSRCDBMGR_IO_PORT;
	return rsrcdbmgr_detach(&res, 1);
#else 
	return 0;
#endif
}

int request_dma(int dma)
{
#if 0
	rsrc_request_t res;
	
	res.start = dma;
	res.end = dma;
	res.flags = RSRCDBMGR_DMA_CHANNEL;
	return rsrcdbmgr_attach(&res, 1);
#else 
	return 0;
#endif
}

int free_dma(int dma)
{
#if 0
	rsrc_request_t res;
	
	res.start = dma;
	res.end = dma;
	res.flags = RSRCDBMGR_DMA_CHANNEL;
	return rsrcdbmgr_detach(&res, 1);
#else 
	return 0;
#endif
}

int request_irq(int irq, int flags)
{
#if 0
	rsrc_request_t res;
	
	res.start = irq;
	res.end = irq;
	res.flags = RSRCDBMGR_IRQ | ((flags & SA_SHIRQ)?RSRCDBMGR_FLAG_SHARE:0);
	return rsrcdbmgr_attach(&res, 1);
#else 
	return 0;
#endif
}

int free_irq(int irq)
{
#if 0
	rsrc_request_t res;
	
	res.start = irq;
	res.end = irq;
	res.flags = RSRCDBMGR_IRQ;
	return rsrcdbmgr_detach(&res, 1);
#else 
	return 0;
#endif
}

#endif
