Implement interlocked* and wine_switch_to_stack for Alpha.

This commit is contained in:
Vincent Béron 2004-10-11 19:50:52 +00:00 committed by Alexandre Julliard
parent ef138f090e
commit e5fdc454a4
2 changed files with 58 additions and 0 deletions

View File

@ -244,6 +244,57 @@ long interlocked_xchg_add( long *dest, long incr )
_lwp_mutex_unlock( &interlocked_mutex );
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
# error You must implement the interlocked* functions for your CPU
#endif

View File

@ -135,6 +135,13 @@ __ASM_GLOBAL_FUNC( wine_switch_to_stack,
"mr 1,5\n\t" /* stack */
"bctr\n\t" /* call ctr */
"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
#error You must implement wine_switch_to_stack for your platform
#endif