/* This is main public interface: somehow allocate a ST-RAM block */
void* atari_stram_alloc(long size, const char *owner)
/* This is main public interface: somehow allocate a ST-RAM block */
void* atari_stram_alloc(long size, const char *owner)
{
	void *addr = NULL;
	BLOCK *block;
	int flags;
	DPRINTK("atari_stram_alloc(size=%08lx,owner=%s)\n", size, owner);
	if (!mem_init_done)
		return alloc_bootmem_low(size);
	else {
		addr = (void *)__get_dma_pages(GFP_KERNEL, get_order(size));
		flags = BLOCK_GFP;
		DPRINTK( "atari_stram_alloc: after mem_init, "
				 "get_pages=%p\n", addr );
	}
	if (addr) {
		if (!(block = add_region( addr, size ))) {
			DPRINTK( "atari_stram_alloc: out of mem for BLOCK -- "
					 "freeing again\n" );
			free_pages((unsigned long)addr, get_order(size));
			return( NULL );
		}
		block->owner = owner;
		block->flags |= flags;
	}
	return( addr );
}