login
Header Space

 
 

Page global directory

May 8, 2008 - 8:05am
Submitted by Anonymous on May 8, 2008 - 8:05am.
Linux

kernel defines
typedef struct { unsigned long long pgd; } pgd_t;
but what I know is it should eb an array depending on how you haev broken up the virtual address.
how that table is created ?

Page global directory

May 9, 2008 - 5:30am
Giuseppe Calderaro (not verified)

>>> typedef struct { unsigned long long pgd; } pgd_t;

pgd_t is used to reference a single entry in the PGD. For example:

pgd_t *pgd;
int pgd_idx;
pgd_idx = pgd_index(address);
pgd = pgd_base + pgd_idx;

About PGD creation (arch/x86/mm/pgtable_32.c):

pgd_t *pgd_alloc(struct mm_struct *mm)
{
int i;
pgd_t *pgd = quicklist_alloc(0, GFP_KERNEL, pgd_ctor);
if (PTRS_PER_PMD == 1 || !pgd)
return pgd;

quicklist_alloc takes a page and calls pgd_ctor to build PGD.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
speck-geostationary