Changeset 43d6401 in mainline
- Timestamp:
- 2009-01-29T18:24:40Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 917c427
- Parents:
- f817d3a
- Location:
- kernel/arch/ppc32
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ppc32/include/mm/page.h
rf817d3a r43d6401 121 121 /* Macros for querying the last-level PTEs. */ 122 122 #define PTE_VALID_ARCH(pte) (*((uint32_t *) (pte)) != 0) 123 #define PTE_PRESENT_ARCH(pte) ((pte)->p != 0)123 #define PTE_PRESENT_ARCH(pte) ((pte)->present != 0) 124 124 #define PTE_GET_FRAME_ARCH(pte) ((pte)->pfn << 12) 125 125 #define PTE_WRITABLE_ARCH(pte) 1 … … 135 135 pte_t *p = &pt[i]; 136 136 137 return (( 1<< PAGE_CACHEABLE_SHIFT) |138 ((!p->p ) << PAGE_PRESENT_SHIFT) |137 return (((!p->page_cache_disable) << PAGE_CACHEABLE_SHIFT) | 138 ((!p->present) << PAGE_PRESENT_SHIFT) | 139 139 (1 << PAGE_USER_SHIFT) | 140 140 (1 << PAGE_READ_SHIFT) | 141 141 (1 << PAGE_WRITE_SHIFT) | 142 142 (1 << PAGE_EXEC_SHIFT) | 143 (p->g << PAGE_GLOBAL_SHIFT));143 (p->global << PAGE_GLOBAL_SHIFT)); 144 144 } 145 145 … … 148 148 pte_t *p = &pt[i]; 149 149 150 p->p = !(flags & PAGE_NOT_PRESENT); 151 p->g = (flags & PAGE_GLOBAL) != 0; 150 p->page_cache_disable = !(flags & PAGE_CACHEABLE); 151 p->present = !(flags & PAGE_NOT_PRESENT); 152 p->global = (flags & PAGE_GLOBAL) != 0; 152 153 p->valid = 1; 153 154 } -
kernel/arch/ppc32/include/mm/tlb.h
rf817d3a r43d6401 40 40 #include <typedefs.h> 41 41 42 #define WIMG_GUARDED 0x01 43 #define WIMG_COHERENT 0x02 44 #define WIMG_NO_CACHE 0x04 45 #define WIMG_WRITETHRU 0x08 46 42 47 typedef struct { 43 48 unsigned v : 1; /**< Valid */ -
kernel/arch/ppc32/include/types.h
rf817d3a r43d6401 85 85 /** Page Table Entry. */ 86 86 typedef struct { 87 unsigned p : 1; /**< Present bit. */ 88 unsigned a : 1; /**< Accessed bit. */ 89 unsigned g : 1; /**< Global bit. */ 90 unsigned valid : 1; /**< Valid content even if not present. */ 91 unsigned pfn : 20; /**< Physical frame number. */ 87 unsigned present : 1; /**< Present bit. */ 88 unsigned page_write_through : 1; /**< Write thought caching. */ 89 unsigned page_cache_disable : 1; /**< No caching. */ 90 unsigned accessed : 1; /**< Accessed bit. */ 91 unsigned global : 1; /**< Global bit. */ 92 unsigned valid : 1; /**< Valid content even if not present. */ 93 unsigned pfn : 20; /**< Physical frame number. */ 92 94 } pte_t; 93 95 -
kernel/arch/ppc32/src/mm/tlb.c
rf817d3a r43d6401 67 67 */ 68 68 pte_t *pte = page_mapping_find(as, badvaddr); 69 if ((pte) && (pte->p )) {69 if ((pte) && (pte->present)) { 70 70 /* 71 71 * Mapping found in page tables. … … 89 89 page_table_lock(as, lock); 90 90 pte = page_mapping_find(as, badvaddr); 91 ASSERT((pte) && (pte->p ));91 ASSERT((pte) && (pte->present)); 92 92 *pfrc = 0; 93 93 return pte; … … 127 127 128 128 129 static void pht_insert(const uintptr_t vaddr, const p fn_t pfn)129 static void pht_insert(const uintptr_t vaddr, const pte_t *pte) 130 130 { 131 131 uint32_t page = (vaddr >> 12) & 0xffff; … … 190 190 phte[base + i].h = h; 191 191 phte[base + i].api = api; 192 phte[base + i].rpn = p fn;192 phte[base + i].rpn = pte->pfn; 193 193 phte[base + i].r = 0; 194 194 phte[base + i].c = 0; 195 phte[base + i].wimg = (pte->page_cache_disable ? WIMG_NO_CACHE : 0); 195 196 phte[base + i].pp = 2; // FIXME 196 197 } … … 264 265 phte_physical[base + i].r = 0; 265 266 phte_physical[base + i].c = 0; 267 phte_physical[base + i].wimg = 0; 266 268 phte_physical[base + i].pp = 2; // FIXME 267 269 } … … 319 321 } 320 322 321 pte->a = 1; /* Record access to PTE */322 pht_insert(badvaddr, pte ->pfn);323 pte->accessed = 1; /* Record access to PTE */ 324 pht_insert(badvaddr, pte); 323 325 324 326 page_table_unlock(as, lock);
Note:
See TracChangeset
for help on using the changeset viewer.