From 12dd79b05345f85942904c3066d2cd1dadfa91c3 Mon Sep 17 00:00:00 2001
From: whh8b <whh8b@git.zephyr-software.com>
Date: Tue, 28 Jun 2016 18:46:32 +0000
Subject: [PATCH] Yet newer SDK semantics

1. There are now two functions to identify
   the size of the dollop entry.
2. The plugin must identify whether or not
   it plopped the actual instruction as
	 opposed to just bytes in the dollop entry's
	 opening and/or closing.
---
 include/zipr_plugin.h | 47 ++++++++++++++++++++++++++++---------------
 1 file changed, 31 insertions(+), 16 deletions(-)

diff --git a/include/zipr_plugin.h b/include/zipr_plugin.h
index 480386c..5c84968 100644
--- a/include/zipr_plugin.h
+++ b/include/zipr_plugin.h
@@ -45,14 +45,19 @@ class ZiprPluginInterface_t
 			return 0;
 		}
 		/*
-		 * InsnPaddingSize()
+		 * DollopEntryOpeningSize()
+		 * DollopEntryClosingSize()
 		 *
 		 * 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.
+		 * should return the size of that padding in 
+		 * these functions.
 		 */
-		virtual size_t InsnPaddingSize(libIRDB::Instruction_t*, Zipr_t *)
+		virtual size_t DollopEntryOpeningSize(DollopEntry_t*, Zipr_t *)
+		{
+			return 0;
+		}
+		virtual size_t DollopEntryClosingSize(DollopEntry_t*, Zipr_t *)
 		{
 			return 0;
 		}
@@ -66,24 +71,34 @@ class ZiprPluginInterface_t
 		 * 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.
+		 * entry: A pointer to the dollop entry to be plopped.
+		 *
+		 * instruction_address: Because multiple plugins 
+		 * may want to plop the same dollop entry, the current 
+		 * address of the instruction within the entry is 
+		 * passed in this parameter. If the plugin moves that 
+		 * instruction, it must update the parameter.
+		 *
+		 * instruction_size: The size of the instruction itself.
+		 *
+		 * placed_instruction: A flag that the plugin sets
+		 * to tell Zipr whether this plugin placed the
+		 * instruction or whether it just wrote into the entry
+		 * surrounding the instruction. The plugin should set
+		 * this value appropriately. The default is false.
 		 *
-		 * Finally, to access the other functions that Zipr
-		 * provides, the fourth parameter is available.
+		 * zipr: Pointer to a Zipr object for plugin access to
+		 * functionality provided by zipr.
 		 *
 		 * 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 *)
+		virtual RangeAddress_t PlopDollopEntry(Zipr_SDK::DollopEntry_t *entry,
+			RangeAddress_t &instruction_address,
+			size_t instruction_size,
+			bool &placed_instruction,
+			Zipr_t *zipr)
 		{
 			return 0;
 		}
-- 
GitLab