diff options
author | Igor V. Kovalenko <igor.v.kovalenko@gmail.com> | 2010-05-04 23:15:41 +0400 |
---|---|---|
committer | Blue Swirl <blauwirbel@gmail.com> | 2010-05-06 20:13:36 +0000 |
commit | 299b520cd4092be3c53f8380b81315c33927d9d3 (patch) | |
tree | 3c37f5188ec41e70558cb18b9f940fbd81a782cd /target-sparc/cpu.h | |
parent | 788686ec59bb8277ff70ae3853a0720c8b2b865d (diff) |
sparc64: implement global translation table entries v1
- match global tte against any context
- show global tte in MMU dump
v0->v1: added default case to switch statement in demap_tlb
- should fix gcc warning about uninitialized context variable
Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'target-sparc/cpu.h')
-rw-r--r-- | target-sparc/cpu.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/target-sparc/cpu.h b/target-sparc/cpu.h index 0e7f39059d..b7057282b8 100644 --- a/target-sparc/cpu.h +++ b/target-sparc/cpu.h @@ -513,6 +513,24 @@ static inline void cpu_set_cwp(CPUSPARCState *env1, int new_cwp) /* sun4m.c, sun4u.c */ void cpu_check_irqs(CPUSPARCState *env); +#if defined (TARGET_SPARC64) + +static inline int compare_masked(uint64_t x, uint64_t y, uint64_t mask) +{ + return (x & mask) == (y & mask); +} + +#define MMU_CONTEXT_BITS 13 +#define MMU_CONTEXT_MASK ((1 << MMU_CONTEXT_BITS) - 1) + +static inline int tlb_compare_context(const SparcTLBEntry *tlb, + uint64_t context) +{ + return compare_masked(context, tlb->tag, MMU_CONTEXT_MASK); +} + +#endif + static inline void PUT_PSR(CPUSPARCState *env1, target_ulong val) { env1->psr = val & PSR_ICC; |