[Openmcl-devel] Help with lapfunctions

Taoufik Dachraoui dachraoui.taoufik at gmail.com
Thu Jan 9 07:10:04 PST 2014


Hi

Can someone help me correcting the following lapfunctions:

(ccl::defx86lapfunction acquire-lock-xchg ((addr arg_y) (offset arg_z))
       load addr into temp0 ;  32 bits words
                                   (or (% temp0) ($ (ash 1 offset))) ; set
bit at offset  (is there set nth bit instr?)
   @again
       (xchgl (% temp0) (@ addr))
       test temp0 if bit at offset is not set then win
       (jz @win)
       (pause)
       (jmp @again)
     @win
      (ret))

(ccl::defx86lapfunction free-lock-xchg ((addr arg_x) (offset arg_z))
       load addr into temp0 ;  32 bits words
                                   (and (% temp0) ($ (- #xFFFFFFFF (ash 1
offset)))) ; reset bit at offset   (is there set nth bit instr?)

       (xchgl (% temp0) (@ addr))
       (ret))

Kind regards
Taoufik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clozure.com/pipermail/openmcl-devel/attachments/20140109/95858b80/attachment.htm>


More information about the Openmcl-devel mailing list