Skip to content
Snippets Groups Projects
Commit 366e9c50 authored by whh8b's avatar whh8b
Browse files

Update to new 'composable' plopping semantics.

parent cb854be0
No related branches found
No related tags found
No related merge requests found
......@@ -50,7 +50,7 @@ class DollopManager_t {
public:
DollopManager_t() {};
virtual int DetermineWorstCaseInsnSize(libIRDB::Instruction_t *insn)=0;
virtual size_t DetermineWorstCaseDollopEntrySize(DollopEntry_t *entry)=0;
/*
* Add a dollop and all its fallthrough dollops
......
......@@ -48,8 +48,8 @@ class Zipr_t
/*
* These are public functions that the SDK user way want to use.
*/
virtual int DetermineWorstCaseInsnSize(libIRDB::Instruction_t*, bool account_for_jump = true) = 0;
virtual int PluginDetermineWorstCaseInsnSize(libIRDB::Instruction_t*, bool account_for_jump = true) = 0;
virtual size_t DetermineWorstCaseInsnSize(libIRDB::Instruction_t*, bool account_for_jump = true) = 0;
virtual size_t DetermineWorstCaseDollopEntrySize(DollopEntry_t*, bool account_for_jump = true) = 0;
virtual Zipr_SDK::RangeAddress_t PlopDollopEntry(
DollopEntry_t *,
......
......@@ -44,8 +44,45 @@ class ZiprPluginInterface_t
{
return 0;
}
/*
* InsnPaddingSize()
*
* A plugin that wants to put padding into a
* dollop entry before/after an instruction
* should return the size of that padding in this
* function.
*/
virtual size_t InsnPaddingSize(libIRDB::Instruction_t*, Zipr_t *)
{
return 0;
}
/*
* PlopDollopEntry()
*
* This function is invoked by Zipr for a plugin to
* plop a dollop entry. The entry to plop is given as
* the first parameter. The plugin writer can use
* it's Place() function to determine the beginning
* of the space allocated for this dollop entry.
*
* Because multiple plugins may want to plop the same
* dollop entry, the current address of the instruction
* within the entry is passed as the second parameter.
* If the plugin moves that instruction, it must update
* the parameter. In order to know the length of the
* instruction, there is the third parameter.
*
* Finally, to access the other functions that Zipr
* provides, the fourth parameter is available.
*
* As output, the implementation must provide the
* address of the memory that "concludes" the
* dollop entry.
*/
virtual RangeAddress_t PlopDollopEntry(Zipr_SDK::DollopEntry_t *,
RangeAddress_t &,
size_t,
Zipr_t *)
{
return 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment