Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- s32 sceGe_lazy_31129B95(s32 dlId, void *stall)
- {
- s32 tmp0;
- s32 tmp1;
- s32 ret;
- if (dlId == g_lazy.dlId) {
- g_lazy.stall = stall;
- if (stall != NULL) {
- g_lazy.count++;
- if (g_lazy.count < g_lazy.max) {
- return 0;
- }
- }
- }
- if (g_lazy.dlId < 0) {
- goto loc_000001C0;
- }
- do {
- /* begin atomic RMW */
- asm __volatile__(
- "ll %0, (%1)"
- : "=r" (tmp0)
- : "r" (&g_lazy.dlId)
- );
- tmp1 = -1;
- if (tmp0 != g_lazy.dlId) {
- goto loc_000001C0;
- }
- /* end atomic RMW */
- /* if an atomic update as occured, %0 will be set to 1 */
- asm __volatile__(
- "sc %0, (%1)"
- : "=r" (tmp1)
- : "r" (&g_lazy.dlId)
- );
- } while (!tmp1);
- sub_00000208(tmp0, g_lazy.stall);
- loc_000001C0:
- ret = sub_00000208(dlId, stall);
- if (ret < 0) {
- return ret;
- }
- do {
- /* begin atomic RMW */
- asm __volatile__(
- "ll %0, (%1)"
- : "=r" (tmp0)
- : "r" (&g_lazy.dlId)
- );
- tmp1 = dlId;
- if (tmp0 >= 0) {
- return ret;
- }
- /* end atomic RMW */
- /* if an atomic update as occured, %0 will be set to 1 */
- asm __volatile__(
- "sc %0, (%1)"
- : "=r" (tmp1)
- : "r" (&g_lazy.dlId)
- );
- } while (!tmp1);
- g_lazy.stall = stall;
- g_lazy.count = 0;
- return ret;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement