Remove TLB from userspace
authorPaul Brook <paul@codesourcery.com>
Fri, 12 Mar 2010 16:54:58 +0000 (16:54 +0000)
committerPaul Brook <paul@codesourcery.com>
Fri, 12 Mar 2010 18:34:21 +0000 (18:34 +0000)
Remove TLB from userspace CPU structure.

Signed-off-by: Paul Brook <paul@codesourcery.com>
cpu-defs.h
tcg/arm/tcg-target.c
tcg/i386/tcg-target.c
tcg/x86_64/tcg-target.c

index 7fdbe977877a0abd878ecf5263dfe83f2b17494e..47c1d8596863f5a501e2d54bc99a26b6584dfebe 100644 (file)
@@ -72,6 +72,7 @@ typedef uint64_t target_ulong;
 #define TB_JMP_ADDR_MASK (TB_JMP_PAGE_SIZE - 1)
 #define TB_JMP_PAGE_MASK (TB_JMP_CACHE_SIZE - TB_JMP_PAGE_SIZE)
 
+#if !defined(CONFIG_USER_ONLY)
 #define CPU_TLB_BITS 8
 #define CPU_TLB_SIZE (1 << CPU_TLB_BITS)
 
@@ -106,6 +107,18 @@ typedef struct CPUTLBEntry {
                    sizeof(target_phys_addr_t))];
 } CPUTLBEntry;
 
+#define CPU_COMMON_TLB \
+    /* The meaning of the MMU modes is defined in the target code. */   \
+    CPUTLBEntry tlb_table[NB_MMU_MODES][CPU_TLB_SIZE];                  \
+    target_phys_addr_t iotlb[NB_MMU_MODES][CPU_TLB_SIZE];               \
+
+#else
+
+#define CPU_COMMON_TLB
+
+#endif
+
+
 #ifdef HOST_WORDS_BIGENDIAN
 typedef struct icount_decr_u16 {
     uint16_t high;
@@ -150,9 +163,7 @@ typedef struct CPUWatchpoint {
     uint32_t stopped; /* Artificially stopped */                        \
     uint32_t interrupt_request;                                         \
     volatile sig_atomic_t exit_request;                                 \
-    /* The meaning of the MMU modes is defined in the target code. */   \
-    CPUTLBEntry tlb_table[NB_MMU_MODES][CPU_TLB_SIZE];                  \
-    target_phys_addr_t iotlb[NB_MMU_MODES][CPU_TLB_SIZE];               \
+    CPU_COMMON_TLB                                                      \
     struct TranslationBlock *tb_jmp_cache[TB_JMP_CACHE_SIZE];           \
     /* buffer for temporaries in the code generator */                  \
     long temp_buf[CPU_TEMP_BUF_NLONGS];                                 \
index dabc0f5bca19599499b0f7a1d633e74760792101..6d1ea14defc21616e02a6428ede15e1df1534b35 100644 (file)
@@ -1690,9 +1690,11 @@ static const TCGTargetOpDef arm_op_defs[] = {
 
 void tcg_target_init(TCGContext *s)
 {
+#if !defined(CONFIG_USER_ONLY)
     /* fail safe */
     if ((1 << CPU_TLB_ENTRY_BITS) != sizeof(CPUTLBEntry))
         tcg_abort();
+#endif
 
     tcg_regset_set32(tcg_target_available_regs[TCG_TYPE_I32], 0,
                     ((2 << TCG_REG_R14) - 1) & ~(1 << TCG_REG_R8));
index b69b5b0c8c9b6de22b387defcae90263e3e40d9b..09c73b4396a284a7a06fe7868088c9cf9109a1ba 100644 (file)
@@ -1353,9 +1353,11 @@ void tcg_target_qemu_prologue(TCGContext *s)
 
 void tcg_target_init(TCGContext *s)
 {
+#if !defined(CONFIG_USER_ONLY)
     /* fail safe */
     if ((1 << CPU_TLB_ENTRY_BITS) != sizeof(CPUTLBEntry))
         tcg_abort();
+#endif
 
     tcg_regset_set32(tcg_target_available_regs[TCG_TYPE_I32], 0, 0xff);
     tcg_regset_set32(tcg_target_call_clobber_regs, 0,
index 6e7a6a42f9218d9b48e042fc1ba8cdc50119678c..ea313fa87a5dca80a9c2c1a56c9ed7559930f8f3 100644 (file)
@@ -1426,9 +1426,11 @@ static const TCGTargetOpDef x86_64_op_defs[] = {
 
 void tcg_target_init(TCGContext *s)
 {
+#if !defined(CONFIG_USER_ONLY)
     /* fail safe */
     if ((1 << CPU_TLB_ENTRY_BITS) != sizeof(CPUTLBEntry))
         tcg_abort();
+#endif
 
     tcg_regset_set32(tcg_target_available_regs[TCG_TYPE_I32], 0, 0xffff);
     tcg_regset_set32(tcg_target_available_regs[TCG_TYPE_I64], 0, 0xffff);