mirror of
https://git.proxmox.com/git/qemu
synced 2025-08-05 21:46:04 +00:00
MIPS_USES_R4K_TLB typo
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1465 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
6af0bf9c7c
commit
9fb63ac281
@ -17,11 +17,10 @@
|
|||||||
* 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 "exec.h"
|
#include "exec.h"
|
||||||
|
|
||||||
/* MIPS32 4K MMU emulation */
|
/* MIPS32 4K MMU emulation */
|
||||||
#if MIPS_USES_4K_TLB
|
#ifdef MIPS_USES_R4K_TLB
|
||||||
static int map_address (CPUState *env, target_ulong *physical, int *prot,
|
static int map_address (CPUState *env, target_ulong *physical, int *prot,
|
||||||
target_ulong address, int rw, int access_type)
|
target_ulong address, int rw, int access_type)
|
||||||
{
|
{
|
||||||
@ -44,9 +43,9 @@ static int map_address (CPUState *env, target_ulong *physical, int *prot,
|
|||||||
/* Check access rights */
|
/* Check access rights */
|
||||||
if ((tlb->V[n] & 2) && (rw == 0 || (tlb->D[n] & 4))) {
|
if ((tlb->V[n] & 2) && (rw == 0 || (tlb->D[n] & 4))) {
|
||||||
*physical = tlb->PFN[n] | (address & 0xFFF);
|
*physical = tlb->PFN[n] | (address & 0xFFF);
|
||||||
*prot = PROT_READ;
|
*prot = PAGE_READ;
|
||||||
if (tlb->D[n])
|
if (tlb->D[n])
|
||||||
*prot |= PROT_WRITE;
|
*prot |= PAGE_WRITE;
|
||||||
return 0;
|
return 0;
|
||||||
} else if (!(tlb->V[n] & 2)) {
|
} else if (!(tlb->V[n] & 2)) {
|
||||||
return -3;
|
return -3;
|
||||||
@ -78,9 +77,9 @@ int get_physical_address (CPUState *env, target_ulong *physical, int *prot,
|
|||||||
return -1;
|
return -1;
|
||||||
ret = 0;
|
ret = 0;
|
||||||
if (address < 0x80000000UL) {
|
if (address < 0x80000000UL) {
|
||||||
if (user_mode || !(env->hflags & MIPS_HFLAG_ERL)) {
|
if (!(env->hflags & MIPS_HFLAG_ERL)) {
|
||||||
#if MIPS_USES_4K_TLB
|
#ifdef MIPS_USES_R4K_TLB
|
||||||
ret = map_address(env, physical, prot, address, rw);
|
ret = map_address(env, physical, prot, address, rw, access_type);
|
||||||
#else
|
#else
|
||||||
*physical = address + 0x40000000UL;
|
*physical = address + 0x40000000UL;
|
||||||
*prot = PAGE_READ | PAGE_WRITE;
|
*prot = PAGE_READ | PAGE_WRITE;
|
||||||
@ -101,8 +100,8 @@ int get_physical_address (CPUState *env, target_ulong *physical, int *prot,
|
|||||||
*prot = PAGE_READ | PAGE_WRITE;
|
*prot = PAGE_READ | PAGE_WRITE;
|
||||||
} else if (address < 0xE0000000UL) {
|
} else if (address < 0xE0000000UL) {
|
||||||
/* kseg2 */
|
/* kseg2 */
|
||||||
#if MIPS_USES_4K_TLB
|
#ifdef MIPS_USES_R4K_TLB
|
||||||
ret = map_address(env, physical, prot, address, rw);
|
ret = map_address(env, physical, prot, address, rw, access_type);
|
||||||
#else
|
#else
|
||||||
*physical = address;
|
*physical = address;
|
||||||
*prot = PAGE_READ | PAGE_WRITE;
|
*prot = PAGE_READ | PAGE_WRITE;
|
||||||
@ -111,8 +110,8 @@ int get_physical_address (CPUState *env, target_ulong *physical, int *prot,
|
|||||||
/* kseg3 */
|
/* kseg3 */
|
||||||
/* XXX: check supervisor mode */
|
/* XXX: check supervisor mode */
|
||||||
/* XXX: debug segment is not emulated */
|
/* XXX: debug segment is not emulated */
|
||||||
#if MIPS_USES_4K_TLB
|
#ifdef MIPS_USES_R4K_TLB
|
||||||
ret = map_address(env, physical, prot, address, rw);
|
ret = map_address(env, physical, prot, address, rw, access_type);
|
||||||
#else
|
#else
|
||||||
*physical = address;
|
*physical = address;
|
||||||
*prot = PAGE_READ | PAGE_WRITE;
|
*prot = PAGE_READ | PAGE_WRITE;
|
||||||
@ -332,7 +331,7 @@ void do_interrupt (CPUState *env)
|
|||||||
pc = 0xBFC00480;
|
pc = 0xBFC00480;
|
||||||
break;
|
break;
|
||||||
case EXCP_RESET:
|
case EXCP_RESET:
|
||||||
#if defined (MIPS_USES_R4K_TLB)
|
#ifdef MIPS_USES_R4K_TLB
|
||||||
env->CP0_random = MIPS_TLB_NB - 1;
|
env->CP0_random = MIPS_TLB_NB - 1;
|
||||||
#endif
|
#endif
|
||||||
env->CP0_Wired = 0;
|
env->CP0_Wired = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user