Changeset 7192


Ignore:
Timestamp:
Sep 11, 2007, 11:13:11 AM (12 years ago)
Author:
gb
Message:

No more %TRY-READ-LOCK-RWLOCK, no %UNLOCK-RWLOCK here.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/working-0709/ccl/level-0/X86/x86-misc.lisp

    r7025 r7192  
    393393;;; Return true iff we were able to increment a non-negative
    394394;;; lock._value
    395 (defx86lapfunction %try-read-lock-rwlock ((lock arg_z))
    396   (check-nargs 1)
    397   @try
    398   (movq (@ x8664::lock._value (% lock)) (% rax))
    399   (movq (% rax) (% imm1))
    400   (addq ($ '1) (% imm1))
    401   (jle @fail)
    402   (lock)
    403   (cmpxchgq (% imm1) (@ x8664::lock._value (% lock)))
    404   (jne @try)
    405   (single-value-return)                                 ; return the lock
    406 @fail
    407   (movl ($ x8664::nil-value) (%l arg_z))
    408   (single-value-return))
    409 
    410 
    411 
    412 (defx86lapfunction unlock-rwlock ((lock arg_z))
    413   (cmpq ($ 0) (@ x8664::lock._value (% lock)))
    414   (jle @unlock-write)
    415   @unlock-read
    416   (movq (@ x8664::lock._value (% lock)) (% rax))
    417   (lea (@ '-1 (% imm0)) (% imm1))
    418   (lock)
    419   (cmpxchgq (% imm1) (@ x8664::lock._value (% lock)))
    420   (jne @unlock-read)
    421   (single-value-return)
    422   @unlock-write
    423   ;;; If we aren't the writer, return NIL.
    424   ;;; If we are and the value's about to go to 0, clear the writer field.
    425   (movq (@ x8664::lock.writer (% lock)) (% imm0))
    426   (cmpq (% imm0) (@ (% :rcontext) x8664::tcr.linear))
    427   (jne @fail)
    428   (addq ($ '1) (@ x8664::lock._value (% lock)))
    429   (jne @home)
    430   (movsd (% fpzero) (@ x8664::lock.writer (% lock)))
    431   @home
    432   (single-value-return)
    433   @fail
    434   (movl ($ x8664::nil-value) (%l arg_z))
    435   (single-value-return))
     395
     396
     397
    436398
    437399(defx86lapfunction %atomic-incf-node ((by arg_x) (node arg_y) (disp arg_z))
Note: See TracChangeset for help on using the changeset viewer.