diff --git a/libs/port/interlocked.c b/libs/port/interlocked.c index 5e1dcf76a59..dbcac4f34c2 100644 --- a/libs/port/interlocked.c +++ b/libs/port/interlocked.c @@ -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 diff --git a/libs/wine/port.c b/libs/wine/port.c index e2b664519e9..6cbdd37fa42 100644 --- a/libs/wine/port.c +++ b/libs/wine/port.c @@ -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