summaryrefslogtreecommitdiff
path: root/src/base/bitfield.hh
diff options
context:
space:
mode:
authorAli Saidi <saidi@eecs.umich.edu>2007-02-18 19:57:46 -0500
committerAli Saidi <saidi@eecs.umich.edu>2007-02-18 19:57:46 -0500
commitbd367d4825e26ab3f8e01f3b4bdb914bb0ef756a (patch)
treed7969c7a0dc5eb9097280ad1e56cca8048a6b0ed /src/base/bitfield.hh
parentb2fd2a813d75815ed2ceaa447590986a29ee99b8 (diff)
downloadgem5-bd367d4825e26ab3f8e01f3b4bdb914bb0ef756a.tar.xz
implement vtophys and 32bit gdb support
src/arch/alpha/vtophys.cc: src/arch/alpha/vtophys.hh: src/arch/sparc/arguments.hh: move Copy* to vport since it's generic for all the ISAs src/arch/sparc/isa_traits.hh: the Solaris kernel sets up a virtual-> real mapping for all memory starting at SegKPMBase src/arch/sparc/pagetable.hh: add a class for getting bits out of the TteTag src/arch/sparc/remote_gdb.cc: add 32bit support kinda.... If its 32 bit src/arch/sparc/remote_gdb.hh: Add 32bit register offsets too. src/arch/sparc/tlb.cc: cleanup generation of tsb pointers src/arch/sparc/tlb.hh: add function to return tsb pointers for an address make lookup public so vtophys can use it src/arch/sparc/vtophys.cc: src/arch/sparc/vtophys.hh: write vtophys for sparc src/base/bitfield.hh: return a mask of bits first->last src/mem/vport.cc: src/mem/vport.hh: move Copy* here since it's ISA generic --HG-- extra : convert_revision : c42c331e396c0d51a2789029d8e232fe66995d0f
Diffstat (limited to 'src/base/bitfield.hh')
-rw-r--r--src/base/bitfield.hh7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/base/bitfield.hh b/src/base/bitfield.hh
index 1fc0bad5d..0f1233677 100644
--- a/src/base/bitfield.hh
+++ b/src/base/bitfield.hh
@@ -44,6 +44,7 @@ mask(int nbits)
}
+
/**
* Extract the bitfield from position 'first' to 'last' (inclusive)
* from 'val' and right justify it. MSB is numbered 63, LSB is 0.
@@ -69,6 +70,12 @@ mbits(T val, int first, int last)
return val & (mask(first+1) & ~mask(last));
}
+inline uint64_t
+mask(int first, int last)
+{
+ return mbits((uint64_t)-1LL, first, last);
+}
+
/**
* Sign-extend an N-bit value to 64 bits.
*/