2 #include "../../dyninstAPI/src/inst-power.h"
5 .globl DYNINSTthreadIndexFAST
6 .globl .DYNINSTthreadIndexFAST
7 DYNINSTthreadIndexFAST:
8 .DYNINSTthreadIndexFAST:
11 .globl DYNINSTthreadContext
12 .globl .DYNINSTthreadContext
14 .DYNINSTthreadContext:
20 beq DYNINSTthreadContext_NOT_SPR
22 DYNINSTthreadContext_NOT_SPR:
24 .globl DYNINSTthreadSelf
25 .globl .DYNINSTthreadSelf
33 beq DYNINSTthreadSelf_NOT_SPR
35 DYNINSTthreadSelf_NOT_SPR:
49 lwarx 4,0,10 # r4 == old value of mutex
50 stwcx. 6,0,10 # t->mutex = 1
51 bne- tc_lock_lock_loop
53 bne- tc_lock_lock_done
54 tc_lock_lock_failed: # Someone else has the lock
55 l 5,4(10) # r5 == old tid value
57 bne tc_lock_lock_loop # Don't have lock, try again
58 lil 3,-2 # Already have lock, return error, -2 == DYNINST_DEAD_LOCK
60 tc_lock_lock_done: # Need to record new tid, return
61 st 3,4(10) # t->tid = pid
68 .globl tc_lock_trylock
69 .globl .tc_lock_trylock
79 lwarx 4,0,10 # r4 == old value of mutex
80 stwcx. 6,0,10 # t->mutex = 1
81 bne- tc_lock_trylock_loop
83 bne- tc_lock_trylock_done
84 tc_lock_trylock_failed: # Someone else has the lock
85 l 5,4(10) # r5 == old tid value
87 bne tc_lock_trylock_live # Don't have lock, try again
88 lil 3,-2 # Already have lock, return error
91 lil 3,-1 # Someone else has lock, LIVE_LOCK == -1
93 tc_lock_trylock_done: # Need to record new tid, return
94 st 3,4(10) # t->tid = pid