slot = ppc_md.hpte_insert(hpte_group, va, prpn, 0, hpteflags, 0, 1); 
slot = ppc_md.hpte_insert(hpte_group, va, prpn, HPTE_V_LARGE, rflags); 
int hash_huge_page(struct mm_struct *mm, unsigned long access,		   unsigned long ea, unsigned long vsid, int local){	pte_t *ptep;	unsigned long va, vpn;	pte_t old_pte, new_pte;	unsigned long hpteflags, prpn;	long slot;	int err = 1;	spin_lock(&mm->page_table_lock);	ptep = huge_pte_offset(mm, ea);	/* Search the Linux page table for a match with va */	va = (vsid << 28) | (ea & 0x0fffffff);	vpn = va >> HPAGE_SHIFT;	/*	 * If no pte found or not present, send the problem up to	 * do_page_fault	 */	if (unlikely(!ptep || pte_none(*ptep)))		goto out;/* 	BUG_ON(pte_bad(*ptep)); */	/* 	 * Check the user's access rights to the page.  If access should be	 * prevented then send the problem up to do_page_fault.	 */	if (unlikely(access & ~pte_val(*ptep)))		goto out;	/*	 * At this point, we have a pte (old_pte) which can be used to build	 * or update an HPTE. There are 2 cases:	 *	 * 1. There is a valid (present) pte with no associated HPTE (this is 	 *	the most common case)	 * 2. There is a valid (present) pte with an associated HPTE. The	 *	current values of the pp bits in the HPTE prevent access	 *	because we are doing software DIRTY bit management and the	 *	page is currently not DIRTY. 	 */	old_pte = *ptep;	new_pte = old_pte;	hpteflags = 0x2 | (! (pte_val(new_pte) & _PAGE_RW)); 	/* _PAGE_EXEC -> HW_NO_EXEC since it's inverted */	hpteflags |= ((pte_val(new_pte) & _PAGE_EXEC) ? 0 : HW_NO_EXEC);	/* Check if pte already has an hpte (case 2) */	if (unlikely(pte_val(old_pte) & _PAGE_HASHPTE)) {		/* There MIGHT be an HPTE for this pte */		unsigned long hash, slot;		hash = hpt_hash(vpn, 1);		if (pte_val(old_pte) & _PAGE_SECONDARY)			hash = ~hash;		slot = (hash & htab_hash_mask) * HPTES_PER_GROUP;		slot += (pte_val(old_pte) & _PAGE_GROUP_IX) >> 12;		if (ppc_md.hpte_updatepp(slot, hpteflags, va, 1, local) == -1)			pte_val(old_pte) &= ~_PAGE_HPTEFLAGS;	}	if (likely(!(pte_val(old_pte) & _PAGE_HASHPTE))) {		unsigned long hash = hpt_hash(vpn, 1);		unsigned long hpte_group;		prpn = pte_pfn(old_pte);repeat:		hpte_group = ((hash & htab_hash_mask) *			      HPTES_PER_GROUP) & ~0x7UL;		/* Update the linux pte with the HPTE slot */		pte_val(new_pte) &= ~_PAGE_HPTEFLAGS;		pte_val(new_pte) |= _PAGE_HASHPTE;		/* Add in WIMG bits */		/* XXX We should store these in the pte */		hpteflags |= _PAGE_COHERENT;		slot = ppc_md.hpte_insert(hpte_group, va, prpn, 0,					  hpteflags, 0, 1);		/* Primary is full, try the secondary */		if (unlikely(slot == -1)) {			pte_val(new_pte) |= _PAGE_SECONDARY;			hpte_group = ((~hash & htab_hash_mask) *				      HPTES_PER_GROUP) & ~0x7UL; 			slot = ppc_md.hpte_insert(hpte_group, va, prpn,						  1, hpteflags, 0, 1);			if (slot == -1) {				if (mftb() & 0x1)					hpte_group = ((hash & htab_hash_mask) * HPTES_PER_GROUP) & ~0x7UL;				ppc_md.hpte_remove(hpte_group);				goto repeat;                        }		}		if (unlikely(slot == -2))			panic("hash_huge_page: pte_insert failed\n");		pte_val(new_pte) |= (slot<<12) & _PAGE_GROUP_IX;		/* 		 * No need to use ldarx/stdcx here because all who		 * might be updating the pte will hold the		 * page_table_lock		 */		*ptep = new_pte;	}	err = 0; out:	spin_unlock(&mm->page_table_lock);	return err;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/96e2844999f99878fc5b03b81ccaa60580005b81/hugetlbpage.c/clean/arch/ppc64/mm/hugetlbpage.c