summaryrefslogtreecommitdiff
path: root/src/base/types.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/base/types.hh')
-rw-r--r--src/base/types.hh22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/base/types.hh b/src/base/types.hh
index 30b2d9258..5ce778572 100644
--- a/src/base/types.hh
+++ b/src/base/types.hh
@@ -67,6 +67,28 @@ const Tick MaxTick = LL(0x7fffffffffffffff);
*/
typedef uint64_t Addr;
+typedef uint16_t MicroPC;
+
+static const MicroPC MicroPCRomBit = 1 << (sizeof(MicroPC) * 8 - 1);
+
+static inline MicroPC
+romMicroPC(MicroPC upc)
+{
+ return upc | MicroPCRomBit;
+}
+
+static inline MicroPC
+normalMicroPC(MicroPC upc)
+{
+ return upc & ~MicroPCRomBit;
+}
+
+static inline bool
+isRomMicroPC(MicroPC upc)
+{
+ return MicroPCRomBit & upc;
+}
+
const Addr MaxAddr = (Addr)-1;
/**