SSUOS_P6/src/kernel/mem/palloc.c
/* Frees the PAGE_CNT pages starting at PAGES. */
Frees the PAGE_CNT pages starting at PAGES.
Frees the PAGE_CNT pages starting at PAGES .
void palloc_free_multiple_page(void * pages,size_t page_cnt) 
{
	int i;
	void * addr;
	size_t from,bit_count;
	struct memory_pool * pool;
	int test;
	if(pages == NULL || page_cnt <= 0) 
		return (void)NULL;
	if((void *)KERNEL_ADDR <= pages && pages < (void *)USER_POOL_START) 
	{
		pool = &kernel_pool;
		from = (size_t)((uint32_t)(pages - KERNEL_ADDR) / PAGE_SIZE);
		test = 0;
	}
	if((void *)USER_POOL_START <= pages && pages < (void *)RKERNEL_HEAP_START) 
	{
		pool = &user_pool;
		from = (size_t)((uint32_t)(pages - USER_POOL_START) / PAGE_SIZE);
		test = 1;
	}
	for(i = from; i < from+page_cnt; i++)
		set_bitmap(pool->bitmap,i,false); 
}
void palloc_free_multiple_page ( void * pages , size_t page_cnt ) { int i ; void * addr ; size_t from , bit_count ; struct memory_pool * pool ; int test ; if ( pages == NULL || page_cnt <= 0 ) return ( void ) NULL ; if ( ( void * ) KERNEL_ADDR <= pages && pages < ( void * ) USER_POOL_START ) { pool = & kernel_pool ; from = ( size_t ) ( ( uint32_t ) ( pages - KERNEL_ADDR ) / PAGE_SIZE ) ; test = 0 ; } if ( ( void * ) USER_POOL_START <= pages && pages < ( void * ) RKERNEL_HEAP_START ) { pool = & user_pool ; from = ( size_t ) ( ( uint32_t ) ( pages - USER_POOL_START ) / PAGE_SIZE ) ; test = 1 ; } for ( i = from ; i < from + page_cnt ; i ++ ) set_bitmap ( pool -> bitmap , i , false ) ; }
Frees the PAGE_CNT pages starting at PAGES.
Frees the PAGE_CNT pages starting at PAGES .
// error handling // kernel // user // bitmap의 bit변경