Some cleanups on last commit

This commit is contained in:
Bahadir Balban
2009-10-15 20:24:01 +03:00
parent e762f4162c
commit 6982e96d1f
2 changed files with 30 additions and 20 deletions

View File

@@ -10,6 +10,16 @@
#include <init.h>
#include <physmem.h>
#include <linker.h>
#include <capability.h>
struct container_memory_regions {
struct capability *shmem;
struct capability *utcb;
struct capability *task;
struct capability *pager;
struct capability *physmem;
};
extern struct container_memory_regions cont_mem_regions;
#define PAGER_MMAP_SEGMENT SZ_4MB
#define PAGER_MMAP_START (page_align_up(__stack))

View File

@@ -43,17 +43,13 @@ struct memdesc physmem; /* Initial, primitive memory descriptor */
struct membank membank[1]; /* The memory bank */
struct page *page_array; /* The physical page array based on mem bank */
struct container_memory_regions {
struct capability *shmem;
struct capability *utcb;
struct capability *task;
struct capability *pager;
struct capability *physmem;
} cont_mem_regions;
/* Capability descriptor list */
struct cap_list capability_list;
/* Memory region capabilities */
struct container_memory_regions cont_mem_regions;
__initdata static struct capability *caparray;
__initdata static int total_caps = 0;
@@ -192,8 +188,6 @@ int read_pager_capabilities()
" capabilities failed.\n Could not "
"complete CAP_CONTROL_NCAPS request.\n");
BUG();
} else {
printf("There are %d capabilities defined.\n", ncaps);
}
total_caps = ncaps;
@@ -225,16 +219,16 @@ int read_pager_capabilities()
if ((cap->type & CAP_RTYPE_MASK)
== CAP_RTYPE_VIRTMEM) {
printf("Capability range 0x%lx - 0x%lx\n",
__pfn_to_addr(cap->start), __pfn_to_addr(cap->end));
/* Pager address region (get from linker-defined) */
if (__pfn_to_addr(cap->start)
== (unsigned long)virtual_base)
cont_mem_regions.pager = cap;
/* UTCB address region */
else if (UTCB_REGION_START == __pfn_to_addr(cap->start)) {
if (UTCB_REGION_END != __pfn_to_addr(cap->end)) {
else if (UTCB_REGION_START ==
__pfn_to_addr(cap->start)) {
if (UTCB_REGION_END !=
__pfn_to_addr(cap->end)) {
printf("FATAL: Region designated "
"for UTCB allocation does not "
"match on start/end marks");
@@ -251,8 +245,10 @@ int read_pager_capabilities()
}
/* Shared memory disjoint region */
else if (SHMEM_REGION_START == __pfn_to_addr(cap->start)) {
if (SHMEM_REGION_END != __pfn_to_addr(cap->end)) {
else if (SHMEM_REGION_START ==
__pfn_to_addr(cap->start)) {
if (SHMEM_REGION_END !=
__pfn_to_addr(cap->end)) {
printf("FATAL: Region designated "
"for SHM allocation does not "
"match on start/end marks");
@@ -263,11 +259,13 @@ int read_pager_capabilities()
}
/* Task memory region */
else if (TASK_REGION_START == __pfn_to_addr(cap->start)) {
if (TASK_REGION_END != __pfn_to_addr(cap->end)) {
else if (TASK_REGION_START ==
__pfn_to_addr(cap->start)) {
if (TASK_REGION_END !=
__pfn_to_addr(cap->end)) {
printf("FATAL: Region designated "
"for Task address space does not "
"match on start/end marks");
"for Task address space does"
"not match on start/end mark.");
BUG();
}
cont_mem_regions.task = cap;
@@ -283,7 +281,9 @@ int read_pager_capabilities()
printf("%s: Error, pager does not have one of the required"
"mem capabilities defined. (TASK, SHM, PHYSMEM, UTCB)\n",
__TASKNAME__);
printf("%p, %p, %p, %p, %p\n", cont_mem_regions.task, cont_mem_regions.shmem, cont_mem_regions.utcb, cont_mem_regions.physmem, cont_mem_regions.pager);
printf("%p, %p, %p, %p, %p\n", cont_mem_regions.task,
cont_mem_regions.shmem, cont_mem_regions.utcb,
cont_mem_regions.physmem, cont_mem_regions.pager);
BUG();
}