From 832d3137df6e5dd69849f9f7ce40ae13c11601ad Mon Sep 17 00:00:00 2001 From: Johnny Chen Date: Wed, 26 Jan 2011 01:18:52 +0000 Subject: [PATCH] Move #define's out of ARMUtils.h and into a newly created file ARMDefines.h. llvm-svn: 124261 --- lldb/lldb.xcodeproj/project.pbxproj | 4 ++ .../Plugins/Process/Utility/ARMDefines.h | 56 +++++++++++++++++++ .../source/Plugins/Process/Utility/ARMUtils.h | 36 ------------ .../Process/Utility/EmulateInstructionARM.cpp | 1 + 4 files changed, 61 insertions(+), 36 deletions(-) create mode 100644 lldb/source/Plugins/Process/Utility/ARMDefines.h diff --git a/lldb/lldb.xcodeproj/project.pbxproj b/lldb/lldb.xcodeproj/project.pbxproj index 281a71493a4e..cc91d0c65f0e 100644 --- a/lldb/lldb.xcodeproj/project.pbxproj +++ b/lldb/lldb.xcodeproj/project.pbxproj @@ -384,6 +384,7 @@ AF68D3311255A111002FF25B /* UnwindLLDB.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF68D32F1255A110002FF25B /* UnwindLLDB.cpp */; }; AF94005911C03F6500085DB9 /* SymbolVendor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF94005711C03F6500085DB9 /* SymbolVendor.cpp */; }; B23DD25012EDFAC1000C3894 /* ARMUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = B23DD24F12EDFAC1000C3894 /* ARMUtils.h */; }; + B287E63F12EFAE2C00C9BEFE /* ARMDefines.h in Headers */ = {isa = PBXBuildFile; fileRef = B287E63E12EFAE2C00C9BEFE /* ARMDefines.h */; }; B296983712C2FB98002D92C3 /* CommandObjectVersion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B296983412C2FB2B002D92C3 /* CommandObjectVersion.cpp */; }; B2D3033712EFA5C500F84EB3 /* InstructionUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = B2D3033612EFA5C500F84EB3 /* InstructionUtils.h */; }; /* End PBXBuildFile section */ @@ -1097,6 +1098,7 @@ AF68D3301255A110002FF25B /* UnwindLLDB.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UnwindLLDB.h; path = Utility/UnwindLLDB.h; sourceTree = ""; }; AF94005711C03F6500085DB9 /* SymbolVendor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SymbolVendor.cpp; path = source/Symbol/SymbolVendor.cpp; sourceTree = ""; }; B23DD24F12EDFAC1000C3894 /* ARMUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ARMUtils.h; path = Utility/ARMUtils.h; sourceTree = ""; }; + B287E63E12EFAE2C00C9BEFE /* ARMDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ARMDefines.h; path = Utility/ARMDefines.h; sourceTree = ""; }; B296983412C2FB2B002D92C3 /* CommandObjectVersion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectVersion.cpp; path = source/Commands/CommandObjectVersion.cpp; sourceTree = ""; }; B296983512C2FB2B002D92C3 /* CommandObjectVersion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectVersion.h; path = source/Commands/CommandObjectVersion.h; sourceTree = ""; }; B2D3033612EFA5C500F84EB3 /* InstructionUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InstructionUtils.h; path = Utility/InstructionUtils.h; sourceTree = ""; }; @@ -1614,6 +1616,7 @@ isa = PBXGroup; children = ( B2D3033612EFA5C500F84EB3 /* InstructionUtils.h */, + B287E63E12EFAE2C00C9BEFE /* ARMDefines.h */, B23DD24F12EDFAC1000C3894 /* ARMUtils.h */, 2621C9CC12EA009300711A30 /* EmulateInstruction.h */, 2621CA0A12EA107700711A30 /* EmulateInstruction.cpp */, @@ -2321,6 +2324,7 @@ 2621C9D012EA066500711A30 /* EmulateInstructionARM.h in Headers */, B23DD25012EDFAC1000C3894 /* ARMUtils.h in Headers */, B2D3033712EFA5C500F84EB3 /* InstructionUtils.h in Headers */, + B287E63F12EFAE2C00C9BEFE /* ARMDefines.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/lldb/source/Plugins/Process/Utility/ARMDefines.h b/lldb/source/Plugins/Process/Utility/ARMDefines.h new file mode 100644 index 000000000000..b258b7525239 --- /dev/null +++ b/lldb/source/Plugins/Process/Utility/ARMDefines.h @@ -0,0 +1,56 @@ +//===-- lldb_ARMDefines.h ---------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef lldb_ARMDefines_h_ +#define lldb_ARMDefines_h_ + +#include "InstructionUtils.h" + +// Common defintions for the ARM/Thumb Instruction Set Architecture. + +namespace lldb_private { + +// ARM conditions +#define COND_EQ 0x0 +#define COND_NE 0x1 +#define COND_CS 0x2 +#define COND_HS 0x2 +#define COND_CC 0x3 +#define COND_LO 0x3 +#define COND_MI 0x4 +#define COND_PL 0x5 +#define COND_VS 0x6 +#define COND_VC 0x7 +#define COND_HI 0x8 +#define COND_LS 0x9 +#define COND_GE 0xA +#define COND_LT 0xB +#define COND_GT 0xC +#define COND_LE 0xD +#define COND_AL 0xE +#define COND_UNCOND 0xF + +// Masks for CPSR +#define MASK_CPSR_MODE_MASK (0x0000001fu) +#define MASK_CPSR_T (1u << 5) +#define MASK_CPSR_F (1u << 6) +#define MASK_CPSR_I (1u << 7) +#define MASK_CPSR_A (1u << 8) +#define MASK_CPSR_E (1u << 9) +#define MASK_CPSR_GE_MASK (0x000f0000u) +#define MASK_CPSR_J (1u << 24) +#define MASK_CPSR_Q (1u << 27) +#define MASK_CPSR_V (1u << 28) +#define MASK_CPSR_C (1u << 29) +#define MASK_CPSR_Z (1u << 30) +#define MASK_CPSR_N (1u << 31) + +} // namespace lldb_private + +#endif // lldb_ARMDefines_h_ diff --git a/lldb/source/Plugins/Process/Utility/ARMUtils.h b/lldb/source/Plugins/Process/Utility/ARMUtils.h index c0ad1cc2e903..e81de10b905a 100644 --- a/lldb/source/Plugins/Process/Utility/ARMUtils.h +++ b/lldb/source/Plugins/Process/Utility/ARMUtils.h @@ -16,42 +16,6 @@ namespace lldb_private { -// ARM conditions -#define COND_EQ 0x0 -#define COND_NE 0x1 -#define COND_CS 0x2 -#define COND_HS 0x2 -#define COND_CC 0x3 -#define COND_LO 0x3 -#define COND_MI 0x4 -#define COND_PL 0x5 -#define COND_VS 0x6 -#define COND_VC 0x7 -#define COND_HI 0x8 -#define COND_LS 0x9 -#define COND_GE 0xA -#define COND_LT 0xB -#define COND_GT 0xC -#define COND_LE 0xD -#define COND_AL 0xE -#define COND_UNCOND 0xF - -// Masks for CPSR -#define MASK_CPSR_MODE_MASK (0x0000001fu) -#define MASK_CPSR_T (1u << 5) -#define MASK_CPSR_F (1u << 6) -#define MASK_CPSR_I (1u << 7) -#define MASK_CPSR_A (1u << 8) -#define MASK_CPSR_E (1u << 9) -#define MASK_CPSR_GE_MASK (0x000f0000u) -#define MASK_CPSR_J (1u << 24) -#define MASK_CPSR_Q (1u << 27) -#define MASK_CPSR_V (1u << 28) -#define MASK_CPSR_C (1u << 29) -#define MASK_CPSR_Z (1u << 30) -#define MASK_CPSR_N (1u << 31) - - static inline uint32_t bits(const uint32_t val, const uint32_t msbit, const uint32_t lsbit) { return Bits32(val, msbit, lsbit); diff --git a/lldb/source/Plugins/Process/Utility/EmulateInstructionARM.cpp b/lldb/source/Plugins/Process/Utility/EmulateInstructionARM.cpp index 56a8366ff979..7d61a60e3e93 100644 --- a/lldb/source/Plugins/Process/Utility/EmulateInstructionARM.cpp +++ b/lldb/source/Plugins/Process/Utility/EmulateInstructionARM.cpp @@ -8,6 +8,7 @@ //===----------------------------------------------------------------------===// #include "EmulateInstructionARM.h" +#include "ARMDefines.h" #include "ARMUtils.h" using namespace lldb;