/* After mem_init() and no swapping: can only resort to * __get_dma_pages() */ 
/* After mem_init(): can only resort to __get_dma_pages() */ 
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);	size = ALIGN_IF_SWAP(size);	DPRINTK( "atari_stram_alloc: rounded size = %08lx\n", size );#ifdef CONFIG_STRAM_SWAP	if (max_swap_size) {		/* If swapping is active: make some free space in the swap		   "device". */		DPRINTK( "atari_stram_alloc: after mem_init, swapping ok, "				 "calling get_region\n" );		addr = get_stram_region( N_PAGES(size) );		flags = BLOCK_INSWAP;	}	else#endif	if (!mem_init_done)		return alloc_bootmem_low(size);	else {		/* After mem_init() and no swapping: can only resort to		 * __get_dma_pages() */		addr = (void *)__get_dma_pages(GFP_KERNEL, get_order(size));		flags = BLOCK_GFP;		DPRINTK( "atari_stram_alloc: after mem_init, swapping off, "				 "get_pages=%p\n", addr );	}	if (addr) {		if (!(block = add_region( addr, size ))) {			/* out of memory for BLOCK structure :-( */			DPRINTK( "atari_stram_alloc: out of mem for BLOCK -- "					 "freeing again\n" );#ifdef CONFIG_STRAM_SWAP			if (flags == BLOCK_INSWAP)				free_stram_region( SWAP_NR(addr), N_PAGES(size) );			else#endif				free_pages((unsigned long)addr, get_order(size));			return( NULL );		}		block->owner = owner;		block->flags |= flags;	}	return( addr );}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/f9c98d0287de42221c624482fd4f8d485c98ab22/stram.c/buggy/arch/m68k/atari/stram.c