Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 1388 → Rev 1389

/kernel/trunk/generic/src/main/main.c
200,7 → 200,7
arch_post_mm_init();
 
version_print();
printf("%.*p: hardcoded_ktext_size=%zdK, hardcoded_kdata_size=%zdK\n", sizeof(__address) * 2, config.base, hardcoded_ktext_size / 1024, hardcoded_kdata_size / 1024);
printf("%.*p: hardcoded_ktext_size=%zdK, hardcoded_kdata_size=%zdK\n", sizeof(__address) * 2, config.base, hardcoded_ktext_size >> 10, hardcoded_kdata_size >> 10);
 
arch_pre_smp_init();
smp_init();
207,7 → 207,7
slab_enable_cpucache(); /* Slab must be initialized AFTER we know the number of processors */
 
printf("config.memory_size=%zdM\n", config.memory_size/(1024*1024));
printf("config.memory_size=%zdM\n", config.memory_size >> 20);
printf("config.cpu_count=%zd\n", config.cpu_count);
cpu_init();
219,7 → 219,7
futex_init();
for (i = 0; i < init.cnt; i++)
printf("init[%zd].addr=%.*p, init[%zd].size=%zd\n", i, sizeof(__address)*2, init.tasks[i].addr, i, init.tasks[i].size);
printf("init[%zd].addr=%.*p, init[%zd].size=%zd\n", i, sizeof(__address) * 2, init.tasks[i].addr, i, init.tasks[i].size);
ipc_init();
 
/kernel/trunk/arch/ppc32/src/mm/page.c
132,13 → 132,16
);
/* Primary hash (xor) */
__u32 hash = ((vsid ^ page) & 0x3ff) << 3;
__u32 h = 0;
__u32 hash = vsid ^ page;
__u32 base = (hash & 0x3ff) << 3;
__u32 i;
bool found = false;
/* Find unused PTE in PTEG */
/* Find unused or colliding
PTE in PTEG */
for (i = 0; i < 8; i++) {
if (!phte[hash + i].v) {
if ((!phte[base + i].v) || ((phte[base + i].vsid == vsid) && (phte[base + i].api == api))) {
found = true;
break;
}
146,12 → 149,15
if (!found) {
/* Secondary hash (not) */
hash = ~hash;
__u32 base2 = (~hash & 0x3ff) << 3;
/* Find unused PTE in PTEG */
/* Find unused or colliding
PTE in PTEG */
for (i = 0; i < 8; i++) {
if (!phte[hash + i].v) {
if (!phte[base2 + i].v) {
found = true;
base = base2;
h = 1;
break;
}
}
162,14 → 168,14
}
}
phte[hash + i].v = 1;
phte[hash + i].vsid = vsid;
phte[hash + i].h = 0;
phte[hash + i].api = api;
phte[hash + i].rpn = pfn;
phte[hash + i].r = 0;
phte[hash + i].c = 0;
phte[hash + i].pp = 2; // FIXME
phte[base + i].v = 1;
phte[base + i].vsid = vsid;
phte[base + i].h = h;
phte[base + i].api = api;
phte[base + i].rpn = pfn;
phte[base + i].r = 0;
phte[base + i].c = 0;
phte[base + i].pp = 2; // FIXME
}
 
 
246,6 → 252,18
if (config.cpu_active == 1) {
page_mapping_operations = &pt_mapping_operations;
__address cur;
int flags;
/* Pages below 128 MB are mapped using BAT,
map rest of the physical memory */
for (cur = 128 << 20; cur < last_frame; cur += FRAME_SIZE) {
flags = PAGE_CACHEABLE;
if ((PA2KA(cur) >= config.base) && (PA2KA(cur) < config.base + config.kernel_size))
flags |= PAGE_GLOBAL;
page_mapping_insert(AS_KERNEL, PA2KA(cur), cur, flags);
}
/* Allocate page hash table */
phte_t *physical_phte = (phte_t *) PFN2ADDR(frame_alloc(PHT_ORDER, FRAME_KA | FRAME_PANIC));
phte = (phte_t *) PA2KA((__address) physical_phte);