Changeset 5006


Ignore:
Timestamp:
Aug 22, 2006, 1:02:04 AM (18 years ago)
Author:
Gary Byers
Message:

atomic_and(), pseudo_sigreturn() for DarwinX8664.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/lisp-kernel/x86-asmutils64.s

    r4980 r5006  
    102102       
    103103       
     104/* Logand the value in *rdi with the value in rsi (presumably a bitmask with exactly 1 */
     105/* bit set.)  Return the value now in *rdi (for some value of "now" */
     106
     107_exportfn(C(atomic_and))
     1080:      __(movq (%rdi), %rax)
     109        __(movq %rax,%rcx)
     110        __(and %rsi,%rcx)
     111        __(lock)
     112        __(cmpxchg %rcx,(%rdi))
     113        __(jnz 0b)
     114        __(movq %rcx,%rax)
     115        __(ret)
     116_endfn
    104117
    105118
     119        __ifdef([DARWIN])
     120_exportfn(C(pseudo_sigreturn))
     121        __(ud2b)
     122        __(jmp C(pseudo_sigreturn))
     123_endfn
     124        __endif                       
    106125
    107126/* int cpuid (int code, int *pebx, int *pecx, int *pedx)  */
     
    146165        __ifdef([DARWIN_GS_HACK])
    147166/* Check (in and ugly, non-portale way) to see if %gs is addressing
    148    threads data.  If it was, return 0; otherwise, assume that it's
     167   pthreads data.  If it was, return 0; otherwise, assume that it's
    149168   addressing a lisp tcr and set %gs to point to the tcr's tcr.osid,
    150169   then return 1. */
Note: See TracChangeset for help on using the changeset viewer.