Changeset 8230


Ignore:
Timestamp:
Jan 20, 2008, 10:47:13 PM (12 years ago)
Author:
andreas
Message:

PPC support for atomic pop from the list of static conses. Completely
untested.

Location:
trunk/source
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-0/PPC/ppc-misc.lisp

    r7624 r8230  
    980980  (li arg_z t)
    981981  (blr))
     982
     983(defppclapfunction %atomic-pop-static-cons ()
     984  (li imm0 (+ target::nil-value (target::kernel-global static-conses)))
     985  @again
     986  (lrarx arg_z rzero imm0)
     987  (cmpri arg_z target::nil-value)
     988  (be @lose)
     989  (%cdr arg_z arg_y)
     990  (strcx. arg_y rzero imm0)
     991  (bne @again)
     992  @lose
     993  (blr))
    982994 
    983995
  • trunk/source/lib/misc.lisp

    r8229 r8230  
    824824  (gc))
    825825
    826 (defmacro atomic-pop-kernel-global (place)
    827   "Pops an cons cell off a kernel global, in a way that's atomic w.r.t.
    828    garbage collection.  Uses gc-lock a.t.m., which is too
    829    expensive."
    830   `(without-interrupts
    831      (%lock-gc-lock)
    832      (let ((value (%get-kernel-global ,place)))
    833        (%set-kernel-global ,place (cdr value))
    834        (%unlock-gc-lock)
    835        value)))
    836 
    837826(defun static-cons (car-value cdr-value)
    838827  "Allocates a cons cell that doesn't move on garbage collection,
     
    841830  (when (eq (%get-kernel-global 'static-conses) 0)
    842831    (initialize-static-cons))
    843   (let ((cell #-x8664-target (atomic-pop-kernel-global 'static-conses)
    844               #+x8664-target (%atomic-pop-static-cons)))
     832  (let ((cell (%atomic-pop-static-cons)))
    845833    (if cell
    846834      (progn
Note: See TracChangeset for help on using the changeset viewer.