-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* initial WIP sleigh based SPARC32 arch * add install option to build script * fix register names * fix incorrect index into current_bytes in loadFill implementation * add didrestore register * dlog register adding * ignore categories * remove decompile_mode from llvm * fix register mapping for flags * remove nextpc/npc since it doesn't appear to be used and breaks anvill * overlay NPC with NEXT_PC * remove next_pc correctly since it was still breaking stuff * Don't mark instruction as "invalid" when we can't determine a control flow category * fix pcode cfg for calls and branches * add double registers to sparc state structure * match up with ghidra register names * fix missing header * add starts for blocks after control flow ops to guarentee a block split for a term * remove sparc64_sleigh, fix initialization order * lift floating point numbers using ghidra names --------- Co-authored-by: Alex Cameron <[email protected]> Co-authored-by: 2over12 <[email protected]>
- Loading branch information
1 parent
0183248
commit 17cff6b
Showing
30 changed files
with
706 additions
and
3,070 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#pragma once | ||
#include <remill/Arch/Arch.h> | ||
#include <remill/Arch/ArchBase.h> | ||
|
||
#include <remill/Arch/SPARC32/Runtime/State.h> | ||
|
||
namespace remill { | ||
|
||
class SPARC32ArchBase : public virtual ArchBase { | ||
public: | ||
SPARC32ArchBase(llvm::LLVMContext *context_, OSName os_name_, | ||
ArchName arch_name_) | ||
: ArchBase(context_, os_name_, arch_name_) {} | ||
|
||
virtual std::string_view StackPointerRegisterName(void) const override; | ||
|
||
std::string_view ProgramCounterRegisterName(void) const override; | ||
|
||
llvm::CallingConv::ID DefaultCallingConv(void) const override; | ||
llvm::DataLayout DataLayout(void) const override; | ||
llvm::Triple Triple(void) const override; | ||
|
||
// Align/Minimum/Maximum number of bytes in an instruction. | ||
uint64_t MinInstructionAlign(const DecodingContext &) const override; | ||
uint64_t MinInstructionSize(const DecodingContext &) const override; | ||
uint64_t MaxInstructionSize(const DecodingContext &, | ||
bool permit_fuse_idioms) const override; | ||
bool MemoryAccessIsLittleEndian(void) const override; | ||
// Returns `true` if a given instruction might have a delay slot. | ||
bool MayHaveDelaySlot(const Instruction &inst) const override; | ||
// Returns `true` if we should lift the semantics of `next_inst` as a delay | ||
// slot of `inst`. The `branch_taken_path` tells us whether we are in the | ||
// context of the taken path of a branch or the not-taken path of a branch. | ||
virtual bool NextInstructionIsDelayed(const Instruction &inst, | ||
const Instruction &next_inst, | ||
bool branch_taken_path) const final; | ||
void PopulateRegisterTable(void) const override; | ||
// Populate a just-initialized lifted function function with architecture- | ||
// specific variables. | ||
void | ||
FinishLiftedFunctionInitialization(llvm::Module *module, | ||
llvm::Function *bb_func) const override; | ||
virtual ~SPARC32ArchBase(void) = default; | ||
}; | ||
|
||
} // namespace remill |
Oops, something went wrong.