Changeset dadb68e in mainline
- Timestamp:
- 2006-05-21T18:59:40Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- cf464d1
- Parents:
- 2a1803eb
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/ppc32/src/mm/page.c
r2a1803eb rdadb68e 133 133 134 134 /* 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; 137 138 __u32 i; 138 139 bool found = false; 139 /* Find unused PTE in PTEG */ 140 141 /* Find unused or colliding 142 PTE in PTEG */ 140 143 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))) { 142 145 found = true; 143 146 break; … … 147 150 if (!found) { 148 151 /* 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 */ 152 156 for (i = 0; i < 8; i++) { 153 if (!phte[ hash+ i].v) {157 if (!phte[base2 + i].v) { 154 158 found = true; 159 base = base2; 160 h = 1; 155 161 break; 156 162 } … … 163 169 } 164 170 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; // FIXME171 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 173 179 } 174 180 … … 247 253 page_mapping_operations = &pt_mapping_operations; 248 254 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 249 267 /* Allocate page hash table */ 250 268 phte_t *physical_phte = (phte_t *) PFN2ADDR(frame_alloc(PHT_ORDER, FRAME_KA | FRAME_PANIC)); -
generic/src/main/main.c
r2a1803eb rdadb68e 201 201 202 202 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); 204 204 205 205 arch_pre_smp_init(); … … 208 208 slab_enable_cpucache(); /* Slab must be initialized AFTER we know the number of processors */ 209 209 210 printf("config.memory_size=%zdM\n", config.memory_size /(1024*1024));210 printf("config.memory_size=%zdM\n", config.memory_size >> 20); 211 211 printf("config.cpu_count=%zd\n", config.cpu_count); 212 212 cpu_init(); … … 220 220 221 221 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); 223 223 224 224 ipc_init();
Note:
See TracChangeset
for help on using the changeset viewer.