target-microblaze: Correct bit shift for the PVR0 version field
authorEdgar E. Iglesias <edgar.iglesias@xilinx.com>
Tue, 10 Jan 2017 16:14:34 +0000 (17:14 +0100)
committerEdgar E. Iglesias <edgar.iglesias@xilinx.com>
Tue, 4 Jul 2017 07:22:20 +0000 (09:22 +0200)
Correct bit shift for the PVR0 version field.

Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
target/microblaze/cpu.c
target/microblaze/cpu.h

index 3d588697164c92cf3b2ca9398c0f1b9cfd8e7a9e..af70faaa90f5ec1f604da19ca482ee11f9519ad9 100644 (file)
@@ -182,7 +182,7 @@ static void mb_cpu_realizefn(DeviceState *dev, Error **errp)
                         (cpu->cfg.use_fpu ? PVR0_USE_FPU_MASK : 0) |
                         (cpu->cfg.use_mmu ? PVR0_USE_MMU_MASK : 0) |
                         (cpu->cfg.endi ? PVR0_ENDI_MASK : 0) |
-                        (version_code << 16) |
+                        (version_code << PVR0_VERSION_SHIFT) |
                         (cpu->cfg.pvr == C_PVR_FULL ? PVR0_PVR_FULL_MASK : 0);
 
     env->pvr.regs[2] |= (cpu->cfg.use_fpu ? PVR2_USE_FPU_MASK : 0) |
index bf6963bcb719f55a6e1b92d434cbb3c9dbaeb68a..68c33e83e4d872d98008f73cc8db0f41c6c83eba 100644 (file)
@@ -129,6 +129,8 @@ typedef struct CPUMBState CPUMBState;
 #define PVR0_USER1_MASK                 0x000000FF
 #define PVR0_SPROT_MASK                 0x00000001
 
+#define PVR0_VERSION_SHIFT              8
+
 /* User 2 PVR mask */
 #define PVR1_USER2_MASK                 0xFFFFFFFF