FreeBSD/sys/i386/i386/pmap.c
/*
 * Set PG_G on kernel pages.  Only the BSP calls this when SMP is turned on.
 */
Set PG_G on kernel pages.  Only the BSP calls this when SMP is turned on.
Set PG_G on kernel pages . Only the BSP calls this when SMP is turned on .
static void
pmap_set_pg(void)
{
	pt_entry_t *pte;
	vm_offset_t va, endva;
	if (pgeflag == 0)
		return;
	endva = KERNBASE + KERNend;
	if (pseflag) {
		va = KERNBASE + KERNLOAD;
		while (va  < endva) {
			pdir_pde(PTD, va) |= pgeflag;
			invltlb();	
			va += NBPDR;
		}
	} else {
		va = (vm_offset_t)btext;
		while (va < endva) {
			pte = vtopte(va);
			if (*pte)
				*pte |= pgeflag;
			invltlb();	
			va += PAGE_SIZE;
		}
	}
}
static void pmap_set_pg ( void ) { pt_entry_t * pte ; vm_offset_t va , endva ; if ( pgeflag == 0 ) return ; endva = KERNBASE + KERNend ; if ( pseflag ) { va = KERNBASE + KERNLOAD ; while ( va < endva ) { pdir_pde ( PTD , va ) |= pgeflag ; invltlb ( ) ; va += NBPDR ; } } else { va = ( vm_offset_t ) btext ; while ( va < endva ) { pte = vtopte ( va ) ; if ( * pte ) * pte |= pgeflag ; invltlb ( ) ; va += PAGE_SIZE ; } } }
Set PG_G on kernel pages.
Set PG_G on kernel pages .
/* Flush non-PG_G entries. */ /* Flush non-PG_G entries. */