Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 140349
b: refs/heads/master
c: c947a58
h: refs/heads/master
i:
  140347: 47ebeff
v: v3
  • Loading branch information
Johannes Weiner authored and Chris Zankel committed Apr 3, 2009
1 parent 93c9f65 commit 30edfb4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 264da9f708b130122d881fa4570d1cd618440a73
refs/heads/master: c947a585ab13f310c9223284dfd502790abd05f9
5 changes: 4 additions & 1 deletion trunk/arch/xtensa/include/asm/page.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <asm/processor.h>
#include <asm/types.h>
#include <asm/cache.h>
#include <platform/hardware.h>

/*
* Fixed TLB translations in the processor.
Expand Down Expand Up @@ -150,9 +151,11 @@ extern void copy_user_page(void*, void*, unsigned long, struct page*);
* addresses.
*/

#define ARCH_PFN_OFFSET (PLATFORM_DEFAULT_MEM_START >> PAGE_SHIFT)

#define __pa(x) ((unsigned long) (x) - PAGE_OFFSET)
#define __va(x) ((void *)((unsigned long) (x) + PAGE_OFFSET))
#define pfn_valid(pfn) ((unsigned long)pfn < max_mapnr)
#define pfn_valid(pfn) ((pfn) >= ARCH_PFN_OFFSET && ((pfn) - ARCH_PFN_OFFSET) < max_mapnr)
#ifdef CONFIG_DISCONTIGMEM
# error CONFIG_DISCONTIGMEM not supported
#endif
Expand Down
10 changes: 5 additions & 5 deletions trunk/arch/xtensa/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ void __init paging_init(void)

/* All pages are DMA-able, so we put them all in the DMA zone. */

zones_size[ZONE_DMA] = max_low_pfn;
zones_size[ZONE_DMA] = max_low_pfn - ARCH_PFN_OFFSET;
for (i = 1; i < MAX_NR_ZONES; i++)
zones_size[i] = 0;

Expand All @@ -179,7 +179,7 @@ void __init paging_init(void)

memset(swapper_pg_dir, 0, PAGE_SIZE);

free_area_init(zones_size);
free_area_init_node(0, zones_size, ARCH_PFN_OFFSET, NULL);
}

/*
Expand Down Expand Up @@ -220,8 +220,8 @@ void __init mem_init(void)
unsigned long codesize, reservedpages, datasize, initsize;
unsigned long highmemsize, tmp, ram;

max_mapnr = num_physpages = max_low_pfn;
high_memory = (void *) __va(max_mapnr << PAGE_SHIFT);
max_mapnr = num_physpages = max_low_pfn - ARCH_PFN_OFFSET;
high_memory = (void *) __va(max_low_pfn << PAGE_SHIFT);
highmemsize = 0;

#ifdef CONFIG_HIGHMEM
Expand All @@ -231,7 +231,7 @@ void __init mem_init(void)
totalram_pages += free_all_bootmem();

reservedpages = ram = 0;
for (tmp = 0; tmp < max_low_pfn; tmp++) {
for (tmp = 0; tmp < max_mapnr; tmp++) {
ram++;
if (PageReserved(mem_map+tmp))
reservedpages++;
Expand Down

0 comments on commit 30edfb4

Please sign in to comment.