]> git.wh0rd.org Git - ICEs.git/blob - hppa-O1/vfprintf.i.1
initial import
[ICEs.git] / hppa-O1 / vfprintf.i.1
1 typedef int lll_lock_t;
2 static inline void
3     __attribute__ ((always_inline)) __lll_mutex_lock(lll_lock_t * futex)
4 {
5         if (( {
6              int ret; ret = ( {
7               volatile int lws_errno = 14; volatile int lws_ret = 0xdeadbeef; asm volatile ("0:                                 \n\t" "copy     %3, %%r26                       \n\t" "copy     %4, %%r25                       \n\t" "copy     %5, %%r24                       \n\t" "ble      " "0xb0" "(%%sr2, %%r0)         \n\t" "ldi      " "0" ", %%r20          \n\t" "cmpib,=,n " "11" ",%%r21,0b      \n\t" "nop                                      \n\t" "stw      %%r28, %0                       \n\t" "sub      %%r0, %%r21, %%r21              \n\t" "stw      %%r21, %1                       \n\t": "=m" (lws_ret), "=m"(lws_errno), "=m"(*futex): "r"(futex), "r"(0), "r"(1):"r1", "r26", "r25", "r24", "r23", "r22", "r21", "r20", "r28", "r31", "memory"); lws_ret;}
8              );}
9             ) != 0)
10                 __lll_lock_wait(futex);
11 }
12 typedef __builtin_va_list __gnuc_va_list;
13 typedef struct {
14         int lock;
15         void *owner;
16 } _IO_lock_t;
17 struct _IO_FILE {
18         int _flags;
19         char *_IO_write_base;
20         char *_IO_write_ptr;
21         char *_IO_write_end;
22         _IO_lock_t *_lock;
23 };
24 typedef struct _IO_FILE _IO_FILE;
25 struct _IO_jump_t {
26 };
27 struct _IO_FILE_plus {
28 };
29 static int buffered_vfprintf(_IO_FILE * stream, const char *fmt, __gnuc_va_list)
30     __attribute__ ((__nothrow__)) __attribute__ ((noinline));
31 int _IO_vfprintf_internal(_IO_FILE * s, const char *format, __gnuc_va_list ap)
32 {
33         if (((s)->_flags & 2))
34                 return buffered_vfprintf(s, format, ap);
35 }
36 struct helper_file {
37         struct _IO_FILE_plus _f;
38 };
39 static int buffered_vfprintf(register _IO_FILE * s, const char *format,
40                              __gnuc_va_list args)
41 {
42         char buf[8192];
43         struct helper_file helper;
44         register _IO_FILE *hp = (_IO_FILE *) & helper._f;
45         ((hp)->_IO_write_base = (hp)->_IO_write_ptr = buf, (hp)->_IO_write_end =
46          (buf + sizeof buf));
47         {
48                 if (((s)->_flags & 0x8000) == 0)
49                         do {
50                                 void *__self = ({
51                                                 __self = __get_cr27();}
52                                 );
53                                 if ((*(s)->_lock).owner != __self) {
54                                         __lll_mutex_lock(&((*(s)->_lock).lock));
55                                 }
56                         }
57                         while (0);
58         };
59 }