]> git.wh0rd.org - ICEs.git/blob - hppa-O1/vfprintf.i.2
initial import
[ICEs.git] / hppa-O1 / vfprintf.i.2
1 static inline void
2 __attribute__ ((always_inline)) __lll_mutex_lock(int * futex)
3 {
4 if (( {
5 int ret; ret = ( {
6 volatile int lws_errno = 14;
7 volatile int lws_ret = 0xdeadbeef;
8 asm volatile ("0: \n\t"
9 "copy %3, %%r26 \n\t"
10 "copy %4, %%r25 \n\t"
11 "copy %5, %%r24 \n\t"
12 "ble " "0xb0" "(%%sr2, %%r0) \n\t"
13 "ldi " "0" ", %%r20 \n\t"
14 "cmpib,=,n " "11" ",%%r21,0b \n\t"
15 "nop \n\t"
16 "stw %%r28, %0 \n\t"
17 "sub %%r0, %%r21, %%r21 \n\t"
18 "stw %%r21, %1 \n\t"
19 : "=m" (lws_ret), "=m"(lws_errno), "=m"(*futex)
20 : "r"(futex), "r"(0), "r"(1)
21 :"r1", "r26", "r25", "r24", "r23", "r22", "r21", "r20", "r28", "r31", "memory");
22 lws_ret;}
23 );}
24 ))
25 __lll_lock_wait(futex);
26 }
27 typedef struct {
28 char *_IO_write_end;
29 int lock;
30 } _IO_FILE;
31 __attribute__ ((__nothrow__)) __attribute__ ((noinline))
32 static int buffered_vfprintf(register _IO_FILE *s)
33 {
34 char buf[8192];
35 register _IO_FILE *hp;
36 hp->_IO_write_end = buf;
37 __lll_mutex_lock(&s->lock);
38 }
39 void foo(_IO_FILE *s)
40 {
41 buffered_vfprintf(s);
42 }