Changeset 7398 for branches/working-0710


Ignore:
Timestamp:
Oct 12, 2007, 9:29:17 AM (12 years ago)
Author:
gb
Message:

Nuke old rwlock stuff; check for deferred GC.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/working-0710/ccl/level-0/PPC/ppc-misc.lisp

    r7343 r7398  
    551551  (blr))
    552552
    553 ;;; Return true iff we were able to increment a non-negative
    554 ;;; lock._value
    555 (defppclapfunction %try-read-lock-rwlock ((lock arg_z))
    556   (check-nargs 1)
    557   (li imm1 target::lock._value)
    558   @try
    559   (lrarx imm0 lock imm1)
    560   (cmpri imm0 0)
    561   (blt @fail)                           ; locked for writing
    562   (addi imm0 imm0 '1)
    563   (strcx. imm0 lock imm1)
    564   (bne @try)                            ; lost reservation, try again
    565   (isync)
    566   (blr)                                 ; return the lock
    567 @fail
    568   (li imm0 target::reservation-discharge)
    569   (strcx. rzero rzero imm0)
    570   (li arg_z nil)
    571   (blr))
    572 
    573 
    574 
    575 (defppclapfunction unlock-rwlock ((lock arg_z))
    576   (ldr imm2 target::lock._value lock)
    577   (cmpri imm2 0)
    578   (li imm1 target::lock._value)
    579   (ble @unlock-write)
    580   @unlock-read
    581   (lrarx imm0 lock imm1)
    582   (subi imm0 imm0 '1)
    583   (strcx. imm0 lock imm1)
    584   (bne @unlock-read)
    585   (isync)
    586   (blr)
    587   @unlock-write
    588   ;;; If we aren't the writer, return NIL.
    589   ;;; If we are and the value's about to go to 0, clear the writer field.
    590   (ldr imm0 target::lock.writer lock)
    591   (cmpr imm0 target::rcontext)
    592   (ldrx imm0 lock imm1)
    593   (cmpri cr1 imm0 '-1)
    594   (addi imm0 imm0 '1)
    595   (bne @fail)
    596   (bne cr1 @noclear)
    597   (str rzero target::lock.writer lock)
    598   @noclear
    599   (str imm0 target::lock._value lock)
    600   (blr)
    601   @fail
    602   (li arg_z nil)
    603   (blr))
     553
    604554
    605555(defppclapfunction %atomic-incf-node ((by arg_x) (node arg_y) (disp arg_z))
     
    1022972  (blr))
    1023973
     974(defppclapfunction %check-deferred-gc ()
     975  (ldr imm0 target::tcr.flags target::rcontext)
     976  (slri. imm0 imm0 (- (1- target::nbits-in-word) (+ arch::tcr-flag-bit-pending-suspend target::fixnumshift)))
     977  (li arg_z nil)
     978  (bgelr)
     979  (uuo_interr arch::error-propagate-suspend rzero)
     980  (li arg_z t)
     981  (blr))
     982 
    1024983
    1025984; end of ppc-misc.lisp
Note: See TracChangeset for help on using the changeset viewer.