]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/ppc/hw_vm.s
xnu-1486.2.11.tar.gz
[apple/xnu.git] / osfmk / ppc / hw_vm.s
index a85ed3c9f81134913f523064128a8aad609790db..bcad7dad23da773ce954b84097d4ab2e1edb8e52 100644 (file)
@@ -270,9 +270,16 @@ hamGotX:   mr              r3,r28                                          ; Get the pmap to insert into
                        lhz             r8,mpSpace(r31)                         ; Get the address space
                        lwz             r11,lgpPcfg(r11)                        ; Get the page config
                        mfsdr1  r7                                                      ; Get the hash table base/bounds
+
                        lwz             r4,pmapResidentCnt(r28)         ; Get the mapped page count 
+                       lwz     r12,pmapResidentMax(r28)                ; r12 = pmap->stats.resident_max
+                       addi    r4,r4,1                                         ; Bump up the mapped page count
+                       stw             r4,pmapResidentCnt(r28)         ; Set the mapped page count
+                       cmplw   r12,r4                                  ; if pmap->stats.resident_max >= pmap->stats.resident_count
+                       bge+    hamSkipMax                              ;       goto hamSkipResMax
+                       stw     r4,pmapResidentMax(r28)                 ; pmap->stats.resident_max = pmap->stats.resident_count
                        
-                       andi.   r0,r24,mpType                           ; Is this a normal mapping?
+hamSkipMax:            andi.   r0,r24,mpType                           ; Is this a normal mapping?
 
                        rlwimi  r8,r8,14,4,17                           ; Double address space
                        rlwinm  r9,r30,0,4,31                           ; Clear segment
@@ -280,10 +287,9 @@ hamGotX:   mr              r3,r28                                          ; Get the pmap to insert into
                        rlwimi  r8,r8,28,0,3                            ; Get the last nybble of the hash
                        rlwimi  r10,r29,18,0,13                         ; Shift EA[18:31] down to VSID (31-bit math works because of max hash table size)                       
                        rlwinm  r7,r7,0,16,31                           ; Isolate length mask (or count)
-                       addi    r4,r4,1                                         ; Bump up the mapped page count
                        srw             r9,r9,r11                                       ; Isolate just the page index
                        xor             r10,r10,r8                                      ; Calculate the low 32 bits of the VSID
-                       stw             r4,pmapResidentCnt(r28)         ; Set the mapped page count 
+
                        xor             r9,r9,r10                                       ; Get the hash to the PTEG
                        
                        bne--   hamDoneNP                                       ; Not a normal mapping, therefore, no physent...
@@ -5464,7 +5470,7 @@ isInv1:           lwz             r4,pmapCCtl(r3)                         ; Get the segment cache control
 ;                              We are in the exception vectors
 ;                              pf64Bitb is set up
 ;                              R3 contains the MSR we going to
-;                              We can not use R4, R13, R20, R21, R29
+;                              We can not use R4, R13, R20, R21, R25, R26, R29
 ;                              R13 is the savearea
 ;                              R29 has the per_proc
 ;