Changeset 18e0a6c in mainline for arch/ia32/src/atomic.S


Ignore:
Timestamp:
2005-06-09T23:43:45Z (20 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
74df77d
Parents:
d896525
Message:

Implement several assembler functions in gcc's asm notation instead of in .s or .S file.
Gain both better speed and size.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • arch/ia32/src/atomic.S

    rd896525 r18e0a6c  
    2929.text
    3030
    31 .global atomic_inc
    32 atomic_inc:
    33         pushl %ebx
    34         movl 8(%esp),%ebx
    35 #ifdef __SMP__ 
    36         lock incl (%ebx)
    37 #else
    38         incl (%ebx)
    39 #endif         
    40         popl %ebx
    41         ret
    42 
    43 .global atomic_dec
    44 atomic_dec:
    45         pushl %ebx
    46         movl 8(%esp),%ebx
    47 #ifdef __SMP__ 
    48         lock decl (%ebx)
    49 #else
    50         decl (%ebx)
    51 #endif
    52         popl %ebx
    53         ret
    54        
    55 
    5631#ifdef __SMP__
    5732
    58 
    59 .global test_and_set
    6033.global spinlock_arch
    61 
    62 test_and_set:
    63         pushl %ebx
    64    
    65         movl 8(%esp),%ebx
    66         movl $1,%eax
    67         xchgl %eax,(%ebx)       # xchg implicitly turns on the LOCK signal
    68    
    69         popl %ebx
    70         ret
    71 
    7234
    7335#
Note: See TracChangeset for help on using the changeset viewer.