diff --git a/.gitattributes b/.gitattributes index 14ce7d747b58b352fa71d04e97e6ebf0e7eb4a13..45b1e8f6aaa3130b68d5cc4742abb2701efcae5d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,6 +1,7 @@ * text=auto !eol /README -text /SDK_VERSION -text +include/dollop.h -text include/memory_space.h -text include/range.h -text include/zipr.h -text diff --git a/include/dollop.h b/include/dollop.h new file mode 100644 index 0000000000000000000000000000000000000000..4b8a8a80b98991305049ec4d020df73f0cb9347e --- /dev/null +++ b/include/dollop.h @@ -0,0 +1,46 @@ +/*************************************************************************** + * Copyright (c) 2014 Zephyr Software LLC. All rights reserved. + * + * This software is furnished under a license and/or other restrictive + * terms and may be used and copied only in accordance with such terms + * and the inclusion of the above copyright notice. This software or + * any other copies thereof may not be provided or otherwise made + * available to any other person without the express written consent + * of an authorized representative of Zephyr Software LCC. Title to, + * ownership of, and all rights in the software is retained by + * Zephyr Software LCC. + * + * Zephyr Software LLC. Proprietary Information + * + * Unless otherwise specified, the information contained in this + * directory, following this legend, and/or referenced herein is + * Zephyr Software LLC. (Zephyr) Proprietary Information. + * + * CONTACT + * + * For technical assistance, contact Zephyr Software LCC. at: + * + * + * Zephyr Software, LLC + * 2040 Tremont Rd + * Charlottesville, VA 22911 + * + * E-mail: jwd@zephyr-software.com + **************************************************************************/ + +#ifndef dollop_h +#define dollop_h + +namespace Zipr_SDK +{ +class Dollop_t { + public: + Dollop_t(libIRDB::Instruction_t *start); + size_t GetSize() const { return m_size; } + private: + size_t CalculateWorstCaseSize(); + size_t m_size; + libIRDB::Instruction_t *m_start; +}; +} +#endif diff --git a/include/memory_space.h b/include/memory_space.h index fa263b9f67936c6d2ca5a02c55ab0263c8259ca1..d77af98ea09e6234b4fa1a58002041279f79a1bf 100644 --- a/include/memory_space.h +++ b/include/memory_space.h @@ -47,6 +47,7 @@ class MemorySpace_t : public std::map<RangeAddress_t,char> virtual void MergeFreeRange(RangeAddress_t addr)=0; virtual RangeSet_t::iterator FindFreeRange(RangeAddress_t addr)=0; virtual Range_t GetFreeRange(int size)=0; + virtual Range_t GetNearbyFreeRange(const RangeAddress_t hint)=0; virtual void AddFreeRange(Range_t newRange)=0; virtual void RemoveFreeRange(Range_t newRange)=0; diff --git a/include/zipr_plugin.h b/include/zipr_plugin.h index 1034c42245b40f940a7659a5f09c020463ca850f..1e463d894fb74cc5b1279b4b6f3cb2f61a79563b 100644 --- a/include/zipr_plugin.h +++ b/include/zipr_plugin.h @@ -3,6 +3,10 @@ namespace Zipr_SDK { typedef std::map<libIRDB::Instruction_t*,Zipr_SDK::RangeAddress_t> InstructionLocationMap_t; +enum ZiprPreference { + None, + Must, +}; class Zipr_t; class ZiprPluginInterface_t @@ -27,6 +31,12 @@ class ZiprPluginInterface_t { } + virtual ZiprPreference PlopAddress( + const RangeAddress_t &jump, const Dollop_t &dollop, Range_t &place) + { + return ZiprPreference::None; + } + virtual bool WillPluginPlop(libIRDB::Instruction_t*) { return false; diff --git a/include/zipr_sdk.h b/include/zipr_sdk.h index c61446011796b374a85ef48a97e71eb4b152f640..831f5ad2ac83a71d05f3f2e76ac21ae9c1024ff7 100644 --- a/include/zipr_sdk.h +++ b/include/zipr_sdk.h @@ -48,6 +48,7 @@ // SDK internals #include <range.h> +#include <dollop.h> #include <memory_space.h> #include <zipr_options.h> #include <zipr_plugin.h>