Port the SB128 code to AROS.
[AROS.git] / workbench / devs / AHI / Drivers / SB128 / pci_wrapper.h
blobe92f10e707eac4f86249fd5526f6c77e83f00091
1 #ifndef PCI_WRAPPER_H
2 #define PCI_WRAPPER_H
4 #ifndef EXEC_TYPES_H
5 # include <exec/types.h>
6 #endif
8 #include "DriverData.h"
10 #undef PCI_COMMAND
11 #undef PCI_COMMAND_IO
12 #undef PCI_COMMAND_MEMORY
13 #undef PCI_COMMAND_MASTER
14 #undef PCI_BASE_ADDRESS_IO_MASK
15 #undef PCI_REVISION_ID
16 #undef PCI_SUBSYSTEM_ID
17 #undef PCI_DEVICE_ID
18 #undef PCI_SUBSYSTEM_VENDOR_ID
21 #define PCI_COMMAND 4
22 #define PCI_COMMAND_IO 1
23 #define PCI_COMMAND_MEMORY 2
24 #define PCI_COMMAND_MASTER 4
26 #define PCI_BASE_ADDRESS_0 0x10
28 #define PCI_BASE_ADDRESS_IO_MASK (~0x3UL)
30 #define PCI_REVISION_ID 8
31 #define PCI_SUBSYSTEM_ID 0x2e
32 #define PCI_DEVICE_ID 2
33 #define PCI_SUBSYSTEM_VENDOR_ID 0x2c
35 BOOL ahi_pci_init(struct DriverBase* AHIsubBase);
36 void ahi_pci_exit(void);
38 APTR ahi_pci_find_device(ULONG vendorid, ULONG deviceid, APTR dev);
40 ULONG pci_inl(ULONG addr, struct SB128_DATA *card);
41 UWORD pci_inw(ULONG addr, struct SB128_DATA *card);
42 UBYTE pci_inb(ULONG addr, struct SB128_DATA *card);
44 void pci_outl(ULONG value, ULONG addr, struct SB128_DATA *card);
45 void pci_outw(UWORD value, ULONG addr, struct SB128_DATA *card);
46 void pci_outb(UBYTE value, ULONG addr, struct SB128_DATA *card);
48 void outb_setbits(UBYTE value, ULONG addr, struct SB128_DATA *card);
49 void outw_setbits(UWORD value, ULONG addr, struct SB128_DATA *card);
50 void outl_setbits(ULONG value, ULONG addr, struct SB128_DATA *card);
51 void outb_clearbits(UBYTE value, ULONG addr, struct SB128_DATA *card);
52 void outw_clearbits(UWORD value, ULONG addr, struct SB128_DATA *card);
53 void outl_clearbits(ULONG value, ULONG addr, struct SB128_DATA *card);
55 ULONG inl_config(UBYTE reg, APTR dev);
56 UWORD inw_config(UBYTE reg, APTR dev);
57 UBYTE inb_config(UBYTE reg, APTR dev);
59 void outl_config(UBYTE reg, ULONG val, APTR dev);
60 void outw_config(UBYTE reg, UWORD val, APTR dev);
61 void outb_config(UBYTE reg, UBYTE val, APTR dev);
63 ULONG ahi_pci_get_irq(APTR dev);
65 BOOL ahi_pci_add_intserver(struct Interrupt *i, APTR dev);
66 void ahi_pci_rem_intserver(struct Interrupt *i, APTR dev);
68 APTR ahi_pci_logic_to_physic_addr(APTR addr, APTR dev);
70 APTR ahi_pci_get_base_address(WORD which, APTR dev);
71 ULONG ahi_pci_get_base_size(WORD which, APTR dev);
72 ULONG ahi_pci_get_type(WORD which, APTR dev);
73 ULONG ahi_pci_mem_map(APTR addr, APTR dev);
75 #ifdef __AMIGAOS4__
76 #define ALLOCVEC AllocVec
77 #define FREEVEC FreeVec
78 #define DEBUGPRINTF IExec->DebugPrintF
79 #define CAUSE Cause
80 #define CALLHOOK CallHookPkt
81 #define INITSEMAPHORE InitSemaphore
82 #define OBTAINSEMAPHORE ObtainSemaphore
83 #define RELEASESEMAPHORE ReleaseSemaphore
84 #define CREATEPORT(a, b) CreatePort(a, b)
85 #define CREATEIOREQUEST CreateIORequest
86 #define OPENDEVICE OpenDevice
87 #define DOIO DoIO
88 #define DELETEIOREQUEST DeleteIORequest
89 #define CLOSEDEVICE IExec->CloseDevice
90 #define DELETEPORT IExec->DeletePort
91 #define GETTAGDATA IUtility->GetTagData
92 #define IRQTYPE INTERRUPT_NODE_TYPE
93 #define DELAY IDOS->Delay
94 #define bug DebugPrintF
95 #else
96 #include <aros/debug.h>
97 #define ALLOCVEC AllocVec
98 #define FREEVEC FreeVec
99 #define DEBUGPRINTF kprintf
100 #define CAUSE Cause
101 #define CALLHOOK CallHookA
102 #define INITSEMAPHORE InitSemaphore
103 #define OBTAINSEMAPHORE ObtainSemaphore
104 #define RELEASESEMAPHORE ReleaseSemaphore
105 #define CREATEPORT(a, b) CreateMsgPort()
106 #define CREATEIOREQUEST CreateIORequest
107 #define OPENDEVICE OpenDevice
108 #define DOIO DoIO
109 #define DELETEIOREQUEST DeleteIORequest
110 #define CLOSEDEVICE CloseDevice
111 #define DELETEPORT DeleteMsgPort
112 #define GETTAGDATA GetTagData
113 #define IRQTYPE INTERRUPT_NODE_TYPE
114 #define DELAY Delay
115 #endif
117 #endif