|
|
|
@ -2,8 +2,16 @@
|
|
|
|
|
|
|
|
|
|
#include <asm/common.h>
|
|
|
|
|
|
|
|
|
|
/* int arch_atom_read(const atom_t *atom) */
|
|
|
|
|
ASM_ENTRY(arch_atom_read)
|
|
|
|
|
/*
|
|
|
|
|
* These routines are only really used if debugging is enabled, where everything
|
|
|
|
|
* is compiled with -O0. Otherwise clang would just take the inline definitions
|
|
|
|
|
* from the header file (what an elegant way of creating bugs that only appear
|
|
|
|
|
* in optimized code!). Therefore, we sacrifice a bit of performance for the
|
|
|
|
|
* sake of being nicer to gdb by creating frame pointers.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/* int atom_read(const atom_t *atom) */
|
|
|
|
|
ASM_ENTRY(atom_read)
|
|
|
|
|
push %ebp
|
|
|
|
|
mov %esp, %ebp
|
|
|
|
|
|
|
|
|
@ -12,10 +20,10 @@ ASM_ENTRY(arch_atom_read)
|
|
|
|
|
|
|
|
|
|
pop %ebp
|
|
|
|
|
ret
|
|
|
|
|
ASM_END(arch_atom_read)
|
|
|
|
|
ASM_END(atom_read)
|
|
|
|
|
|
|
|
|
|
/* int arch_atom_write(atom_t *atom, int val) */
|
|
|
|
|
ASM_ENTRY(arch_atom_write)
|
|
|
|
|
/* int atom_write(atom_t *atom, int val) */
|
|
|
|
|
ASM_ENTRY(atom_write)
|
|
|
|
|
push %ebp
|
|
|
|
|
mov %esp, %ebp
|
|
|
|
|
|
|
|
|
@ -28,10 +36,10 @@ ASM_ENTRY(arch_atom_write)
|
|
|
|
|
|
|
|
|
|
pop %ebp
|
|
|
|
|
ret
|
|
|
|
|
ASM_END(arch_atom_write)
|
|
|
|
|
ASM_END(atom_write)
|
|
|
|
|
|
|
|
|
|
/* bool arch_atom_inc(atom_t *atom) */
|
|
|
|
|
ASM_ENTRY(arch_atom_inc)
|
|
|
|
|
/* bool atom_inc(atom_t *atom) */
|
|
|
|
|
ASM_ENTRY(atom_inc)
|
|
|
|
|
push %ebp
|
|
|
|
|
mov %esp, %ebp
|
|
|
|
|
|
|
|
|
@ -43,10 +51,10 @@ ASM_ENTRY(arch_atom_inc)
|
|
|
|
|
|
|
|
|
|
pop %ebp
|
|
|
|
|
ret
|
|
|
|
|
ASM_END(arch_atom_inc)
|
|
|
|
|
ASM_END(atom_inc)
|
|
|
|
|
|
|
|
|
|
/* bool arch_atom_dec(atom_t *atom) */
|
|
|
|
|
ASM_ENTRY(arch_atom_dec)
|
|
|
|
|
/* bool atom_dec(atom_t *atom) */
|
|
|
|
|
ASM_ENTRY(atom_dec)
|
|
|
|
|
push %ebp
|
|
|
|
|
mov %esp, %ebp
|
|
|
|
|
|
|
|
|
@ -58,10 +66,10 @@ ASM_ENTRY(arch_atom_dec)
|
|
|
|
|
|
|
|
|
|
pop %ebp
|
|
|
|
|
ret
|
|
|
|
|
ASM_END(arch_atom_dec)
|
|
|
|
|
ASM_END(atom_dec)
|
|
|
|
|
|
|
|
|
|
/* int arch_atom_add(atom_t *atom, int val) */
|
|
|
|
|
ASM_ENTRY(arch_atom_add)
|
|
|
|
|
/* int atom_add(atom_t *atom, int val) */
|
|
|
|
|
ASM_ENTRY(atom_add)
|
|
|
|
|
push %ebp
|
|
|
|
|
mov %esp, %ebp
|
|
|
|
|
|
|
|
|
@ -72,10 +80,10 @@ ASM_ENTRY(arch_atom_add)
|
|
|
|
|
|
|
|
|
|
pop %ebp
|
|
|
|
|
ret
|
|
|
|
|
ASM_END(arch_atom_add)
|
|
|
|
|
ASM_END(atom_add)
|
|
|
|
|
|
|
|
|
|
/* int arch_atom_sub(atom_t *atom, int val) */
|
|
|
|
|
ASM_ENTRY(arch_atom_sub)
|
|
|
|
|
/* int atom_sub(atom_t *atom, int val) */
|
|
|
|
|
ASM_ENTRY(atom_sub)
|
|
|
|
|
push %ebp
|
|
|
|
|
mov %esp, %ebp
|
|
|
|
|
|
|
|
|
@ -89,10 +97,10 @@ ASM_ENTRY(arch_atom_sub)
|
|
|
|
|
|
|
|
|
|
pop %ebp
|
|
|
|
|
ret
|
|
|
|
|
ASM_END(arch_atom_sub)
|
|
|
|
|
ASM_END(atom_sub)
|
|
|
|
|
|
|
|
|
|
/* int arch_atom_and(atom_t *atom, int val) */
|
|
|
|
|
ASM_ENTRY(arch_atom_and)
|
|
|
|
|
/* int atom_and(atom_t *atom, int val) */
|
|
|
|
|
ASM_ENTRY(atom_and)
|
|
|
|
|
push %ebp
|
|
|
|
|
mov %esp, %ebp
|
|
|
|
|
|
|
|
|
@ -107,10 +115,10 @@ ASM_ENTRY(arch_atom_and)
|
|
|
|
|
|
|
|
|
|
pop %ebp
|
|
|
|
|
ret
|
|
|
|
|
ASM_END(arch_atom_and)
|
|
|
|
|
ASM_END(atom_and)
|
|
|
|
|
|
|
|
|
|
/* int arch_atom_or(atom_t *atom, int val) */
|
|
|
|
|
ASM_ENTRY(arch_atom_or)
|
|
|
|
|
/* int atom_or(atom_t *atom, int val) */
|
|
|
|
|
ASM_ENTRY(atom_or)
|
|
|
|
|
push %ebp
|
|
|
|
|
mov %esp, %ebp
|
|
|
|
|
|
|
|
|
@ -125,10 +133,10 @@ ASM_ENTRY(arch_atom_or)
|
|
|
|
|
|
|
|
|
|
pop %ebp
|
|
|
|
|
ret
|
|
|
|
|
ASM_END(arch_atom_or)
|
|
|
|
|
ASM_END(atom_or)
|
|
|
|
|
|
|
|
|
|
/* int arch_atom_xor(atom_t *atom, int val) */
|
|
|
|
|
ASM_ENTRY(arch_atom_xor)
|
|
|
|
|
/* int atom_xor(atom_t *atom, int val) */
|
|
|
|
|
ASM_ENTRY(atom_xor)
|
|
|
|
|
push %ebp
|
|
|
|
|
mov %esp, %ebp
|
|
|
|
|
|
|
|
|
@ -143,10 +151,10 @@ ASM_ENTRY(arch_atom_xor)
|
|
|
|
|
|
|
|
|
|
pop %ebp
|
|
|
|
|
ret
|
|
|
|
|
ASM_END(arch_atom_xor)
|
|
|
|
|
ASM_END(atom_xor)
|
|
|
|
|
|
|
|
|
|
/* bool arch_atom_set_bit(atom_t *atom, int bit) */
|
|
|
|
|
ASM_ENTRY(arch_atom_set_bit)
|
|
|
|
|
/* bool atom_set_bit(atom_t *atom, int bit) */
|
|
|
|
|
ASM_ENTRY(atom_set_bit)
|
|
|
|
|
push %ebp
|
|
|
|
|
mov %esp, %ebp
|
|
|
|
|
push %ebx
|
|
|
|
@ -171,10 +179,10 @@ ASM_ENTRY(arch_atom_set_bit)
|
|
|
|
|
pop %ebx
|
|
|
|
|
pop %ebp
|
|
|
|
|
ret
|
|
|
|
|
ASM_END(arch_atom_set_bit)
|
|
|
|
|
ASM_END(atom_set_bit)
|
|
|
|
|
|
|
|
|
|
/* bool arch_atom_clr_bit(atom_t *atom, int bit) */
|
|
|
|
|
ASM_ENTRY(arch_atom_clr_bit)
|
|
|
|
|
/* bool atom_clr_bit(atom_t *atom, int bit) */
|
|
|
|
|
ASM_ENTRY(atom_clr_bit)
|
|
|
|
|
push %ebp
|
|
|
|
|
mov %esp, %ebp
|
|
|
|
|
push %ebx
|
|
|
|
@ -199,7 +207,7 @@ ASM_ENTRY(arch_atom_clr_bit)
|
|
|
|
|
pop %ebx
|
|
|
|
|
pop %ebp
|
|
|
|
|
ret
|
|
|
|
|
ASM_END(arch_atom_clr_bit)
|
|
|
|
|
ASM_END(atom_clr_bit)
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* This file is part of GayBSD.
|
|
|
|
|