On 01/23/2012 06:29 PM, Scott Wood wrote:
On 01/20/2012 10:15 PM, Alexander Graf wrote:
+/* returns bitmap of supported page sizes for a given TLB */
+static inline uint32_t booke206_tlbnps(CPUState *env, const int tlbn)
+{
+ bool mav2 = false;
+ uint32_t ret = 0;
+
+ if (mav2) {
+ ret = env->spr[SPR_BOOKE_TLB0PS + tlbn];
+ } else {
+ uint32_t tlbncfg = env->spr[SPR_BOOKE_TLB0CFG + tlbn];
+ uint32_t min = (tlbncfg& TLBnCFG_MINSIZE)>> TLBnCFG_MINSIZE_SHIFT;
+ uint32_t max = (tlbncfg& TLBnCFG_MAXSIZE)>> TLBnCFG_MAXSIZE_SHIFT;
+ int i;
+ for (i = min; i<= max; i++) {
+ ret |= (1<< (i<< 1));
+ }
+ }
For mav1 only the even sizes are supported.
Yes, which is why min and max are >> 1 compared to the MAV2 values.
Alex