From ada42911f92def477368edfbd47d815c4a3a2721 Mon Sep 17 00:00:00 2001
From: whh8b <whh8b@git.zephyr-software.com>
Date: Tue, 19 May 2015 02:50:13 +0000
Subject: [PATCH] Initial Halt Protection SDK patches.

---
 include/memory_space.h |  2 +-
 include/range.h        | 12 +++++++++---
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/include/memory_space.h b/include/memory_space.h
index a4edf6d..e2a168c 100644
--- a/include/memory_space.h
+++ b/include/memory_space.h
@@ -48,7 +48,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 void AddFreeRange(Range_t newRange)=0;
+		virtual void AddFreeRange(Range_t newRange, bool phantom=false)=0;
 
 		// queries about free areas.
 		virtual bool AreBytesFree(RangeAddress_t addr, int num_bytes)=0;
diff --git a/include/range.h b/include/range.h
index 3dae538..43c352a 100644
--- a/include/range.h
+++ b/include/range.h
@@ -41,13 +41,15 @@ typedef uintptr_t RangeAddress_t;
 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) { }
+		Range_t(RangeAddress_t p_s, RangeAddress_t p_e, bool phantom=false)
+			: m_start(p_s), m_end(p_e), m_phantom(phantom) { }
+		Range_t() : m_start(0), m_end(0), m_phantom(false) { }
 
 		virtual RangeAddress_t GetStart() const { return m_start; }
 		virtual RangeAddress_t GetEnd() const { return m_end; }
 		virtual RangeAddress_t SetStart(RangeAddress_t s) { m_start=s; }
 		virtual RangeAddress_t SetEnd(RangeAddress_t e) { m_end=e; }
+		virtual void SetPhantom(bool phantom) { m_phantom = phantom; };
 
 		virtual bool Is2ByteRange()
 		{
@@ -57,9 +59,13 @@ class Range_t
 		{
 			return (m_end - m_start) == 5;
 		};
+		virtual bool IsPhantom()
+		{
+			return m_phantom;
+		};
 
 	protected:
-
+		bool m_phantom;
 		RangeAddress_t m_start, m_end;
 };
 
-- 
GitLab