nsprpub/pr/src/md/unix/os_Irix.s

Wed, 31 Dec 2014 06:55:46 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:55:46 +0100
changeset 1
ca08bd8f51b2
permissions
-rw-r--r--

Added tag TORBROWSER_REPLICA for changeset 6474c204b198

     1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 /* 
     7  *  Atomically add a new element to the top of the stack
     8  *
     9  *  usage : PR_StackPush(listp, elementp);
    10  *  -----------------------
    11  */
    13 #include "md/_irix.h"
    14 #ifdef _PR_HAVE_ATOMIC_CAS
    16 #include <sys/asm.h>
    17 #include <sys/regdef.h>
    19 LEAF(PR_StackPush)
    21 retry_push:
    22 .set noreorder
    23 		lw		v0,0(a0)
    24 		li		t1,1
    25 		beq		v0,t1,retry_push
    26 		move	t0,a1
    28         ll      v0,0(a0)
    29 		beq		v0,t1,retry_push
    30 		nop
    31 		sc		t1,0(a0)	
    32 		beq		t1,0,retry_push
    33 		nop
    34 		sw		v0,0(a1)
    35 		sync
    36 		sw		t0,0(a0)
    37 		nop
    38 		nop
    39 		nop
    40 		nop
    41 		nop
    42 		nop
    43 		nop
    44 		nop
    45 		nop
    46 		nop
    47 		nop
    48 		nop
    49 		nop
    50 		nop
    51 		nop
    52 		nop
    53 		nop
    54 		nop
    55 		nop
    56 		nop
    57 		nop
    58 		nop
    59 		nop
    60 		nop
    61 		nop
    62 		nop
    63 		nop
    64 		nop
    65 		jr		ra
    66 		nop
    68 END(PR_StackPush)
    70 /*
    71  *
    72  *  Atomically remove the element at the top of the stack
    73  *
    74  *  usage : elemep = PR_StackPop(listp);
    75  *
    76  */
    78 LEAF(PR_StackPop)
    79 retry_pop:
    80 .set noreorder
    83 		lw		v0,0(a0)
    84 		li		t1,1
    85 		beq		v0,0,done
    86 		nop	
    87 		beq		v0,t1,retry_pop
    88 		nop	
    90         ll      v0,0(a0)
    91 		beq		v0,0,done
    92 		nop
    93 		beq		v0,t1,retry_pop
    94 		nop
    95 		sc		t1,0(a0)	
    96 		beq		t1,0,retry_pop
    97 		nop
    98 		lw		t0,0(v0)
    99 		sw		t0,0(a0)
   100 done:
   101 		nop
   102 		nop
   103 		nop
   104 		nop
   105 		nop
   106 		nop
   107 		nop
   108 		nop
   109 		nop
   110 		nop
   111 		nop
   112 		nop
   113 		nop
   114 		nop
   115 		nop
   116 		nop
   117 		nop
   118 		nop
   119 		nop
   120 		nop
   121 		nop
   122 		nop
   123 		nop
   124 		nop
   125 		nop
   126 		nop
   127 		nop
   128 		nop
   129 		jr		ra
   130 		nop
   132 END(PR_StackPop)
   134 #endif /* _PR_HAVE_ATOMIC_CAS */

mercurial