hw/serial: don't create a char device if none is specified
[qemu] / target-alpha / translate.c
index f8a946b..9d2bc45 100644 (file)
@@ -14,8 +14,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA  02110-1301 USA
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 
 #include <stdint.h>
@@ -104,8 +103,7 @@ static void alpha_translate_init(void)
     done_init = 1;
 }
 
-static always_inline void gen_excp (DisasContext *ctx,
-                                    int exception, int error_code)
+static inline void gen_excp(DisasContext *ctx, int exception, int error_code)
 {
     TCGv_i32 tmp1, tmp2;
 
@@ -117,12 +115,12 @@ static always_inline void gen_excp (DisasContext *ctx,
     tcg_temp_free_i32(tmp1);
 }
 
-static always_inline void gen_invalid (DisasContext *ctx)
+static inline void gen_invalid(DisasContext *ctx)
 {
     gen_excp(ctx, EXCP_OPCDEC, 0);
 }
 
-static always_inline void gen_qemu_ldf (TCGv t0, TCGv t1, int flags)
+static inline void gen_qemu_ldf(TCGv t0, TCGv t1, int flags)
 {
     TCGv tmp = tcg_temp_new();
     TCGv_i32 tmp32 = tcg_temp_new_i32();
@@ -133,7 +131,7 @@ static always_inline void gen_qemu_ldf (TCGv t0, TCGv t1, int flags)
     tcg_temp_free(tmp);
 }
 
-static always_inline void gen_qemu_ldg (TCGv t0, TCGv t1, int flags)
+static inline void gen_qemu_ldg(TCGv t0, TCGv t1, int flags)
 {
     TCGv tmp = tcg_temp_new();
     tcg_gen_qemu_ld64(tmp, t1, flags);
@@ -141,7 +139,7 @@ static always_inline void gen_qemu_ldg (TCGv t0, TCGv t1, int flags)
     tcg_temp_free(tmp);
 }
 
-static always_inline void gen_qemu_lds (TCGv t0, TCGv t1, int flags)
+static inline void gen_qemu_lds(TCGv t0, TCGv t1, int flags)
 {
     TCGv tmp = tcg_temp_new();
     TCGv_i32 tmp32 = tcg_temp_new_i32();
@@ -152,22 +150,23 @@ static always_inline void gen_qemu_lds (TCGv t0, TCGv t1, int flags)
     tcg_temp_free(tmp);
 }
 
-static always_inline void gen_qemu_ldl_l (TCGv t0, TCGv t1, int flags)
+static inline void gen_qemu_ldl_l(TCGv t0, TCGv t1, int flags)
 {
     tcg_gen_mov_i64(cpu_lock, t1);
     tcg_gen_qemu_ld32s(t0, t1, flags);
 }
 
-static always_inline void gen_qemu_ldq_l (TCGv t0, TCGv t1, int flags)
+static inline void gen_qemu_ldq_l(TCGv t0, TCGv t1, int flags)
 {
     tcg_gen_mov_i64(cpu_lock, t1);
     tcg_gen_qemu_ld64(t0, t1, flags);
 }
 
-static always_inline void gen_load_mem (DisasContext *ctx,
-                                        void (*tcg_gen_qemu_load)(TCGv t0, TCGv t1, int flags),
-                                        int ra, int rb, int32_t disp16,
-                                        int fp, int clear)
+static inline void gen_load_mem(DisasContext *ctx,
+                                void (*tcg_gen_qemu_load)(TCGv t0, TCGv t1,
+                                                          int flags),
+                                int ra, int rb, int32_t disp16, int fp,
+                                int clear)
 {
     TCGv addr;
 
@@ -191,7 +190,7 @@ static always_inline void gen_load_mem (DisasContext *ctx,
     tcg_temp_free(addr);
 }
 
-static always_inline void gen_qemu_stf (TCGv t0, TCGv t1, int flags)
+static inline void gen_qemu_stf(TCGv t0, TCGv t1, int flags)
 {
     TCGv_i32 tmp32 = tcg_temp_new_i32();
     TCGv tmp = tcg_temp_new();
@@ -202,7 +201,7 @@ static always_inline void gen_qemu_stf (TCGv t0, TCGv t1, int flags)
     tcg_temp_free_i32(tmp32);
 }
 
-static always_inline void gen_qemu_stg (TCGv t0, TCGv t1, int flags)
+static inline void gen_qemu_stg(TCGv t0, TCGv t1, int flags)
 {
     TCGv tmp = tcg_temp_new();
     gen_helper_g_to_memory(tmp, t0);
@@ -210,7 +209,7 @@ static always_inline void gen_qemu_stg (TCGv t0, TCGv t1, int flags)
     tcg_temp_free(tmp);
 }
 
-static always_inline void gen_qemu_sts (TCGv t0, TCGv t1, int flags)
+static inline void gen_qemu_sts(TCGv t0, TCGv t1, int flags)
 {
     TCGv_i32 tmp32 = tcg_temp_new_i32();
     TCGv tmp = tcg_temp_new();
@@ -221,7 +220,7 @@ static always_inline void gen_qemu_sts (TCGv t0, TCGv t1, int flags)
     tcg_temp_free_i32(tmp32);
 }
 
-static always_inline void gen_qemu_stl_c (TCGv t0, TCGv t1, int flags)
+static inline void gen_qemu_stl_c(TCGv t0, TCGv t1, int flags)
 {
     int l1, l2;
 
@@ -237,7 +236,7 @@ static always_inline void gen_qemu_stl_c (TCGv t0, TCGv t1, int flags)
     tcg_gen_movi_i64(cpu_lock, -1);
 }
 
-static always_inline void gen_qemu_stq_c (TCGv t0, TCGv t1, int flags)
+static inline void gen_qemu_stq_c(TCGv t0, TCGv t1, int flags)
 {
     int l1, l2;
 
@@ -253,10 +252,11 @@ static always_inline void gen_qemu_stq_c (TCGv t0, TCGv t1, int flags)
     tcg_gen_movi_i64(cpu_lock, -1);
 }
 
-static always_inline void gen_store_mem (DisasContext *ctx,
-                                         void (*tcg_gen_qemu_store)(TCGv t0, TCGv t1, int flags),
-                                         int ra, int rb, int32_t disp16,
-                                         int fp, int clear, int local)
+static inline void gen_store_mem(DisasContext *ctx,
+                                 void (*tcg_gen_qemu_store)(TCGv t0, TCGv t1,
+                                                            int flags),
+                                 int ra, int rb, int32_t disp16, int fp,
+                                 int clear, int local)
 {
     TCGv addr;
     if (local)
@@ -289,9 +289,8 @@ static always_inline void gen_store_mem (DisasContext *ctx,
     tcg_temp_free(addr);
 }
 
-static always_inline void gen_bcond (DisasContext *ctx,
-                                     TCGCond cond,
-                                     int ra, int32_t disp, int mask)
+static inline void gen_bcond(DisasContext *ctx, TCGCond cond, int ra,
+                             int32_t disp, int mask)
 {
     int l1, l2;
 
@@ -318,8 +317,8 @@ static always_inline void gen_bcond (DisasContext *ctx,
     gen_set_label(l2);
 }
 
-static always_inline void gen_fbcond (DisasContext *ctx, int opc,
-                                      int ra, int32_t disp16)
+static inline void gen_fbcond(DisasContext *ctx, int opc, int ra,
+                              int32_t disp16)
 {
     int l1, l2;
     TCGv tmp;
@@ -364,9 +363,8 @@ static always_inline void gen_fbcond (DisasContext *ctx, int opc,
     gen_set_label(l2);
 }
 
-static always_inline void gen_cmov (TCGCond inv_cond,
-                                    int ra, int rb, int rc,
-                                    int islit, uint8_t lit, int mask)
+static inline void gen_cmov(TCGCond inv_cond, int ra, int rb, int rc,
+                            int islit, uint8_t lit, int mask)
 {
     int l1;
 
@@ -398,7 +396,7 @@ static always_inline void gen_cmov (TCGCond inv_cond,
 }
 
 #define FARITH2(name)                                       \
-static always_inline void glue(gen_f, name)(int rb, int rc) \
+static inline void glue(gen_f, name)(int rb, int rc)        \
 {                                                           \
     if (unlikely(rc == 31))                                 \
       return;                                               \
@@ -430,7 +428,7 @@ FARITH2(cvtqlv)
 FARITH2(cvtqlsv)
 
 #define FARITH3(name)                                                     \
-static always_inline void glue(gen_f, name) (int ra, int rb, int rc)      \
+static inline void glue(gen_f, name)(int ra, int rb, int rc)              \
 {                                                                         \
     if (unlikely(rc == 31))                                               \
         return;                                                           \
@@ -481,7 +479,7 @@ FARITH3(cpysn)
 FARITH3(cpyse)
 
 #define FCMOV(name)                                                   \
-static always_inline void glue(gen_f, name) (int ra, int rb, int rc)  \
+static inline void glue(gen_f, name)(int ra, int rb, int rc)          \
 {                                                                     \
     int l1;                                                           \
     TCGv tmp;                                                         \
@@ -513,9 +511,8 @@ FCMOV(cmpfle)
 FCMOV(cmpfgt)
 
 /* EXTWH, EXTWH, EXTLH, EXTQH */
-static always_inline void gen_ext_h(void (*tcg_gen_ext_i64)(TCGv t0, TCGv t1),
-                                    int ra, int rb, int rc,
-                                    int islit, uint8_t lit)
+static inline void gen_ext_h(void(*tcg_gen_ext_i64)(TCGv t0, TCGv t1),
+                             int ra, int rb, int rc, int islit, uint8_t lit)
 {
     if (unlikely(rc == 31))
         return;
@@ -544,9 +541,8 @@ static always_inline void gen_ext_h(void (*tcg_gen_ext_i64)(TCGv t0, TCGv t1),
 }
 
 /* EXTBL, EXTWL, EXTWL, EXTLL, EXTQL */
-static always_inline void gen_ext_l(void (*tcg_gen_ext_i64)(TCGv t0, TCGv t1),
-                                    int ra, int rb, int rc,
-                                    int islit, uint8_t lit)
+static inline void gen_ext_l(void(*tcg_gen_ext_i64)(TCGv t0, TCGv t1),
+                             int ra, int rb, int rc, int islit, uint8_t lit)
 {
     if (unlikely(rc == 31))
         return;
@@ -569,8 +565,8 @@ static always_inline void gen_ext_l(void (*tcg_gen_ext_i64)(TCGv t0, TCGv t1),
 
 /* Code to call arith3 helpers */
 #define ARITH3(name)                                                  \
-static always_inline void glue(gen_, name) (int ra, int rb, int rc,   \
-                                            int islit, uint8_t lit)   \
+static inline void glue(gen_, name)(int ra, int rb, int rc, int islit,\
+                                    uint8_t lit)                      \
 {                                                                     \
     if (unlikely(rc == 31))                                           \
         return;                                                       \
@@ -618,9 +614,8 @@ ARITH3(umulh)
 ARITH3(mullv)
 ARITH3(mulqv)
 
-static always_inline void gen_cmp(TCGCond cond,
-                                  int ra, int rb, int rc,
-                                  int islit, uint8_t lit)
+static inline void gen_cmp(TCGCond cond, int ra, int rb, int rc, int islit,
+                           uint8_t lit)
 {
     int l1, l2;
     TCGv tmp;
@@ -648,7 +643,7 @@ static always_inline void gen_cmp(TCGCond cond,
     gen_set_label(l2);
 }
 
-static always_inline int translate_one (DisasContext *ctx, uint32_t insn)
+static inline int translate_one(DisasContext *ctx, uint32_t insn)
 {
     uint32_t palcode;
     int32_t disp21, disp16, disp12;
@@ -1732,12 +1727,6 @@ static always_inline int translate_one (DisasContext *ctx, uint32_t insn)
             break;
         case 0xE800:
             /* ECB */
-            /* XXX: TODO: evict tb cache at address rb */
-#if 0
-            ret = 2;
-#else
-            goto invalid_opc;
-#endif
             break;
         case 0xF000:
             /* RS */
@@ -2343,9 +2332,9 @@ static always_inline int translate_one (DisasContext *ctx, uint32_t insn)
     return ret;
 }
 
-static always_inline void gen_intermediate_code_internal (CPUState *env,
-                                                          TranslationBlock *tb,
-                                                          int search_pc)
+static inline void gen_intermediate_code_internal(CPUState *env,
+                                                  TranslationBlock *tb,
+                                                  int search_pc)
 {
 #if defined ALPHA_DEBUG_DISAS
     static int insn_count;
@@ -2378,8 +2367,8 @@ static always_inline void gen_intermediate_code_internal (CPUState *env,
 
     gen_icount_start();
     for (ret = 0; ret == 0;) {
-        if (unlikely(!TAILQ_EMPTY(&env->breakpoints))) {
-            TAILQ_FOREACH(bp, &env->breakpoints, entry) {
+        if (unlikely(!QTAILQ_EMPTY(&env->breakpoints))) {
+            QTAILQ_FOREACH(bp, &env->breakpoints, entry) {
                 if (bp->pc == ctx.pc) {
                     gen_excp(&ctx, EXCP_DEBUG, 0);
                     break;
@@ -2511,6 +2500,7 @@ CPUAlphaState * cpu_alpha_init (const char *cpu_model)
     env->ipr[IPR_SISR] = 0;
     env->ipr[IPR_VIRBND] = -1ULL;
 
+    qemu_init_vcpu(env);
     return env;
 }