Changeset 771cd22 in mainline for kernel/arch/sparc64/src/mm/as.c
- Timestamp:
- 2006-12-16T19:07:02Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7e7c8747
- Parents:
- 1ecdbb0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/sparc64/src/mm/as.c
r1ecdbb0 r771cd22 62 62 { 63 63 #ifdef CONFIG_TSB 64 int order = fnzb32(((ITSB_ENTRY_COUNT+DTSB_ENTRY_COUNT)*sizeof(tsb_entry_t))>>FRAME_WIDTH); 64 int order = fnzb32(((ITSB_ENTRY_COUNT + DTSB_ENTRY_COUNT) * 65 sizeof(tsb_entry_t)) >> FRAME_WIDTH); 65 66 uintptr_t tsb = (uintptr_t) frame_alloc(order, flags | FRAME_KA); 66 67 … … 69 70 70 71 as->arch.itsb = (tsb_entry_t *) tsb; 71 as->arch.dtsb = (tsb_entry_t *) (tsb + ITSB_ENTRY_COUNT * sizeof(tsb_entry_t)); 72 memsetb((uintptr_t) as->arch.itsb, (ITSB_ENTRY_COUNT+DTSB_ENTRY_COUNT)*sizeof(tsb_entry_t), 0); 72 as->arch.dtsb = (tsb_entry_t *) (tsb + ITSB_ENTRY_COUNT * 73 sizeof(tsb_entry_t)); 74 memsetb((uintptr_t) as->arch.itsb, (ITSB_ENTRY_COUNT + DTSB_ENTRY_COUNT) 75 * sizeof(tsb_entry_t), 0); 73 76 #endif 74 77 return 0; … … 78 81 { 79 82 #ifdef CONFIG_TSB 80 count_t cnt = ((ITSB_ENTRY_COUNT+DTSB_ENTRY_COUNT)*sizeof(tsb_entry_t))>>FRAME_WIDTH; 83 count_t cnt = ((ITSB_ENTRY_COUNT + DTSB_ENTRY_COUNT) * 84 sizeof(tsb_entry_t)) >> FRAME_WIDTH; 81 85 frame_free(KA2PA((uintptr_t) as->arch.itsb)); 82 86 return cnt; … … 100 104 } 101 105 102 /** Perform sparc64-specific tasks when an address space becomes active on the processor. 106 /** Perform sparc64-specific tasks when an address space becomes active on the 107 * processor. 103 108 * 104 109 * Install ASID and map TSBs. … … 135 140 uintptr_t tsb = (uintptr_t) as->arch.itsb; 136 141 137 if (!overlaps(tsb, 8 *PAGE_SIZE, base, 1 << KERNEL_PAGE_WIDTH)) {142 if (!overlaps(tsb, 8 * PAGE_SIZE, base, 1 << KERNEL_PAGE_WIDTH)) { 138 143 /* 139 144 * TSBs were allocated from memory not covered … … 161 166 } 162 167 163 /** Perform sparc64-specific tasks when an address space is removed from the processor. 168 /** Perform sparc64-specific tasks when an address space is removed from the 169 * processor. 164 170 * 165 171 * Demap TSBs. … … 184 190 uintptr_t tsb = (uintptr_t) as->arch.itsb; 185 191 186 if (!overlaps(tsb, 8 *PAGE_SIZE, base, 1 << KERNEL_PAGE_WIDTH)) {192 if (!overlaps(tsb, 8 * PAGE_SIZE, base, 1 << KERNEL_PAGE_WIDTH)) { 187 193 /* 188 194 * TSBs were allocated from memory not covered
Note:
See TracChangeset
for help on using the changeset viewer.