diff --git a/include/dollop_man.h b/include/dollop_man.h index e177e17f48cb5c54acc723392d47be010d8fb3bd..370c95c35237c927b471325ca9a130e676542195 100644 --- a/include/dollop_man.h +++ b/include/dollop_man.h @@ -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 diff --git a/include/zipr.h b/include/zipr.h index 300ebe6a95653b5eb774f64bfc2b19aa11332d33..350d6e68740997faaba94acbbce20e4719e682b0 100644 --- a/include/zipr.h +++ b/include/zipr.h @@ -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 *, diff --git a/include/zipr_plugin.h b/include/zipr_plugin.h index 1c7f82642fd3f29bd1303c9937ca284eeb9cc632..480386c18d63d921d52a55be401e67355b1cefd5 100644 --- a/include/zipr_plugin.h +++ b/include/zipr_plugin.h @@ -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;