Commit e5fdc454 authored by Vincent Béron's avatar Vincent Béron Committed by Alexandre Julliard

Implement interlocked* and wine_switch_to_stack for Alpha.

parent ef138f09
...@@ -244,6 +244,57 @@ long interlocked_xchg_add( long *dest, long incr ) ...@@ -244,6 +244,57 @@ long interlocked_xchg_add( long *dest, long incr )
_lwp_mutex_unlock( &interlocked_mutex ); _lwp_mutex_unlock( &interlocked_mutex );
return retv; return retv;
} }
#elif defined(__ALPHA__) && defined(__GNUC__)
__ASM_GLOBAL_FUNC(interlocked_cmpxchg,
"L0cmpxchg:\n\t"
"ldq_l $0,0($16)\n\t"
"cmpeq $0,$18,$1\n\t"
"beq $1,L1cmpxchg\n\t"
"mov $17,$0\n\t"
"stq_c $0,0($16)\n\t"
"beq $0,L0cmpxchg\n\t"
"mov $18,$0\n"
"L1cmpxchg:\n\t"
"mb");
__ASM_GLOBAL_FUNC(interlocked_cmpxchg_ptr,
"L0cmpxchg_ptr:\n\t"
"ldq_l $0,0($16)\n\t"
"cmpeq $0,$18,$1\n\t"
"beq $1,L1cmpxchg_ptr\n\t"
"mov $17,$0\n\t"
"stq_c $0,0($16)\n\t"
"beq $0,L0cmpxchg_ptr\n\t"
"mov $18,$0\n"
"L1cmpxchg_ptr:\n\t"
"mb");
__ASM_GLOBAL_FUNC(interlocked_xchg,
"L0xchg:\n\t"
"ldq_l $0,0($16)\n\t"
"mov $17,$1\n\t"
"stq_c $1,0($16)\n\t"
"beq $1,L0xchg\n\t"
"mb");
__ASM_GLOBAL_FUNC(interlocked_xchg_ptr,
"L0xchg_ptr:\n\t"
"ldq_l $0,0($16)\n\t"
"mov $17,$1\n\t"
"stq_c $1,0($16)\n\t"
"beq $1,L0xchg_ptr\n\t"
"mb");
__ASM_GLOBAL_FUNC(interlocked_xchg_add,
"L0xchg_add:\n\t"
"ldq_l $0,0($16)\n\t"
"addq $0,$17,$1\n\t"
"stq_c $1,0($16)\n\t"
"beq $1,L0xchg_add\n\t"
"mb");
#else #else
# error You must implement the interlocked* functions for your CPU # error You must implement the interlocked* functions for your CPU
#endif #endif
...@@ -135,6 +135,13 @@ __ASM_GLOBAL_FUNC( wine_switch_to_stack, ...@@ -135,6 +135,13 @@ __ASM_GLOBAL_FUNC( wine_switch_to_stack,
"mr 1,5\n\t" /* stack */ "mr 1,5\n\t" /* stack */
"bctr\n\t" /* call ctr */ "bctr\n\t" /* call ctr */
"1:\tb 1b"); /* loop */ "1:\tb 1b"); /* loop */
#elif defined(__ALPHA__) && defined(__GNUC__)
__ASM_GLOBAL_FUNC( wine_switch_to_stack,
"mov $16,$0\n\t" /* func */
"mov $17,$16\n\t" /* arg */
"mov $18,$30\n\t" /* stack */
"jsr $31,($0),0\n\t" /* call func */
"L1:\tbr $31,L1"); /* loop */
#else #else
#error You must implement wine_switch_to_stack for your platform #error You must implement wine_switch_to_stack for your platform
#endif #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment