diff --git a/include/unicorn/ppc.h b/include/unicorn/ppc.h index 9d09a990..48812d18 100644 --- a/include/unicorn/ppc.h +++ b/include/unicorn/ppc.h @@ -16,13 +16,15 @@ extern "C" { #endif typedef enum uc_cpu_ppc { - UC_CPU_PPC_401A1 = 0, + UC_CPU_PPC_401 = 0, + UC_CPU_PPC_401A1, UC_CPU_PPC_401B2, UC_CPU_PPC_401C2, UC_CPU_PPC_401D2, UC_CPU_PPC_401E2, UC_CPU_PPC_401F2, UC_CPU_PPC_401G2, + UC_CPU_PPC_IOP480, UC_CPU_PPC_COBRA, UC_CPU_PPC_403GA, UC_CPU_PPC_403GB, @@ -49,275 +51,283 @@ typedef enum uc_cpu_ppc { UC_CPU_PPC_STB04, UC_CPU_PPC_STB25, UC_CPU_PPC_X2VP4, + UC_CPU_PPC_X2VP20, UC_CPU_PPC_440_XILINX, + UC_CPU_PPC_440_XILINX_W_DFPU, UC_CPU_PPC_440EPA, UC_CPU_PPC_440EPB, - UC_CPU_PPC_440GPB, - UC_CPU_PPC_440GPC, - UC_CPU_PPC_440GRX, - UC_CPU_PPC_440GXA, - UC_CPU_PPC_440GXB, - UC_CPU_PPC_440GXC, - UC_CPU_PPC_440GXF, - UC_CPU_PPC_440SP, - UC_CPU_PPC_440SP2, - UC_CPU_PPC_440SPE, + UC_CPU_PPC_440EPX, UC_CPU_PPC_460EXB, - UC_CPU_PPC_MPC5XX, - UC_CPU_PPC_MPC8XX, UC_CPU_PPC_G2, UC_CPU_PPC_G2H4, UC_CPU_PPC_G2GP, UC_CPU_PPC_G2LS, + UC_CPU_PPC_G2HIP3, + UC_CPU_PPC_G2HIP4, UC_CPU_PPC_MPC603, - UC_CPU_PPC_G2_HIP3, - UC_CPU_PPC_G2_HIP4, UC_CPU_PPC_G2LE, UC_CPU_PPC_G2LEGP, UC_CPU_PPC_G2LELS, UC_CPU_PPC_G2LEGP1, UC_CPU_PPC_G2LEGP3, + UC_CPU_PPC_MPC5200_V10, + UC_CPU_PPC_MPC5200_V11, + UC_CPU_PPC_MPC5200_V12, + UC_CPU_PPC_MPC5200B_V20, + UC_CPU_PPC_MPC5200B_V21, UC_CPU_PPC_E200Z5, UC_CPU_PPC_E200Z6, UC_CPU_PPC_E300C1, UC_CPU_PPC_E300C2, UC_CPU_PPC_E300C3, UC_CPU_PPC_E300C4, - UC_CPU_PPC_E500V1_V10, - UC_CPU_PPC_E500V1_V20, + UC_CPU_PPC_MPC8343, + UC_CPU_PPC_MPC8343A, + UC_CPU_PPC_MPC8343E, + UC_CPU_PPC_MPC8343EA, + UC_CPU_PPC_MPC8347T, + UC_CPU_PPC_MPC8347P, + UC_CPU_PPC_MPC8347AT, + UC_CPU_PPC_MPC8347AP, + UC_CPU_PPC_MPC8347ET, + UC_CPU_PPC_MPC8347EP, + UC_CPU_PPC_MPC8347EAT, + UC_CPU_PPC_MPC8347EAP, + UC_CPU_PPC_MPC8349, + UC_CPU_PPC_MPC8349A, + UC_CPU_PPC_MPC8349E, + UC_CPU_PPC_MPC8349EA, + UC_CPU_PPC_MPC8377, + UC_CPU_PPC_MPC8377E, + UC_CPU_PPC_MPC8378, + UC_CPU_PPC_MPC8378E, + UC_CPU_PPC_MPC8379, + UC_CPU_PPC_MPC8379E, + UC_CPU_PPC_E500_V10, + UC_CPU_PPC_E500_V20, UC_CPU_PPC_E500V2_V10, - UC_CPU_PPC_E500V2_V11, UC_CPU_PPC_E500V2_V20, UC_CPU_PPC_E500V2_V21, UC_CPU_PPC_E500V2_V22, UC_CPU_PPC_E500V2_V30, UC_CPU_PPC_E500MC, - UC_CPU_PPC_E5500, - UC_CPU_PPC_E6500, + UC_CPU_PPC_MPC8533_V10, + UC_CPU_PPC_MPC8533_V11, + UC_CPU_PPC_MPC8533E_V10, + UC_CPU_PPC_MPC8533E_V11, + UC_CPU_PPC_MPC8540_V10, + UC_CPU_PPC_MPC8540_V20, + UC_CPU_PPC_MPC8540_V21, + UC_CPU_PPC_MPC8541_V10, + UC_CPU_PPC_MPC8541_V11, + UC_CPU_PPC_MPC8541E_V10, + UC_CPU_PPC_MPC8541E_V11, + UC_CPU_PPC_MPC8543_V10, + UC_CPU_PPC_MPC8543_V11, + UC_CPU_PPC_MPC8543_V20, + UC_CPU_PPC_MPC8543_V21, + UC_CPU_PPC_MPC8543E_V10, + UC_CPU_PPC_MPC8543E_V11, + UC_CPU_PPC_MPC8543E_V20, + UC_CPU_PPC_MPC8543E_V21, + UC_CPU_PPC_MPC8544_V10, + UC_CPU_PPC_MPC8544_V11, + UC_CPU_PPC_MPC8544E_V10, + UC_CPU_PPC_MPC8544E_V11, + UC_CPU_PPC_MPC8545_V20, + UC_CPU_PPC_MPC8545_V21, + UC_CPU_PPC_MPC8545E_V20, + UC_CPU_PPC_MPC8545E_V21, + UC_CPU_PPC_MPC8547E_V20, + UC_CPU_PPC_MPC8547E_V21, + UC_CPU_PPC_MPC8548_V10, + UC_CPU_PPC_MPC8548_V11, + UC_CPU_PPC_MPC8548_V20, + UC_CPU_PPC_MPC8548_V21, + UC_CPU_PPC_MPC8548E_V10, + UC_CPU_PPC_MPC8548E_V11, + UC_CPU_PPC_MPC8548E_V20, + UC_CPU_PPC_MPC8548E_V21, + UC_CPU_PPC_MPC8555_V10, + UC_CPU_PPC_MPC8555_V11, + UC_CPU_PPC_MPC8555E_V10, + UC_CPU_PPC_MPC8555E_V11, + UC_CPU_PPC_MPC8560_V10, + UC_CPU_PPC_MPC8560_V20, + UC_CPU_PPC_MPC8560_V21, + UC_CPU_PPC_MPC8567, + UC_CPU_PPC_MPC8567E, + UC_CPU_PPC_MPC8568, + UC_CPU_PPC_MPC8568E, + UC_CPU_PPC_MPC8572, + UC_CPU_PPC_MPC8572E, UC_CPU_PPC_E600, + UC_CPU_PPC_MPC8610, + UC_CPU_PPC_MPC8641, + UC_CPU_PPC_MPC8641D, UC_CPU_PPC_601_V0, UC_CPU_PPC_601_V1, UC_CPU_PPC_601_V2, UC_CPU_PPC_602, UC_CPU_PPC_603, - UC_CPU_PPC_603E_V11, - UC_CPU_PPC_603E_V12, - UC_CPU_PPC_603E_V13, - UC_CPU_PPC_603E_V14, - UC_CPU_PPC_603E_V22, + UC_CPU_PPC_603E_V1_1, + UC_CPU_PPC_603E_V1_2, + UC_CPU_PPC_603E_V1_3, + UC_CPU_PPC_603E_V1_4, + UC_CPU_PPC_603E_V2_2, UC_CPU_PPC_603E_V3, UC_CPU_PPC_603E_V4, - UC_CPU_PPC_603E_V41, + UC_CPU_PPC_603E_V4_1, + UC_CPU_PPC_603E7, UC_CPU_PPC_603E7T, UC_CPU_PPC_603E7V, UC_CPU_PPC_603E7V1, UC_CPU_PPC_603E7V2, - UC_CPU_PPC_603E7, UC_CPU_PPC_603P, UC_CPU_PPC_604, - UC_CPU_PPC_604E_V10, - UC_CPU_PPC_604E_V22, - UC_CPU_PPC_604E_V24, + UC_CPU_PPC_604E_V1_0, + UC_CPU_PPC_604E_V2_2, + UC_CPU_PPC_604E_V2_4, UC_CPU_PPC_604R, - UC_CPU_PPC_7X0_V10, - UC_CPU_PPC_7X0_V20, - UC_CPU_PPC_7X0_V21, - UC_CPU_PPC_7X0_V22, - UC_CPU_PPC_7X0_V30, - UC_CPU_PPC_7X0_V31, + UC_CPU_PPC_740_V1_0, + UC_CPU_PPC_750_V1_0, + UC_CPU_PPC_740_V2_0, + UC_CPU_PPC_750_V2_0, + UC_CPU_PPC_740_V2_1, + UC_CPU_PPC_750_V2_1, + UC_CPU_PPC_740_V2_2, + UC_CPU_PPC_750_V2_2, + UC_CPU_PPC_740_V3_0, + UC_CPU_PPC_750_V3_0, + UC_CPU_PPC_740_V3_1, + UC_CPU_PPC_750_V3_1, UC_CPU_PPC_740E, UC_CPU_PPC_750E, - UC_CPU_PPC_7X0P, - UC_CPU_PPC_750CL_V10, - UC_CPU_PPC_750CL_V20, - UC_CPU_PPC_750CX_V10, - UC_CPU_PPC_750CX_V20, - UC_CPU_PPC_750CX_V21, - UC_CPU_PPC_750CX_V22, - UC_CPU_PPC_750CXE_V21, - UC_CPU_PPC_750CXE_V22, - UC_CPU_PPC_750CXE_V23, - UC_CPU_PPC_750CXE_V24, - UC_CPU_PPC_750CXE_V24B, - UC_CPU_PPC_750CXE_V30, - UC_CPU_PPC_750CXE_V31, - UC_CPU_PPC_750CXE_V31B, + UC_CPU_PPC_740P, + UC_CPU_PPC_750P, + UC_CPU_PPC_750CL_V1_0, + UC_CPU_PPC_750CL_V2_0, + UC_CPU_PPC_750CX_V1_0, + UC_CPU_PPC_750CX_V2_0, + UC_CPU_PPC_750CX_V2_1, + UC_CPU_PPC_750CX_V2_2, + UC_CPU_PPC_750CXE_V2_1, + UC_CPU_PPC_750CXE_V2_2, + UC_CPU_PPC_750CXE_V2_3, + UC_CPU_PPC_750CXE_V2_4, + UC_CPU_PPC_750CXE_V2_4B, + UC_CPU_PPC_750CXE_V3_0, + UC_CPU_PPC_750CXE_V3_1, + UC_CPU_PPC_750CXE_V3_1B, UC_CPU_PPC_750CXR, UC_CPU_PPC_750FL, - UC_CPU_PPC_750FX_V10, - UC_CPU_PPC_750FX_V20, - UC_CPU_PPC_750FX_V21, - UC_CPU_PPC_750FX_V22, - UC_CPU_PPC_750FX_V23, + UC_CPU_PPC_750FX_V1_0, + UC_CPU_PPC_750FX_V2_0, + UC_CPU_PPC_750FX_V2_1, + UC_CPU_PPC_750FX_V2_2, + UC_CPU_PPC_750FX_V2_3, UC_CPU_PPC_750GL, - UC_CPU_PPC_750GX_V10, - UC_CPU_PPC_750GX_V11, - UC_CPU_PPC_750GX_V12, - UC_CPU_PPC_750L_V20, - UC_CPU_PPC_750L_V21, - UC_CPU_PPC_750L_V22, - UC_CPU_PPC_750L_V30, - UC_CPU_PPC_750L_V32, - UC_CPU_PPC_7X5_V10, - UC_CPU_PPC_7X5_V11, - UC_CPU_PPC_7X5_V20, - UC_CPU_PPC_7X5_V21, - UC_CPU_PPC_7X5_V22, - UC_CPU_PPC_7X5_V23, - UC_CPU_PPC_7X5_V24, - UC_CPU_PPC_7X5_V25, - UC_CPU_PPC_7X5_V26, - UC_CPU_PPC_7X5_V27, - UC_CPU_PPC_7X5_V28, - UC_CPU_PPC_7400_V10, - UC_CPU_PPC_7400_V11, - UC_CPU_PPC_7400_V20, - UC_CPU_PPC_7400_V21, - UC_CPU_PPC_7400_V22, - UC_CPU_PPC_7400_V26, - UC_CPU_PPC_7400_V27, - UC_CPU_PPC_7400_V28, - UC_CPU_PPC_7400_V29, - UC_CPU_PPC_7410_V10, - UC_CPU_PPC_7410_V11, - UC_CPU_PPC_7410_V12, - UC_CPU_PPC_7410_V13, - UC_CPU_PPC_7410_V14, - UC_CPU_PPC_7448_V10, - UC_CPU_PPC_7448_V11, - UC_CPU_PPC_7448_V20, - UC_CPU_PPC_7448_V21, - UC_CPU_PPC_7450_V10, - UC_CPU_PPC_7450_V11, - UC_CPU_PPC_7450_V12, - UC_CPU_PPC_7450_V20, - UC_CPU_PPC_7450_V21, - UC_CPU_PPC_74X1_V23, - UC_CPU_PPC_74X1_V210, - UC_CPU_PPC_74X5_V10, - UC_CPU_PPC_74X5_V21, - UC_CPU_PPC_74X5_V32, - UC_CPU_PPC_74X5_V33, - UC_CPU_PPC_74X5_V34, - UC_CPU_PPC_74X7_V10, - UC_CPU_PPC_74X7_V11, - UC_CPU_PPC_74X7_V12, - UC_CPU_PPC_74X7A_V10, - UC_CPU_PPC_74X7A_V11, - UC_CPU_PPC_74X7A_V12, - UC_CPU_PPC_IOP480 = UC_CPU_PPC_401B2, - UC_CPU_PPC_X2VP20 = UC_CPU_PPC_440GXF, - UC_CPU_PPC_440GRA = UC_CPU_PPC_440EPB, - UC_CPU_PPC_440EPX = UC_CPU_PPC_440GRX, - UC_CPU_PPC_MPC5200_V10 = UC_CPU_PPC_G2LEGP1, - UC_CPU_PPC_MPC5200_V11 = UC_CPU_PPC_G2LEGP1, - UC_CPU_PPC_MPC5200_V12 = UC_CPU_PPC_G2LEGP1, - UC_CPU_PPC_MPC5200B_V20 = UC_CPU_PPC_G2LEGP1, - UC_CPU_PPC_MPC5200B_V21 = UC_CPU_PPC_G2LEGP1, - UC_CPU_PPC_MPC834X = UC_CPU_PPC_E300C1, - UC_CPU_PPC_MPC837X = UC_CPU_PPC_E300C4, - UC_CPU_PPC_E500 = UC_CPU_PPC_E500V2_V22, - UC_CPU_PPC_MPC8533_V10 = UC_CPU_PPC_E500V2_V21, - UC_CPU_PPC_MPC8533_V11 = UC_CPU_PPC_E500V2_V22, - UC_CPU_PPC_MPC8533E_V10 = UC_CPU_PPC_E500V2_V21, - UC_CPU_PPC_MPC8533E_V11 = UC_CPU_PPC_E500V2_V22, - UC_CPU_PPC_MPC8540_V10 = UC_CPU_PPC_E500V1_V10, - UC_CPU_PPC_MPC8540_V20 = UC_CPU_PPC_E500V1_V20, - UC_CPU_PPC_MPC8540_V21 = UC_CPU_PPC_E500V1_V20, - UC_CPU_PPC_MPC8541_V10 = UC_CPU_PPC_E500V1_V20, - UC_CPU_PPC_MPC8541_V11 = UC_CPU_PPC_E500V1_V20, - UC_CPU_PPC_MPC8541E_V10 = UC_CPU_PPC_E500V1_V20, - UC_CPU_PPC_MPC8541E_V11 = UC_CPU_PPC_E500V1_V20, - UC_CPU_PPC_MPC8543_V10 = UC_CPU_PPC_E500V2_V10, - UC_CPU_PPC_MPC8543_V11 = UC_CPU_PPC_E500V2_V11, - UC_CPU_PPC_MPC8543_V20 = UC_CPU_PPC_E500V2_V20, - UC_CPU_PPC_MPC8543_V21 = UC_CPU_PPC_E500V2_V21, - UC_CPU_PPC_MPC8543E_V10 = UC_CPU_PPC_E500V2_V10, - UC_CPU_PPC_MPC8543E_V11 = UC_CPU_PPC_E500V2_V11, - UC_CPU_PPC_MPC8543E_V20 = UC_CPU_PPC_E500V2_V20, - UC_CPU_PPC_MPC8543E_V21 = UC_CPU_PPC_E500V2_V21, - UC_CPU_PPC_MPC8544_V10 = UC_CPU_PPC_E500V2_V21, - UC_CPU_PPC_MPC8544_V11 = UC_CPU_PPC_E500V2_V22, - UC_CPU_PPC_MPC8544E_V11 = UC_CPU_PPC_E500V2_V22, - UC_CPU_PPC_MPC8544E_V10 = UC_CPU_PPC_E500V2_V21, - UC_CPU_PPC_MPC8545_V10 = UC_CPU_PPC_E500V2_V10, - UC_CPU_PPC_MPC8545_V20 = UC_CPU_PPC_E500V2_V20, - UC_CPU_PPC_MPC8545_V21 = UC_CPU_PPC_E500V2_V21, - UC_CPU_PPC_MPC8545E_V10 = UC_CPU_PPC_E500V2_V10, - UC_CPU_PPC_MPC8545E_V20 = UC_CPU_PPC_E500V2_V20, - UC_CPU_PPC_MPC8545E_V21 = UC_CPU_PPC_E500V2_V21, - UC_CPU_PPC_MPC8547E_V10 = UC_CPU_PPC_E500V2_V10, - UC_CPU_PPC_MPC8547E_V20 = UC_CPU_PPC_E500V2_V20, - UC_CPU_PPC_MPC8547E_V21 = UC_CPU_PPC_E500V2_V21, - UC_CPU_PPC_MPC8548_V10 = UC_CPU_PPC_E500V2_V10, - UC_CPU_PPC_MPC8548_V11 = UC_CPU_PPC_E500V2_V11, - UC_CPU_PPC_MPC8548_V20 = UC_CPU_PPC_E500V2_V20, - UC_CPU_PPC_MPC8548_V21 = UC_CPU_PPC_E500V2_V21, - UC_CPU_PPC_MPC8548E_V10 = UC_CPU_PPC_E500V2_V10, - UC_CPU_PPC_MPC8548E_V11 = UC_CPU_PPC_E500V2_V11, - UC_CPU_PPC_MPC8548E_V20 = UC_CPU_PPC_E500V2_V20, - UC_CPU_PPC_MPC8548E_V21 = UC_CPU_PPC_E500V2_V21, - UC_CPU_PPC_MPC8555_V10 = UC_CPU_PPC_E500V2_V10, - UC_CPU_PPC_MPC8555_V11 = UC_CPU_PPC_E500V2_V11, - UC_CPU_PPC_MPC8555E_V10 = UC_CPU_PPC_E500V2_V10, - UC_CPU_PPC_MPC8555E_V11 = UC_CPU_PPC_E500V2_V11, - UC_CPU_PPC_MPC8560_V10 = UC_CPU_PPC_E500V2_V10, - UC_CPU_PPC_MPC8560_V20 = UC_CPU_PPC_E500V2_V20, - UC_CPU_PPC_MPC8560_V21 = UC_CPU_PPC_E500V2_V21, - UC_CPU_PPC_MPC8567 = UC_CPU_PPC_E500V2_V22, - UC_CPU_PPC_MPC8567E = UC_CPU_PPC_E500V2_V22, - UC_CPU_PPC_MPC8568 = UC_CPU_PPC_E500V2_V22, - UC_CPU_PPC_MPC8568E = UC_CPU_PPC_E500V2_V22, - UC_CPU_PPC_MPC8572 = UC_CPU_PPC_E500V2_V30, - UC_CPU_PPC_MPC8572E = UC_CPU_PPC_E500V2_V30, - UC_CPU_PPC_MPC8610 = UC_CPU_PPC_E600, - UC_CPU_PPC_MPC8641 = UC_CPU_PPC_E600, - UC_CPU_PPC_MPC8641D = UC_CPU_PPC_E600, + UC_CPU_PPC_750GX_V1_0, + UC_CPU_PPC_750GX_V1_1, + UC_CPU_PPC_750GX_V1_2, + UC_CPU_PPC_750L_V2_0, + UC_CPU_PPC_750L_V2_1, + UC_CPU_PPC_750L_V2_2, + UC_CPU_PPC_750L_V3_0, + UC_CPU_PPC_750L_V3_2, + UC_CPU_PPC_745_V1_0, + UC_CPU_PPC_755_V1_0, + UC_CPU_PPC_745_V1_1, + UC_CPU_PPC_755_V1_1, + UC_CPU_PPC_745_V2_0, + UC_CPU_PPC_755_V2_0, + UC_CPU_PPC_745_V2_1, + UC_CPU_PPC_755_V2_1, + UC_CPU_PPC_745_V2_2, + UC_CPU_PPC_755_V2_2, + UC_CPU_PPC_745_V2_3, + UC_CPU_PPC_755_V2_3, + UC_CPU_PPC_745_V2_4, + UC_CPU_PPC_755_V2_4, + UC_CPU_PPC_745_V2_5, + UC_CPU_PPC_755_V2_5, + UC_CPU_PPC_745_V2_6, + UC_CPU_PPC_755_V2_6, + UC_CPU_PPC_745_V2_7, + UC_CPU_PPC_755_V2_7, + UC_CPU_PPC_745_V2_8, + UC_CPU_PPC_755_V2_8, + UC_CPU_PPC_7400_V1_0, + UC_CPU_PPC_7400_V1_1, + UC_CPU_PPC_7400_V2_0, + UC_CPU_PPC_7400_V2_1, + UC_CPU_PPC_7400_V2_2, + UC_CPU_PPC_7400_V2_6, + UC_CPU_PPC_7400_V2_7, + UC_CPU_PPC_7400_V2_8, + UC_CPU_PPC_7400_V2_9, + UC_CPU_PPC_7410_V1_0, + UC_CPU_PPC_7410_V1_1, + UC_CPU_PPC_7410_V1_2, + UC_CPU_PPC_7410_V1_3, + UC_CPU_PPC_7410_V1_4, + UC_CPU_PPC_7448_V1_0, + UC_CPU_PPC_7448_V1_1, + UC_CPU_PPC_7448_V2_0, + UC_CPU_PPC_7448_V2_1, + UC_CPU_PPC_7450_V1_0, + UC_CPU_PPC_7450_V1_1, + UC_CPU_PPC_7450_V1_2, + UC_CPU_PPC_7450_V2_0, + UC_CPU_PPC_7450_V2_1, + UC_CPU_PPC_7441_V2_1, + UC_CPU_PPC_7441_V2_3, + UC_CPU_PPC_7451_V2_3, + UC_CPU_PPC_7441_V2_10, + UC_CPU_PPC_7451_V2_10, + UC_CPU_PPC_7445_V1_0, + UC_CPU_PPC_7455_V1_0, + UC_CPU_PPC_7445_V2_1, + UC_CPU_PPC_7455_V2_1, + UC_CPU_PPC_7445_V3_2, + UC_CPU_PPC_7455_V3_2, + UC_CPU_PPC_7445_V3_3, + UC_CPU_PPC_7455_V3_3, + UC_CPU_PPC_7445_V3_4, + UC_CPU_PPC_7455_V3_4, + UC_CPU_PPC_7447_V1_0, + UC_CPU_PPC_7457_V1_0, + UC_CPU_PPC_7447_V1_1, + UC_CPU_PPC_7457_V1_1, + UC_CPU_PPC_7457_V1_2, + UC_CPU_PPC_7447A_V1_0, + UC_CPU_PPC_7457A_V1_0, + UC_CPU_PPC_7447A_V1_1, + UC_CPU_PPC_7457A_V1_1, + UC_CPU_PPC_7447A_V1_2, + UC_CPU_PPC_7457A_V1_2, } uc_cpu_ppc; typedef enum uc_cpu_ppc64 { - UC_CPU_PPC64_620 = 0, - UC_CPU_PPC64_630, - UC_CPU_PPC64_631, - UC_CPU_PPC64_POWER4, - UC_CPU_PPC64_POWER4P, - UC_CPU_PPC64_POWER5, - UC_CPU_PPC64_POWER5P_V21, - UC_CPU_PPC64_POWER6, - UC_CPU_PPC64_POWER_SERVER_MASK, - UC_CPU_PPC64_POWER7_BASE, - UC_CPU_PPC64_POWER7_V23, - UC_CPU_PPC64_POWER7P_BASE, - UC_CPU_PPC64_POWER7P_V21, - UC_CPU_PPC64_POWER8E_BASE, - UC_CPU_PPC64_POWER8E_V21, - UC_CPU_PPC64_POWER8_BASE, - UC_CPU_PPC64_POWER8_V20, - UC_CPU_PPC64_POWER8NVL_BASE, - UC_CPU_PPC64_POWER8NVL_V10, - UC_CPU_PPC64_POWER9_BASE, - UC_CPU_PPC64_POWER9_DD1, - UC_CPU_PPC64_POWER9_DD20, - UC_CPU_PPC64_POWER10_BASE, - UC_CPU_PPC64_POWER10_DD1, - UC_CPU_PPC64_970_V22, - UC_CPU_PPC64_970FX_V10, - UC_CPU_PPC64_970FX_V20, - UC_CPU_PPC64_970FX_V21, - UC_CPU_PPC64_970FX_V30, - UC_CPU_PPC64_970FX_V31, - UC_CPU_PPC64_970MP_V10, - UC_CPU_PPC64_970MP_V11, - UC_CPU_PPC64_CELL_V10, - UC_CPU_PPC64_CELL_V20, - UC_CPU_PPC64_CELL_V30, - UC_CPU_PPC64_CELL_V31, - UC_CPU_PPC64_RS64, - UC_CPU_PPC64_RS64II, - UC_CPU_PPC64_RS64III, - UC_CPU_PPC64_RS64IV, - UC_CPU_PPC64_CELL_V32 = UC_CPU_PPC64_CELL_V31, - UC_CPU_PPC64_CELL = UC_CPU_PPC64_CELL_V32, + UC_CPU_PPC_E5500 = 0, + UC_CPU_PPC_E6500, + UC_CPU_PPC_970_V2_2, + UC_CPU_PPC_970FX_V1_0, + UC_CPU_PPC_970FX_V2_0, + UC_CPU_PPC_970FX_V2_1, + UC_CPU_PPC_970FX_V3_0, + UC_CPU_PPC_970FX_V3_1, + UC_CPU_PPC_970MP_V1_0, + UC_CPU_PPC_970MP_V1_1, + UC_CPU_PPC_POWER5_V2_1, + UC_CPU_PPC_POWER7_V2_3, + UC_CPU_PPC_POWER7_V2_1, + UC_CPU_PPC_POWER8E_V2_1, + UC_CPU_PPC_POWER8_V2_0, + UC_CPU_PPC_POWER8NVL_V1_0, + UC_CPU_PPC_POWER9_V1_0, + UC_CPU_PPC_POWER9_V2_0, + UC_CPU_PPC_POWER10_V1_0, } uc_cpu_ppc64; //> PPC registers diff --git a/qemu/target/ppc/translate_init.inc.c b/qemu/target/ppc/translate_init.inc.c index bc2152d1..3f40bd60 100644 --- a/qemu/target/ppc/translate_init.inc.c +++ b/qemu/target/ppc/translate_init.inc.c @@ -10696,12 +10696,6 @@ static const PowerPCCPUInfo ppc_cpus[] = { CPU_POWERPC_e500v2_v30, POWERPC_SVR_E500, e500v2) POWERPC_DEF_SVR("e500mc", "e500mc", CPU_POWERPC_e500mc, POWERPC_SVR_E500, e500mc) -#ifdef TARGET_PPC64 - POWERPC_DEF_SVR("e5500", "e5500", - CPU_POWERPC_e5500, POWERPC_SVR_E500, e5500) - POWERPC_DEF_SVR("e6500", "e6500", - CPU_POWERPC_e6500, POWERPC_SVR_E500, e6500) -#endif /* PowerPC e500 microcontrollers */ POWERPC_DEF_SVR("mpc8533_v10", "MPC8533 v1.0", CPU_POWERPC_MPC8533_v10, POWERPC_SVR_8533_v10, e500v2) @@ -11099,8 +11093,11 @@ static const PowerPCCPUInfo ppc_cpus[] = { "PowerPC 7447A v1.2 (G4)") POWERPC_DEF("7457a_v1.2", CPU_POWERPC_74x7A_v12, 7455, "PowerPC 7457A v1.2 (G4)") - /* 64 bits PowerPC */ -#if defined(TARGET_PPC64) +#ifdef TARGET_PPC64 + POWERPC_DEF_SVR("e5500", "e5500", + CPU_POWERPC_e5500, POWERPC_SVR_E500, e5500) + POWERPC_DEF_SVR("e6500", "e6500", + CPU_POWERPC_e6500, POWERPC_SVR_E500, e6500) POWERPC_DEF("970_v2.2", CPU_POWERPC_970_v22, 970, "PowerPC 970 v2.2") POWERPC_DEF("970fx_v1.0", CPU_POWERPC_970FX_v10, 970, @@ -11138,28 +11135,34 @@ static const PowerPCCPUInfo ppc_cpus[] = { #endif /* defined (TARGET_PPC64) */ }; -PowerPCCPU *cpu_ppc_init(struct uc_struct *uc, const char *cpu_model) +PowerPCCPU *cpu_ppc_init(struct uc_struct *uc) { - int i; PowerPCCPU *cpu; CPUState *cs; CPUClass *cc; PowerPCCPUClass *pcc; - if (cpu_model == NULL) { -#ifdef TARGET_PPC64 - cpu_model = "power10_v1.0"; -#else -// cpu_model = "e500v2_v10"; - cpu_model = "7457a_v1.2"; -#endif - } - cpu = malloc(sizeof(*cpu)); if (cpu == NULL) { return NULL; } memset(cpu, 0, sizeof(*cpu)); +#ifdef TARGET_PPC64 + if (uc->cpu_model == INT_MAX) { + uc->cpu_model = 18 + UC_CPU_PPC_7457A_V1_2 + 1; // power10_v1.0 + } else if (uc->cpu_model + UC_CPU_PPC_7457A_V1_2 + 1 >= ARRAY_SIZE(ppc_cpus)) { + free(cpu); + return NULL; + } +#else + if (uc->cpu_model == INT_MAX) { + uc->cpu_model = 289; // 7457a_v1.2 + } else if (uc->cpu_model >= ARRAY_SIZE(ppc_cpus)) { + free(cpu); + return NULL; + } +#endif + cs = (CPUState *)cpu; cc = (CPUClass *)&cpu->cc; @@ -11173,15 +11176,10 @@ PowerPCCPU *cpu_ppc_init(struct uc_struct *uc, const char *cpu_model) ppc_cpu_class_init(uc, cc); /* init PowerPC family class */ pcc = &cpu->cc; - for (i = 0; i < ARRAY_SIZE(ppc_cpus); i++) { - if (strcmp(cpu_model, ppc_cpus[i].name) == 0) { - pcc->pvr = ppc_cpus[i].pvr; - pcc->svr = ppc_cpus[i].svr; - if (ppc_cpus[i].cpu_family_class_init) { - ppc_cpus[i].cpu_family_class_init(cc, uc); - } - break; - } + pcc->pvr = ppc_cpus[uc->cpu_model].pvr; + pcc->svr = ppc_cpus[uc->cpu_model].svr; + if (ppc_cpus[uc->cpu_model].cpu_family_class_init) { + ppc_cpus[uc->cpu_model].cpu_family_class_init(cc, uc); } /* init CPUState */ cpu_common_initfn(uc, cs); diff --git a/qemu/target/ppc/unicorn.c b/qemu/target/ppc/unicorn.c index 99438c27..d8d50d57 100644 --- a/qemu/target/ppc/unicorn.c +++ b/qemu/target/ppc/unicorn.c @@ -202,12 +202,12 @@ int ppc_context_reg_write(struct uc_context *ctx, unsigned int *regs, return 0; } -PowerPCCPU *cpu_ppc_init(struct uc_struct *uc, const char *cpu_model); +PowerPCCPU *cpu_ppc_init(struct uc_struct *uc); static int ppc_cpus_init(struct uc_struct *uc, const char *cpu_model) { PowerPCCPU *cpu; - cpu = cpu_ppc_init(uc, cpu_model); + cpu = cpu_ppc_init(uc); if (cpu == NULL) { return -1; }