tools/adflib: build only host variant which is used by Sam440 target
[AROS.git] / workbench / devs / AHI / Drivers / VIA-AC97 / pci_wrapper.h
blob40e77fa69c5ad1db5047734e2d3e71e8564f673a
1 /*
2 Copyright © 2004-2013, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #ifndef PCI_WRAPPER_H
7 #define PCI_WRAPPER_H
9 #ifndef EXEC_TYPES_H
10 # include <exec/types.h>
11 #endif
13 #include "DriverData.h"
15 #undef PCI_COMMAND
16 #undef PCI_COMMAND_IO
17 #undef PCI_COMMAND_MEMORY
18 #undef PCI_COMMAND_MASTER
19 #undef PCI_BASE_ADDRESS_IO_MASK
20 #undef PCI_REVISION_ID
21 #undef PCI_SUBSYSTEM_ID
22 #undef PCI_DEVICE_ID
23 #undef PCI_SUBSYSTEM_VENDOR_ID
26 #define PCI_COMMAND 4
27 #define PCI_COMMAND_IO 1
28 #define PCI_COMMAND_MEMORY 2
29 #define PCI_COMMAND_MASTER 4
31 #define PCI_BASE_ADDRESS_0 0x10
32 #define PCI_BASE_ADDRESS_1 0x14
33 #define PCI_BASE_ADDRESS_2 0x18
35 #define PCI_BASE_ADDRESS_IO_MASK (~0x3UL)
37 #define PCI_REVISION_ID 8
38 #define PCI_SUBSYSTEM_ID 0x2e
39 #define PCI_DEVICE_ID 2
40 #define PCI_SUBSYSTEM_VENDOR_ID 0x2c
42 BOOL ahi_pci_init(struct DriverBase* AHIsubBase);
43 void ahi_pci_exit(void);
45 APTR ahi_pci_find_device(ULONG vendorid, ULONG deviceid, APTR dev);
47 ULONG pci_inl(ULONG addr, struct CardData *card);
48 UWORD pci_inw(ULONG addr, struct CardData *card);
49 UBYTE pci_inb(ULONG addr, struct CardData *card);
51 void pci_outl(ULONG value, ULONG addr, struct CardData *card);
52 void pci_outw(UWORD value, ULONG addr, struct CardData *card);
53 void pci_outb(UBYTE value, ULONG addr, struct CardData *card);
55 void outb_setbits(UBYTE value, ULONG addr, struct CardData *card);
56 void outw_setbits(UWORD value, ULONG addr, struct CardData *card);
57 void outl_setbits(ULONG value, ULONG addr, struct CardData *card);
58 void outb_clearbits(UBYTE value, ULONG addr, struct CardData *card);
59 void outw_clearbits(UWORD value, ULONG addr, struct CardData *card);
60 void outl_clearbits(ULONG value, ULONG addr, struct CardData *card);
62 ULONG inl_config(UBYTE reg, APTR dev);
63 UWORD inw_config(UBYTE reg, APTR dev);
64 UBYTE inb_config(UBYTE reg, APTR dev);
66 void outl_config(UBYTE reg, ULONG val, APTR dev);
67 void outw_config(UBYTE reg, UWORD val, APTR dev);
68 void outb_config(UBYTE reg, UBYTE val, APTR dev);
70 ULONG ahi_pci_get_irq(APTR dev);
72 BOOL ahi_pci_add_intserver(struct Interrupt *i, APTR dev);
73 void ahi_pci_rem_intserver(struct Interrupt *i, APTR dev);
75 APTR ahi_pci_logic_to_physic_addr(APTR addr, APTR dev);
77 APTR ahi_pci_get_base_address(WORD which, APTR dev);
78 ULONG ahi_pci_get_base_size(WORD which, APTR dev);
79 ULONG ahi_pci_get_type(WORD which, APTR dev);
80 ULONG ahi_pci_mem_map(APTR addr, APTR dev);
82 #ifdef __AMIGAOS4__
83 #define ALLOCVEC AllocVec
84 #define FREEVEC FreeVec
85 #define DEBUGPRINTF IExec->DebugPrintF
86 #define CAUSE Cause
87 #define CALLHOOK CallHookPkt
88 #define INITSEMAPHORE InitSemaphore
89 #define OBTAINSEMAPHORE ObtainSemaphore
90 #define RELEASESEMAPHORE ReleaseSemaphore
91 #define CREATEPORT(a, b) CreatePort(a, b)
92 #define CREATEIOREQUEST CreateIORequest
93 #define OPENDEVICE OpenDevice
94 #define DOIO DoIO
95 #define DELETEIOREQUEST DeleteIORequest
96 #define CLOSEDEVICE IExec->CloseDevice
97 #define DELETEPORT IExec->DeletePort
98 #define GETTAGDATA IUtility->GetTagData
99 #define IRQTYPE INTERRUPT_NODE_TYPE
100 #define DELAY IDOS->Delay
101 #define bug DebugPrintF
102 #else
103 #include <aros/debug.h>
104 #define ALLOCVEC AllocVec
105 #define FREEVEC FreeVec
106 #define DEBUGPRINTF kprintf
107 #define CAUSE Cause
108 #define CALLHOOK CallHookA
109 #define INITSEMAPHORE InitSemaphore
110 #define OBTAINSEMAPHORE ObtainSemaphore
111 #define RELEASESEMAPHORE ReleaseSemaphore
112 #define CREATEPORT(a, b) CreateMsgPort()
113 #define CREATEIOREQUEST CreateIORequest
114 #define OPENDEVICE OpenDevice
115 #define DOIO DoIO
116 #define DELETEIOREQUEST DeleteIORequest
117 #define CLOSEDEVICE CloseDevice
118 #define DELETEPORT DeleteMsgPort
119 #define GETTAGDATA GetTagData
120 #define IRQTYPE INTERRUPT_NODE_TYPE
121 #define DELAY Delay
122 #endif
124 #endif