[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 07/24] target-alpha: Cleanup MMU modes.
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PATCH 07/24] target-alpha: Cleanup MMU modes. |
Date: |
Tue, 19 Apr 2011 08:04:44 -0700 |
Don't bother including executive and supervisor modes.
Signed-off-by: Richard Henderson <address@hidden>
---
target-alpha/cpu.h | 36 ++++++++++++++++++++++++++++--------
1 files changed, 28 insertions(+), 8 deletions(-)
diff --git a/target-alpha/cpu.h b/target-alpha/cpu.h
index e977705..4737b83 100644
--- a/target-alpha/cpu.h
+++ b/target-alpha/cpu.h
@@ -192,6 +192,33 @@ enum {
#define SWCR_MASK (SWCR_TRAP_ENABLE_MASK | SWCR_MAP_MASK | SWCR_STATUS_MASK)
+/* MMU modes definitions */
+
+/* Alpha has 5 MMU modes: PALcode, kernel, executive, supervisor, and user.
+ The Unix PALcode only exposes the kernel and user modes; presumably
+ executive and supervisor are used by VMS.
+
+ PALcode itself uses physical mode for code and kernel mode for data;
+ there are PALmode instructions that can access data via physical mode
+ or via an os-installed "alternate mode", which is one of the 4 above.
+
+ QEMU does not currently properly distinguish between code/data when
+ looking up addresses. To avoid having to address this issue, our
+ emulated PALcode will cheat and use the KSEG mapping for its code+data
+ rather than physical addresses.
+
+ Moreover, we're only emulating Unix PALcode, and not attempting VMS.
+
+ All of which allows us to drop all but kernel and user modes.
+ Elide the unused MMU modes to save space. */
+
+#define NB_MMU_MODES 2
+
+#define MMU_MODE0_SUFFIX _kernel
+#define MMU_MODE1_SUFFIX _user
+#define MMU_KERNEL_IDX 0
+#define MMU_USER_IDX 1
+
typedef struct CPUAlphaState CPUAlphaState;
struct CPUAlphaState {
@@ -246,16 +273,9 @@ struct CPUAlphaState {
#define cpu_gen_code cpu_alpha_gen_code
#define cpu_signal_handler cpu_alpha_signal_handler
-/* MMU modes definitions */
-#define NB_MMU_MODES 4
-#define MMU_MODE0_SUFFIX _kernel
-#define MMU_MODE1_SUFFIX _executive
-#define MMU_MODE2_SUFFIX _supervisor
-#define MMU_MODE3_SUFFIX _user
-#define MMU_USER_IDX 3
static inline int cpu_mmu_index (CPUState *env)
{
- return (env->ps >> 3) & 3;
+ return (env->ps >> 3) & 1;
}
#include "cpu-all.h"
--
1.7.3.4
- [Qemu-devel] [PATCH 01/24] Export the unassigned_mem read/write functions., (continued)
- [Qemu-devel] [PATCH 01/24] Export the unassigned_mem read/write functions., Richard Henderson, 2011/04/19
- [Qemu-devel] [PATCH 23/24] target-alpha: Enable the alpha-softmmu target., Richard Henderson, 2011/04/19
- [Qemu-devel] [PATCH 16/24] target-alpha: Disable interrupts properly., Richard Henderson, 2011/04/19
- [Qemu-devel] [PATCH 08/24] target-alpha: Fixup translation of PALmode instructions., Richard Henderson, 2011/04/19
- [Qemu-devel] [PATCH 06/24] target-alpha: Rationalize internal processor registers., Richard Henderson, 2011/04/19
- [Qemu-devel] [PATCH 02/24] target-alpha: Disassemble EV6 PALcode instructions., Richard Henderson, 2011/04/19
- [Qemu-devel] [PATCH 13/24] target-alpha: Swap shadow registers moving to/from PALmode., Richard Henderson, 2011/04/19
- [Qemu-devel] [PATCH 04/24] target-alpha: Remove partial support for palcode emulation., Richard Henderson, 2011/04/19
- [Qemu-devel] [PATCH 18/24] target-alpha: Add custom PALcode image for SX164 emulation., Richard Henderson, 2011/04/19
- [Qemu-devel] [PATCH 20/24] target-alpha: Trap for unassigned and unaligned addresses., Richard Henderson, 2011/04/19
- [Qemu-devel] [PATCH 07/24] target-alpha: Cleanup MMU modes.,
Richard Henderson <=
- Re: [Qemu-devel] [PATCH 00/24] Alpha system emulation, v2, Tristan Gingold, 2011/04/20
- Re: [Qemu-devel] [PATCH 00/24] Alpha system emulation, v2, Brian Wheeler, 2011/04/20
- Re: [Qemu-devel] [PATCH 00/24] Alpha system emulation, v2, Richard Henderson, 2011/04/20
- Re: [Qemu-devel] [PATCH 00/24] Alpha system emulation, v2, Tristan Gingold, 2011/04/20
- Re: [Qemu-devel] [PATCH 00/24] Alpha system emulation, v2, Richard Henderson, 2011/04/20
- Re: [Qemu-devel] [PATCH 00/24] Alpha system emulation, v2, Tristan Gingold, 2011/04/21
- Re: [Qemu-devel] [PATCH 00/24] Alpha system emulation, v2, Brian Wheeler, 2011/04/21
- Re: [Qemu-devel] [PATCH 00/24] Alpha system emulation, v2, Tristan Gingold, 2011/04/21
- Re: [Qemu-devel] [PATCH 00/24] Alpha system emulation, v2, Brian Wheeler, 2011/04/21
- Re: [Qemu-devel] [PATCH 00/24] Alpha system emulation, v2, Richard Henderson, 2011/04/21