Commit 5f21aef2b0e53b9c179d36cba6004df785500ac1
1 parent
829309c7
suppressed unneeded header
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@832 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
12 additions
and
14 deletions
target-ppc/helper.c
| ... | ... | @@ -17,8 +17,6 @@ |
| 17 | 17 | * License along with this library; if not, write to the Free Software |
| 18 | 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 19 | 19 | */ |
| 20 | -#include <sys/mman.h> | |
| 21 | - | |
| 22 | 20 | #include "exec.h" |
| 23 | 21 | #if defined (USE_OPEN_FIRMWARE) |
| 24 | 22 | #include <time.h> |
| ... | ... | @@ -133,14 +131,14 @@ static int get_bat (CPUState *env, uint32_t *real, int *prot, |
| 133 | 131 | ((virtual & 0x0FFE0000 & bl) | (*BATl & 0x0FFE0000)) | |
| 134 | 132 | (virtual & 0x0001F000); |
| 135 | 133 | if (*BATl & 0x00000001) |
| 136 | - *prot = PROT_READ; | |
| 134 | + *prot = PAGE_READ; | |
| 137 | 135 | if (*BATl & 0x00000002) |
| 138 | - *prot = PROT_WRITE | PROT_READ; | |
| 136 | + *prot = PAGE_WRITE | PAGE_READ; | |
| 139 | 137 | #if defined (DEBUG_BATS) |
| 140 | 138 | if (loglevel > 0) { |
| 141 | 139 | fprintf(logfile, "BAT %d match: r 0x%08x prot=%c%c\n", |
| 142 | - i, *real, *prot & PROT_READ ? 'R' : '-', | |
| 143 | - *prot & PROT_WRITE ? 'W' : '-'); | |
| 140 | + i, *real, *prot & PAGE_READ ? 'R' : '-', | |
| 141 | + *prot & PAGE_WRITE ? 'W' : '-'); | |
| 144 | 142 | } |
| 145 | 143 | #endif |
| 146 | 144 | ret = 0; |
| ... | ... | @@ -203,9 +201,9 @@ static int find_pte (uint32_t *RPN, int *prot, uint32_t base, uint32_t va, |
| 203 | 201 | } |
| 204 | 202 | /* Check access rights */ |
| 205 | 203 | if (key == 0) { |
| 206 | - access = PROT_READ; | |
| 204 | + access = PAGE_READ; | |
| 207 | 205 | if ((pte1 & 0x00000003) != 0x3) |
| 208 | - access |= PROT_WRITE; | |
| 206 | + access |= PAGE_WRITE; | |
| 209 | 207 | } else { |
| 210 | 208 | switch (pte1 & 0x00000003) { |
| 211 | 209 | case 0x0: |
| ... | ... | @@ -213,16 +211,16 @@ static int find_pte (uint32_t *RPN, int *prot, uint32_t base, uint32_t va, |
| 213 | 211 | break; |
| 214 | 212 | case 0x1: |
| 215 | 213 | case 0x3: |
| 216 | - access = PROT_READ; | |
| 214 | + access = PAGE_READ; | |
| 217 | 215 | break; |
| 218 | 216 | case 0x2: |
| 219 | - access = PROT_READ | PROT_WRITE; | |
| 217 | + access = PAGE_READ | PAGE_WRITE; | |
| 220 | 218 | break; |
| 221 | 219 | } |
| 222 | 220 | } |
| 223 | 221 | if (ret < 0) { |
| 224 | - if ((rw == 0 && (access & PROT_READ)) || | |
| 225 | - (rw == 1 && (access & PROT_WRITE))) { | |
| 222 | + if ((rw == 0 && (access & PAGE_READ)) || | |
| 223 | + (rw == 1 && (access & PAGE_WRITE))) { | |
| 226 | 224 | #if defined (DEBUG_MMU) |
| 227 | 225 | if (loglevel > 0) |
| 228 | 226 | fprintf(logfile, "PTE access granted !\n"); |
| ... | ... | @@ -264,7 +262,7 @@ static int find_pte (uint32_t *RPN, int *prot, uint32_t base, uint32_t va, |
| 264 | 262 | store = 1; |
| 265 | 263 | } else { |
| 266 | 264 | /* Force page fault for first write access */ |
| 267 | - *prot &= ~PROT_WRITE; | |
| 265 | + *prot &= ~PAGE_WRITE; | |
| 268 | 266 | } |
| 269 | 267 | } |
| 270 | 268 | if (store) { |
| ... | ... | @@ -409,7 +407,7 @@ int get_physical_address (CPUState *env, uint32_t *physical, int *prot, |
| 409 | 407 | if ((access_type == ACCESS_CODE && msr_ir == 0) || msr_dr == 0) { |
| 410 | 408 | /* No address translation */ |
| 411 | 409 | *physical = address & ~0xFFF; |
| 412 | - *prot = PROT_READ | PROT_WRITE; | |
| 410 | + *prot = PAGE_READ | PAGE_WRITE; | |
| 413 | 411 | ret = 0; |
| 414 | 412 | } else { |
| 415 | 413 | /* Try to find a BAT */ | ... | ... |