Seems phys_to_page/page_to_phys macros are fixed in mm0

This commit is contained in:
Bahadir Balban
2009-08-09 17:59:32 +03:00
parent 02a3f1ac91
commit aa71161a04
3 changed files with 10 additions and 5 deletions

View File

@@ -29,7 +29,7 @@ struct container_info cinfo[] = {
[0] = {
.pager_lma = __pfn(CONFIG_CONT0_PAGER_START),
.pager_vma = __pfn(0xE0000000),
.pager_size = __pfn(0x9F000),
.pager_size = __pfn(0xa0000),
.ncaps = 14,
.caps = {
[0] = {

View File

@@ -13,6 +13,7 @@
#include <task.h>
#include <arch/mm.h>
#include <lib/spinlock.h>
#include <physmem.h>
// #define DEBUG_FAULT_HANDLING
#ifdef DEBUG_FAULT_HANDLING
@@ -76,10 +77,11 @@ struct devpage {
#define page_refcnt(x) ((x)->count + 1)
#define virtual(x) ((x)->virtual)
#define phys_to_page(x) (page_array + __pfn(x))
#define page_to_phys(x) __pfn_to_addr((((void *)x) - \
(void *)page_array) \
/ sizeof(struct page))
#define phys_to_page(x) (page_array + __pfn((x) - membank[0].start))
#define page_to_phys(x) (__pfn_to_addr((((void *)(x)) - \
(void *)page_array) / \
sizeof(struct page)) + \
membank[0].start)
/* Fault data specific to this task + ptr to kernel's data */
struct fault_data {

View File

@@ -131,6 +131,9 @@ void init_physmem_secondary(struct initdata *initdata, struct membank *membank)
/* Set global page array to this bank's array */
page_array = membank[0].page_array;
/* Test that page/phys macros work */
BUG_ON(phys_to_page(page_to_phys(&page_array[5])) != &page_array[5])
}