	.text

	.globl opal_atomic_mb
opal_atomic_mb:
	pushq	%rbp
	movq	%rsp, %rbp
	leave
	ret


	.globl opal_atomic_rmb
opal_atomic_rmb:
	pushq	%rbp
	movq	%rsp, %rbp
	leave
	ret


	.globl opal_atomic_wmb
opal_atomic_wmb:
	pushq	%rbp
	movq	%rsp, %rbp
	leave
	ret


	.globl opal_atomic_cmpset_32
opal_atomic_cmpset_32:
        movl    %esi, %eax
        lock; cmpxchgl %edx,(%rdi)   
        sete     %dl
        movzbl  %dl, %eax
        ret


	.globl opal_atomic_cmpset_64
opal_atomic_cmpset_64:
        movq    %rsi, %rax
        lock; cmpxchgq %rdx,(%rdi)   
        sete     %dl
        movzbl  %dl, %eax
        ret


	.globl opal_sys_timer_get_cycles
opal_sys_timer_get_cycles:
        rdtsc
        salq    $32, %rdx
        mov     %eax, %eax
        orq     %rdx, %rax
        ret
