mmu_phyp.c (fa1e92b687fa55aae3b9aff3cddc806ddd49cc4b) | mmu_phyp.c (1cd30eb6dd61f24520d2dfc71856ac94c4f7b5ad) |
---|---|
1/* 2 * Copyright (C) 2010 Andreas Tobler 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 100 unchanged lines hidden (view full) --- 109static void 110mphyp_bootstrap(mmu_t mmup, vm_offset_t kernelstart, vm_offset_t kernelend) 111{ 112 uint64_t final_pteg_count = 0; 113 char buf[8]; 114 uint32_t prop[2]; 115 uint32_t nptlp, shift = 0, slb_encoding = 0; 116 uint32_t lp_size, lp_encoding; | 1/* 2 * Copyright (C) 2010 Andreas Tobler 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 100 unchanged lines hidden (view full) --- 109static void 110mphyp_bootstrap(mmu_t mmup, vm_offset_t kernelstart, vm_offset_t kernelend) 111{ 112 uint64_t final_pteg_count = 0; 113 char buf[8]; 114 uint32_t prop[2]; 115 uint32_t nptlp, shift = 0, slb_encoding = 0; 116 uint32_t lp_size, lp_encoding; |
117 struct lpte old; 118 uint64_t vsid; |
|
117 phandle_t dev, node, root; 118 int idx, len, res; 119 120 rw_init(&mphyp_eviction_lock, "pte eviction"); 121 122 moea64_early_bootstrap(mmup, kernelstart, kernelend); 123 124 root = OF_peer(0); --- 20 unchanged lines hidden (view full) --- 145 panic("mmu_phyp: unknown PFT size"); 146 final_pteg_count = 1 << prop[1]; 147 res = OF_getprop(node, "ibm,slb-size", prop, sizeof(prop[0])); 148 if (res > 0) 149 n_slbs = prop[0]; 150 151 moea64_pteg_count = final_pteg_count / sizeof(struct lpteg); 152 | 119 phandle_t dev, node, root; 120 int idx, len, res; 121 122 rw_init(&mphyp_eviction_lock, "pte eviction"); 123 124 moea64_early_bootstrap(mmup, kernelstart, kernelend); 125 126 root = OF_peer(0); --- 20 unchanged lines hidden (view full) --- 147 panic("mmu_phyp: unknown PFT size"); 148 final_pteg_count = 1 << prop[1]; 149 res = OF_getprop(node, "ibm,slb-size", prop, sizeof(prop[0])); 150 if (res > 0) 151 n_slbs = prop[0]; 152 153 moea64_pteg_count = final_pteg_count / sizeof(struct lpteg); 154 |
155 /* Clear any old page table entries */ 156 for (idx = 0; idx < moea64_pteg_count*8; idx++) { 157 phyp_pft_hcall(H_READ, 0, idx, 0, 0, &old.pte_hi, 158 &old.pte_lo, &old.pte_lo); 159 vsid = (old.pte_hi << (ADDR_API_SHFT64 - ADDR_PIDX_SHFT)) >> 28; 160 if (vsid == VSID_VRMA || vsid == 0 /* Older VRMA */) 161 continue; 162 163 if (old.pte_hi & LPTE_VALID) 164 phyp_hcall(H_REMOVE, 0, idx, 0); 165 } 166 |
|
153 /* 154 * Scan the large page size property for PAPR compatible machines. 155 * See PAPR D.5 Changes to Section 5.1.4, 'CPU Node Properties' 156 * for the encoding of the property. 157 */ 158 159 len = OF_getproplen(node, "ibm,segment-page-sizes"); 160 if (len > 0) { --- 300 unchanged lines hidden --- | 167 /* 168 * Scan the large page size property for PAPR compatible machines. 169 * See PAPR D.5 Changes to Section 5.1.4, 'CPU Node Properties' 170 * for the encoding of the property. 171 */ 172 173 len = OF_getproplen(node, "ibm,segment-page-sizes"); 174 if (len > 0) { --- 300 unchanged lines hidden --- |