-/* asm_compare_and_swap ********************************************************
-
- Does an atomic compare and swap. Required for the lock
- implementation.
-
-*******************************************************************************/
-
-asm_compare_and_swap:
- mov a1,v0 /* v0 is %rax */
- lock cmpxchg a2,(a0)
- ret
-
-
-/* asm_memory_barrier **********************************************************
-
- A memory barrier for the Java Memory Model.
-
-*******************************************************************************/
-
-asm_memory_barrier:
- mfence
- ret
-
-
-/* asm_get_cycle_count *********************************************************
-
- Get the current time-stamp counter from the CPU.
-
-*******************************************************************************/
-
-asm_get_cycle_count:
- rdtsc
- shl $0x20, %rdx
- mov %eax, %eax
- or %rdx, %rax
- ret
-
-