Ok. I didn't make 2.4.0 in 2000. Tough. I tried, but we had some
[davej-history.git] / include / asm-parisc / gsc.h
blob0cf1e6d6836f7b0a4185117b454e4ad201fcd6f4
1 #ifndef ASM_PARISC_GSC_H
2 #define ASM_PARISC_GSC_H
3 #ifdef __KERNEL__
5 #include <linux/types.h>
6 #include <asm/hardware.h> /* for struct hp_device */
8 /*
9 * The convention used for inb/outb etc. is that names starting with
10 * two underscores are the inline versions, names starting with a
11 * single underscore are proper functions, and names starting with a
12 * letter are macros that map in some way to inline or proper function
13 * versions. Not all that pretty, but before you change it, be sure
14 * to convince yourself that it won't break anything (in particular
15 * module support).
17 extern u8 _gsc_readb(void *);
18 extern u16 _gsc_readw(void *);
19 extern u32 _gsc_readl(void *);
20 extern u64 _gsc_readq(void *);
21 extern void _gsc_writeb(u8, void *);
22 extern void _gsc_writew(u16,void *);
23 extern void _gsc_writel(u32,void *);
24 extern void _gsc_writeq(u64,void *);
26 #define gsc_readb(a) _gsc_readb((void *)(a))
27 #define gsc_readw(a) _gsc_readw((void *)(a))
28 #define gsc_readl(a) _gsc_readl((void *)(a))
29 #define gsc_readq(a) _gsc_readq((void *)(a))
30 #define gsc_writeb(v,a) _gsc_writeb((v),(void *)(a))
31 #define gsc_writew(v,a) _gsc_writew((v),(void *)(a))
32 #define gsc_writel(v,a) _gsc_writel((v),(void *)(a))
33 #define gsc_writeq(v,a) _gsc_writeq((v),(void *)(a))
35 struct gsc_dev {
36 struct gsc_bus *bus; /* bus this device is on */
37 struct gsc_dev *next; /* chain of all devices */
38 struct gsc_dev *next_bus; /* chain of all devices on a bus */
39 struct gsc_dev *next_submod; /* chain of all devices on a module */
41 unsigned irq; /* irq generated by this device */
42 void *hpa; /* hard physical address */
44 u16 hversion;
45 u8 spa; /* SPA requirements */
46 u8 type;
47 u32 sversion;
50 struct gsc_irq {
51 unsigned long txn_addr; /* IRQ "target" */
52 int txn_data; /* HW "IRQ" */
53 int irq; /* virtual IRQ */
56 /* PA I/O Architected devices support at least 5 bits in the EIM register. */
57 #define GSC_EIM_WIDTH 5
59 extern int gsc_alloc_irq(struct gsc_irq *dev); /* dev needs an irq */
60 extern int gsc_claim_irq(struct gsc_irq *dev, int irq); /* dev needs this irq */
62 struct gsc_bus {
63 void *hpa; /* HPA of device 0, function 0 of this bus */
67 * There is one gsc_dev structure for each slot-number/function-number
68 * combination:
71 struct gsc_dev *gsc_find_device(u16 hversion, struct gsc_dev *from);
73 extern void probe_serial_gsc(void);
75 /* returns a virtual irq for device at dev->hpa (works for all LASI/ASP/WAX) */
76 extern int busdevice_alloc_irq( struct hp_device *dev );
78 #endif /* __KERNEL__ */
79 #endif /* LINUX_GSC_H */