<div dir="ltr">Hi<div><br></div><div>Can someone help me correcting the following lapfunctions:</div><div><br></div><div><div>(ccl::defx86lapfunction acquire-lock-xchg ((addr arg_y) (offset arg_z))</div><div> load addr into temp0 ; 32 bits words (or (% temp0) ($ (ash 1 offset))) ; set bit at offset (is there set nth bit instr?) </div>
<div> @again</div><div> (xchgl (% temp0) (@ addr))<br></div><div> test temp0 if bit at offset is not set then win</div><div> (jz @win)</div><div> (pause)<br></div><div> (jmp @again)</div><div>
@win<br></div><div> (ret))</div><div><br></div><div>(ccl::defx86lapfunction free-lock-xchg ((addr arg_x) (offset arg_z))</div><div> load addr into temp0 ; 32 bits words (and (% temp0) ($ (- #xFFFFFFFF (ash 1 offset)))) ; reset bit at offset (is there set nth bit instr?) </div>
<div> (xchgl (% temp0) (@ addr))</div><div> (ret))</div></div><div><br></div><div>Kind regards</div><div>Taoufik</div><div><br></div></div>