diff --git a/ArmPkg/Drivers/CpuDxe/CpuDxe.h b/ArmPkg/Drivers/CpuDxe/CpuDxe.h index c8cba81621..b5464398ea 100644 --- a/ArmPkg/Drivers/CpuDxe/CpuDxe.h +++ b/ArmPkg/Drivers/CpuDxe/CpuDxe.h @@ -28,6 +28,7 @@ #include #include #include +#include #include #include diff --git a/ArmPkg/Drivers/CpuDxe/CpuDxe.inf b/ArmPkg/Drivers/CpuDxe/CpuDxe.inf index 99d52f96b4..d88d488fad 100644 --- a/ArmPkg/Drivers/CpuDxe/CpuDxe.inf +++ b/ArmPkg/Drivers/CpuDxe/CpuDxe.inf @@ -57,6 +57,7 @@ UefiLib CpuLib DefaultExceptioHandlerLib + DebugLib [Protocols] gEfiCpuArchProtocolGuid diff --git a/ArmPkg/Library/ArmDisassemblerLib/ThumbDisassembler.c b/ArmPkg/Library/ArmDisassemblerLib/ThumbDisassembler.c index a8dd8d8dee..0f4139d585 100644 --- a/ArmPkg/Library/ArmDisassemblerLib/ThumbDisassembler.c +++ b/ArmPkg/Library/ArmDisassemblerLib/ThumbDisassembler.c @@ -22,6 +22,7 @@ #include #include +#include #include extern CHAR8 *gCondition[]; @@ -30,6 +31,8 @@ extern CHAR8 *gReg[]; // Thumb address modes #define LOAD_STORE_FORMAT1 1 +#define LOAD_STORE_FORMAT1_H 101 +#define LOAD_STORE_FORMAT1_B 111 #define LOAD_STORE_FORMAT2 2 #define LOAD_STORE_FORMAT3 3 #define LOAD_STORE_FORMAT4 4 @@ -74,9 +77,10 @@ extern CHAR8 *gReg[]; #define SRS_FORMAT 215 #define RFE_FORMAT 216 #define LDRD_REG_IMM8_SIGNED 217 - - - +#define ADD_IMM12 218 +#define ADD_IMM5 219 +#define ADR_THUMB2 220 +#define CMN_THUMB2 221 typedef struct { CHAR8 *Start; @@ -127,9 +131,9 @@ THUMB_INSTRUCTIONS gOpThumb[] = { { "LDR" , 0x5800, 0xfe00, LOAD_STORE_FORMAT2 }, { "LDR" , 0x4800, 0xf800, LOAD_STORE_FORMAT3 }, { "LDR" , 0x9800, 0xf800, LOAD_STORE_FORMAT4 }, - { "LDRB" , 0x7800, 0xf800, LOAD_STORE_FORMAT1 }, + { "LDRB" , 0x7800, 0xf800, LOAD_STORE_FORMAT1_B }, { "LDRB" , 0x5c00, 0xfe00, LOAD_STORE_FORMAT2 }, - { "LDRH" , 0x8800, 0xf800, LOAD_STORE_FORMAT1 }, + { "LDRH" , 0x8800, 0xf800, LOAD_STORE_FORMAT1_H }, { "LDRH" , 0x7a00, 0xfe00, LOAD_STORE_FORMAT2 }, { "LDRSB" , 0x5600, 0xfe00, LOAD_STORE_FORMAT2 }, { "LDRSH" , 0x5e00, 0xfe00, LOAD_STORE_FORMAT2 }, @@ -164,9 +168,9 @@ THUMB_INSTRUCTIONS gOpThumb[] = { { "STR" , 0x5000, 0xfe00, LOAD_STORE_FORMAT2 }, { "STR" , 0x4000, 0xf800, LOAD_STORE_FORMAT3 }, { "STR" , 0x9000, 0xf800, LOAD_STORE_FORMAT4 }, - { "STRB" , 0x7000, 0xf800, LOAD_STORE_FORMAT1 }, + { "STRB" , 0x7000, 0xf800, LOAD_STORE_FORMAT1_B }, { "STRB" , 0x5800, 0xfe00, LOAD_STORE_FORMAT2 }, - { "STRH" , 0x8000, 0xf800, LOAD_STORE_FORMAT1 }, + { "STRH" , 0x8000, 0xf800, LOAD_STORE_FORMAT1_H }, { "STRH" , 0x5200, 0xfe00, LOAD_STORE_FORMAT2 }, { "SUB" , 0x1e00, 0xfe00, DATA_FORMAT2 }, @@ -185,6 +189,32 @@ THUMB_INSTRUCTIONS gOpThumb[] = { THUMB_INSTRUCTIONS gOpThumb2[] = { //Instruct OpCode OpCode Mask Addressig Mode + + { "ADR", 0xf2af0000, 0xfbff8000, ADR_THUMB2 }, // ADDR ,