aboutsummaryrefslogtreecommitdiff
path: root/target-sparc/cpu.h
diff options
context:
space:
mode:
authorTsuneo Saito <tsnsaito@gmail.com>2011-07-22 00:16:27 +0900
committerBlue Swirl <blauwirbel@gmail.com>2011-07-21 19:57:12 +0000
commit06e12b6503d08bbc27f256b9f5d7d211420b3c41 (patch)
treeccb1860874fcb0063f0022674892e9f823040c79 /target-sparc/cpu.h
parent6c916eda22e7ef180bb2dd183bbef85f9ff006c6 (diff)
downloadqemu-06e12b6503d08bbc27f256b9f5d7d211420b3c41.zip
qemu-06e12b6503d08bbc27f256b9f5d7d211420b3c41.tar.gz
qemu-06e12b6503d08bbc27f256b9f5d7d211420b3c41.tar.bz2
SPARC64: TTE bits cleanup
Add macros for TTE bits and modify to use macros instead of magic numbers. Signed-off-by: Tsuneo Saito <tsnsaito@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'target-sparc/cpu.h')
-rw-r--r--target-sparc/cpu.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/target-sparc/cpu.h b/target-sparc/cpu.h
index 0084b67..b2160e9 100644
--- a/target-sparc/cpu.h
+++ b/target-sparc/cpu.h
@@ -292,16 +292,23 @@ enum {
#define TTE_VALID_BIT (1ULL << 63)
#define TTE_USED_BIT (1ULL << 41)
#define TTE_LOCKED_BIT (1ULL << 6)
+#define TTE_PRIV_BIT (1ULL << 2)
+#define TTE_W_OK_BIT (1ULL << 1)
#define TTE_GLOBAL_BIT (1ULL << 0)
#define TTE_IS_VALID(tte) ((tte) & TTE_VALID_BIT)
#define TTE_IS_USED(tte) ((tte) & TTE_USED_BIT)
#define TTE_IS_LOCKED(tte) ((tte) & TTE_LOCKED_BIT)
+#define TTE_IS_PRIV(tte) ((tte) & TTE_PRIV_BIT)
+#define TTE_IS_W_OK(tte) ((tte) & TTE_W_OK_BIT)
#define TTE_IS_GLOBAL(tte) ((tte) & TTE_GLOBAL_BIT)
#define TTE_SET_USED(tte) ((tte) |= TTE_USED_BIT)
#define TTE_SET_UNUSED(tte) ((tte) &= ~TTE_USED_BIT)
+#define TTE_PGSIZE(tte) (((tte) >> 61) & 3ULL)
+#define TTE_PA(tte) ((tte) & 0x1ffffffe000ULL)
+
typedef struct SparcTLBEntry {
uint64_t tag;
uint64_t tte;