Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • opensrc/zipr-sdk
1 result
Show changes
Commits on Source (1)
0.09j
0.9
namespace Zipr_SDK
{
enum
{
DEFAULT_TRAMPOLINE_SIZE=5
};
};
......@@ -12,7 +12,6 @@ namespace Zipr_SDK
using DollopEntryList_t = list<DollopEntry_t*>;
class Placeable_t
{
protected:
......@@ -27,21 +26,6 @@ namespace Zipr_SDK
friend ostream &operator<<(ostream &, const Placeable_t &);
};
class DollopPatch_t : virtual public Placeable_t
{
protected:
DollopPatch_t() { }
DollopPatch_t(const DollopPatch_t& copy) = delete;
public:
virtual ~DollopPatch_t() { }
virtual Dollop_t* getTarget() const = 0 ;
virtual void setTarget(Dollop_t *target) = 0 ;
friend ostream &operator<<(ostream &, const DollopPatch_t &);
};
class DollopEntry_t : virtual public Placeable_t
{
protected:
......@@ -50,8 +34,8 @@ namespace Zipr_SDK
public:
virtual ~DollopEntry_t() { }
virtual void setTargetDollop(Dollop_t *target) = 0 ;
virtual void MemberOfDollop(Dollop_t *member_of) = 0 ;
virtual void setTargetDollop(Dollop_t *target) = 0 ;
virtual void MemberOfDollop(Dollop_t *member_of) = 0 ;
virtual Instruction_t* getInstruction() const = 0 ;
virtual Dollop_t* getTargetDollop() const = 0 ;
......
......@@ -11,8 +11,6 @@ namespace Zipr_SDK
using DollopList_t = set<Dollop_t*>;
using InsnToDollopMap_t = map<Instruction_t*,Dollop_t*>;
using DollopPatchList_t = list<DollopPatch_t*>;
using DollopToDollopPatchListMap_t = map<Dollop_t*, DollopPatchList_t >;
class DollopManager_t
......@@ -29,6 +27,7 @@ namespace Zipr_SDK
* to the dollop manager.
*/
virtual void addDollops(Dollop_t *dollop_head)=0;
/*
* Create new dollops from a particular start instruction.
*/
......@@ -44,16 +43,6 @@ namespace Zipr_SDK
*/
virtual Dollop_t *getContainingDollop( Instruction_t *insn)=0;
/*
* Add a dollop patch to the dollop manager.
*/
virtual void addDollopPatch(DollopPatch_t *new_patch) = 0;
/*
* Return all the patches that point to a particular
* dollop.
*/
virtual DollopPatchList_t getPatchesToDollop( Dollop_t *target)=0;
/*
* Update the dollops under management based on the
* targetted dollops in a particular dollop.
......@@ -74,26 +63,7 @@ namespace Zipr_SDK
virtual DollopList_t::iterator dollops_begin() = 0;
virtual DollopList_t::iterator dollops_end() = 0;
/*
* Print (for debugging) all the dollop patches
* under management.
*/
virtual void printDollopPatches(const ostream &) = 0;
/*
* Print (useful output for end user) information about
* statistics of the dollop manager and the job it is
* doing.
*/
virtual void printStats(ostream &out) = 0;
/*
* Generate a placement map file for all the dollops under management.
*/
virtual void printPlacementMap(const MemorySpace_t &memory_space,
const string &map_filename) = 0;
/* helper */
/* Figure out how much space an instruction will take */
virtual size_t determineDollopEntrySize(DollopEntry_t *entry)=0;
/*
......
......@@ -36,12 +36,12 @@ namespace Zipr_SDK
public:
virtual ~ZiprTypedOption_t() { }
// Cast the option to it's type (e.g., string or bool)
virtual T getValue() const = 0;
virtual operator T() const = 0;
};
class ZiprStringOption_t : virtual public ZiprTypedOption_t<string>
{
protected:
......@@ -75,7 +75,6 @@ namespace Zipr_SDK
};
class ZiprDoubleOption_t : public ZiprTypedOption_t<double>
{
protected:
......@@ -115,5 +114,4 @@ namespace Zipr_SDK
};
}
namespace Zipr_SDK
{
using namespace std;
using RangeAddress_t = uintptr_t ;
// Note: Unlike other Zipr SDK classes, this is copyable, assignable, etc.
// i.e., this is not a pure virtual class.
class Range_t
{
public:
Range_t(RangeAddress_t p_s, RangeAddress_t p_e) : m_start(p_s), m_end(p_e) { }
Range_t() : m_start(0), m_end(0) { }
virtual ~Range_t() {}
virtual RangeAddress_t getStart() const { return m_start; }
virtual RangeAddress_t getEnd() const { return m_end; }
virtual void setStart(RangeAddress_t s) { m_start=s; }
virtual void setEnd(RangeAddress_t e) { m_end=e; }
virtual bool is2ByteRange()
{
return (m_end - m_start) == 2;
};
virtual bool is5ByteRange()
{
return (m_end - m_start) == 5;
};
virtual bool isInfiniteRange()
{
return m_end==(RangeAddress_t)-1;
};
Range_t(RangeAddress_t p_s, RangeAddress_t p_e);
Range_t(); // zero init
protected:
virtual ~Range_t();
virtual RangeAddress_t getStart() const;
virtual RangeAddress_t getEnd() const;
virtual bool is2ByteRange() const;
virtual bool is5ByteRange() const;
virtual bool isInfiniteRange() const;
virtual void setStart(RangeAddress_t s);
virtual void setEnd(RangeAddress_t e);
protected:
RangeAddress_t m_start, m_end;
};
// useful for putting Range_t's in containers (sets, etc).
struct Range_tCompare
{
bool operator() (const Range_t first, const Range_t second) const
{
return first.getEnd() < second.getStart();
}
// Caution! Only works for NON-OVERLAPPING ranges.
bool operator() (const Range_t first, const Range_t second) const;
};
}
......@@ -26,19 +26,6 @@ namespace Zipr_SDK
DollopEntry_t*,
bool account_for_fallthrough) = 0;
virtual RangeAddress_t plopDollopEntry(
DollopEntry_t *,
RangeAddress_t = 0,
RangeAddress_t = 0) = 0;
virtual RangeAddress_t plopDollopEntryWithTarget(
DollopEntry_t *,
RangeAddress_t = 0,
RangeAddress_t = 0) = 0;
virtual RangeAddress_t plopDollopEntryWithCallback(
DollopEntry_t *,
RangeAddress_t = 0) = 0;
virtual void applyPatch(
RangeAddress_t from_addr,
RangeAddress_t to_addr) = 0;
......