1 /* { dg-do compile } */
2 /* { dg-additional-options "-ftree-pre -fcode-hoisting" } */
4 __extension__
typedef __UINTPTR_TYPE__
uintptr_t;
6 typedef unsigned char u8
;
7 extern unsigned long pci_io_base
;
8 u8
in_8 (const volatile void *);
10 void eeh_check_failure ();
12 u8
eeh_readb(const volatile void *addr
)
15 if (((val
) == (u8
)~0 && eeh_enabled())) eeh_check_failure();
18 extern struct ppc_pci_io
{
19 void (*outb
) (u8 val
, unsigned long port
);
23 u8
readb (const volatile void * addr
)
25 return eeh_readb((addr
));
28 u8
inb (unsigned long port
)
30 return readb((volatile void *)(uintptr_t)pci_io_base
+ port
);
33 void outb (u8 val
, unsigned long port
)
35 if (ppc_pci_io
.outb
!= ((void *)0)) ppc_pci_io
.outb (val
, port
);
37 void frob_econtrol(unsigned long base_hi
, unsigned char m
, unsigned char v
)
39 unsigned char ectr
= 0;
40 if (m
!= 0xff) ectr
= inb((base_hi
+ 0x2));
41 outb((ectr
& ~m
) ^ v
, (base_hi
+ 0x2));