Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 105315
b: refs/heads/master
c: ec4b2c0
h: refs/heads/master
i:
  105313: a25c8a9
  105311: 97e2260
v: v3
  • Loading branch information
Jon Tollefson authored and Linus Torvalds committed Jul 24, 2008
1 parent e8d2cb2 commit 03ffe41
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 53ba51d21d6e048424ab8aadfebdb1f25ae07b60
refs/heads/master: ec4b2c0c8312d1118c2acd00c89988ecf955d5cc
21 changes: 21 additions & 0 deletions trunk/arch/powerpc/mm/hugetlbpage.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@

#define NUM_LOW_AREAS (0x100000000UL >> SID_SHIFT)
#define NUM_HIGH_AREAS (PGTABLE_RANGE >> HTLB_AREA_SHIFT)
#define MAX_NUMBER_GPAGES 1024

/* Tracks the 16G pages after the device tree is scanned and before the
* huge_boot_pages list is ready. */
static unsigned long gpage_freearray[MAX_NUMBER_GPAGES];
static unsigned nr_gpages;

unsigned int hugepte_shift;
#define PTRS_PER_HUGEPTE (1 << hugepte_shift)
Expand Down Expand Up @@ -104,6 +110,21 @@ pmd_t *hpmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long addr)
}
#endif

/* Moves the gigantic page addresses from the temporary list to the
* huge_boot_pages list. */
int alloc_bootmem_huge_page(struct hstate *h)
{
struct huge_bootmem_page *m;
if (nr_gpages == 0)
return 0;
m = phys_to_virt(gpage_freearray[--nr_gpages]);
gpage_freearray[nr_gpages] = 0;
list_add(&m->list, &huge_boot_pages);
m->hstate = h;
return 1;
}


/* Modelled after find_linux_pte() */
pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr)
{
Expand Down

0 comments on commit 03ffe41

Please sign in to comment.