Ignore:
Timestamp:
Jun 29, 2017, 2:27:35 PM (7 years ago)
Author:
max@…
Message:

add the and/or ops

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/hal/x86_64/core/hal_cpu.S

    r97 r98  
    111111        ret
    112112
     113ASM_ENTRY(atomic_and_32)
     114        movl    (%rdi),%eax
     1151:
     116        movl    %eax,%ecx
     117        andl    %esi,%ecx
     118        lock
     119        cmpxchgl %ecx,(%rdi)
     120        jnz     1b
     121        /* %eax now contains the old value */
     122        ret
     123
     124ASM_ENTRY(atomic_or_32)
     125        movl    (%rdi),%eax
     1261:
     127        movl    %eax,%ecx
     128        orl     %esi,%ecx
     129        lock
     130        cmpxchgl %ecx,(%rdi)
     131        jnz     1b
     132        /* %eax now contains the old value */
     133        ret
     134
Note: See TracChangeset for help on using the changeset viewer.