Changeset dadb68e in mainline


Ignore:
Timestamp:
2006-05-21T18:59:40Z (19 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
cf464d1
Parents:
2a1803eb
Message:

minor changes
ppc32: identically map the whole physical memory
fix page hash table refill logic

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • arch/ppc32/src/mm/page.c

    r2a1803eb rdadb68e  
    133133       
    134134        /* Primary hash (xor) */
    135         __u32 hash = ((vsid ^ page) & 0x3ff) << 3;
    136        
     135        __u32 h = 0;
     136        __u32 hash = vsid ^ page;
     137        __u32 base = (hash & 0x3ff) << 3;
    137138        __u32 i;
    138139        bool found = false;
    139         /* Find unused PTE in PTEG */
     140       
     141        /* Find unused or colliding
     142           PTE in PTEG */
    140143        for (i = 0; i < 8; i++) {
    141                 if (!phte[hash + i].v) {
     144                if ((!phte[base + i].v) || ((phte[base + i].vsid == vsid) && (phte[base + i].api == api))) {
    142145                        found = true;
    143146                        break;
     
    147150        if (!found) {
    148151                /* Secondary hash (not) */
    149                 hash = ~hash;
    150                
    151                 /* Find unused PTE in PTEG */
     152                __u32 base2 = (~hash & 0x3ff) << 3;
     153               
     154                /* Find unused or colliding
     155                   PTE in PTEG */
    152156                for (i = 0; i < 8; i++) {
    153                         if (!phte[hash + i].v) {
     157                        if (!phte[base2 + i].v) {
    154158                                found = true;
     159                                base = base2;
     160                                h = 1;
    155161                                break;
    156162                        }
     
    163169        }
    164170       
    165         phte[hash + i].v = 1;
    166         phte[hash + i].vsid = vsid;
    167         phte[hash + i].h = 0;
    168         phte[hash + i].api = api;
    169         phte[hash + i].rpn = pfn;
    170         phte[hash + i].r = 0;
    171         phte[hash + i].c = 0;
    172         phte[hash + i].pp = 2; // FIXME
     171        phte[base + i].v = 1;
     172        phte[base + i].vsid = vsid;
     173        phte[base + i].h = h;
     174        phte[base + i].api = api;
     175        phte[base + i].rpn = pfn;
     176        phte[base + i].r = 0;
     177        phte[base + i].c = 0;
     178        phte[base + i].pp = 2; // FIXME
    173179}
    174180
     
    247253                page_mapping_operations = &pt_mapping_operations;
    248254               
     255                __address cur;
     256                int flags;
     257               
     258                /* Pages below 128 MB are mapped using BAT,
     259                   map rest of the physical memory */
     260                for (cur = 128 << 20; cur < last_frame; cur += FRAME_SIZE) {
     261                        flags = PAGE_CACHEABLE;
     262                        if ((PA2KA(cur) >= config.base) && (PA2KA(cur) < config.base + config.kernel_size))
     263                                flags |= PAGE_GLOBAL;
     264                        page_mapping_insert(AS_KERNEL, PA2KA(cur), cur, flags);
     265                }
     266               
    249267                /* Allocate page hash table */
    250268                phte_t *physical_phte = (phte_t *) PFN2ADDR(frame_alloc(PHT_ORDER, FRAME_KA | FRAME_PANIC));
  • generic/src/main/main.c

    r2a1803eb rdadb68e  
    201201
    202202        version_print();
    203         printf("%.*p: hardcoded_ktext_size=%zdK, hardcoded_kdata_size=%zdK\n", sizeof(__address) * 2, config.base, hardcoded_ktext_size / 1024, hardcoded_kdata_size / 1024);
     203        printf("%.*p: hardcoded_ktext_size=%zdK, hardcoded_kdata_size=%zdK\n", sizeof(__address) * 2, config.base, hardcoded_ktext_size >> 10, hardcoded_kdata_size >> 10);
    204204
    205205        arch_pre_smp_init();
     
    208208        slab_enable_cpucache(); /* Slab must be initialized AFTER we know the number of processors */
    209209
    210         printf("config.memory_size=%zdM\n", config.memory_size/(1024*1024));
     210        printf("config.memory_size=%zdM\n", config.memory_size >> 20);
    211211        printf("config.cpu_count=%zd\n", config.cpu_count);
    212212        cpu_init();
     
    220220       
    221221        for (i = 0; i < init.cnt; i++)
    222                 printf("init[%zd].addr=%.*p, init[%zd].size=%zd\n", i, sizeof(__address)*2, init.tasks[i].addr, i, init.tasks[i].size);
     222                printf("init[%zd].addr=%.*p, init[%zd].size=%zd\n", i, sizeof(__address) * 2, init.tasks[i].addr, i, init.tasks[i].size);
    223223       
    224224        ipc_init();
Note: See TracChangeset for help on using the changeset viewer.