mirror of
https://git.proxmox.com/git/qemu
synced 2025-08-07 16:52:06 +00:00
suppressed unneeded header
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@832 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
829309c70c
commit
5f21aef2b0
@ -17,8 +17,6 @@
|
|||||||
* License along with this library; if not, write to the Free Software
|
* License along with this library; if not, write to the Free Software
|
||||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
*/
|
*/
|
||||||
#include <sys/mman.h>
|
|
||||||
|
|
||||||
#include "exec.h"
|
#include "exec.h"
|
||||||
#if defined (USE_OPEN_FIRMWARE)
|
#if defined (USE_OPEN_FIRMWARE)
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
@ -133,14 +131,14 @@ static int get_bat (CPUState *env, uint32_t *real, int *prot,
|
|||||||
((virtual & 0x0FFE0000 & bl) | (*BATl & 0x0FFE0000)) |
|
((virtual & 0x0FFE0000 & bl) | (*BATl & 0x0FFE0000)) |
|
||||||
(virtual & 0x0001F000);
|
(virtual & 0x0001F000);
|
||||||
if (*BATl & 0x00000001)
|
if (*BATl & 0x00000001)
|
||||||
*prot = PROT_READ;
|
*prot = PAGE_READ;
|
||||||
if (*BATl & 0x00000002)
|
if (*BATl & 0x00000002)
|
||||||
*prot = PROT_WRITE | PROT_READ;
|
*prot = PAGE_WRITE | PAGE_READ;
|
||||||
#if defined (DEBUG_BATS)
|
#if defined (DEBUG_BATS)
|
||||||
if (loglevel > 0) {
|
if (loglevel > 0) {
|
||||||
fprintf(logfile, "BAT %d match: r 0x%08x prot=%c%c\n",
|
fprintf(logfile, "BAT %d match: r 0x%08x prot=%c%c\n",
|
||||||
i, *real, *prot & PROT_READ ? 'R' : '-',
|
i, *real, *prot & PAGE_READ ? 'R' : '-',
|
||||||
*prot & PROT_WRITE ? 'W' : '-');
|
*prot & PAGE_WRITE ? 'W' : '-');
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
ret = 0;
|
ret = 0;
|
||||||
@ -203,9 +201,9 @@ static int find_pte (uint32_t *RPN, int *prot, uint32_t base, uint32_t va,
|
|||||||
}
|
}
|
||||||
/* Check access rights */
|
/* Check access rights */
|
||||||
if (key == 0) {
|
if (key == 0) {
|
||||||
access = PROT_READ;
|
access = PAGE_READ;
|
||||||
if ((pte1 & 0x00000003) != 0x3)
|
if ((pte1 & 0x00000003) != 0x3)
|
||||||
access |= PROT_WRITE;
|
access |= PAGE_WRITE;
|
||||||
} else {
|
} else {
|
||||||
switch (pte1 & 0x00000003) {
|
switch (pte1 & 0x00000003) {
|
||||||
case 0x0:
|
case 0x0:
|
||||||
@ -213,16 +211,16 @@ static int find_pte (uint32_t *RPN, int *prot, uint32_t base, uint32_t va,
|
|||||||
break;
|
break;
|
||||||
case 0x1:
|
case 0x1:
|
||||||
case 0x3:
|
case 0x3:
|
||||||
access = PROT_READ;
|
access = PAGE_READ;
|
||||||
break;
|
break;
|
||||||
case 0x2:
|
case 0x2:
|
||||||
access = PROT_READ | PROT_WRITE;
|
access = PAGE_READ | PAGE_WRITE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
if ((rw == 0 && (access & PROT_READ)) ||
|
if ((rw == 0 && (access & PAGE_READ)) ||
|
||||||
(rw == 1 && (access & PROT_WRITE))) {
|
(rw == 1 && (access & PAGE_WRITE))) {
|
||||||
#if defined (DEBUG_MMU)
|
#if defined (DEBUG_MMU)
|
||||||
if (loglevel > 0)
|
if (loglevel > 0)
|
||||||
fprintf(logfile, "PTE access granted !\n");
|
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,
|
|||||||
store = 1;
|
store = 1;
|
||||||
} else {
|
} else {
|
||||||
/* Force page fault for first write access */
|
/* Force page fault for first write access */
|
||||||
*prot &= ~PROT_WRITE;
|
*prot &= ~PAGE_WRITE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (store) {
|
if (store) {
|
||||||
@ -409,7 +407,7 @@ int get_physical_address (CPUState *env, uint32_t *physical, int *prot,
|
|||||||
if ((access_type == ACCESS_CODE && msr_ir == 0) || msr_dr == 0) {
|
if ((access_type == ACCESS_CODE && msr_ir == 0) || msr_dr == 0) {
|
||||||
/* No address translation */
|
/* No address translation */
|
||||||
*physical = address & ~0xFFF;
|
*physical = address & ~0xFFF;
|
||||||
*prot = PROT_READ | PROT_WRITE;
|
*prot = PAGE_READ | PAGE_WRITE;
|
||||||
ret = 0;
|
ret = 0;
|
||||||
} else {
|
} else {
|
||||||
/* Try to find a BAT */
|
/* Try to find a BAT */
|
||||||
|
Loading…
Reference in New Issue
Block a user