Exemple #1
0
bool PAEPaging::unmap_page_table( Address addr)
{
	unsigned pdp_id	= get_page_directory_pointer_off(addr , mode);
	unsigned pd_id = get_page_directory_off(addr , mode);
	PageTable* pd_ptr = get_next_level_address<PageTable>( page_directory_pointer , pdp_id); 
	if( pd_ptr )
	{
		if( mode == PAE_Normal)
		{
			PageTable* pt_ptr = get_next_level_address<PageTable>(pd_ptr , pd_id);
			if( pt_ptr )
			{
			 unsigned pt_id = get_pagetable_off(addr,mode);
			 invalidate_page( pt_ptr , pt_id );
			 return true;
			}
		}
		else if( mode == PAE_Huge)
		{
			invalidate_page(pd_ptr , pd_id);
			return true;
		}
	}
	return false;
}
void invalidate_page_wrapper(gpointer data, gpointer user_data) {
    ClientEntry* client = (ClientEntry*) data;
    PageRequest* request = (PageRequest*) user_data;

    if (client->clientId != request->nodeId) {
        InvalidationResponse* response = invalidate_page(request->nodeId, request->pageNumber, client);
        free(response);
    }
}
Exemple #3
0
bool LongModePaging::unmap_page_table( Address addr)
{
	unsigned pml4_id,pdp_id,pd_id,pt_id;
	std::vector<unsigned> entry_id_vec(4);
	
	get_domains(addr , pml4_id , pdp_id , pd_id , pt_id , mode);
	entry_id_vec[0]=pml4_id;
	entry_id_vec[1]=pdp_id;
	entry_id_vec[2]=pd_id;
	PageTable* table = NULL;
	//point to page directory pointer table
	if( mode == LongMode_Normal)
	{
		table = get_tables(3, entry_id_vec);
		if( !table )
		{
			debug_printf("didn't find entry indexed with %ld !",addr);
			return false;
		}
		invalidate_page(table,pt_id);
	}
	else if( mode == LongMode_Middle )
	{
		table = get_tables(2,entry_id_vec);
		if( !table)
		{
			debug_printf("didn't find entry indexed with %ld !",addr);
			return false;
		}
		invalidate_page( table,pd_id);
	}
	else if( mode == LongMode_Huge)
	{
		table = get_tables(1,entry_id_vec);
		if(!table)
		{
			debug_printf("didn't find entry indexed with %ld !",addr);
			return false;
		}
		invalidate_page(table,pdp_id);
	}
	return false;
}
Exemple #4
0
bool NormalPaging::unmap_page_table( Address addr)
{
	unsigned pd_entry_id = get_page_directory_off(addr,mode);
	if( mode == Legacy_Normal )
	{
		unsigned pt_id = get_pagetable_off(addr,mode);
		PageTable* table = NULL;
		if(page_directory)
		{
			get_next_level_address<PageTable>(page_directory , pd_entry_id);
		}
		if( !table )
		{
			debug_printf("entry to be invalidate of TLB isn't valid!");
			return false;
		}
		invalidate_page( table , pt_id );
	}
	else if( mode == Legacy_Huge )
	{
		invalidate_page( page_directory , pd_entry_id);		
	}
	return true;
}
Exemple #5
0
/** Invalidate TLB entries for specified page range belonging to specified
 * address space.
 *
 * @param asid Ignored as the ARM architecture doesn't support it.
 * @param page Address of the first page whose entry is to be invalidated.
 * @param cnt Number of entries to invalidate.
 */
void tlb_invalidate_pages(asid_t asid __attribute__((unused)), uintptr_t page, size_t cnt)
{
	for (unsigned i = 0; i < cnt; i++)
		invalidate_page(page + i * PAGE_SIZE);
}