├── Build.info ├── CopyINCLUDES ├── CopyINCLUDES.info ├── CopyOpenPciDev ├── CopyOpenPciDev.info ├── DELObject ├── DELObject.info ├── FULLsmakefile.wth ├── FULLsmakefile.wth.info ├── InOut.h ├── LICENSE ├── Mediator.info ├── MediatorOpenPci.info ├── PARTIALsmakefile ├── PowerpciOpenPci.info ├── Prometheus.info ├── Prometheus └── include │ ├── clib │ └── prometheus_protos.h │ ├── inline │ ├── prometheus.h │ └── prometheus_protos.h │ ├── libraries │ └── prometheus.h │ ├── lvo │ └── prometheus_lib.i │ ├── pragma │ └── prometheus_lib.h │ ├── pragmas │ └── prometheus_pragmas.h │ └── proto │ └── prometheus.h ├── PrometheusOpenPci ├── DELObject ├── DELObject.info ├── Ppci_allocfree_dma.c ├── Ppci_allocfree_dma.c.info ├── Ppci_in_out.c ├── Ppci_in_out.c.info ├── Ppci_interrupt.c ├── Ppci_interrupt.c.info ├── Ppci_logictophysic_addr.c ├── Ppci_logictophysic_addr.c.info ├── Ppci_obtainrelease_card.c ├── Ppci_obtainrelease_card.c.info ├── Ppci_readwrite_config.c ├── Ppci_readwrite_config.c.info ├── Ppci_set_master.c ├── Ppci_set_master.c.info ├── Prometheus-3.0 │ ├── Developer │ │ ├── autodocs │ │ │ └── prometheus.doc │ │ └── fd │ │ │ └── prometheus_lib.fd │ ├── include │ │ ├── clib │ │ │ └── prometheus_protos.h │ │ ├── inline │ │ │ ├── prometheus.h │ │ │ └── prometheus_protos.h │ │ ├── libraries │ │ │ └── prometheus.h │ │ ├── lvo │ │ │ └── prometheus_lib.i │ │ ├── pragma │ │ │ └── prometheus_lib.h │ │ ├── pragmas │ │ │ └── prometheus_pragmas.h │ │ └── proto │ │ │ └── prometheus.h │ └── prometheus.library ├── PrometheusWrapper.c ├── PrometheusWrapper.c.info ├── PrometheusWrapper.h ├── PrometheusWrapper.h.info ├── developer.guide └── developer.guide.info ├── README.openpci_V2.1 ├── SCoptions ├── SCoptions.info ├── clib ├── openpci_protos.h └── openpci_protos.h.info ├── compiler.h ├── debug.c ├── debug.h ├── debug_protos.h ├── fd ├── MAKEPRAGMAS ├── MAKEPRAGMAS.info ├── fd2pragma ├── openpci_lib.fd └── openpci_lib.fd.info ├── internlibraries.info ├── internlibraries ├── openpci.h └── openpci.h.info ├── libraries.info ├── libraries ├── openpci.h └── openpci.h.info ├── makefile ├── openpci.c ├── openpci.c.info ├── openpci.library ├── openpci.library.notes ├── openpci.library.notes.info ├── openpci.library_VERSION.h ├── openpci.library_VERSION.h.info ├── openpci_protosWrapper.h ├── openpci_protosWrapper.h.info ├── openpcidata.h ├── openpcidata.h.info ├── openpcifunctable.c ├── openpcifunctable.h ├── openpciinfo ├── OpenPciInfo.c ├── OpenPciInfo.elf ├── OpenPciInfo.info ├── OpenPciInfo.lnk ├── build.info ├── delobject ├── delobject.info ├── makefile ├── pcibusinfo.h ├── pcihdr.h └── smakefile ├── openpciinfo_HexDumpPCI ├── OpenPciInfo ├── OpenPciInfo.c ├── OpenPciInfo.c.info ├── OpenPciInfo.info ├── OpenPciInfo.lnk ├── OpenPciInfo_v1_7-HexDump.zip ├── build.info ├── delobject ├── delobject.info ├── makefile ├── pcibusinfo.h ├── pcibusinfo.h.info ├── pcihdr.h └── smakefile ├── openpciinfo_TstObtainRelease ├── OpenPciInfo ├── OpenPciInfo.c ├── OpenPciInfo.c.info ├── OpenPciInfo.elf ├── OpenPciInfo.info ├── OpenPciInfo.lnk ├── build.info ├── delobject ├── delobject.info ├── makefile ├── pcibusinfo.h ├── pcibusinfo.h.info ├── pcihdr.h └── smakefile ├── pci.h ├── pci_allocfree_dma_mem.c ├── pci_find.c ├── pci_in_out.c ├── pci_interrupt.c ├── pci_logictophysic_addr.c ├── pci_obtainrelease_card.c ├── pci_readwrite_config.c ├── pci_set_master.c ├── pcibus.c ├── pcibus.h ├── ppcinline └── lowlevel.h ├── pragmas └── openpci_pragmas.h ├── proto ├── openpci.h └── openpci.h.info ├── smakefile └── smakefile.wth /Build.info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/Build.info -------------------------------------------------------------------------------- /CopyINCLUDES: -------------------------------------------------------------------------------- 1 | copy fd/openpci_lib.fd include:fd/ 2 | copy proto/openpci.h include:proto/ 3 | copy pragmas/openpci_pragmas.h include:pragmas/ 4 | copy clib/openpci_protos.h include:clib/ 5 | copy libraries/openpci.h include:libraries/ 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /CopyINCLUDES.info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/CopyINCLUDES.info -------------------------------------------------------------------------------- /CopyOpenPciDev: -------------------------------------------------------------------------------- 1 | makedir /OpenPciDev/fd 2 | copy fd/openpci_lib.fd /OpenPciDev/fd/ 3 | makedir /OpenPciDev/proto 4 | copy proto/openpci.h /OpenPciDev/proto/ 5 | makedir /OpenPciDev/pragmas 6 | copy pragmas/openpci_pragmas.h /OpenPciDev/pragmas/ 7 | makedir /OpenPciDev/clib 8 | copy clib/openpci_protos.h /OpenPciDev/clib/ 9 | makedir /OpenPciDev/libraries 10 | copy libraries/openpci.h /OpenPciDev/libraries/ 11 | copy openpci.library /OpenPciDev/ 12 | makedir /OpenPciDev/OpenPciInfo 13 | copy OpenPciInfo/#? /OpenPciDev/OpenPciInfo/ 14 | makedir /OpenPciDev/Doc 15 | copy Doc/ /OpenPciDev/Doc/ 16 | makedir /OpenPciDev/RTL8139Device 17 | copy /RTL8139Device/rtl8139.device /OpenPciDev/RTL8139Device/ 18 | -------------------------------------------------------------------------------- /CopyOpenPciDev.info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/CopyOpenPciDev.info -------------------------------------------------------------------------------- /DELObject: -------------------------------------------------------------------------------- 1 | delete #?.o 2 | delete #?.lnk 3 | delete #?.lst 4 | delete #?.lst.info 5 | delete MediatorOpenPci/#?.o 6 | delete MediatorOpenPci/#?.lnk 7 | delete MediatorOpenPci/#?.lst 8 | delete MediatorOpenPci/#?.lst.info 9 | delete PrometheusOpenPci/#?.o 10 | delete PrometheusOpenPci/#?.lnk 11 | delete PrometheusOpenPci/#?.lst 12 | delete PrometheusOpenPci/#?.lst.info 13 | delete GrexOpenPci/#?.o 14 | delete GrexOpenPci/#?.lnk 15 | delete GrexOpenPci/#?.lst 16 | delete GrexOpenPci/#?.lst.info 17 | delete PowerpciOpenPci/#?.o 18 | delete PowerpciOpenPci/#?.lnk 19 | delete PowerpciOpenPci/#?.lst 20 | delete PowerpciOpenPci/#?.lst.info 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /DELObject.info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/DELObject.info -------------------------------------------------------------------------------- /FULLsmakefile.wth: -------------------------------------------------------------------------------- 1 | FROM openpci.o 2 | pci_find.o pci_readwrite_config.o pci_interrupt.o pci_set_master.o 3 | pci_allocfree_dma_mem.o pci_logictophysic_addr.o pci_obtainrelease_card.o pci_in_out.o 4 | openpcifunctable.o pcibus.o debug.o 5 | GrexOpenPci/GrexWrapper.o 6 | GrexOpenPci/Gpci_readwrite_config.o GrexOpenPci/Gpci_set_master.o 7 | GrexOpenPci/Gpci_allocfree_dma.o GrexOpenPci/Gpci_interrupt.o 8 | GrexOpenPci/Gpci_in_out.o GrexOpenPci/Gpci_logictophysic_addr.o GrexOpenPci/Gpci_obtainrelease_card.o GrexOpenPci/memory.o 9 | PrometheusOpenPci/PrometheusWrapper.o 10 | PrometheusOpenPci/Ppci_readwrite_config.o PrometheusOpenPci/Ppci_set_master.o 11 | PrometheusOpenPci/Ppci_allocfree_dma.o PrometheusOpenPci/Ppci_interrupt.o 12 | PrometheusOpenPci/Ppci_in_out.o PrometheusOpenPci/Ppci_logictophysic_addr.o PrometheusOpenPci/Ppci_obtainrelease_card.o 13 | PowerPciOpenPci/PowerPciWrapper.o 14 | PowerPciOpenPci/Apci_readwrite_config.o PowerPciOpenPci/Apci_set_master.o PowerPciOpenPci/Apci_allocfree_dma.o 15 | PowerPciOpenPci/Apci_interrupt.o PowerPciOpenPci/Apci_in_out.o PowerPciOpenPci/Apci_logicphysic_addr.o PowerPciOpenPci/Apci_obtainrelease_card.o 16 | MediatorOpenPci/MediatorWrapper.o 17 | MediatorOpenPci/Mpci_readwrite_config.o MediatorOpenPci/Mpci_set_master.o MediatorOpenPci/Mpci_allocfree_dma.o 18 | MediatorOpenPci/Mpci_interrupt.o MediatorOpenPci/Mpci_in_out.o MediatorOpenPci/Mpci_logictophysic_addr.o MediatorOpenPci/Mpci_obtainrelease_card.o 19 | 20 | LIB lib:sc.lib lib:amiga.lib lib:debug.lib 21 | NODEBUG 22 | NOICONS 23 | TO openpci.library 24 | -------------------------------------------------------------------------------- /FULLsmakefile.wth.info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/FULLsmakefile.wth.info -------------------------------------------------------------------------------- /InOut.h: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | #include "debug.h" 5 | 6 | #define inline __inline 7 | 8 | static inline 9 | unsigned char hinb(unsigned long Addr) 10 | { 11 | /* 12 | moveq #0,d0 13 | move.b (a0),d0 14 | rts 15 | */ 16 | DEBUG( dprintf("0x%08lx=hinb(0x%08lx)\n",*(unsigned char *)Addr,Addr) ); 17 | return( *(unsigned char *)Addr ); 18 | } 19 | 20 | static inline 21 | void houtb(unsigned char value, unsigned long Addr) 22 | { 23 | /* 24 | move.b d0,(a0) 25 | rts 26 | */ 27 | DEBUG( dprintf("houtb(value=0x%08lx,addr=0x%08lx\n",value,Addr) ); 28 | *(unsigned char *)Addr=value; 29 | } 30 | 31 | static inline 32 | unsigned short hinw(unsigned long Addr) 33 | { 34 | /* 35 | moveq #0,d0 36 | move.w (a0),d0 37 | rts 38 | */ 39 | DEBUG( dprintf("0x%08lx=hinw(0x%08lx)\n",*(unsigned short *)Addr,Addr) ); 40 | return( *(unsigned short *)Addr ); 41 | } 42 | 43 | static inline 44 | void houtw(unsigned short value, unsigned long Addr) 45 | { 46 | /* 47 | move.w d0,(a0) 48 | rts 49 | */ 50 | DEBUG( dprintf("houtw(val=0x%08lx,addr=0x%08lx\n",value,Addr) ); 51 | *(unsigned short *)Addr=value; 52 | } 53 | 54 | static inline 55 | unsigned long hinl(unsigned long Addr) 56 | { 57 | /* 58 | moveq #0,d0 59 | move.l (a0),d0 60 | rts 61 | */ 62 | DEBUG( dprintf("0x%08lx=hinl(0x%08lx)\n",*(unsigned long *)Addr,Addr) ); 63 | return( *(unsigned long *)Addr ); 64 | } 65 | 66 | static inline 67 | void houtl(unsigned long value, unsigned long Addr) 68 | { 69 | /* 70 | move.l d0,(a0) 71 | rts 72 | */ 73 | DEBUG( dprintf("houtl(val=0x%08lx,addr=0x%08lx\n",value,Addr) ); 74 | *(unsigned long *)Addr=value; 75 | } 76 | 77 | static inline 78 | void memcpyl(void *source, void *dest, unsigned long taille) 79 | { 80 | /* 81 | lsr #2,d0 ; On divise d0 par 4 82 | boucle: 83 | move.l (a0)+,(a1)+ 84 | dbf d0,boucle 85 | rts 86 | */ 87 | /* 88 | //unsigned long tailleOrig=taille; 89 | long *destp=dest; 90 | long *sourcep=source; 91 | taille>>=2; 92 | 93 | do 94 | { 95 | *destp++=*sourcep++; 96 | }while(--taille); 97 | */ 98 | memcpy(dest,source,taille); 99 | //CopyMem(source,dest,taille); 100 | 101 | } 102 | 103 | 104 | 105 | 106 | 107 | /* C Version */ 108 | /* 109 | //extern inline unsigned char hinb(unsigned long Addr); 110 | unsigned char ASM hinb(REG(a0,unsigned long Addr)); 111 | void ASM houtb(REG(d0,unsigned char value), REG(a0,unsigned long Addr)); 112 | unsigned short ASM hinw(REG(a0,unsigned long Addr)); 113 | void ASM houtw(REG(d0,unsigned short value), REG(a0,unsigned long Addr)); 114 | unsigned long ASM hinl(REG(a0,unsigned long Addr)); 115 | void ASM houtl(REG(d0,unsigned long value), REG(a0,unsigned long Addr)); 116 | void ASM memcpyl( REG(a0,void *source), REG(a1,void *dest), REG(d0,unsigned long taille)); 117 | */ 118 | 119 | /* 120 | unsigned char hinb(unsigned long Addr); 121 | void houtb(unsigned char value,unsigned long Addr); 122 | unsigned short hinw(unsigned long Addr); 123 | void houtw(unsigned short value, unsigned long Addr); 124 | unsigned long hinl(unsigned long Addr); 125 | void houtl(unsigned long value, unsigned long Addr); 126 | void memcpyl(void *source, void *dest, unsigned long taille); 127 | */ 128 | 129 | /* 130 | #define hinb(Addr) ( *(unsigned char *)Addr) 131 | #define houtb(value, Addr) *(unsigned char *)Addr=value 132 | #define hinw(Addr) ( *(unsigned short *)Addr ) 133 | #define houtw(value, Addr) *(unsigned short *)Addr=value 134 | #define hinl(Addr) ( *(unsigned long *)Addr ) 135 | #define memcpyl(source, dest, taille) taille>>=2\ 136 | do{\ 137 | *dest++=*source++\ 138 | }while(--taille) 139 | 140 | */ 141 | /* ASM 68k Version */ 142 | /* 143 | extern unsigned char __asm hinb(register __a0 unsigned long Addr); 144 | extern void __asm houtb(register __d0 unsigned char value, register __a0 unsigned long Addr); 145 | extern unsigned short __asm hinw(register __a0 unsigned long Addr); 146 | extern void __asm houtw(register __d0 unsigned short value, register __a0 unsigned long Addr); 147 | extern unsigned long __asm hinl(register __a0 unsigned long Addr); 148 | extern void __asm houtl(register __d0 unsigned long value, register __a0 unsigned long Addr); 149 | 150 | extern void __asm memcpyl( register __a0 void *source , register __a1 void *dest, register __d0 unsigned long taille); 151 | */ 152 | 153 | // outx(source,destination) -------------------------------------------------------------------------------- /Mediator.info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/Mediator.info -------------------------------------------------------------------------------- /MediatorOpenPci.info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/MediatorOpenPci.info -------------------------------------------------------------------------------- /PARTIALsmakefile: -------------------------------------------------------------------------------- 1 | all: openpci.library 2 | 3 | openpci.library: openpci.o\ 4 | pci_find.o pci_readwrite_config.o pci_interrupt.o pci_set_master.o\ 5 | pci_allocfree_dma_mem.o pci_in_out.o pci_logictophysic_addr.o\ 6 | openpcifunctable.o pcibus.o debug.o GrexOpenPci/memory.o\ 7 | GrexOpenPci/GrexWrapper.o\ 8 | GrexOpenPci/Gpci_readwrite_config.o GrexOpenPci/Gpci_set_master.o GrexOpenPci/Gpci_allocfree_dma.o\ 9 | GrexOpenPci/Gpci_interrupt.o GrexOpenPci/Gpci_in_out.o GrexOpenPci/Gpci_logictophysic_addr.o\ 10 | PrometheusOpenPci/PrometheusWrapper.o\ 11 | PrometheusOpenPci/Ppci_readwrite_config.o PrometheusOpenPci/Ppci_set_master.o PrometheusOpenPci/Ppci_allocfree_dma.o\ 12 | PrometheusOpenPci/Ppci_interrupt.o PrometheusOpenPci/Ppci_in_out.o PrometheusOpenPci/Ppci_logictophysic_addr.o\ 13 | PowerPciOpenPci/PowerPciWrapper.o\ 14 | PowerPciOpenPci/Apci_readwrite_config.o PowerPciOpenPci/Apci_set_master.o PowerPciOpenPci/Apci_allocfree_dma.o\ 15 | PowerPciOpenPci/Apci_interrupt.o PowerPciOpenPci/Apci_in_out.o PowerPciOpenPci/Apci_logicphysic_addr.o\ 16 | 17 | SLINK WITH smakefile.wth 18 | Copy openpci.library libs:openpci.library 19 | avail flush 20 | 21 | openpci.o: openpci.c openpci.library_VERSION.h 22 | # $(CC) $*.c DisAssemble ram:openpci.asm 23 | $(CC) $*.c 24 | 25 | openpcifunctable.o: openpcifunctable.c openpcidata.h openpcifunctable.h 26 | $(CC) $*.c 27 | 28 | pcibus.o: pcibus.c openpcidata.h 29 | $(CC) $*.c 30 | 31 | pci_find.o: pci_find.c openpcidata.h 32 | # $(CC) $*.c DisAssemble ram:pcifind.asm 33 | $(CC) $*.c 34 | 35 | pci_in_out.o: pci_in_out.c openpcidata.h 36 | $(CC) $*.c 37 | 38 | pci_interrupt.o: pci_interrupt.c openpcidata.h 39 | $(CC) $*.c 40 | 41 | pci_set_master.o: pci_set_master.c openpcidata.h 42 | $(CC) $*.c 43 | 44 | pci_readwrite_config.o: pci_readwrite_config.c openpcidata.h 45 | $(CC) $*.c 46 | 47 | pci_allocfree_dma_mem.o: pci_allocfree_dma_mem.c openpcidata.h 48 | $(CC) $*.c 49 | 50 | pci_logictophysic_addr.o: pci_logictophysic_addr.c openpcidata.h 51 | $(CC) $*.c 52 | 53 | debug.o: debug.c debug.h 54 | $(CC) $*.c 55 | 56 | memory.o: memory.c memory.h 57 | $(CC) $*.c 58 | 59 | #InOut.o: InOut.a 60 | # $(CC) $*.a 61 | 62 | #InOut.o: InOut.c 63 | # $(CC) $*.c DisAssemble ram:InOut.asm 64 | 65 | # MEDIATOR WRAPPER 66 | MediatorWrapper.o: MediatorOpenPci/MediatorWrapper.c openpcidata.h openpci_protosWrapper.h MediatorOpenPci/MediatorWrapper.h 67 | $(CC) $*.c 68 | 69 | Mpci_readwrite_config.o: MediatorOpenPci/Mpci_readwrite_config.c openpcidata.h 70 | $(CC) $*.c 71 | 72 | Mpci_set_master.o: MediatorOpenPci/Mpci_set_master.c openpcidata.h 73 | $(CC) $*.c 74 | 75 | Mpci_allocfree_dma.o: MediatorOpenPci/Mpci_allocfree_dma.c openpcidata.h 76 | $(CC) $*.c 77 | 78 | Mpci_interrupt.o: MediatorOpenPci/Mpci_interrupt.c openpcidata.h 79 | $(CC) $*.c 80 | 81 | Mpci_in_out.o: MediatorOpenPci/Mpci_in_out.c openpcidata.h InOut.h 82 | $(CC) $*.c 83 | 84 | Mpci_logictophysic_addr.o: MediatorOpenPci/Mpci_logictophysic_addr.c openpcidata.h 85 | $(CC) $*.c 86 | 87 | 88 | # GREX WRAPPER 89 | GrexWrapper.o: GrexOpenPci/GrexWrapper.c openpcidata.h openpci_protosWrapper.h GrexOpenPci/GrexWrapper.h 90 | $(CC) $*.c 91 | 92 | Gpci_readwrite_config.o: GrexOpenPci/Gpci_readwrite_config.c openpcidata.h 93 | $(CC) $*.c 94 | 95 | Gpci_set_master.o: GrexOpenPci/Gpci_set_master.c openpcidata.h 96 | $(CC) $*.c 97 | 98 | Gpci_allocfree_dma.o: GrexOpenPci/Gpci_allocfree_dma.c openpcidata.h 99 | $(CC) $*.c 100 | 101 | Gpci_interrupt.o: GrexOpenPci/Gpci_interrupt.c openpcidata.h 102 | $(CC) $*.c 103 | 104 | Gpci_in_out.o: GrexOpenPci/Gpci_in_out.c openpcidata.h InOut.h 105 | $(CC) $*.c 106 | 107 | Gpci_logictophysic_addr.o: GrexOpenPci/Gpci_logictophysic_addr.c openpcidata.h 108 | $(CC) $*.c 109 | 110 | 111 | 112 | # PROMETHEUS WRAPPER 113 | PrometheusWrapper.o: PrometheusOpenPci/PrometheusWrapper.c openpcidata.h openpci_protosWrapper.h PrometheusOpenPci/PrometheusWrapper.h 114 | $(CC) $*.c debug=full 115 | 116 | Ppci_readwrite_config.o: PrometheusOpenPci/Ppci_readwrite_config.c openpcidata.h 117 | $(CC) $*.c 118 | 119 | Ppci_set_master.o: PrometheusOpenPci/Ppci_set_master.c openpcidata.h 120 | $(CC) $*.c 121 | 122 | Ppci_allocfree_dma.o: PrometheusOpenPci/Ppci_allocfree_dma.c openpcidata.h 123 | $(CC) $*.c 124 | 125 | Ppci_interrupt.o: PrometheusOpenPci/Ppci_interrupt.c openpcidata.h 126 | $(CC) $*.c 127 | 128 | Ppci_in_out.o: PrometheusOpenPci/Ppci_in_out.c openpcidata.h InOut.h 129 | $(CC) $*.c 130 | 131 | Ppci_logictophysic_addr.o: PrometheusOpenPci/Ppci_logictophysic_addr.c openpcidata.h 132 | $(CC) $*.c 133 | 134 | 135 | # POWERPCI WRAPPER 136 | PowerPciWrapper.o: PowerPciOpenPci/PowerPciWrapper.c openpcidata.h openpci_protosWrapper.h PowerPciOpenPci/PowerPciWrapper.h 137 | $(CC) $*.c debug=full 138 | 139 | Apci_readwrite_config.o: PowerPciOpenPci/Apci_readwrite_config.c openpcidata.h 140 | $(CC) $*.c 141 | 142 | Apci_set_master.o: PowerPciOpenPci/Apci_set_master.c openpcidata.h 143 | $(CC) $*.c 144 | 145 | Apci_allocfree_dma.o: PowerPciOpenPci/Apci_allocfree_dma.c openpcidata.h 146 | $(CC) $*.c 147 | 148 | Apci_interrupt.o: PowerPciOpenPci/Apci_interrupt.c openpcidata.h 149 | $(CC) $*.c 150 | 151 | Apci_in_out.o: PowerPciOpenPci/Apci_in_out.c openpcidata.h InOut.h 152 | $(CC) $*.c 153 | 154 | Apci_logicphysic_addr.o: PowerPciOpenPci/Apci_logicphysic_addr.c openpcidata.h 155 | $(CC) $*.c 156 | 157 | 158 | -------------------------------------------------------------------------------- /PowerpciOpenPci.info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/PowerpciOpenPci.info -------------------------------------------------------------------------------- /Prometheus.info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/Prometheus.info -------------------------------------------------------------------------------- /Prometheus/include/clib/prometheus_protos.h: -------------------------------------------------------------------------------- 1 | #ifndef CLIB_PROMETHEUS_PROTOS_H 2 | #define CLIB_PROMETHEUS_PROTOS_H 3 | 4 | /* 5 | ** $VER: prometheus_protos.h 2.0 (14.1.2002) 6 | ** 7 | ** C prototypes. For use with 32 bit integers only. 8 | ** 9 | ** (C) Copyright 2000-2002 Matay. 10 | ** All Rights Reserved 11 | */ 12 | 13 | #ifndef EXEC_INTERRUPTS_H 14 | #include 15 | #endif /* EXEC_INTERRUPTS_H */ 16 | 17 | #ifndef EXEC_TYPES_H 18 | #include 19 | #endif /* EXEC_TYPES_H */ 20 | 21 | #ifndef LIBRARIES_PROMETHEUS_H 22 | #include 23 | #endif /* LIBRARIES_PROMETHEUS_H */ 24 | 25 | #ifndef UTILITY_TAGITEM_H 26 | #include 27 | #endif /* UTILITY_TAGITEM_H */ 28 | 29 | /*--- functions in V1 or higher ---*/ 30 | 31 | PCIBoard *Prm_FindBoardTagList(PCIBoard *previous, struct TagItem* taglist); 32 | PCIBoard *Prm_FindBoardTags(PCIBoard *previous, Tag tag1, ...); 33 | ULONG Prm_GetBoardAttrsTagList(PCIBoard *board, struct TagItem* taglist); 34 | ULONG Prm_GetBoardAttrsTags(PCIBoard *board, Tag tag1, ...); 35 | 36 | /*--- functions in V2 or higher ---*/ 37 | 38 | ULONG Prm_ReadConfigLong(PCIBoard *board, UBYTE offset); 39 | UWORD Prm_ReadConfigWord(PCIBoard *board, UBYTE offset); 40 | UBYTE Prm_ReadConfigByte(PCIBoard *board, UBYTE offset); 41 | VOID Prm_WriteConfigLong(PCIBoard *board, ULONG data, UBYTE offset); 42 | VOID Prm_WriteConfigWord(PCIBoard *board, UWORD data, UBYTE offset); 43 | VOID Prm_WriteConfigByte(PCIBoard *board, UBYTE data, UBYTE offset); 44 | ULONG Prm_SetBoardAttrsTagList(PCIBoard *board, struct TagItem* taglist); 45 | ULONG Prm_SetBoardAttrsTags(PCIBoard *board, Tag tag1, ...); 46 | BOOL Prm_AddIntServer(PCIBoard *board, struct Interrupt *intr); 47 | VOID Prm_RemIntServer(PCIBoard *board, struct Interrupt *intr); 48 | APTR Prm_AllocDMABuffer(ULONG size); 49 | VOID Prm_FreeDMABuffer(APTR buffer, ULONG size); 50 | APTR Prm_GetPhysicalAddress(APTR addr); 51 | 52 | #endif /* CLIB_PROMETHEUS_PROTOS_H */ 53 | -------------------------------------------------------------------------------- /Prometheus/include/inline/prometheus.h: -------------------------------------------------------------------------------- 1 | /* Automatically generated header! Do not edit! */ 2 | 3 | #ifndef _INLINE_PROMETHEUS_H 4 | #define _INLINE_PROMETHEUS_H 5 | 6 | #ifndef __INLINE_MACROS_H 7 | #include 8 | #endif /* !__INLINE_MACROS_H */ 9 | 10 | #ifndef PROMETHEUS_BASE_NAME 11 | #define PROMETHEUS_BASE_NAME PrometheusBase 12 | #endif /* !PROMETHEUS_BASE_NAME */ 13 | 14 | #define Prm_AddIntServer(board, intr) \ 15 | LP2(0x54, BOOL, Prm_AddIntServer, PCIBoard *, board, a0, struct Interrupt *, intr, a1, \ 16 | , PROMETHEUS_BASE_NAME) 17 | 18 | #define Prm_AllocDMABuffer(size) \ 19 | LP1(0x60, APTR, Prm_AllocDMABuffer, ULONG, size, d0, \ 20 | , PROMETHEUS_BASE_NAME) 21 | 22 | #define Prm_FindBoardTagList(previous, taglist) \ 23 | LP2(0x1e, PCIBoard *, Prm_FindBoardTagList, PCIBoard *, previous, a0, struct TagItem*, taglist, a1, \ 24 | , PROMETHEUS_BASE_NAME) 25 | 26 | #ifndef NO_INLINE_STDARG 27 | #define Prm_FindBoardTags(a0, tags...) \ 28 | ({ULONG _tags[] = { tags }; Prm_FindBoardTagList((a0), (struct TagItem*)_tags);}) 29 | #endif /* !NO_INLINE_STDARG */ 30 | 31 | #define Prm_FreeDMABuffer(block, size) \ 32 | LP2NR(0x66, Prm_FreeDMABuffer, APTR, block, a0, ULONG, size, d0, \ 33 | , PROMETHEUS_BASE_NAME) 34 | 35 | #define Prm_GetBoardAttrsTagList(board, taglist) \ 36 | LP2(0x24, ULONG, Prm_GetBoardAttrsTagList, PCIBoard *, board, a0, struct TagItem*, taglist, a1, \ 37 | , PROMETHEUS_BASE_NAME) 38 | 39 | #ifndef NO_INLINE_STDARG 40 | #define Prm_GetBoardAttrsTags(a0, tags...) \ 41 | ({ULONG _tags[] = { tags }; Prm_GetBoardAttrsTagList((a0), (struct TagItem*)_tags);}) 42 | #endif /* !NO_INLINE_STDARG */ 43 | 44 | #define Prm_GetPhysicalAddress(addr) \ 45 | LP1(0x6c, APTR, Prm_GetPhysicalAddress, APTR, addr, d0, \ 46 | , PROMETHEUS_BASE_NAME) 47 | 48 | #define Prm_ReadConfigByte(board, offset) \ 49 | LP2(0x36, UBYTE, Prm_ReadConfigByte, PCIBoard *, board, a0, UBYTE, offset, d0, \ 50 | , PROMETHEUS_BASE_NAME) 51 | 52 | #define Prm_ReadConfigLong(board, offset) \ 53 | LP2(0x2a, ULONG, Prm_ReadConfigLong, PCIBoard *, board, a0, UBYTE, offset, d0, \ 54 | , PROMETHEUS_BASE_NAME) 55 | 56 | #define Prm_ReadConfigWord(board, offset) \ 57 | LP2(0x30, UWORD, Prm_ReadConfigWord, PCIBoard *, board, a0, UBYTE, offset, d0, \ 58 | , PROMETHEUS_BASE_NAME) 59 | 60 | #define Prm_RemIntServer(board, intr) \ 61 | LP2NR(0x5a, Prm_RemIntServer, PCIBoard *, board, a0, struct Interrupt *, intr, a1, \ 62 | , PROMETHEUS_BASE_NAME) 63 | 64 | #define Prm_SetBoardAttrsTagList(board, taglist) \ 65 | LP2(0x4e, ULONG, Prm_SetBoardAttrsTagList, PCIBoard *, board, a0, struct TagItem*, taglist, a1, \ 66 | , PROMETHEUS_BASE_NAME) 67 | 68 | #ifndef NO_INLINE_STDARG 69 | #define Prm_SetBoardAttrsTags(a0, tags...) \ 70 | ({ULONG _tags[] = { tags }; Prm_SetBoardAttrsTagList((a0), (struct TagItem*)_tags);}) 71 | #endif /* !NO_INLINE_STDARG */ 72 | 73 | #define Prm_WriteConfigByte(board, data, offset) \ 74 | LP3NR(0x48, Prm_WriteConfigByte, PCIBoard *, board, a0, UBYTE, data, d0, UBYTE, offset, d1, \ 75 | , PROMETHEUS_BASE_NAME) 76 | 77 | #define Prm_WriteConfigLong(board, data, offset) \ 78 | LP3NR(0x3c, Prm_WriteConfigLong, PCIBoard *, board, a0, ULONG, data, d0, UBYTE, offset, d1, \ 79 | , PROMETHEUS_BASE_NAME) 80 | 81 | #define Prm_WriteConfigWord(board, data, offset) \ 82 | LP3NR(0x42, Prm_WriteConfigWord, PCIBoard *, board, a0, UWORD, data, d0, UBYTE, offset, d1, \ 83 | , PROMETHEUS_BASE_NAME) 84 | 85 | #endif /* !_INLINE_PROMETHEUS_H */ 86 | -------------------------------------------------------------------------------- /Prometheus/include/inline/prometheus_protos.h: -------------------------------------------------------------------------------- 1 | #ifndef _VBCCINLINE_PROMETHEUS_H 2 | #define _VBCCINLINE_PROMETHEUS_H 3 | 4 | #ifndef EXEC_TYPES_H 5 | #include 6 | #endif 7 | 8 | PCIBoard * __Prm_FindBoardTagList(__reg("a6") struct Library *, __reg("a0") PCIBoard * previous, __reg("a1") struct TagItem* taglist)="\tjsr\t-30(a6)"; 9 | #define Prm_FindBoardTagList(previous, taglist) __Prm_FindBoardTagList(PrometheusBase, (previous), (taglist)) 10 | 11 | #if !defined(NO_INLINE_STDARG) && (__STDC__ == 1L) && (__STDC_VERSION__ >= 199901L) 12 | PCIBoard * __Prm_FindBoardTags(__reg("a6") struct Library *, __reg("a0") PCIBoard * previous, Tag taglist, ...)="\tmovea.l\ta7,a1\n\tjsr\t-30(a6)"; 13 | #define Prm_FindBoardTags(previous, ...) __Prm_FindBoardTags(PrometheusBase, (previous), __VA_ARGS__) 14 | #endif 15 | 16 | ULONG __Prm_GetBoardAttrsTagList(__reg("a6") struct Library *, __reg("a0") PCIBoard * board, __reg("a1") struct TagItem* taglist)="\tjsr\t-36(a6)"; 17 | #define Prm_GetBoardAttrsTagList(board, taglist) __Prm_GetBoardAttrsTagList(PrometheusBase, (board), (taglist)) 18 | 19 | #if !defined(NO_INLINE_STDARG) && (__STDC__ == 1L) && (__STDC_VERSION__ >= 199901L) 20 | ULONG __Prm_GetBoardAttrsTags(__reg("a6") struct Library *, __reg("a0") PCIBoard * board, Tag taglist, ...)="\tmovea.l\ta7,a1\n\tjsr\t-36(a6)"; 21 | #define Prm_GetBoardAttrsTags(board, ...) __Prm_GetBoardAttrsTags(PrometheusBase, (board), __VA_ARGS__) 22 | #endif 23 | 24 | ULONG __Prm_ReadConfigLong(__reg("a6") struct Library *, __reg("a0") PCIBoard * board, __reg("d0") UBYTE offset)="\tjsr\t-42(a6)"; 25 | #define Prm_ReadConfigLong(board, offset) __Prm_ReadConfigLong(PrometheusBase, (board), (offset)) 26 | 27 | UWORD __Prm_ReadConfigWord(__reg("a6") struct Library *, __reg("a0") PCIBoard * board, __reg("d0") UBYTE offset)="\tjsr\t-48(a6)"; 28 | #define Prm_ReadConfigWord(board, offset) __Prm_ReadConfigWord(PrometheusBase, (board), (offset)) 29 | 30 | UBYTE __Prm_ReadConfigByte(__reg("a6") struct Library *, __reg("a0") PCIBoard * board, __reg("d0") UBYTE offset)="\tjsr\t-54(a6)"; 31 | #define Prm_ReadConfigByte(board, offset) __Prm_ReadConfigByte(PrometheusBase, (board), (offset)) 32 | 33 | VOID __Prm_WriteConfigLong(__reg("a6") struct Library *, __reg("a0") PCIBoard * board, __reg("d0") ULONG data, __reg("d1") UBYTE offset)="\tjsr\t-60(a6)"; 34 | #define Prm_WriteConfigLong(board, data, offset) __Prm_WriteConfigLong(PrometheusBase, (board), (data), (offset)) 35 | 36 | VOID __Prm_WriteConfigWord(__reg("a6") struct Library *, __reg("a0") PCIBoard * board, __reg("d0") UWORD data, __reg("d1") UBYTE offset)="\tjsr\t-66(a6)"; 37 | #define Prm_WriteConfigWord(board, data, offset) __Prm_WriteConfigWord(PrometheusBase, (board), (data), (offset)) 38 | 39 | VOID __Prm_WriteConfigByte(__reg("a6") struct Library *, __reg("a0") PCIBoard * board, __reg("d0") UBYTE data, __reg("d1") UBYTE offset)="\tjsr\t-72(a6)"; 40 | #define Prm_WriteConfigByte(board, data, offset) __Prm_WriteConfigByte(PrometheusBase, (board), (data), (offset)) 41 | 42 | ULONG __Prm_SetBoardAttrsTagList(__reg("a6") struct Library *, __reg("a0") PCIBoard * board, __reg("a1") struct TagItem* taglist)="\tjsr\t-78(a6)"; 43 | #define Prm_SetBoardAttrsTagList(board, taglist) __Prm_SetBoardAttrsTagList(PrometheusBase, (board), (taglist)) 44 | 45 | #if !defined(NO_INLINE_STDARG) && (__STDC__ == 1L) && (__STDC_VERSION__ >= 199901L) 46 | ULONG __Prm_SetBoardAttrsTags(__reg("a6") struct Library *, __reg("a0") PCIBoard * board, Tag taglist, ...)="\tmovea.l\ta7,a1\n\tjsr\t-78(a6)"; 47 | #define Prm_SetBoardAttrsTags(board, ...) __Prm_SetBoardAttrsTags(PrometheusBase, (board), __VA_ARGS__) 48 | #endif 49 | 50 | BOOL __Prm_AddIntServer(__reg("a6") struct Library *, __reg("a0") PCIBoard * board, __reg("a1") struct Interrupt * intr)="\tjsr\t-84(a6)"; 51 | #define Prm_AddIntServer(board, intr) __Prm_AddIntServer(PrometheusBase, (board), (intr)) 52 | 53 | VOID __Prm_RemIntServer(__reg("a6") struct Library *, __reg("a0") PCIBoard * board, __reg("a1") struct Interrupt * intr)="\tjsr\t-90(a6)"; 54 | #define Prm_RemIntServer(board, intr) __Prm_RemIntServer(PrometheusBase, (board), (intr)) 55 | 56 | APTR __Prm_AllocDMABuffer(__reg("a6") struct Library *, __reg("d0") ULONG size)="\tjsr\t-96(a6)"; 57 | #define Prm_AllocDMABuffer(size) __Prm_AllocDMABuffer(PrometheusBase, (size)) 58 | 59 | VOID __Prm_FreeDMABuffer(__reg("a6") struct Library *, __reg("a0") APTR block, __reg("d0") ULONG size)="\tjsr\t-102(a6)"; 60 | #define Prm_FreeDMABuffer(block, size) __Prm_FreeDMABuffer(PrometheusBase, (block), (size)) 61 | 62 | APTR __Prm_GetPhysicalAddress(__reg("a6") struct Library *, __reg("d0") APTR addr)="\tjsr\t-108(a6)"; 63 | #define Prm_GetPhysicalAddress(addr) __Prm_GetPhysicalAddress(PrometheusBase, (addr)) 64 | 65 | #endif /* _VBCCINLINE_PROMETHEUS_H */ 66 | -------------------------------------------------------------------------------- /Prometheus/include/libraries/prometheus.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/Prometheus/include/libraries/prometheus.h -------------------------------------------------------------------------------- /Prometheus/include/lvo/prometheus_lib.i: -------------------------------------------------------------------------------- 1 | IFND LIBRARIES_PROMETHEUS_LIB_I 2 | LIBRARIES_PROMETHEUS_LIB_I SET 1 3 | 4 | 5 | _LVOPrm_FindBoardTagList EQU -30 6 | _LVOPrm_GetBoardAttrsTagList EQU -36 7 | _LVOPrm_ReadConfigLong EQU -42 8 | _LVOPrm_ReadConfigWord EQU -48 9 | _LVOPrm_ReadConfigByte EQU -54 10 | _LVOPrm_WriteConfigLong EQU -60 11 | _LVOPrm_WriteConfigWord EQU -66 12 | _LVOPrm_WriteConfigByte EQU -72 13 | _LVOPrm_SetBoardAttrsTagList EQU -78 14 | _LVOPrm_AddIntServer EQU -84 15 | _LVOPrm_RemIntServer EQU -90 16 | _LVOPrm_AllocDMABuffer EQU -96 17 | _LVOPrm_FreeDMABuffer EQU -102 18 | _LVOPrm_GetPhysicalAddress EQU -108 19 | 20 | ENDC 21 | -------------------------------------------------------------------------------- /Prometheus/include/pragma/prometheus_lib.h: -------------------------------------------------------------------------------- 1 | #ifndef _INCLUDE_PRAGMA_PROMETHEUS_LIB_H 2 | #define _INCLUDE_PRAGMA_PROMETHEUS_LIB_H 3 | 4 | #ifndef CLIB_PROMETHEUS_PROTOS_H 5 | #include 6 | #endif 7 | 8 | #if defined(AZTEC_C) || defined(__MAXON__) || defined(__STORM__) 9 | #pragma amicall(PrometheusBase,0x01e,Prm_FindBoardTagList(a0,a1)) 10 | #pragma amicall(PrometheusBase,0x024,Prm_GetBoardAttrsTagList(a0,a1)) 11 | #pragma amicall(PrometheusBase,0x02a,Prm_ReadConfigLong(a0,d0)) 12 | #pragma amicall(PrometheusBase,0x030,Prm_ReadConfigWord(a0,d0)) 13 | #pragma amicall(PrometheusBase,0x036,Prm_ReadConfigByte(a0,d0)) 14 | #pragma amicall(PrometheusBase,0x03c,Prm_WriteConfigLong(a0,d0,d1)) 15 | #pragma amicall(PrometheusBase,0x042,Prm_WriteConfigWord(a0,d0,d1)) 16 | #pragma amicall(PrometheusBase,0x048,Prm_WriteConfigByte(a0,d0,d1)) 17 | #pragma amicall(PrometheusBase,0x04e,Prm_SetBoardAttrsTagList(a0,a1)) 18 | #pragma amicall(PrometheusBase,0x054,Prm_AddIntServer(a0,a1)) 19 | #pragma amicall(PrometheusBase,0x05a,Prm_RemIntServer(a0,a1)) 20 | #pragma amicall(PrometheusBase,0x060,Prm_AllocDMABuffer(d0)) 21 | #pragma amicall(PrometheusBase,0x066,Prm_FreeDMABuffer(a0,d0)) 22 | #pragma amicall(PrometheusBase,0x06c,Prm_GetPhysicalAddress(d0)) 23 | #endif 24 | #if defined(_DCC) || defined(__SASC) 25 | #pragma libcall PrometheusBase Prm_FindBoardTagList 01e 9802 26 | #pragma libcall PrometheusBase Prm_GetBoardAttrsTagList 024 9802 27 | #pragma libcall PrometheusBase Prm_ReadConfigLong 02a 0802 28 | #pragma libcall PrometheusBase Prm_ReadConfigWord 030 0802 29 | #pragma libcall PrometheusBase Prm_ReadConfigByte 036 0802 30 | #pragma libcall PrometheusBase Prm_WriteConfigLong 03c 10803 31 | #pragma libcall PrometheusBase Prm_WriteConfigWord 042 10803 32 | #pragma libcall PrometheusBase Prm_WriteConfigByte 048 10803 33 | #pragma libcall PrometheusBase Prm_SetBoardAttrsTagList 04e 9802 34 | #pragma libcall PrometheusBase Prm_AddIntServer 054 9802 35 | #pragma libcall PrometheusBase Prm_RemIntServer 05a 9802 36 | #pragma libcall PrometheusBase Prm_AllocDMABuffer 060 001 37 | #pragma libcall PrometheusBase Prm_FreeDMABuffer 066 0802 38 | #pragma libcall PrometheusBase Prm_GetPhysicalAddress 06c 001 39 | #endif 40 | #ifdef __STORM__ 41 | #pragma tagcall(PrometheusBase,0x01e,Prm_FindBoardTags(a0,a1)) 42 | #pragma tagcall(PrometheusBase,0x024,Prm_GetBoardAttrsTags(a0,a1)) 43 | #pragma tagcall(PrometheusBase,0x04e,Prm_SetBoardAttrsTags(a0,a1)) 44 | #endif 45 | #ifdef __SASC_60 46 | #pragma tagcall PrometheusBase Prm_FindBoardTags 01e 9802 47 | #pragma tagcall PrometheusBase Prm_GetBoardAttrsTags 024 9802 48 | #pragma tagcall PrometheusBase Prm_SetBoardAttrsTags 04e 9802 49 | #endif 50 | 51 | #endif /* _INCLUDE_PRAGMA_PROMETHEUS_LIB_H */ 52 | -------------------------------------------------------------------------------- /Prometheus/include/pragmas/prometheus_pragmas.h: -------------------------------------------------------------------------------- 1 | #ifndef _INCLUDE_PRAGMA_PROMETHEUS_LIB_H 2 | #define _INCLUDE_PRAGMA_PROMETHEUS_LIB_H 3 | 4 | #ifndef CLIB_PROMETHEUS_PROTOS_H 5 | #include 6 | #endif 7 | 8 | #if defined(AZTEC_C) || defined(__MAXON__) || defined(__STORM__) 9 | #pragma amicall(PrometheusBase,0x01e,Prm_FindBoardTagList(a0,a1)) 10 | #pragma amicall(PrometheusBase,0x024,Prm_GetBoardAttrsTagList(a0,a1)) 11 | #pragma amicall(PrometheusBase,0x02a,Prm_ReadConfigLong(a0,d0)) 12 | #pragma amicall(PrometheusBase,0x030,Prm_ReadConfigWord(a0,d0)) 13 | #pragma amicall(PrometheusBase,0x036,Prm_ReadConfigByte(a0,d0)) 14 | #pragma amicall(PrometheusBase,0x03c,Prm_WriteConfigLong(a0,d0,d1)) 15 | #pragma amicall(PrometheusBase,0x042,Prm_WriteConfigWord(a0,d0,d1)) 16 | #pragma amicall(PrometheusBase,0x048,Prm_WriteConfigByte(a0,d0,d1)) 17 | #pragma amicall(PrometheusBase,0x04e,Prm_SetBoardAttrsTagList(a0,a1)) 18 | #pragma amicall(PrometheusBase,0x054,Prm_AddIntServer(a0,a1)) 19 | #pragma amicall(PrometheusBase,0x05a,Prm_RemIntServer(a0,a1)) 20 | #pragma amicall(PrometheusBase,0x060,Prm_AllocDMABuffer(d0)) 21 | #pragma amicall(PrometheusBase,0x066,Prm_FreeDMABuffer(a0,d0)) 22 | #pragma amicall(PrometheusBase,0x06c,Prm_GetPhysicalAddress(d0)) 23 | #endif 24 | #if defined(_DCC) || defined(__SASC) 25 | #pragma libcall PrometheusBase Prm_FindBoardTagList 01e 9802 26 | #pragma libcall PrometheusBase Prm_GetBoardAttrsTagList 024 9802 27 | #pragma libcall PrometheusBase Prm_ReadConfigLong 02a 0802 28 | #pragma libcall PrometheusBase Prm_ReadConfigWord 030 0802 29 | #pragma libcall PrometheusBase Prm_ReadConfigByte 036 0802 30 | #pragma libcall PrometheusBase Prm_WriteConfigLong 03c 10803 31 | #pragma libcall PrometheusBase Prm_WriteConfigWord 042 10803 32 | #pragma libcall PrometheusBase Prm_WriteConfigByte 048 10803 33 | #pragma libcall PrometheusBase Prm_SetBoardAttrsTagList 04e 9802 34 | #pragma libcall PrometheusBase Prm_AddIntServer 054 9802 35 | #pragma libcall PrometheusBase Prm_RemIntServer 05a 9802 36 | #pragma libcall PrometheusBase Prm_AllocDMABuffer 060 001 37 | #pragma libcall PrometheusBase Prm_FreeDMABuffer 066 0802 38 | #pragma libcall PrometheusBase Prm_GetPhysicalAddress 06c 001 39 | #endif 40 | #ifdef __STORM__ 41 | #pragma tagcall(PrometheusBase,0x01e,Prm_FindBoardTags(a0,a1)) 42 | #pragma tagcall(PrometheusBase,0x024,Prm_GetBoardAttrsTags(a0,a1)) 43 | #pragma tagcall(PrometheusBase,0x04e,Prm_SetBoardAttrsTags(a0,a1)) 44 | #endif 45 | #ifdef __SASC_60 46 | #pragma tagcall PrometheusBase Prm_FindBoardTags 01e 9802 47 | #pragma tagcall PrometheusBase Prm_GetBoardAttrsTags 024 9802 48 | #pragma tagcall PrometheusBase Prm_SetBoardAttrsTags 04e 9802 49 | #endif 50 | 51 | #endif /* _INCLUDE_PRAGMA_PROMETHEUS_LIB_H */ 52 | -------------------------------------------------------------------------------- /Prometheus/include/proto/prometheus.h: -------------------------------------------------------------------------------- 1 | #ifndef _PROTO_PROMETHEUS_H 2 | #define _PROTO_PROMETHEUS_H 3 | 4 | #ifndef EXEC_TYPES_H 5 | #include 6 | #endif 7 | #ifndef CLIB_PROMETHEUS_PROTOS_H 8 | #include 9 | #endif 10 | 11 | #ifndef __NOLIBBASE__ 12 | extern struct Library *PrometheusBase; 13 | #endif 14 | 15 | #ifdef __GNUC__ 16 | #include 17 | #elif !defined(__VBCC__) 18 | #include 19 | #endif 20 | 21 | #endif /* _PROTO_PROMETHEUS_H */ 22 | -------------------------------------------------------------------------------- /PrometheusOpenPci/DELObject: -------------------------------------------------------------------------------- 1 | delete #?.o 2 | delete #?.lnk 3 | delete #?.lst 4 | delete #?.lst.info 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /PrometheusOpenPci/DELObject.info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/PrometheusOpenPci/DELObject.info -------------------------------------------------------------------------------- /PrometheusOpenPci/Ppci_allocfree_dma.c: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: Ppci_allocfree_dma.c,v 1.1.1.1 2002/05/09 13:36:45 titan Exp $ 3 | */ 4 | 5 | #include "/openpcidata.h" 6 | #include "PrometheusWrapper.h" 7 | 8 | /* Alloc and Free DMA memory for PCI card */ 9 | APTR PROMETHEUSpci_allocdma_mem(unsigned long size, unsigned long flags) 10 | { 11 | return(Prm_AllocDMABuffer(size)); 12 | } 13 | 14 | void PROMETHEUSpci_freedma_mem(APTR buffer, unsigned long size) 15 | { 16 | Prm_FreeDMABuffer(buffer, size); 17 | } 18 | 19 | -------------------------------------------------------------------------------- /PrometheusOpenPci/Ppci_allocfree_dma.c.info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/PrometheusOpenPci/Ppci_allocfree_dma.c.info -------------------------------------------------------------------------------- /PrometheusOpenPci/Ppci_in_out.c: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: Ppci_in_out.c,v 1.2 2002/07/06 18:25:05 titan Exp $ 3 | */ 4 | 5 | #include "openpcidata.h" 6 | #include "PrometheusWrapper.h" 7 | 8 | #ifdef __GNUC__ 9 | #include "../InOut.h" 10 | #else 11 | #include "InOut.h" 12 | #endif 13 | 14 | /* IN/OUT Function for PCI Bus */ 15 | 16 | unsigned char PROMETHEUSpci_inb(unsigned long address) 17 | { 18 | return(hinb(address)); 19 | } 20 | void PROMETHEUSpci_outb(unsigned char value, unsigned long address) 21 | { 22 | houtb(value,address); 23 | } 24 | 25 | unsigned short PROMETHEUSpci_inw(unsigned long address) 26 | { 27 | return(hinw(address)); 28 | } 29 | void PROMETHEUSpci_outw(unsigned short value, unsigned long address) 30 | { 31 | houtw(value,address); 32 | } 33 | 34 | unsigned long PROMETHEUSpci_inl(unsigned long address) 35 | { 36 | return(hinl(address)); 37 | } 38 | 39 | void PROMETHEUSpci_outl(unsigned long value, unsigned long address) 40 | { 41 | houtl(value,address); 42 | } 43 | 44 | /* Write Pci memory -> Amiga memory */ 45 | void PROMETHEUSpci_to_hostcpy(void *pcimemsource, void *memdest, unsigned long packetsize) 46 | { 47 | memcpyl(pcimemsource,memdest,packetsize); 48 | } 49 | 50 | /* Write Amiga memory -> Pci memory */ 51 | void PROMETHEUShost_to_pcicpy(void *memsrc, void *pcimemdest, unsigned long packetsize) 52 | { 53 | memcpyl(memsrc,pcimemdest,packetsize); 54 | } 55 | 56 | /* Write Pci memory -> Pci memory */ 57 | void PROMETHEUSpci_to_pcicpy(void *pcimemsrc, void *pcimemdest, unsigned long packetsize) 58 | { 59 | memcpyl(pcimemsrc,pcimemdest,packetsize); 60 | } 61 | 62 | -------------------------------------------------------------------------------- /PrometheusOpenPci/Ppci_in_out.c.info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/PrometheusOpenPci/Ppci_in_out.c.info -------------------------------------------------------------------------------- /PrometheusOpenPci/Ppci_interrupt.c: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: Ppci_interrupt.c,v 1.1.1.1 2002/05/09 13:36:42 titan Exp $ 3 | */ 4 | 5 | #include "/openpcidata.h" 6 | #include "PrometheusWrapper.h" 7 | 8 | /* 9 | Add interrupt server 10 | */ 11 | BOOL PROMETHEUSpci_add_intserver(struct Interrupt *PciInterrupt, struct pci_dev *pcidev) 12 | { 13 | return(Prm_AddIntServer(pcidev->reserved->board,PciInterrupt)); 14 | } 15 | 16 | void PROMETHEUSpci_rem_intserver(struct Interrupt *PciInterrupt, struct pci_dev *pcidev) 17 | { 18 | Prm_RemIntServer(pcidev->reserved->board,PciInterrupt); 19 | } 20 | 21 | -------------------------------------------------------------------------------- /PrometheusOpenPci/Ppci_interrupt.c.info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/PrometheusOpenPci/Ppci_interrupt.c.info -------------------------------------------------------------------------------- /PrometheusOpenPci/Ppci_logictophysic_addr.c: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: Ppci_logictophysic_addr.c,v 1.1.1.1 2005/03/19 12:11:00 titan Exp $ 3 | */ 4 | 5 | #include "/openpcidata.h" 6 | #include "PrometheusWrapper.h" 7 | 8 | /* Convert Logical to Physical PCI Memory Address */ 9 | APTR PROMETHEUSpci_logic_to_physic_addr(APTR PciLogicalAddr, struct pci_dev *pcidev) 10 | { 11 | if(pcidev) 12 | { 13 | return(Prm_GetPhysicalAddress(PciLogicalAddr)); 14 | } 15 | else 16 | return NULL; 17 | } 18 | 19 | APTR PROMETHEUSpci_physic_to_logic_addr(APTR PciPhysicalAddr, struct pci_dev *pcidev) 20 | { 21 | if(pcidev) 22 | { 23 | return(Prm_GetVirtualAddress(PciPhysicalAddr)); /* Not supported for the moment */ 24 | } 25 | else 26 | return NULL; 27 | } 28 | -------------------------------------------------------------------------------- /PrometheusOpenPci/Ppci_logictophysic_addr.c.info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/PrometheusOpenPci/Ppci_logictophysic_addr.c.info -------------------------------------------------------------------------------- /PrometheusOpenPci/Ppci_obtainrelease_card.c: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: Ppci_obtainrelease_card.c,v 1.2 2005/03/19 11:53:00 titan Exp $ 3 | */ 4 | 5 | #ifdef __GNUC__ 6 | #include "../openpcidata.h" 7 | #else 8 | #include "/openpcidata.h" 9 | #endif 10 | 11 | #include "PrometheusWrapper.h" 12 | 13 | /* Obtain/Release PCI card */ 14 | 15 | /* For Prometheus there's no Unlock mechanism !! */ 16 | BOOL PROMETHEUSpci_obtain_card(struct pci_dev *pcidev) 17 | { 18 | if (Prm_SetBoardAttrsTags(pcidev->reserved->board, 19 | PRM_BoardOwner, (LONG)OpenPciBase, 20 | TAG_END)) 21 | { 22 | pcidev->reserved->pci_cardlocked=TRUE; 23 | // proceed with the hardware 24 | return(TRUE); 25 | } 26 | else 27 | { 28 | pcidev->reserved->pci_cardlocked=FALSE; 29 | // somebody already claimed the hadrware 30 | return(FALSE); 31 | } 32 | 33 | } 34 | 35 | void PROMETHEUSpci_release_card(struct pci_dev *pcidev) 36 | { 37 | Prm_SetBoardAttrsTags(pcidev->reserved->board, 38 | PRM_BoardOwner, (LONG)NULL, 39 | TAG_END); 40 | pcidev->reserved->pci_cardlocked=FALSE; /* We release the PCI card */ 41 | } 42 | 43 | -------------------------------------------------------------------------------- /PrometheusOpenPci/Ppci_obtainrelease_card.c.info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/PrometheusOpenPci/Ppci_obtainrelease_card.c.info -------------------------------------------------------------------------------- /PrometheusOpenPci/Ppci_readwrite_config.c: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: Ppci_readwrite_config.c,v 1.1.1.1 2005/03/19 11:43:00 titan Exp $ 3 | */ 4 | 5 | #include "/openpcidata.h" 6 | #include "PrometheusWrapper.h" 7 | 8 | /* Read Config */ 9 | unsigned char PROMETHEUSpci_read_config_byte(unsigned char registernum, struct pci_dev *dev) 10 | { 11 | return( Prm_ReadConfigByte(dev->reserved->board, registernum) ); 12 | } 13 | 14 | unsigned short PROMETHEUSpci_read_config_word(unsigned char registernum, struct pci_dev *dev) 15 | { 16 | return( Prm_ReadConfigWord(dev->reserved->board, registernum) ); 17 | } 18 | 19 | unsigned long PROMETHEUSpci_read_config_long(unsigned char registernum, struct pci_dev *dev) 20 | { 21 | return( Prm_ReadConfigLong(dev->reserved->board, registernum) ); 22 | } 23 | 24 | /* Write Config */ 25 | 26 | void PROMETHEUSpci_write_config_byte(unsigned char registernum, unsigned char val, struct pci_dev *dev) 27 | { 28 | Prm_WriteConfigByte(dev->reserved->board, val, registernum ); 29 | } 30 | 31 | void PROMETHEUSpci_write_config_word(unsigned char registernum, unsigned short val, struct pci_dev *dev) 32 | { 33 | Prm_WriteConfigWord(dev->reserved->board, val, registernum ); 34 | } 35 | 36 | void PROMETHEUSpci_write_config_long(unsigned char registernum, unsigned long val, struct pci_dev *dev) 37 | { 38 | Prm_WriteConfigLong(dev->reserved->board, val, registernum ); 39 | } 40 | -------------------------------------------------------------------------------- /PrometheusOpenPci/Ppci_readwrite_config.c.info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/PrometheusOpenPci/Ppci_readwrite_config.c.info -------------------------------------------------------------------------------- /PrometheusOpenPci/Ppci_set_master.c: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: Ppci_set_master.c,v 1.4 2005/19/03 12:10:00 titan Exp $ 3 | */ 4 | 5 | #include "/openpcidata.h" 6 | #include "PrometheusWrapper.h" 7 | 8 | BOOL PROMETHEUSpci_set_master(struct pci_dev *dev) 9 | { 10 | unsigned short value; 11 | 12 | if(dev->master) 13 | { 14 | // Read Bus Master 15 | value=Prm_ReadConfigWord(dev->reserved->board, PCI_COMMAND ); 16 | DEBUG(dprintf("Prm_ReadConfigWord : 0x%04lx\n",value)); 17 | // We Activate BUS MASTERING 18 | value|=PCI_COMMAND_MASTER; 19 | DEBUG(dprintf("Prm_WriteConfigWord(0x%08lx,0x%lx,0x%lx)\n",dev->reserved->board, value, PCI_COMMAND )); 20 | Prm_WriteConfigWord(dev->reserved->board, value, PCI_COMMAND); 21 | 22 | // Verify if Bus Master capable 23 | value=Prm_ReadConfigWord(dev->reserved->board, PCI_COMMAND); 24 | 25 | DEBUG(dprintf("Prm_ReadConfigWord : 0x%04lx\n",value)); 26 | if(value&PCI_COMMAND_MASTER) 27 | { 28 | return TRUE; 29 | }else 30 | return FALSE; 31 | }else 32 | return FALSE; 33 | 34 | } 35 | 36 | -------------------------------------------------------------------------------- /PrometheusOpenPci/Ppci_set_master.c.info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/PrometheusOpenPci/Ppci_set_master.c.info -------------------------------------------------------------------------------- /PrometheusOpenPci/Prometheus-3.0/Developer/fd/prometheus_lib.fd: -------------------------------------------------------------------------------- 1 | ##base _PrometheusBase 2 | ##bias 30 3 | ##public 4 | Prm_FindBoardTagList(previous,taglist)(a0/a1) 5 | Prm_GetBoardAttrsTagList(board,taglist)(a0/a1) 6 | *--- functions added in V2 --- 7 | Prm_ReadConfigLong(board,offset)(a0/d0) 8 | Prm_ReadConfigWord(board,offset)(a0/d0) 9 | Prm_ReadConfigByte(board,offset)(a0/d0) 10 | Prm_WriteConfigLong(board,data,offset)(a0/d0/d1) 11 | Prm_WriteConfigWord(board,data,offset)(a0/d0/d1) 12 | Prm_WriteConfigByte(board,data,offset)(a0/d0/d1) 13 | Prm_SetBoardAttrsTagList(board,taglist)(a0/a1) 14 | Prm_AddIntServer(board,intr)(a0/a1) 15 | Prm_RemIntServer(board,intr)(a0/a1) 16 | Prm_AllocDMABuffer(size)(d0) 17 | Prm_FreeDMABuffer(block,size)(a0/d0) 18 | Prm_GetPhysicalAddress(addr)(d0) 19 | ##end 20 | 21 | -------------------------------------------------------------------------------- /PrometheusOpenPci/Prometheus-3.0/include/clib/prometheus_protos.h: -------------------------------------------------------------------------------- 1 | #ifndef CLIB_PROMETHEUS_PROTOS_H 2 | #define CLIB_PROMETHEUS_PROTOS_H 3 | 4 | /* 5 | ** $VER: prometheus_protos.h 3.0 (13.03.2005) 6 | ** 7 | ** C prototypes. For use with 32 bit integers only. 8 | ** 9 | ** (C) Copyright 2000-2005 Matay. 10 | ** All Rights Reserved 11 | */ 12 | 13 | #ifndef EXEC_INTERRUPTS_H 14 | #include 15 | #endif /* EXEC_INTERRUPTS_H */ 16 | 17 | #ifndef EXEC_TYPES_H 18 | #include 19 | #endif /* EXEC_TYPES_H */ 20 | 21 | #ifndef LIBRARIES_PROMETHEUS_H 22 | #include 23 | #endif /* LIBRARIES_PROMETHEUS_H */ 24 | 25 | #ifndef UTILITY_TAGITEM_H 26 | #include 27 | #endif /* UTILITY_TAGITEM_H */ 28 | 29 | /*--- functions in V1 or higher ---*/ 30 | 31 | PCIBoard *Prm_FindBoardTagList(PCIBoard *previous, struct TagItem* taglist); 32 | PCIBoard *Prm_FindBoardTags(PCIBoard *previous, Tag tag1, ...); 33 | ULONG Prm_GetBoardAttrsTagList(PCIBoard *board, struct TagItem* taglist); 34 | ULONG Prm_GetBoardAttrsTags(PCIBoard *board, Tag tag1, ...); 35 | 36 | /*--- functions in V2 or higher ---*/ 37 | 38 | ULONG Prm_ReadConfigLong(PCIBoard *board, UBYTE offset); 39 | UWORD Prm_ReadConfigWord(PCIBoard *board, UBYTE offset); 40 | UBYTE Prm_ReadConfigByte(PCIBoard *board, UBYTE offset); 41 | VOID Prm_WriteConfigLong(PCIBoard *board, ULONG data, UBYTE offset); 42 | VOID Prm_WriteConfigWord(PCIBoard *board, UWORD data, UBYTE offset); 43 | VOID Prm_WriteConfigByte(PCIBoard *board, UBYTE data, UBYTE offset); 44 | ULONG Prm_SetBoardAttrsTagList(PCIBoard *board, struct TagItem* taglist); 45 | ULONG Prm_SetBoardAttrsTags(PCIBoard *board, Tag tag1, ...); 46 | BOOL Prm_AddIntServer(PCIBoard *board, struct Interrupt *intr); 47 | VOID Prm_RemIntServer(PCIBoard *board, struct Interrupt *intr); 48 | APTR Prm_AllocDMABuffer(ULONG size); 49 | VOID Prm_FreeDMABuffer(APTR buffer, ULONG size); 50 | APTR Prm_GetPhysicalAddress(APTR addr); 51 | 52 | /*--- functions in V3 or higher ---*/ 53 | 54 | APTR Prm_GetVirtualAddress(APTR addr); 55 | #endif /* CLIB_PROMETHEUS_PROTOS_H */ 56 | -------------------------------------------------------------------------------- /PrometheusOpenPci/Prometheus-3.0/include/inline/prometheus.h: -------------------------------------------------------------------------------- 1 | /* Automatically generated header! Do not edit! */ 2 | 3 | #ifndef _INLINE_PROMETHEUS_H 4 | #define _INLINE_PROMETHEUS_H 5 | 6 | #ifndef __INLINE_MACROS_H 7 | #include 8 | #endif /* !__INLINE_MACROS_H */ 9 | 10 | #ifndef PROMETHEUS_BASE_NAME 11 | #define PROMETHEUS_BASE_NAME PrometheusBase 12 | #endif /* !PROMETHEUS_BASE_NAME */ 13 | 14 | #define Prm_AddIntServer(board, intr) \ 15 | LP2(0x54, BOOL, Prm_AddIntServer, PCIBoard *, board, a0, struct Interrupt *, intr, a1, \ 16 | , PROMETHEUS_BASE_NAME) 17 | 18 | #define Prm_AllocDMABuffer(size) \ 19 | LP1(0x60, APTR, Prm_AllocDMABuffer, ULONG, size, d0, \ 20 | , PROMETHEUS_BASE_NAME) 21 | 22 | #define Prm_FindBoardTagList(previous, taglist) \ 23 | LP2(0x1e, PCIBoard *, Prm_FindBoardTagList, PCIBoard *, previous, a0, struct TagItem*, taglist, a1, \ 24 | , PROMETHEUS_BASE_NAME) 25 | 26 | #ifndef NO_INLINE_STDARG 27 | #define Prm_FindBoardTags(a0, tags...) \ 28 | ({ULONG _tags[] = { tags }; Prm_FindBoardTagList((a0), (struct TagItem*)_tags);}) 29 | #endif /* !NO_INLINE_STDARG */ 30 | 31 | #define Prm_FreeDMABuffer(block, size) \ 32 | LP2NR(0x66, Prm_FreeDMABuffer, APTR, block, a0, ULONG, size, d0, \ 33 | , PROMETHEUS_BASE_NAME) 34 | 35 | #define Prm_GetBoardAttrsTagList(board, taglist) \ 36 | LP2(0x24, ULONG, Prm_GetBoardAttrsTagList, PCIBoard *, board, a0, struct TagItem*, taglist, a1, \ 37 | , PROMETHEUS_BASE_NAME) 38 | 39 | #ifndef NO_INLINE_STDARG 40 | #define Prm_GetBoardAttrsTags(a0, tags...) \ 41 | ({ULONG _tags[] = { tags }; Prm_GetBoardAttrsTagList((a0), (struct TagItem*)_tags);}) 42 | #endif /* !NO_INLINE_STDARG */ 43 | 44 | #define Prm_GetPhysicalAddress(addr) \ 45 | LP1(0x6c, APTR, Prm_GetPhysicalAddress, APTR, addr, d0, \ 46 | , PROMETHEUS_BASE_NAME) 47 | 48 | #define Prm_GetVirtualAddress(addr) \ 49 | LP1(0x72, APTR, Prm_GetVirtualAddress, APTR, addr, d0, \ 50 | , PROMETHEUS_BASE_NAME) 51 | 52 | #define Prm_ReadConfigByte(board, offset) \ 53 | LP2(0x36, UBYTE, Prm_ReadConfigByte, PCIBoard *, board, a0, UBYTE, offset, d0, \ 54 | , PROMETHEUS_BASE_NAME) 55 | 56 | #define Prm_ReadConfigLong(board, offset) \ 57 | LP2(0x2a, ULONG, Prm_ReadConfigLong, PCIBoard *, board, a0, UBYTE, offset, d0, \ 58 | , PROMETHEUS_BASE_NAME) 59 | 60 | #define Prm_ReadConfigWord(board, offset) \ 61 | LP2(0x30, UWORD, Prm_ReadConfigWord, PCIBoard *, board, a0, UBYTE, offset, d0, \ 62 | , PROMETHEUS_BASE_NAME) 63 | 64 | #define Prm_RemIntServer(board, intr) \ 65 | LP2NR(0x5a, Prm_RemIntServer, PCIBoard *, board, a0, struct Interrupt *, intr, a1, \ 66 | , PROMETHEUS_BASE_NAME) 67 | 68 | #define Prm_SetBoardAttrsTagList(board, taglist) \ 69 | LP2(0x4e, ULONG, Prm_SetBoardAttrsTagList, PCIBoard *, board, a0, struct TagItem*, taglist, a1, \ 70 | , PROMETHEUS_BASE_NAME) 71 | 72 | #ifndef NO_INLINE_STDARG 73 | #define Prm_SetBoardAttrsTags(a0, tags...) \ 74 | ({ULONG _tags[] = { tags }; Prm_SetBoardAttrsTagList((a0), (struct TagItem*)_tags);}) 75 | #endif /* !NO_INLINE_STDARG */ 76 | 77 | #define Prm_WriteConfigByte(board, data, offset) \ 78 | LP3NR(0x48, Prm_WriteConfigByte, PCIBoard *, board, a0, UBYTE, data, d0, UBYTE, offset, d1, \ 79 | , PROMETHEUS_BASE_NAME) 80 | 81 | #define Prm_WriteConfigLong(board, data, offset) \ 82 | LP3NR(0x3c, Prm_WriteConfigLong, PCIBoard *, board, a0, ULONG, data, d0, UBYTE, offset, d1, \ 83 | , PROMETHEUS_BASE_NAME) 84 | 85 | #define Prm_WriteConfigWord(board, data, offset) \ 86 | LP3NR(0x42, Prm_WriteConfigWord, PCIBoard *, board, a0, UWORD, data, d0, UBYTE, offset, d1, \ 87 | , PROMETHEUS_BASE_NAME) 88 | 89 | #endif /* !_INLINE_PROMETHEUS_H */ 90 | -------------------------------------------------------------------------------- /PrometheusOpenPci/Prometheus-3.0/include/inline/prometheus_protos.h: -------------------------------------------------------------------------------- 1 | #ifndef _VBCCINLINE_PROMETHEUS_H 2 | #define _VBCCINLINE_PROMETHEUS_H 3 | 4 | #ifndef EXEC_TYPES_H 5 | #include 6 | #endif 7 | 8 | PCIBoard * __Prm_FindBoardTagList(__reg("a6") struct Library *, __reg("a0") PCIBoard * previous, __reg("a1") struct TagItem* taglist)="\tjsr\t-30(a6)"; 9 | #define Prm_FindBoardTagList(previous, taglist) __Prm_FindBoardTagList(PrometheusBase, (previous), (taglist)) 10 | 11 | #if !defined(NO_INLINE_STDARG) && (__STDC__ == 1L) && (__STDC_VERSION__ >= 199901L) 12 | PCIBoard * __Prm_FindBoardTags(__reg("a6") struct Library *, __reg("a0") PCIBoard * previous, Tag taglist, ...)="\tmovea.l\ta7,a1\n\tjsr\t-30(a6)"; 13 | #define Prm_FindBoardTags(previous, ...) __Prm_FindBoardTags(PrometheusBase, (previous), __VA_ARGS__) 14 | #endif 15 | 16 | ULONG __Prm_GetBoardAttrsTagList(__reg("a6") struct Library *, __reg("a0") PCIBoard * board, __reg("a1") struct TagItem* taglist)="\tjsr\t-36(a6)"; 17 | #define Prm_GetBoardAttrsTagList(board, taglist) __Prm_GetBoardAttrsTagList(PrometheusBase, (board), (taglist)) 18 | 19 | #if !defined(NO_INLINE_STDARG) && (__STDC__ == 1L) && (__STDC_VERSION__ >= 199901L) 20 | ULONG __Prm_GetBoardAttrsTags(__reg("a6") struct Library *, __reg("a0") PCIBoard * board, Tag taglist, ...)="\tmovea.l\ta7,a1\n\tjsr\t-36(a6)"; 21 | #define Prm_GetBoardAttrsTags(board, ...) __Prm_GetBoardAttrsTags(PrometheusBase, (board), __VA_ARGS__) 22 | #endif 23 | 24 | ULONG __Prm_ReadConfigLong(__reg("a6") struct Library *, __reg("a0") PCIBoard * board, __reg("d0") UBYTE offset)="\tjsr\t-42(a6)"; 25 | #define Prm_ReadConfigLong(board, offset) __Prm_ReadConfigLong(PrometheusBase, (board), (offset)) 26 | 27 | UWORD __Prm_ReadConfigWord(__reg("a6") struct Library *, __reg("a0") PCIBoard * board, __reg("d0") UBYTE offset)="\tjsr\t-48(a6)"; 28 | #define Prm_ReadConfigWord(board, offset) __Prm_ReadConfigWord(PrometheusBase, (board), (offset)) 29 | 30 | UBYTE __Prm_ReadConfigByte(__reg("a6") struct Library *, __reg("a0") PCIBoard * board, __reg("d0") UBYTE offset)="\tjsr\t-54(a6)"; 31 | #define Prm_ReadConfigByte(board, offset) __Prm_ReadConfigByte(PrometheusBase, (board), (offset)) 32 | 33 | VOID __Prm_WriteConfigLong(__reg("a6") struct Library *, __reg("a0") PCIBoard * board, __reg("d0") ULONG data, __reg("d1") UBYTE offset)="\tjsr\t-60(a6)"; 34 | #define Prm_WriteConfigLong(board, data, offset) __Prm_WriteConfigLong(PrometheusBase, (board), (data), (offset)) 35 | 36 | VOID __Prm_WriteConfigWord(__reg("a6") struct Library *, __reg("a0") PCIBoard * board, __reg("d0") UWORD data, __reg("d1") UBYTE offset)="\tjsr\t-66(a6)"; 37 | #define Prm_WriteConfigWord(board, data, offset) __Prm_WriteConfigWord(PrometheusBase, (board), (data), (offset)) 38 | 39 | VOID __Prm_WriteConfigByte(__reg("a6") struct Library *, __reg("a0") PCIBoard * board, __reg("d0") UBYTE data, __reg("d1") UBYTE offset)="\tjsr\t-72(a6)"; 40 | #define Prm_WriteConfigByte(board, data, offset) __Prm_WriteConfigByte(PrometheusBase, (board), (data), (offset)) 41 | 42 | ULONG __Prm_SetBoardAttrsTagList(__reg("a6") struct Library *, __reg("a0") PCIBoard * board, __reg("a1") struct TagItem* taglist)="\tjsr\t-78(a6)"; 43 | #define Prm_SetBoardAttrsTagList(board, taglist) __Prm_SetBoardAttrsTagList(PrometheusBase, (board), (taglist)) 44 | 45 | #if !defined(NO_INLINE_STDARG) && (__STDC__ == 1L) && (__STDC_VERSION__ >= 199901L) 46 | ULONG __Prm_SetBoardAttrsTags(__reg("a6") struct Library *, __reg("a0") PCIBoard * board, Tag taglist, ...)="\tmovea.l\ta7,a1\n\tjsr\t-78(a6)"; 47 | #define Prm_SetBoardAttrsTags(board, ...) __Prm_SetBoardAttrsTags(PrometheusBase, (board), __VA_ARGS__) 48 | #endif 49 | 50 | BOOL __Prm_AddIntServer(__reg("a6") struct Library *, __reg("a0") PCIBoard * board, __reg("a1") struct Interrupt * intr)="\tjsr\t-84(a6)"; 51 | #define Prm_AddIntServer(board, intr) __Prm_AddIntServer(PrometheusBase, (board), (intr)) 52 | 53 | VOID __Prm_RemIntServer(__reg("a6") struct Library *, __reg("a0") PCIBoard * board, __reg("a1") struct Interrupt * intr)="\tjsr\t-90(a6)"; 54 | #define Prm_RemIntServer(board, intr) __Prm_RemIntServer(PrometheusBase, (board), (intr)) 55 | 56 | APTR __Prm_AllocDMABuffer(__reg("a6") struct Library *, __reg("d0") ULONG size)="\tjsr\t-96(a6)"; 57 | #define Prm_AllocDMABuffer(size) __Prm_AllocDMABuffer(PrometheusBase, (size)) 58 | 59 | VOID __Prm_FreeDMABuffer(__reg("a6") struct Library *, __reg("a0") APTR block, __reg("d0") ULONG size)="\tjsr\t-102(a6)"; 60 | #define Prm_FreeDMABuffer(block, size) __Prm_FreeDMABuffer(PrometheusBase, (block), (size)) 61 | 62 | APTR __Prm_GetPhysicalAddress(__reg("a6") struct Library *, __reg("d0") APTR addr)="\tjsr\t-108(a6)"; 63 | #define Prm_GetPhysicalAddress(addr) __Prm_GetPhysicalAddress(PrometheusBase, (addr)) 64 | 65 | APTR __Prm_GetVirtualAddress(__reg("a6") struct Library *, __reg("d0") APTR addr)="\tjsr\t-114(a6)"; 66 | #define Prm_GetVirtualAddress(addr) __Prm_GetVirtualAddress(PrometheusBase, (addr)) 67 | 68 | #endif /* _VBCCINLINE_PROMETHEUS_H */ 69 | -------------------------------------------------------------------------------- /PrometheusOpenPci/Prometheus-3.0/include/libraries/prometheus.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/PrometheusOpenPci/Prometheus-3.0/include/libraries/prometheus.h -------------------------------------------------------------------------------- /PrometheusOpenPci/Prometheus-3.0/include/lvo/prometheus_lib.i: -------------------------------------------------------------------------------- 1 | IFND LIBRARIES_PROMETHEUS_LIB_I 2 | LIBRARIES_PROMETHEUS_LIB_I SET 1 3 | 4 | 5 | _LVOPrm_FindBoardTagList EQU -30 6 | _LVOPrm_GetBoardAttrsTagList EQU -36 7 | _LVOPrm_ReadConfigLong EQU -42 8 | _LVOPrm_ReadConfigWord EQU -48 9 | _LVOPrm_ReadConfigByte EQU -54 10 | _LVOPrm_WriteConfigLong EQU -60 11 | _LVOPrm_WriteConfigWord EQU -66 12 | _LVOPrm_WriteConfigByte EQU -72 13 | _LVOPrm_SetBoardAttrsTagList EQU -78 14 | _LVOPrm_AddIntServer EQU -84 15 | _LVOPrm_RemIntServer EQU -90 16 | _LVOPrm_AllocDMABuffer EQU -96 17 | _LVOPrm_FreeDMABuffer EQU -102 18 | _LVOPrm_GetPhysicalAddress EQU -108 19 | _LVOPrm_GetVirtualAddress EQU -112 20 | 21 | ENDC 22 | -------------------------------------------------------------------------------- /PrometheusOpenPci/Prometheus-3.0/include/pragma/prometheus_lib.h: -------------------------------------------------------------------------------- 1 | #ifndef _INCLUDE_PRAGMA_PROMETHEUS_LIB_H 2 | #define _INCLUDE_PRAGMA_PROMETHEUS_LIB_H 3 | 4 | #ifndef CLIB_PROMETHEUS_PROTOS_H 5 | #include 6 | #endif 7 | 8 | #if defined(AZTEC_C) || defined(__MAXON__) || defined(__STORM__) 9 | #pragma amicall(PrometheusBase,0x01e,Prm_FindBoardTagList(a0,a1)) 10 | #pragma amicall(PrometheusBase,0x024,Prm_GetBoardAttrsTagList(a0,a1)) 11 | #pragma amicall(PrometheusBase,0x02a,Prm_ReadConfigLong(a0,d0)) 12 | #pragma amicall(PrometheusBase,0x030,Prm_ReadConfigWord(a0,d0)) 13 | #pragma amicall(PrometheusBase,0x036,Prm_ReadConfigByte(a0,d0)) 14 | #pragma amicall(PrometheusBase,0x03c,Prm_WriteConfigLong(a0,d0,d1)) 15 | #pragma amicall(PrometheusBase,0x042,Prm_WriteConfigWord(a0,d0,d1)) 16 | #pragma amicall(PrometheusBase,0x048,Prm_WriteConfigByte(a0,d0,d1)) 17 | #pragma amicall(PrometheusBase,0x04e,Prm_SetBoardAttrsTagList(a0,a1)) 18 | #pragma amicall(PrometheusBase,0x054,Prm_AddIntServer(a0,a1)) 19 | #pragma amicall(PrometheusBase,0x05a,Prm_RemIntServer(a0,a1)) 20 | #pragma amicall(PrometheusBase,0x060,Prm_AllocDMABuffer(d0)) 21 | #pragma amicall(PrometheusBase,0x066,Prm_FreeDMABuffer(a0,d0)) 22 | #pragma amicall(PrometheusBase,0x06c,Prm_GetPhysicalAddress(d0)) 23 | #pragma amicall(PrometheusBase,0x072,Prm_GetVirtualAddress(d0)) 24 | #endif 25 | #if defined(_DCC) || defined(__SASC) 26 | #pragma libcall PrometheusBase Prm_FindBoardTagList 01e 9802 27 | #pragma libcall PrometheusBase Prm_GetBoardAttrsTagList 024 9802 28 | #pragma libcall PrometheusBase Prm_ReadConfigLong 02a 0802 29 | #pragma libcall PrometheusBase Prm_ReadConfigWord 030 0802 30 | #pragma libcall PrometheusBase Prm_ReadConfigByte 036 0802 31 | #pragma libcall PrometheusBase Prm_WriteConfigLong 03c 10803 32 | #pragma libcall PrometheusBase Prm_WriteConfigWord 042 10803 33 | #pragma libcall PrometheusBase Prm_WriteConfigByte 048 10803 34 | #pragma libcall PrometheusBase Prm_SetBoardAttrsTagList 04e 9802 35 | #pragma libcall PrometheusBase Prm_AddIntServer 054 9802 36 | #pragma libcall PrometheusBase Prm_RemIntServer 05a 9802 37 | #pragma libcall PrometheusBase Prm_AllocDMABuffer 060 001 38 | #pragma libcall PrometheusBase Prm_FreeDMABuffer 066 0802 39 | #pragma libcall PrometheusBase Prm_GetPhysicalAddress 06c 001 40 | #pragma libcall PrometheusBase Prm_GetVirtualAddress 072 001 41 | #endif 42 | #ifdef __STORM__ 43 | #pragma tagcall(PrometheusBase,0x01e,Prm_FindBoardTags(a0,a1)) 44 | #pragma tagcall(PrometheusBase,0x024,Prm_GetBoardAttrsTags(a0,a1)) 45 | #pragma tagcall(PrometheusBase,0x04e,Prm_SetBoardAttrsTags(a0,a1)) 46 | #endif 47 | #ifdef __SASC_60 48 | #pragma tagcall PrometheusBase Prm_FindBoardTags 01e 9802 49 | #pragma tagcall PrometheusBase Prm_GetBoardAttrsTags 024 9802 50 | #pragma tagcall PrometheusBase Prm_SetBoardAttrsTags 04e 9802 51 | #endif 52 | 53 | #endif /* _INCLUDE_PRAGMA_PROMETHEUS_LIB_H */ 54 | -------------------------------------------------------------------------------- /PrometheusOpenPci/Prometheus-3.0/include/pragmas/prometheus_pragmas.h: -------------------------------------------------------------------------------- 1 | #ifndef _INCLUDE_PRAGMA_PROMETHEUS_LIB_H 2 | #define _INCLUDE_PRAGMA_PROMETHEUS_LIB_H 3 | 4 | #ifndef CLIB_PROMETHEUS_PROTOS_H 5 | #include 6 | #endif 7 | 8 | #if defined(AZTEC_C) || defined(__MAXON__) || defined(__STORM__) 9 | #pragma amicall(PrometheusBase,0x01e,Prm_FindBoardTagList(a0,a1)) 10 | #pragma amicall(PrometheusBase,0x024,Prm_GetBoardAttrsTagList(a0,a1)) 11 | #pragma amicall(PrometheusBase,0x02a,Prm_ReadConfigLong(a0,d0)) 12 | #pragma amicall(PrometheusBase,0x030,Prm_ReadConfigWord(a0,d0)) 13 | #pragma amicall(PrometheusBase,0x036,Prm_ReadConfigByte(a0,d0)) 14 | #pragma amicall(PrometheusBase,0x03c,Prm_WriteConfigLong(a0,d0,d1)) 15 | #pragma amicall(PrometheusBase,0x042,Prm_WriteConfigWord(a0,d0,d1)) 16 | #pragma amicall(PrometheusBase,0x048,Prm_WriteConfigByte(a0,d0,d1)) 17 | #pragma amicall(PrometheusBase,0x04e,Prm_SetBoardAttrsTagList(a0,a1)) 18 | #pragma amicall(PrometheusBase,0x054,Prm_AddIntServer(a0,a1)) 19 | #pragma amicall(PrometheusBase,0x05a,Prm_RemIntServer(a0,a1)) 20 | #pragma amicall(PrometheusBase,0x060,Prm_AllocDMABuffer(d0)) 21 | #pragma amicall(PrometheusBase,0x066,Prm_FreeDMABuffer(a0,d0)) 22 | #pragma amicall(PrometheusBase,0x06c,Prm_GetPhysicalAddress(d0)) 23 | #pragma amicall(PrometheusBase,0x072,Prm_GetVirtualAddress(d0)) 24 | #endif 25 | #if defined(_DCC) || defined(__SASC) 26 | #pragma libcall PrometheusBase Prm_FindBoardTagList 01e 9802 27 | #pragma libcall PrometheusBase Prm_GetBoardAttrsTagList 024 9802 28 | #pragma libcall PrometheusBase Prm_ReadConfigLong 02a 0802 29 | #pragma libcall PrometheusBase Prm_ReadConfigWord 030 0802 30 | #pragma libcall PrometheusBase Prm_ReadConfigByte 036 0802 31 | #pragma libcall PrometheusBase Prm_WriteConfigLong 03c 10803 32 | #pragma libcall PrometheusBase Prm_WriteConfigWord 042 10803 33 | #pragma libcall PrometheusBase Prm_WriteConfigByte 048 10803 34 | #pragma libcall PrometheusBase Prm_SetBoardAttrsTagList 04e 9802 35 | #pragma libcall PrometheusBase Prm_AddIntServer 054 9802 36 | #pragma libcall PrometheusBase Prm_RemIntServer 05a 9802 37 | #pragma libcall PrometheusBase Prm_AllocDMABuffer 060 001 38 | #pragma libcall PrometheusBase Prm_FreeDMABuffer 066 0802 39 | #pragma libcall PrometheusBase Prm_GetPhysicalAddress 06c 001 40 | #pragma libcall PrometheusBase Prm_GetVirtualAddress 072 001 41 | #endif 42 | #ifdef __STORM__ 43 | #pragma tagcall(PrometheusBase,0x01e,Prm_FindBoardTags(a0,a1)) 44 | #pragma tagcall(PrometheusBase,0x024,Prm_GetBoardAttrsTags(a0,a1)) 45 | #pragma tagcall(PrometheusBase,0x04e,Prm_SetBoardAttrsTags(a0,a1)) 46 | #endif 47 | #ifdef __SASC_60 48 | #pragma tagcall PrometheusBase Prm_FindBoardTags 01e 9802 49 | #pragma tagcall PrometheusBase Prm_GetBoardAttrsTags 024 9802 50 | #pragma tagcall PrometheusBase Prm_SetBoardAttrsTags 04e 9802 51 | #endif 52 | 53 | #endif /* _INCLUDE_PRAGMA_PROMETHEUS_LIB_H */ 54 | -------------------------------------------------------------------------------- /PrometheusOpenPci/Prometheus-3.0/include/proto/prometheus.h: -------------------------------------------------------------------------------- 1 | #ifndef _PROTO_PROMETHEUS_H 2 | #define _PROTO_PROMETHEUS_H 3 | 4 | #ifndef EXEC_TYPES_H 5 | #include 6 | #endif 7 | #ifndef CLIB_PROMETHEUS_PROTOS_H 8 | #include 9 | #endif 10 | 11 | #ifndef __NOLIBBASE__ 12 | extern struct Library *PrometheusBase; 13 | #endif 14 | 15 | #ifdef __GNUC__ 16 | #include 17 | #elif !defined(__VBCC__) 18 | #include 19 | #endif 20 | 21 | #endif /* _PROTO_PROMETHEUS_H */ 22 | -------------------------------------------------------------------------------- /PrometheusOpenPci/Prometheus-3.0/prometheus.library: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/PrometheusOpenPci/Prometheus-3.0/prometheus.library -------------------------------------------------------------------------------- /PrometheusOpenPci/PrometheusWrapper.c: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: PrometheusWrapper.c,v 1.8 2005/29/04 20:00:00 titan Exp $ 3 | */ 4 | 5 | #include "/openpcidata.h" 6 | #include "/openpci_protosWrapper.h" 7 | #include "PrometheusWrapper.h" 8 | 9 | struct Library *PrometheusBase = NULL; 10 | 11 | BOOL PROMETHEUSWrapper(void) 12 | { 13 | pci_inb=PROMETHEUSpci_inb; 14 | pci_outb=PROMETHEUSpci_outb; 15 | pci_inw=PROMETHEUSpci_inw; 16 | pci_outw=PROMETHEUSpci_outw; 17 | pci_inl=PROMETHEUSpci_inl; 18 | pci_outl=PROMETHEUSpci_outl; 19 | 20 | pci_to_hostcpy=PROMETHEUSpci_to_hostcpy; 21 | host_to_pcicpy=PROMETHEUShost_to_pcicpy; 22 | pci_to_pcicpy=PROMETHEUSpci_to_pcicpy; 23 | 24 | pci_read_config_byte=PROMETHEUSpci_read_config_byte; 25 | pci_read_config_word=PROMETHEUSpci_read_config_word; 26 | pci_read_config_long=PROMETHEUSpci_read_config_long; 27 | pci_write_config_byte=PROMETHEUSpci_write_config_byte; 28 | pci_write_config_word=PROMETHEUSpci_write_config_word; 29 | pci_write_config_long=PROMETHEUSpci_write_config_long; 30 | 31 | pci_set_master=PROMETHEUSpci_set_master; 32 | 33 | pci_add_intserver=PROMETHEUSpci_add_intserver; 34 | pci_rem_intserver=PROMETHEUSpci_rem_intserver; 35 | 36 | pci_allocdma_mem=PROMETHEUSpci_allocdma_mem; 37 | pci_freedma_mem=PROMETHEUSpci_freedma_mem; 38 | 39 | pci_logic_to_physic_addr=PROMETHEUSpci_logic_to_physic_addr; 40 | pci_physic_to_logic_addr=PROMETHEUSpci_physic_to_logic_addr; 41 | 42 | pci_obtain_card=PROMETHEUSpci_obtain_card; 43 | pci_release_card=PROMETHEUSpci_release_card; 44 | 45 | 46 | return TRUE; 47 | } 48 | 49 | void PROMETHEUSclose(void) 50 | { 51 | 52 | } 53 | 54 | /* We Fill the pci_dev structure */ 55 | void PROMETHEUSpcidev(void) 56 | { 57 | 58 | int i,j; 59 | 60 | unsigned char devfunc; 61 | unsigned char slotnum; 62 | unsigned char funcnum; 63 | 64 | unsigned long prm_funcnum,prm_slotnum,prm_vendor,prm_device; 65 | 66 | unsigned short oldvalue,value; 67 | 68 | /* PROMETHEUS */ 69 | APTR board = NULL; 70 | 71 | unsigned long memaddr; 72 | unsigned long memsize; 73 | unsigned long memattr; 74 | 75 | struct pci_dev *pred; 76 | 77 | OpenPciBase->pcidev=(struct pci_dev *)AllocVec(sizeof(struct pci_dev),0L); 78 | DEBUG(dprintf("Alloc PciDev 0x%08lx\n",OpenPciBase->pcidev)); 79 | 80 | OpenPciBase->pcidev->reserved=(struct OpenPciRes *)AllocVec(sizeof(struct OpenPciRes),0L); 81 | DEBUG(dprintf("Alloc PciDev reserved 0x%08lx\n",OpenPciBase->pcidev->reserved)); 82 | 83 | OpenPciBase->root=OpenPciBase->pcidev; 84 | DEBUG(dprintf("OpenPciBase->root = 0x%08lx\n",OpenPciBase->root)); 85 | 86 | OpenPciBase->pcidev->device=0; 87 | OpenPciBase->pcidev->bus=NULL; 88 | OpenPciBase->pcidev->next=NULL; 89 | OpenPciBase->pcidev->pred=NULL; 90 | 91 | i=0; 92 | 93 | 94 | while (board = Prm_FindBoardTags (board, TAG_END)) 95 | { 96 | 97 | if(board) 98 | { 99 | if(i) 100 | { 101 | OpenPciBase->pcidev->next=(struct pci_dev *)AllocVec(sizeof(struct pci_dev),0L); 102 | DEBUG(dprintf("Alloc PciDev next 0x%08lx\n",OpenPciBase->pcidev->next)); 103 | OpenPciBase->pcidev->next->reserved=(struct OpenPciRes *)AllocVec(sizeof(struct OpenPciRes),0L); 104 | DEBUG(dprintf("Alloc PciDev next reserved 0x%08lx\n",OpenPciBase->pcidev->next->reserved)); 105 | pred=OpenPciBase->pcidev; 106 | OpenPciBase->pcidev=OpenPciBase->pcidev->next; 107 | OpenPciBase->pcidev->pred=pred; 108 | OpenPciBase->pcidev->bus=NULL; 109 | OpenPciBase->pcidev->next=NULL; 110 | } 111 | 112 | i=1; 113 | 114 | Prm_GetBoardAttrsTags(board, 115 | PRM_Vendor, (ULONG)&prm_vendor, 116 | PRM_Device, (ULONG)&prm_device, 117 | PRM_SlotNumber, (ULONG)&prm_slotnum, 118 | PRM_FunctionNumber, (ULONG)&prm_funcnum, 119 | TAG_END); 120 | 121 | OpenPciBase->pcidev->vendor=(unsigned short)prm_vendor; 122 | OpenPciBase->pcidev->device=(unsigned short)prm_device; 123 | 124 | // PCI_CLASS_REVISION 125 | OpenPciBase->pcidev->devclass=Prm_ReadConfigLong(board,PCI_CLASS_REVISION); 126 | OpenPciBase->pcidev->devclass>>=8; 127 | 128 | slotnum=(unsigned char)prm_slotnum; 129 | funcnum=(unsigned char)prm_funcnum; 130 | 131 | devfunc=PCI_DEVFN(slotnum,funcnum); 132 | 133 | DEBUG(dprintf("Dev %ld Func %ld DevFunc %ld\n",slotnum,funcnum,devfunc)); 134 | 135 | // DEVFN 136 | OpenPciBase->pcidev->devfn=devfunc; 137 | 138 | /* OpenPci reserved fields */ 139 | 140 | // PCI card unlocked at start 141 | OpenPciBase->pcidev->reserved->pci_cardlocked=FALSE; 142 | 143 | // PCI card unique name with Vendor, Device, Devfn 144 | sprintf(OpenPciBase->pcidev->reserved->pci_cardname,"OpenPCI-%04lx-%04lx-%02lx\0",OpenPciBase->pcidev->vendor,OpenPciBase->pcidev->device,OpenPciBase->pcidev->devfn); 145 | 146 | // Private Board Pointer 147 | OpenPciBase->pcidev->reserved->board=board; 148 | 149 | 150 | /* Is Master capable */ 151 | 152 | /* Read Bus Mastering */ 153 | oldvalue=Prm_ReadConfigWord(board, PCI_COMMAND ); 154 | 155 | /* Is the Bus Master Activated ? */ 156 | 157 | if(oldvalue&PCI_COMMAND_MASTER) 158 | { 159 | OpenPciBase->pcidev->master=1; 160 | }else 161 | { 162 | /* 163 | value=oldvalue; 164 | 165 | // We Activate BUS MASTERING 166 | value|=PCI_COMMAND_MASTER; 167 | Prm_WriteConfigWord(board, value, ((PCI_COMMAND^1)<<1) ); 168 | 169 | // Verify if Bus Master capable 170 | // Read Bus Mastering 171 | if(Prm_ReadConfigWord(board, PCI_COMMAND ) & PCI_COMMAND_MASTER) 172 | { 173 | OpenPciBase->pcidev->master=1; 174 | }else 175 | OpenPciBase->pcidev->master=0; 176 | 177 | // Restore oldvalue 178 | Prm_WriteConfigWord(board, oldvalue, ((PCI_COMMAND^1)<<1) ); 179 | */ 180 | OpenPciBase->pcidev->master=0; 181 | } 182 | 183 | /* hdr_type */ 184 | OpenPciBase->pcidev->hdr_type=0; 185 | 186 | /* IRQ num */ 187 | OpenPciBase->pcidev->irq=Prm_ReadConfigByte(board, PCI_INTERRUPT_LINE ); 188 | 189 | /* 190 | For BaseAddress0 to BaseAddress5 191 | */ 192 | for (j = 0; j <= 5; j++) 193 | { 194 | Prm_GetBoardAttrsTags (board, 195 | PRM_MemoryAddr0 + j, (ULONG)&memaddr, 196 | PRM_MemorySize0 + j, (ULONG)&memsize, 197 | TAG_END); 198 | memattr=Prm_ReadConfigLong( board,(PCI_BASE_ADDRESS_0+(j*4)) ); 199 | DEBUG(dprintf("memattr(%ld) 0x%08lx\n",(ULONG)j, memattr)); 200 | memsize-=1; 201 | if (memaddr) 202 | { 203 | OpenPciBase->pcidev->base_address[j]=memaddr; 204 | /* IO Addr Bit0 at 1 */ 205 | if(memattr&1) 206 | { 207 | OpenPciBase->pcidev->base_size[j]=~(memsize&PCI_BASE_ADDRESS_IO_MASK)|1; 208 | 209 | }else 210 | { 211 | /* Mem Addr */ 212 | OpenPciBase->pcidev->base_size[j]=~(memsize&PCI_BASE_ADDRESS_MEM_MASK)&PCI_BASE_ADDRESS_MEM_MASK; 213 | } 214 | 215 | }else 216 | { 217 | OpenPciBase->pcidev->base_address[j]=NULL; 218 | OpenPciBase->pcidev->base_size[j]=NULL; 219 | } 220 | } 221 | 222 | /* RomAddress */ 223 | Prm_GetBoardAttrsTags(board, 224 | PRM_ROM_Address, (ULONG)&memaddr, 225 | PRM_ROM_Size, (ULONG)&memsize, 226 | TAG_END); 227 | 228 | memsize-=1; 229 | if(memaddr && memsize) 230 | { 231 | OpenPciBase->pcidev->rom_address=memaddr; 232 | OpenPciBase->pcidev->rom_size=~(memsize&PCI_ROM_ADDRESS_MASK)&PCI_ROM_ADDRESS_MASK; 233 | }else 234 | { 235 | OpenPciBase->pcidev->rom_address=NULL; 236 | OpenPciBase->pcidev->rom_size=NULL; 237 | } 238 | } 239 | } 240 | 241 | } 242 | 243 | -------------------------------------------------------------------------------- /PrometheusOpenPci/PrometheusWrapper.c.info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/PrometheusOpenPci/PrometheusWrapper.c.info -------------------------------------------------------------------------------- /PrometheusOpenPci/PrometheusWrapper.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef PROMETHEUSWRAPPER_H 3 | #define PROMETHEUSWRAPPER_H 4 | 5 | // Prometheus 6 | #include "Prometheus-3.0/include/libraries/prometheus.h" 7 | #include "Prometheus-3.0/include/clib/prometheus_protos.h" 8 | 9 | #ifdef __GNUC__ 10 | #include "../libraries/openpci.h" 11 | #include "Prometheus-3.0/include/inline/prometheus_protos.h" 12 | #else 13 | #include "/libraries/openpci.h" 14 | #include "Prometheus-3.0/include/pragmas/prometheus_pragmas.h" 15 | #endif 16 | 17 | extern struct Library *PrometheusBase; 18 | 19 | extern BOOL PROMETHEUSWrapper(void); 20 | extern void PROMETHEUSclose(void); 21 | extern void PROMETHEUSpcidev(void); 22 | 23 | extern unsigned char PROMETHEUSpci_inb(unsigned long address); 24 | extern void PROMETHEUSpci_outb(unsigned char value, unsigned long address); 25 | 26 | /* Word (16bits) Read/Write */ 27 | extern unsigned short PROMETHEUSpci_inw(unsigned long address); 28 | extern void PROMETHEUSpci_outw(unsigned short value, unsigned long address); 29 | 30 | /* Long (32bits) Read/Write */ 31 | extern unsigned long PROMETHEUSpci_inl(unsigned long address); 32 | extern void PROMETHEUSpci_outl(unsigned long value, unsigned long address); 33 | 34 | /* Amiga Mem and Pci Mem Read/Write (must be a multiple of 16bytes) (it's a very fast mem bloc copy) */ 35 | extern void PROMETHEUSpci_to_hostcpy(void *pcimemsrc, void *memdest, unsigned long packetsize); 36 | extern void PROMETHEUShost_to_pcicpy(void *memsrc, void *pcimemdest, unsigned long packetsize); 37 | extern void PROMETHEUSpci_to_pcicpy(void *pcimemsrc, void *pcimemdest, unsigned long packetsize); 38 | 39 | /* Pci Bus Read/Write Config functions */ 40 | extern unsigned char PROMETHEUSpci_read_config_byte(unsigned char registernum, struct pci_dev *dev); 41 | extern unsigned short PROMETHEUSpci_read_config_word(unsigned char registernum, struct pci_dev *dev); 42 | extern unsigned long PROMETHEUSpci_read_config_long(unsigned char registernum, struct pci_dev *dev); 43 | extern void PROMETHEUSpci_write_config_byte(unsigned char registernum, unsigned char val, struct pci_dev *dev); 44 | extern void PROMETHEUSpci_write_config_word(unsigned char registernum, unsigned short val, struct pci_dev *dev); 45 | extern void PROMETHEUSpci_write_config_long(unsigned char registernum, unsigned long val, struct pci_dev *dev); 46 | 47 | /* Pci Set Bus Master */ 48 | extern BOOL PROMETHEUSpci_set_master(struct pci_dev *dev); 49 | 50 | /* Interrupt functions */ 51 | extern BOOL PROMETHEUSpci_add_intserver(struct Interrupt *PciInterrupt, struct pci_dev *pcidev); 52 | extern void PROMETHEUSpci_rem_intserver(struct Interrupt *PciInterrupt, struct pci_dev *pcidev); 53 | 54 | /* Alloc/Free DMA memory */ 55 | extern APTR PROMETHEUSpci_allocdma_mem(unsigned long size, unsigned long flags); 56 | extern void PROMETHEUSpci_freedma_mem(APTR buffer, unsigned long size); 57 | 58 | /* Logic<->Physic Addr conversion */ 59 | extern APTR PROMETHEUSpci_logic_to_physic_addr(APTR PciLogicalAddr, struct pci_dev *pcidev); 60 | extern APTR PROMETHEUSpci_physic_to_logic_addr(APTR PciPhysicalAddr, struct pci_dev *pcidev); 61 | 62 | /* Obtain/Release PCI card */ 63 | extern BOOL PROMETHEUSpci_obtain_card(struct pci_dev *pcidev); 64 | extern void PROMETHEUSpci_release_card(struct pci_dev *pcidev); 65 | 66 | #endif /* PROMETHEUSWRAPPER_H */ 67 | -------------------------------------------------------------------------------- /PrometheusOpenPci/PrometheusWrapper.h.info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/PrometheusOpenPci/PrometheusWrapper.h.info -------------------------------------------------------------------------------- /PrometheusOpenPci/developer.guide: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/PrometheusOpenPci/developer.guide -------------------------------------------------------------------------------- /PrometheusOpenPci/developer.guide.info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/PrometheusOpenPci/developer.guide.info -------------------------------------------------------------------------------- /README.openpci_V2.1: -------------------------------------------------------------------------------- 1 | News in V2.1 beta4 (October 08, 2009) 2 | - Mediator : Removed requirement of GFX card for DMA buffer (if no GFX card DMA allocation disabled and return NULL). 3 | - Mediator : Added support for Voodoo Banshee(VendorID/ProductID=0x121a/0x0003) for DMA memory. 4 | - Mediator : Fixed S3 Virge 86C325(VendorID/ProductID=0x5333/0x8a01) DMA memory and added support for S3 Virge DX 86C375(VendorID/ProductID=0x5333/0x5631) for DMA memory(need some tests and feedback). 5 | - Added new MediatorA1200TX support (Thanks to Robert 'Phibrizzo' Krajcarz). 6 | 7 | News/Fixes in V2.1 8 | - Grex & Pegasos1/2 : Fixed a bug in pci_read_config_long() who return bad result for registernum >16 (Thanks to Guido Mersmann) 9 | - Add Mediator1200SX support (Thanks to Thomas Siegel) 10 | - Prometheus : Fixed IO or Mem Address detection bit in base_size (Bit0 set to 1=IO Address, Bit0 set to 0=Mem Address) (Titan) 11 | - Prometheus : Fixed Read/WriteConfXXX, pci_physic_to_logic_addr, pci_set_master & 12 | pci_obtain_card/pci_release_card requires prometheus.library v3 (Titan) 13 | - Pegasos1/2 & Grex : Fixed Address base value for ROM, pci_obtain_card/pci_release_card bug/crash (Titan) 14 | - Mediator : Fixed pci_obtain_card/pci_release_card (Titan) 15 | - Amithlon : Fixed pci_obtain_card/pci_release_card (Titan) 16 | 17 | News in V2.0 18 | 19 | - New functions : pci_physic_to_logic_addr()/pci_obtain_card()/pci_release_card() 20 | - This version is fully compatible with old drivers developped for openpci v1.x but i advise you 21 | to support new pci card lock mechanism (pci_obtain_card()/pci_release_card()) to avoid problems 22 | with drivers who use the same pci card. 23 | - Fixed read & write_config for Prometheus 24 | - Use lock mechanism of Prometheus, Amithlon, Grex 25 | Warning this library support Mediator and i haven't tested it on 26 | Mediator, Prometheus, Grex, Amithlon but it could work. 27 | Please test and send me feedback for Mediator, Prometheus, Grex, Amithlon, Pegasos1 & Pegasos2. 28 | 29 | Informations: 30 | 31 | The openpci.library currently support fully MediatorA1200/Z4, Pegasos1/2, GrexA1200, GrexA4000, Amithlon and Prometheus. 32 | Prometheus wrapper is finished but need more testing. 33 | 34 | openpci.library.elf : 35 | - This is for MorphOS and Pegasos, it's a PPC MorphOS native version. 36 | - This native PPC MorphOS native version support Pegasos1/2, GrexA1200, GrexA4000, Prometheus PCI Bus. 37 | 38 | For Pegasos1/2 use openpci.library.elf ONLY and remove openpci.library if it exist, 39 | because openpci.library doesn't support Pegasos1/2. 40 | 41 | openpci.library: 42 | - This is a 68k version for AmigaOS 3.x and Amithlon 43 | - This version support Mediator A1200, GrexA1200, GrexA4000, Prometheus, PC PCI Bus under Amithlon. 44 | 45 | Details of Mediator board supported in OpenPCI: 46 | 1) Mediator1200 => Expansion Products: MediatorA1200(0x20)+MediatorA1200 MEMORY(0xa0) 47 | 2) Mediator1200SX => Expansion Products: MediatorA1200(0x28)+MediatorA1200 MEMORY(0xa8) 48 | 3) Mediator1200TX => Expansion Products: MediatorA1200(0x3c)+MediatorA1200 MEMORY(0xbc) 49 | 4) MediatorZ4 => Expansion Products: MediatorZ4(0x1f)+MediatorZ4 MEMORY(0x9f) 50 | 5) MediatorZ4 => Expansion Products: MediatorZ4(0x21)+MediatorZ4 MEMORY(0xa1) 51 | 52 | Details of Mediator GFX card DMA memory supported in OpenPCI: 53 | 1) Voodoo Banshee 16MB VendorID/ProductID=0x121a/0x0003 54 | 2) Voodoo3/2000-3000 16MB VendorID/ProductID=0x121a/0x0005 55 | 3) Voodoo4/5 32MB/64MB VendorID/ProductID=0x121a/0x0009 56 | 4) S3 Virge 86C325 2/4MB VendorID/ProductID=0x5333/0x8a01 57 | 5) S3 Virge DX 86C375 2/4MB VendorID/ProductID=0x5333/0x5631 58 | 59 | Note: Total available DMA memory is configured to 256KB. 60 | Warning!!! If you have not one of this GFX card, the DMA memory is disabled and all drivers which requires DMA memory will not work (driver like RTL8139, USB ... will not work). 61 | 62 | Not supported Mediator due to lack on information on these boards (contact me): 63 | I need more expansion information(showconfig) on following Product MediatorXXX/MEMORY. 64 | 1) Mediator Unknown1 => Expansion Products: Mediator???0x30)+Mediator??? MEMORY(0xb0) 65 | 2) Mediator Unknown2 => Expansion Products: Mediator???(0x31)+Mediator??? MEMORY(0xb1) 66 | Any other number ... contact me. 67 | 68 | Requirements: 69 | 70 | To use openpci.library driver with GrexA1200-A4000 or Pegasos board you need: 71 | cybpci.library v2.x or more 72 | 68040 or 68060.library by Ralph Schmidt v44 or more 73 | You can download all this files to: 74 | http://www.vgr.com/grex/ 75 | 76 | To use openpci.library driver with Prometheus board you need: 77 | prometheus.library v3.x or more 78 | 79 | To use openpci.library driver with Amithlon board you need: 80 | powerpci.library v2.xx or more 81 | 82 | -------------------------------------------------------------------------------- /SCoptions: -------------------------------------------------------------------------------- 1 | DATA=FAR 2 | NOSTACKCHECK 3 | NOCHECKABORT 4 | OPTIMIZE 5 | MAPHUNK 6 | MAPSYMBOLS 7 | MAPLIB 8 | MAPXREFERENCE 9 | OPTIMIZERTIME 10 | DISASSEMBLE=ram:a.asm 11 | -------------------------------------------------------------------------------- /SCoptions.info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/SCoptions.info -------------------------------------------------------------------------------- /clib/openpci_protos.h: -------------------------------------------------------------------------------- 1 | #ifndef CLIB_OPENPCI_PROTOS_H 2 | #define CLIB_OPENPCI_PROTOS_H 3 | 4 | #ifndef EXEC_TYPES_H 5 | #include 6 | #endif 7 | #ifndef EXEC_INTERRUPTS_H 8 | #include 9 | #endif 10 | #ifndef UTILITY_TAGITEM_H 11 | #include 12 | #endif 13 | #ifndef DEVICES_TIMER_H 14 | #include 15 | #endif 16 | 17 | /* Return the bus type found */ 18 | unsigned short pci_bus(void); 19 | 20 | /* Pci Find Functions */ 21 | struct pci_dev *pci_find_device( unsigned short vendor, unsigned short device, struct pci_dev *pcidev); 22 | struct pci_dev *pci_find_class( unsigned long class, struct pci_dev *pcidev); 23 | struct pci_dev *pci_find_slot( unsigned char bus, unsigned long devfn); 24 | 25 | /* IN/OUT Function for PCI Bus */ 26 | /* Byte (8bits) Read/Write */ 27 | unsigned char pci_inb(unsigned long address); 28 | void pci_outb(unsigned char value, unsigned long address); 29 | 30 | /* Word (16bits) Read/Write */ 31 | unsigned short pci_inw(unsigned long address); 32 | void pci_outw(unsigned short value, unsigned long address); 33 | 34 | /* Long (32bits) Read/Write */ 35 | unsigned long pci_inl(unsigned long address); 36 | void pci_outl(unsigned long value, unsigned long address); 37 | 38 | /* Amiga Mem and Pci Mem Read/Write (must be a multiple of 16bytes) (it's a very fast mem bloc copy) */ 39 | void pci_to_hostcpy(void *pcimemsrc, void *memdest, unsigned long packetsize); 40 | void host_to_pcicpy(void *memsrc, void *pcimemdest, unsigned long packetsize); 41 | void pci_to_pcicpy(void *pcimemsrc, void *pcimemdest, unsigned long packetsize); 42 | 43 | /* Pci Bus Read/Write Config functions */ 44 | unsigned char pci_read_config_byte(unsigned char registernum,struct pci_dev *pcidev); 45 | unsigned short pci_read_config_word(unsigned char registernum,struct pci_dev *pcidev); 46 | unsigned long pci_read_config_long(unsigned char registernum,struct pci_dev *pcidev); 47 | void pci_write_config_byte(unsigned char registernum, unsigned char val,struct pci_dev *pcidev); 48 | void pci_write_config_word(unsigned char registernum, unsigned short val,struct pci_dev *pcidev); 49 | void pci_write_config_long(unsigned char registernum, unsigned long val,struct pci_dev *pcidev); 50 | 51 | /* Pci Set Bus Master */ 52 | BOOL pci_set_master(struct pci_dev *pcidev); 53 | 54 | /* Interrupt functions */ 55 | BOOL pci_add_intserver(struct Interrupt *PciInterrupt, struct pci_dev *pcidev); 56 | void pci_rem_intserver(struct Interrupt *PciInterrupt, struct pci_dev *pcidev); 57 | 58 | /* Alloc/Free DMA memory */ 59 | APTR pci_allocdma_mem(unsigned long size, unsigned long flags); 60 | void pci_freedma_mem(APTR buffer,unsigned long size); 61 | 62 | /* Logic<->Physic Addr conversion */ 63 | APTR pci_logic_to_physic_addr(APTR PciLogicalAddr, struct pci_dev *pcidev); 64 | APTR pci_physic_to_logic_addr(APTR PciPhysicalAddr, struct pci_dev *pcidev); 65 | 66 | /* Obtain/Release PCI card */ 67 | BOOL pci_obtain_card(struct pci_dev *pcidev); 68 | void pci_release_card(struct pci_dev *pcidev); 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /clib/openpci_protos.h.info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/clib/openpci_protos.h.info -------------------------------------------------------------------------------- /compiler.h: -------------------------------------------------------------------------------- 1 | #ifndef COMPILER_H 2 | #define COMPILER_H 3 | 4 | #ifdef __GNUC__ 5 | #ifdef __MORPHOS__ 6 | #include 7 | #include 8 | #include 9 | #define REG(reg,arg) arg 10 | #define ASM 11 | #ifdef __saveds 12 | #undef __saveds 13 | #endif 14 | #define __saveds 15 | #ifdef __stdargs 16 | #undef __stdargs 17 | #endif 18 | #define __stdargs 19 | #ifdef __aligned 20 | #undef __aligned 21 | #endif 22 | #define __aligned 23 | #else 24 | #define REG(reg,arg) arg __asm(#reg) 25 | #define LIB 26 | #define ASM 27 | #endif 28 | #else 29 | #define REG(reg,arg) register __ ## reg arg 30 | #define LIB __saveds __asm 31 | #define ASM __asm 32 | #endif 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /debug.c: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: debug.c,v 1.2 2002/08/22 16:07:25 titan Exp $ 3 | */ 4 | 5 | #include "debug.h" 6 | 7 | /* 8 | To unactivate DEBUG without a full recompile, make change here 9 | */ 10 | void debugfunc(char *ptr) 11 | { 12 | dprintf(ptr); 13 | } 14 | -------------------------------------------------------------------------------- /debug.h: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: debug.h,v 1.10 2003/07/28 18:47:27 titan Exp $ 3 | */ 4 | 5 | 6 | //#define MOSDBG /* MorphOS Debug, we can disable it with MOS DebugFlags */ 7 | //#define DBG 8 | 9 | #ifdef __GNUC__ /* GCC */ 10 | #define __FUNC__ __FUNCTION__ 11 | #endif 12 | 13 | #ifndef __MORPHOS__ 14 | #include 15 | #ifdef DBG 16 | #define dprintf kprintf 17 | #else 18 | #define dprintf 19 | #endif 20 | #endif 21 | 22 | #ifdef __MORPHOS__ 23 | 24 | #ifdef MOSDBG 25 | #define DEBUG_INIT(x) if(SysBase->ex_DebugFlags & EXECDEBUGF_PCI) x 26 | #define DEBUG_OPEN(x) if(SysBase->ex_DebugFlags & EXECDEBUGF_PCI) x 27 | #define DEBUG_CLOSE(x) if(SysBase->ex_DebugFlags & EXECDEBUGF_PCI) x 28 | #define DEBUG_EXPUNGE(x) if(SysBase->ex_DebugFlags & EXECDEBUGF_PCI) x 29 | #define DEBUG_NULL(x) if(SysBase->ex_DebugFlags & EXECDEBUGF_PCI) x 30 | #define DEBUG(x) if(SysBase->ex_DebugFlags & EXECDEBUGF_PCI) x 31 | #define DB(x) if(SysBase->ex_DebugFlags & EXECDEBUGF_PCI) { dprintf(__FILE__ "[%4ld]/" __FUNC__ "() : ",__LINE__); dprintf(x "\n"); } 32 | #define DBUG(x) if(SysBase->ex_DebugFlags & EXECDEBUGF_PCI) x 33 | #else 34 | #define dprintf 35 | #define DEBUG(x) 36 | #define DEBUG_INIT(x) 37 | #define DEBUG_OPEN(x) 38 | #define DEBUG_CLOSE(x) 39 | #define DEBUG_EXPUNGE(x) 40 | #define DEBUG_NULL(x) 41 | #define DB(x) 42 | #define DBUG(x) 43 | #endif 44 | 45 | #else 46 | 47 | #ifdef DBG 48 | #define DEBUG_INIT(x) x 49 | #define DEBUG_OPEN(x) x 50 | #define DEBUG_CLOSE(x) x 51 | #define DEBUG_EXPUNGE(x) x 52 | #define DEBUG_NULL(x) x 53 | #define DEBUG(x) x 54 | #define DB(x) { dprintf(__FILE__ "[%4ld]/" __FUNC__ "() : ",__LINE__); dprintf(x "\n"); } 55 | #define DBUG(x) x 56 | #else 57 | #define dprintf 58 | #define DEBUG(x) 59 | #define DEBUG_INIT(x) 60 | #define DEBUG_OPEN(x) 61 | #define DEBUG_CLOSE(x) 62 | #define DEBUG_EXPUNGE(x) 63 | #define DEBUG_NULL(x) 64 | #define DB(x) 65 | #define DBUG(x) 66 | #endif 67 | 68 | #endif 69 | 70 | 71 | -------------------------------------------------------------------------------- /debug_protos.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/debug_protos.h -------------------------------------------------------------------------------- /fd/MAKEPRAGMAS: -------------------------------------------------------------------------------- 1 | fd2pragma openpci_lib.fd /pragmas/openpci_pragmas.h 2 | 3 | 4 | -------------------------------------------------------------------------------- /fd/MAKEPRAGMAS.info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/fd/MAKEPRAGMAS.info -------------------------------------------------------------------------------- /fd/fd2pragma: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/fd/fd2pragma -------------------------------------------------------------------------------- /fd/openpci_lib.fd: -------------------------------------------------------------------------------- 1 | ##base _OpenPciBase 2 | ##bias 30 3 | ##public 4 | * Return the bus type found 5 | pci_bus()() 6 | * IN/OUT Function for PCI Bus 7 | * Byte (8bits) Read/Write 8 | pci_inb(address)(a0) 9 | pci_outb(value,address)(d0,a0) 10 | * Word (16bits) Read/Write 11 | pci_inw(address)(a0) 12 | pci_outw(value,address)(d0,a0) 13 | * Long (32bits) Read/Write 14 | pci_inl(address)(a0) 15 | pci_outl(value,address)(d0,a0) 16 | * Amiga Mem and Pci Mem Read/Write (must be a multiple of 8bytes) 17 | pci_to_hostcpy(pcimemsrc,memdest,packetsize)(a0,a1,d0) 18 | host_to_pcicpy(memsrc,pcimemdest,packetsize)(a0,a1,d0) 19 | pci_to_pcicpy(pcimemsrc,pcimemdest,packetsize)(a0,a1,d0) 20 | * Pci Find Functions 21 | pci_find_device(vendor,device,pcidev)(d0,d1,a0) 22 | pci_find_class(class,pcidev)(d0,a0) 23 | pci_find_slot(bus,devfn)(d0,d1) 24 | * Pci Bus Read/Write Config functions 25 | pci_read_config_byte(registernum,pcidev)(d0,a0) 26 | pci_read_config_word(registernum,pcidev)(d0,a0) 27 | pci_read_config_long(registernum,pcidev)(d0,a0) 28 | pci_write_config_byte(registernum,val,pcidev)(d0,d1,a0) 29 | pci_write_config_word(registernum,val,pcidev)(d0,d1,a0) 30 | pci_write_config_long(registernum,val,pcidev)(d0,d1,a0) 31 | * Pci Set Bus Master 32 | pci_set_master(pcidev)(a0) 33 | * Interrupt functions 34 | pci_add_intserver(PciInterrupt,pcidev)(a0,a1) 35 | pci_rem_intserver(PciInterrupt,pcidev)(a0,a1) 36 | * Pci Alloc/Free DMA memory 37 | pci_allocdma_mem(size,flags)(d0,d1) 38 | pci_freedma_mem(buffer,size)(a0,d0) 39 | * Logic<->Physic Addr conversion 40 | pci_logic_to_physic_addr(PciLogicalAddr,pcidev)(a0,a1) 41 | pci_physic_to_logic_addr(PciPhysicalAddr,pcidev)(a0,a1) 42 | * Obtain/Release PCI card 43 | pci_obtain_card(pcidev)(a0) 44 | pci_release_card(pcidev)(a0) 45 | ##end 46 | -------------------------------------------------------------------------------- /fd/openpci_lib.fd.info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/fd/openpci_lib.fd.info -------------------------------------------------------------------------------- /internlibraries.info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/internlibraries.info -------------------------------------------------------------------------------- /internlibraries/openpci.h.info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/internlibraries/openpci.h.info -------------------------------------------------------------------------------- /libraries.info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/libraries.info -------------------------------------------------------------------------------- /libraries/openpci.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBRARIES_OPENPCI_H 2 | #define LIBRARIES_OPENPCI_H 3 | 4 | /* 5 | ** $VER: openpci.h 1.4 (27.09.2002) 6 | ** Includes Release 1.4 7 | ** 8 | ** openpci.library interface structures and definitions. 9 | ** 10 | */ 11 | 12 | /*****************************************************************************/ 13 | 14 | 15 | #ifndef EXEC_TYPES_H 16 | #include 17 | #endif 18 | 19 | /* Conversion Little Endian(x86) -> Big Endian (68k) */ 20 | #define swapl(x) (((x&0x000000FF)<<24)+((x&0x0000FF00)<<8)+((x&0x00FF0000)>>8)+((x&0xFF000000)>>24)) 21 | #define swapw(x) ( ((x&0x00FF)<<8)+((x&0xFF00)>>8) ) 22 | 23 | /* pci_bus() result flags */ 24 | #define MediatorA1200Bus 0x1 25 | #define MediatorZ4Bus 0x2 26 | #define PrometheusBus 0x4 27 | #define GrexA1200Bus 0x8 28 | #define GrexA4000Bus 0x10 29 | #define PegasosBus 0x20 30 | #define PowerPciBus 0x40 31 | 32 | /* pci_allocdma_mem flags */ 33 | #define MEM_PCI 0x1 34 | #define MEM_NONCACHEABLE 0x2 35 | 36 | #define MIN_OPENPCI_VERSION 2 /* Version 2 or more */ 37 | 38 | /*****************************************************************************/ 39 | 40 | 41 | #if defined(__GNUC__) 42 | # pragma pack(2) 43 | #endif 44 | 45 | struct pci_dev { 46 | struct pci_bus *bus; /* bus this device is on */ 47 | struct pci_dev *next; /* Next pci_dev */ 48 | struct pci_dev *pred; /* Previous pci_dev */ 49 | 50 | unsigned char devfn; /* encoded device & function index */ 51 | unsigned short vendor; 52 | unsigned short device; 53 | unsigned int devclass; /* 3 bytes: (base,sub,prog-if) */ 54 | unsigned int hdr_type; /* PCI header type */ 55 | unsigned int master : 1; /* set if device is master capable */ 56 | /* 57 | * In theory, the irq level can be read from configuration 58 | * space and all would be fine. However, old PCI chips don't 59 | * support these registers and return 0 instead. For example, 60 | * the Vision864-P rev 0 chip can uses INTA, but returns 0 in 61 | * the interrupt line and pin registers. pci_init() 62 | * initializes this field with the value at PCI_INTERRUPT_LINE 63 | * and it is the job of pcibios_fixup() to change it if 64 | * necessary. The field must not be 0 unless the device 65 | * cannot generate interrupts at all. 66 | */ 67 | unsigned int irq; /* irq generated by this device */ 68 | 69 | /* Base registers for this device, can be adjusted by 70 | * pcibios_fixup() as necessary. 71 | */ 72 | unsigned long base_address[6]; 73 | unsigned long base_size[6]; 74 | unsigned long rom_address; 75 | unsigned long rom_size; 76 | 77 | void *reserved; 78 | }; 79 | 80 | struct pci_bus { 81 | struct pci_bus *parent; /* parent bus this bridge is on */ 82 | struct pci_bus *children; /* chain of P2P bridges on this bus */ 83 | struct pci_bus *next; /* chain of all PCI buses */ 84 | 85 | struct pci_dev *self; /* bridge device as seen by parent */ 86 | struct pci_dev *devices; /* devices behind this bridge */ 87 | 88 | unsigned char number; /* bus number */ 89 | unsigned char primary; /* number of primary bridge */ 90 | unsigned char secondary; /* number of secondary bridge */ 91 | unsigned char subordinate; /* max number of subordinate buses */ 92 | }; 93 | 94 | #if defined(__GNUC__) 95 | # pragma pack() 96 | #endif 97 | 98 | /* 99 | * Under PCI, each device has 256 bytes of configuration address space, 100 | * of which the first 64 bytes are standardized as follows: 101 | */ 102 | #define PCI_VENDOR_ID 0x00 /* 16 bits */ 103 | #define PCI_DEVICE_ID 0x02 /* 16 bits */ 104 | #define PCI_COMMAND 0x04 /* 16 bits */ 105 | #define PCI_COMMAND_IO 0x1 /* Enable response in I/O space */ 106 | #define PCI_COMMAND_MEMORY 0x2 /* Enable response in Memory space */ 107 | #define PCI_COMMAND_MASTER 0x4 /* Enable bus mastering */ 108 | #define PCI_COMMAND_SPECIAL 0x8 /* Enable response to special cycles */ 109 | #define PCI_COMMAND_INVALIDATE 0x10 /* Use memory write and invalidate */ 110 | #define PCI_COMMAND_VGA_PALETTE 0x20 /* Enable palette snooping */ 111 | #define PCI_COMMAND_PARITY 0x40 /* Enable parity checking */ 112 | #define PCI_COMMAND_WAIT 0x80 /* Enable address/data stepping */ 113 | #define PCI_COMMAND_SERR 0x100 /* Enable SERR */ 114 | #define PCI_COMMAND_FAST_BACK 0x200 /* Enable back-to-back writes */ 115 | 116 | #define PCI_STATUS 0x06 /* 16 bits */ 117 | #define PCI_STATUS_66MHZ 0x20 /* Support 66 Mhz PCI 2.1 bus */ 118 | #define PCI_STATUS_UDF 0x40 /* Support User Definable Features */ 119 | 120 | #define PCI_STATUS_FAST_BACK 0x80 /* Accept fast-back to back */ 121 | #define PCI_STATUS_PARITY 0x100 /* Detected parity error */ 122 | #define PCI_STATUS_DEVSEL_MASK 0x600 /* DEVSEL timing */ 123 | #define PCI_STATUS_DEVSEL_FAST 0x000 124 | #define PCI_STATUS_DEVSEL_MEDIUM 0x200 125 | #define PCI_STATUS_DEVSEL_SLOW 0x400 126 | #define PCI_STATUS_SIG_TARGET_ABORT 0x800 /* Set on target abort */ 127 | #define PCI_STATUS_REC_TARGET_ABORT 0x1000 /* Master ack of " */ 128 | #define PCI_STATUS_REC_MASTER_ABORT 0x2000 /* Set on master abort */ 129 | #define PCI_STATUS_SIG_SYSTEM_ERROR 0x4000 /* Set when we drive SERR */ 130 | #define PCI_STATUS_DETECTED_PARITY 0x8000 /* Set on parity error */ 131 | 132 | #define PCI_CLASS_REVISION 0x08 /* High 24 bits are class, low 8 133 | revision */ 134 | #define PCI_REVISION_ID 0x08 /* Revision ID */ 135 | #define PCI_CLASS_PROG 0x09 /* Reg. Level Programming Interface */ 136 | #define PCI_CLASS_DEVICE 0x0a /* Device class */ 137 | 138 | #define PCI_CACHE_LINE_SIZE 0x0c /* 8 bits */ 139 | #define PCI_LATENCY_TIMER 0x0d /* 8 bits */ 140 | #define PCI_HEADER_TYPE 0x0e /* 8 bits */ 141 | #define PCI_HEADER_TYPE_NORMAL 0 142 | #define PCI_HEADER_TYPE_BRIDGE 1 143 | #define PCI_HEADER_TYPE_CARDBUS 2 144 | 145 | #define PCI_BIST 0x0f /* 8 bits */ 146 | #define PCI_BIST_CODE_MASK 0x0f /* Return result */ 147 | #define PCI_BIST_START 0x40 /* 1 to start BIST, 2 secs or less */ 148 | #define PCI_BIST_CAPABLE 0x80 /* 1 if BIST capable */ 149 | 150 | /* 151 | * Base addresses specify locations in memory or I/O space. 152 | * Decoded size can be determined by writing a value of 153 | * 0xffffffff to the register, and reading it back. Only 154 | * 1 bits are decoded. 155 | */ 156 | #define PCI_BASE_ADDRESS_0 0x10 /* 32 bits */ 157 | #define PCI_BASE_ADDRESS_1 0x14 /* 32 bits [htype 0,1 only] */ 158 | #define PCI_BASE_ADDRESS_2 0x18 /* 32 bits [htype 0 only] */ 159 | #define PCI_BASE_ADDRESS_3 0x1c /* 32 bits */ 160 | #define PCI_BASE_ADDRESS_4 0x20 /* 32 bits */ 161 | #define PCI_BASE_ADDRESS_5 0x24 /* 32 bits */ 162 | #define PCI_BASE_ADDRESS_SPACE 0x01 /* 0 = memory, 1 = I/O */ 163 | #define PCI_BASE_ADDRESS_SPACE_IO 0x01 164 | #define PCI_BASE_ADDRESS_SPACE_MEMORY 0x00 165 | #define PCI_BASE_ADDRESS_MEM_TYPE_MASK 0x06 166 | #define PCI_BASE_ADDRESS_MEM_TYPE_32 0x00 /* 32 bit address */ 167 | #define PCI_BASE_ADDRESS_MEM_TYPE_1M 0x02 /* Below 1M */ 168 | #define PCI_BASE_ADDRESS_MEM_TYPE_64 0x04 /* 64 bit address */ 169 | #define PCI_BASE_ADDRESS_MEM_PREFETCH 0x08 /* prefetchable? */ 170 | #define PCI_BASE_ADDRESS_MEM_MASK (~0x0fUL) 171 | #define PCI_BASE_ADDRESS_IO_MASK (~0x03UL) 172 | /* bit 1 is reserved if address_space = 1 */ 173 | 174 | /* Header type 0 (normal devices) */ 175 | #define PCI_CARDBUS_CIS 0x28 176 | #define PCI_SUBSYSTEM_VENDOR_ID 0x2c 177 | #define PCI_SUBSYSTEM_ID 0x2e 178 | #define PCI_ROM_ADDRESS 0x30 /* Bits 31..11 are address, 10..1 reserved */ 179 | #define PCI_ROM_ADDRESS_ENABLE 0x01 180 | #define PCI_ROM_ADDRESS_MASK (~0x7ffUL) 181 | 182 | /* 0x34-0x3b are reserved */ 183 | #define PCI_INTERRUPT_LINE 0x3c /* 8 bits */ 184 | #define PCI_INTERRUPT_PIN 0x3d /* 8 bits */ 185 | #define PCI_MIN_GNT 0x3e /* 8 bits */ 186 | #define PCI_MAX_LAT 0x3f /* 8 bits */ 187 | 188 | /* Header type 1 (PCI-to-PCI bridges) */ 189 | #define PCI_PRIMARY_BUS 0x18 /* Primary bus number */ 190 | #define PCI_SECONDARY_BUS 0x19 /* Secondary bus number */ 191 | #define PCI_SUBORDINATE_BUS 0x1a /* Highest bus number behind the bridge */ 192 | #define PCI_SEC_LATENCY_TIMER 0x1b /* Latency timer for secondary interface */ 193 | #define PCI_IO_BASE 0x1c /* I/O range behind the bridge */ 194 | #define PCI_IO_LIMIT 0x1d 195 | #define PCI_IO_RANGE_TYPE_MASK 0x0f /* I/O bridging type */ 196 | #define PCI_IO_RANGE_TYPE_16 0x00 197 | #define PCI_IO_RANGE_TYPE_32 0x01 198 | #define PCI_IO_RANGE_MASK ~0x0f 199 | #define PCI_SEC_STATUS 0x1e /* Secondary status register, only bit 14 used */ 200 | #define PCI_MEMORY_BASE 0x20 /* Memory range behind */ 201 | #define PCI_MEMORY_LIMIT 0x22 202 | #define PCI_MEMORY_RANGE_TYPE_MASK 0x0f 203 | #define PCI_MEMORY_RANGE_MASK ~0x0f 204 | #define PCI_PREF_MEMORY_BASE 0x24 /* Prefetchable memory range behind */ 205 | #define PCI_PREF_MEMORY_LIMIT 0x26 206 | #define PCI_PREF_RANGE_TYPE_MASK 0x0f 207 | #define PCI_PREF_RANGE_TYPE_32 0x00 208 | #define PCI_PREF_RANGE_TYPE_64 0x01 209 | #define PCI_PREF_RANGE_MASK ~0x0f 210 | #define PCI_PREF_BASE_UPPER32 0x28 /* Upper half of prefetchable memory range */ 211 | #define PCI_PREF_LIMIT_UPPER32 0x2c 212 | #define PCI_IO_BASE_UPPER16 0x30 /* Upper half of I/O addresses */ 213 | #define PCI_IO_LIMIT_UPPER16 0x32 214 | /* 0x34-0x3b is reserved */ 215 | #define PCI_ROM_ADDRESS1 0x38 /* Same as PCI_ROM_ADDRESS, but for htype 1 */ 216 | /* 0x3c-0x3d are same as for htype 0 */ 217 | #define PCI_BRIDGE_CONTROL 0x3e 218 | #define PCI_BRIDGE_CTL_PARITY 0x01 /* Enable parity detection on secondary interface */ 219 | #define PCI_BRIDGE_CTL_SERR 0x02 /* The same for SERR forwarding */ 220 | #define PCI_BRIDGE_CTL_NO_ISA 0x04 /* Disable bridging of ISA ports */ 221 | #define PCI_BRIDGE_CTL_VGA 0x08 /* Forward VGA addresses */ 222 | #define PCI_BRIDGE_CTL_MASTER_ABORT 0x20 /* Report master aborts */ 223 | #define PCI_BRIDGE_CTL_BUS_RESET 0x40 /* Secondary bus reset */ 224 | #define PCI_BRIDGE_CTL_FAST_BACK 0x80 /* Fast Back2Back enabled on secondary interface */ 225 | 226 | /* Header type 2 (CardBus bridges) */ 227 | /* 0x14-0x15 reserved */ 228 | #define PCI_CB_SEC_STATUS 0x16 /* Secondary status */ 229 | #define PCI_CB_PRIMARY_BUS 0x18 /* PCI bus number */ 230 | #define PCI_CB_CARD_BUS 0x19 /* CardBus bus number */ 231 | #define PCI_CB_SUBORDINATE_BUS 0x1a /* Subordinate bus number */ 232 | #define PCI_CB_LATENCY_TIMER 0x1b /* CardBus latency timer */ 233 | #define PCI_CB_MEMORY_BASE_0 0x1c 234 | #define PCI_CB_MEMORY_LIMIT_0 0x20 235 | #define PCI_CB_MEMORY_BASE_1 0x24 236 | #define PCI_CB_MEMORY_LIMIT_1 0x28 237 | #define PCI_CB_IO_BASE_0 0x2c 238 | #define PCI_CB_IO_BASE_0_HI 0x2e 239 | #define PCI_CB_IO_LIMIT_0 0x30 240 | #define PCI_CB_IO_LIMIT_0_HI 0x32 241 | #define PCI_CB_IO_BASE_1 0x34 242 | #define PCI_CB_IO_BASE_1_HI 0x36 243 | #define PCI_CB_IO_LIMIT_1 0x38 244 | #define PCI_CB_IO_LIMIT_1_HI 0x3a 245 | #define PCI_CB_IO_RANGE_MASK ~0x03 246 | /* 0x3c-0x3d are same as for htype 0 */ 247 | #define PCI_CB_BRIDGE_CONTROL 0x3e 248 | #define PCI_CB_BRIDGE_CTL_PARITY 0x01 /* Similar to standard bridge control register */ 249 | #define PCI_CB_BRIDGE_CTL_SERR 0x02 250 | #define PCI_CB_BRIDGE_CTL_ISA 0x04 251 | #define PCI_CB_BRIDGE_CTL_VGA 0x08 252 | #define PCI_CB_BRIDGE_CTL_MASTER_ABORT 0x20 253 | #define PCI_CB_BRIDGE_CTL_CB_RESET 0x40 /* CardBus reset */ 254 | #define PCI_CB_BRIDGE_CTL_16BIT_INT 0x80 /* Enable interrupt for 16-bit cards */ 255 | #define PCI_CB_BRIDGE_CTL_PREFETCH_MEM0 0x100 /* Prefetch enable for both memory regions */ 256 | #define PCI_CB_BRIDGE_CTL_PREFETCH_MEM1 0x200 257 | #define PCI_CB_BRIDGE_CTL_POST_WRITES 0x400 258 | #define PCI_CB_SUBSYSTEM_VENDOR_ID 0x40 259 | #define PCI_CB_SUBSYSTEM_ID 0x42 260 | #define PCI_CB_LEGACY_MODE_BASE 0x44 /* 16-bit PC Card legacy mode base address (ExCa) */ 261 | /* 0x48-0x7f reserved */ 262 | 263 | /* Device classes and subclasses */ 264 | 265 | #define PCI_CLASS_NOT_DEFINED 0x0000 266 | #define PCI_CLASS_NOT_DEFINED_VGA 0x0001 267 | 268 | #define PCI_BASE_CLASS_STORAGE 0x01 269 | #define PCI_CLASS_STORAGE_SCSI 0x0100 270 | #define PCI_CLASS_STORAGE_IDE 0x0101 271 | #define PCI_CLASS_STORAGE_FLOPPY 0x0102 272 | #define PCI_CLASS_STORAGE_IPI 0x0103 273 | #define PCI_CLASS_STORAGE_RAID 0x0104 274 | #define PCI_CLASS_STORAGE_OTHER 0x0180 275 | 276 | #define PCI_BASE_CLASS_NETWORK 0x02 277 | #define PCI_CLASS_NETWORK_ETHERNET 0x0200 278 | #define PCI_CLASS_NETWORK_TOKEN_RING 0x0201 279 | #define PCI_CLASS_NETWORK_FDDI 0x0202 280 | #define PCI_CLASS_NETWORK_ATM 0x0203 281 | #define PCI_CLASS_NETWORK_OTHER 0x0280 282 | 283 | #define PCI_BASE_CLASS_DISPLAY 0x03 284 | #define PCI_CLASS_DISPLAY_VGA 0x0300 285 | #define PCI_CLASS_DISPLAY_XGA 0x0301 286 | #define PCI_CLASS_DISPLAY_OTHER 0x0380 287 | 288 | #define PCI_BASE_CLASS_MULTIMEDIA 0x04 289 | #define PCI_CLASS_MULTIMEDIA_VIDEO 0x0400 290 | #define PCI_CLASS_MULTIMEDIA_AUDIO 0x0401 291 | #define PCI_CLASS_MULTIMEDIA_OTHER 0x0480 292 | 293 | #define PCI_BASE_CLASS_MEMORY 0x05 294 | #define PCI_CLASS_MEMORY_RAM 0x0500 295 | #define PCI_CLASS_MEMORY_FLASH 0x0501 296 | #define PCI_CLASS_MEMORY_OTHER 0x0580 297 | 298 | #define PCI_BASE_CLASS_BRIDGE 0x06 299 | #define PCI_CLASS_BRIDGE_HOST 0x0600 300 | #define PCI_CLASS_BRIDGE_ISA 0x0601 301 | #define PCI_CLASS_BRIDGE_EISA 0x0602 302 | #define PCI_CLASS_BRIDGE_MC 0x0603 303 | #define PCI_CLASS_BRIDGE_PCI 0x0604 304 | #define PCI_CLASS_BRIDGE_PCMCIA 0x0605 305 | #define PCI_CLASS_BRIDGE_NUBUS 0x0606 306 | #define PCI_CLASS_BRIDGE_CARDBUS 0x0607 307 | #define PCI_CLASS_BRIDGE_OTHER 0x0680 308 | 309 | #define PCI_BASE_CLASS_COMMUNICATION 0x07 310 | #define PCI_CLASS_COMMUNICATION_SERIAL 0x0700 311 | #define PCI_CLASS_COMMUNICATION_PARALLEL 0x0701 312 | #define PCI_CLASS_COMMUNICATION_OTHER 0x0780 313 | 314 | #define PCI_BASE_CLASS_SYSTEM 0x08 315 | #define PCI_CLASS_SYSTEM_PIC 0x0800 316 | #define PCI_CLASS_SYSTEM_DMA 0x0801 317 | #define PCI_CLASS_SYSTEM_TIMER 0x0802 318 | #define PCI_CLASS_SYSTEM_RTC 0x0803 319 | #define PCI_CLASS_SYSTEM_OTHER 0x0880 320 | 321 | #define PCI_BASE_CLASS_INPUT 0x09 322 | #define PCI_CLASS_INPUT_KEYBOARD 0x0900 323 | #define PCI_CLASS_INPUT_PEN 0x0901 324 | #define PCI_CLASS_INPUT_MOUSE 0x0902 325 | #define PCI_CLASS_INPUT_OTHER 0x0980 326 | 327 | #define PCI_BASE_CLASS_DOCKING 0x0a 328 | #define PCI_CLASS_DOCKING_GENERIC 0x0a00 329 | #define PCI_CLASS_DOCKING_OTHER 0x0a01 330 | 331 | #define PCI_BASE_CLASS_PROCESSOR 0x0b 332 | #define PCI_CLASS_PROCESSOR_386 0x0b00 333 | #define PCI_CLASS_PROCESSOR_486 0x0b01 334 | #define PCI_CLASS_PROCESSOR_PENTIUM 0x0b02 335 | #define PCI_CLASS_PROCESSOR_ALPHA 0x0b10 336 | #define PCI_CLASS_PROCESSOR_POWERPC 0x0b20 337 | #define PCI_CLASS_PROCESSOR_CO 0x0b40 338 | 339 | #define PCI_BASE_CLASS_SERIAL 0x0c 340 | #define PCI_CLASS_SERIAL_FIREWIRE 0x0c00 341 | #define PCI_CLASS_SERIAL_ACCESS 0x0c01 342 | #define PCI_CLASS_SERIAL_SSA 0x0c02 343 | #define PCI_CLASS_SERIAL_USB 0x0c03 344 | #define PCI_CLASS_SERIAL_FIBER 0x0c04 345 | 346 | #define PCI_CLASS_OTHERS 0xff 347 | 348 | 349 | /* 350 | * The PCI interface treats multi-function devices as independent 351 | * devices. The slot/function address of each device is encoded 352 | * in a single byte as follows: 353 | * 354 | * 7:3 = slot 355 | * 2:0 = function 356 | * 357 | * see pci_find_slot() 358 | */ 359 | #define PCI_DEVFN(slot,func) ((((slot) & 0x1f) << 3) | ((func) & 0x07)) 360 | #define PCI_SLOT(devfn) (((devfn) >> 3) & 0x1f) 361 | #define PCI_FUNC(devfn) ((devfn) & 0x07) 362 | 363 | #endif /* LIBRARIES_OPENPCI_H */ 364 | -------------------------------------------------------------------------------- /libraries/openpci.h.info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/libraries/openpci.h.info -------------------------------------------------------------------------------- /makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/makefile -------------------------------------------------------------------------------- /openpci.c: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: openpci.c,v 1.3 2003/02/23 17:11:14 titan Exp $ 3 | */ 4 | 5 | #include "openpcidata.h" 6 | 7 | #include "openpci.library_VERSION.h" 8 | 9 | #include "pcibus.h" 10 | 11 | #include "pci.h" 12 | 13 | #include "openpci_protosWrapper.h" 14 | 15 | /* The lib execute init protection which simply returns 16 | */ 17 | 18 | ULONG NoExecute(void) 19 | { 20 | return(0); 21 | } 22 | 23 | struct ExecBase *SysBase; 24 | BPTR SegList; 25 | struct Library *UtilityBase = NULL; 26 | struct DosLibrary *DOSBase = NULL; 27 | struct Library *ExpansionBase = NULL; 28 | 29 | #ifdef __SASC 30 | struct LocaleBase *LocaleBase = 0; 31 | struct Device *TimerBase = 0; 32 | #else 33 | struct Library *LocaleBase = 0; 34 | struct Library *TimerBase = 0; 35 | #endif 36 | 37 | struct OpenPciLib *OpenPciBase; 38 | 39 | extern void (*LibFuncTable[29])(void); 40 | struct OpenPciLib * __saveds ASM LIB_Init(REG(d0, struct OpenPciLib *), REG(a0, BPTR), REG(a6, struct ExecBase *)); 41 | 42 | extern ULONG Dummy; 43 | 44 | struct LibInitStruct 45 | { 46 | ULONG LibSize; 47 | void *FuncTable; 48 | void *DataTable; 49 | /* 50 | void (*InitFunc)(void); 51 | */ 52 | APTR InitFunc; 53 | }; 54 | 55 | struct LibInitStruct LibInitStruct= 56 | { 57 | sizeof(struct OpenPciLib), 58 | LibFuncTable, 59 | NULL, 60 | /* 61 | (void (*)(void)) &LIB_Init 62 | */ 63 | (APTR) LIB_Init 64 | }; 65 | 66 | 67 | struct Resident __aligned LibResident= 68 | { 69 | RTC_MATCHWORD, 70 | &LibResident, 71 | &LibResident + 1, 72 | #ifdef __MORPHOS__ 73 | RTF_PPC | RTF_AUTOINIT, 74 | #else 75 | RTF_AUTOINIT, 76 | #endif 77 | VERSION, 78 | NT_LIBRARY, 79 | 1, 80 | "openpci.library", 81 | VERSTAG,//VSTRING, 82 | &LibInitStruct 83 | }; 84 | 85 | /* 86 | * To tell the loader that this is a new emulppc elf and not 87 | * one for the ppc.library. 88 | * ** IMPORTANT ** 89 | */ 90 | #ifdef __MORPHOS__ 91 | ULONG __abox__=1; 92 | #endif 93 | 94 | /***********************************************************************/ 95 | /***********************************************************************/ 96 | /***********************************************************************/ 97 | /***********************************************************************/ 98 | /***********************************************************************/ 99 | /***********************************************************************/ 100 | /***********************************************************************/ 101 | /***********************************************************************/ 102 | /***********************************************************************/ 103 | 104 | ULONG LIB_Reserved(void); 105 | 106 | static void __saveds ASM LibCleanup(REG(a6, struct OpenPciLib *LibBase)) 107 | { 108 | if (UtilityBase) 109 | CloseLibrary(UtilityBase); 110 | 111 | FreePciDevStruct(); 112 | 113 | } 114 | 115 | /* 116 | * Resident is a RTF_PPC one...that means it`s called 117 | * natively with normal PPC SysV4 ABI argument order. 118 | */ 119 | struct OpenPciLib * __saveds ASM LIB_Init(REG(d0, struct OpenPciLib *LibBase), 120 | REG(a0, BPTR seglist), 121 | REG(a6, struct ExecBase *sysbase)) 122 | { 123 | 124 | DEBUG_INIT(dprintf("LibInit: LibBase 0x%lx SegList 0x%lx SBase 0x%lx\n", LibBase, seglist, sysbase)); 125 | 126 | SysBase = (struct ExecBase *)sysbase; 127 | 128 | if ((UtilityBase = OpenLibrary("utility.library", 39L))) 129 | { 130 | DEBUG(dprintf("utility OK\n")); 131 | 132 | SegList = seglist; 133 | LibBase->Lib.lib_Version = VERSION; 134 | LibBase->Lib.lib_Revision = REVISION; 135 | LibBase->Lib.lib_Node.ln_Pri = 0; 136 | 137 | /* We set all pointer on a Null function */ 138 | 139 | pci_inb=(unsigned char (* )(unsigned long address))&LIB_Reserved; 140 | pci_outb=(void (* )(unsigned char value, unsigned long address))&LIB_Reserved; 141 | pci_inw=(unsigned short (* )(unsigned long address))&LIB_Reserved; 142 | pci_outw=(void (* )(unsigned short value, unsigned long address))&LIB_Reserved; 143 | pci_inl=(unsigned long (* )(unsigned long address))&LIB_Reserved; 144 | pci_outl=(void (* )(unsigned long value, unsigned long address))&LIB_Reserved; 145 | 146 | pci_to_hostcpy=(void (* )(void *pcimemsrc, void *memdest, unsigned long packetsize))&LIB_Reserved; 147 | host_to_pcicpy=(void (* )(void *memsrc, void *pcimemdest, unsigned long packetsize))&LIB_Reserved; 148 | pci_to_pcicpy=(void (* )(void *pcimemsrc, void *pcimemdest, unsigned long packetsize))&LIB_Reserved; 149 | 150 | pci_read_config_byte=(unsigned char (* )(unsigned char registernum,struct pci_dev *pcidev))&LIB_Reserved; 151 | pci_read_config_word=(unsigned short (* )(unsigned char registernum,struct pci_dev *pcidev))&LIB_Reserved; 152 | pci_read_config_long=(unsigned long (* )(unsigned char registernum,struct pci_dev *pcidev))&LIB_Reserved; 153 | pci_write_config_byte=(void (* )(unsigned char registernum, unsigned char val,struct pci_dev *pcidev))&LIB_Reserved; 154 | pci_write_config_word=(void (* )(unsigned char registernum, unsigned short val,struct pci_dev *pcidev))&LIB_Reserved; 155 | pci_write_config_long=(void (* )(unsigned char registernum, unsigned long val,struct pci_dev *pcidev))&LIB_Reserved; 156 | 157 | pci_set_master=(BOOL (* )(struct pci_dev *pcidev))&LIB_Reserved; 158 | 159 | pci_add_intserver=(BOOL (* )(struct Interrupt *PciInterrupt,struct pci_dev *pcidev))&LIB_Reserved; 160 | pci_rem_intserver=(void (* )(struct Interrupt *PciInterrupt, struct pci_dev *pcidev))&LIB_Reserved; 161 | 162 | pci_allocdma_mem=(APTR (* )(unsigned long size, unsigned long flags))&LIB_Reserved; 163 | pci_freedma_mem=(void (* )(APTR buffer,unsigned long size))&LIB_Reserved; 164 | 165 | pci_logic_to_physic_addr=(APTR (* )(APTR PciLogicalAddr, struct pci_dev *pcidev))&LIB_Reserved; 166 | pci_physic_to_logic_addr=(APTR (* )(APTR PciPhysicalAddr, struct pci_dev *pcidev))&LIB_Reserved; 167 | 168 | pci_obtain_card=(BOOL (* )(struct pci_dev *pcidev))&LIB_Reserved; 169 | pci_release_card=(void (* )(struct pci_dev *pcidev))&LIB_Reserved; 170 | 171 | OpenPciBase = LibBase; 172 | 173 | OpenPciBase->root=NULL; 174 | 175 | FindPCIBus(); 176 | 177 | DEBUG(dprintf("Bus found : 0x%lx\n",OpenPciBase->bus)); 178 | 179 | /* 180 | 68k version doesn't support Pegasos 181 | Pegasos users must use openpci.library.elf 182 | */ 183 | #ifdef __SASC 184 | if(OpenPciBase->bus&PegasosBus) 185 | { 186 | LibCleanup(LibBase); 187 | return NULL; 188 | } 189 | #endif 190 | 191 | if(OpenPCIBus(OpenPciBase->bus)==NULL) 192 | { 193 | LibCleanup(LibBase); 194 | return NULL; 195 | } 196 | return(LibBase); 197 | } /* if Utility */ 198 | 199 | LibCleanup(LibBase); 200 | return NULL; 201 | } 202 | 203 | /***********************************************************************/ 204 | /***********************************************************************/ 205 | /***********************************************************************/ 206 | /***********************************************************************/ 207 | /***********************************************************************/ 208 | /***********************************************************************/ 209 | /***********************************************************************/ 210 | /***********************************************************************/ 211 | /***********************************************************************/ 212 | 213 | ULONG __saveds ASM LibExpunge(REG(a6, struct OpenPciLib *LibBase)) 214 | { 215 | BPTR MySegment; 216 | 217 | DEBUG_EXPUNGE(dprintf("LIB_Expunge: LibBase 0x%lx <%s> OpenCount %ld\n", 218 | LibBase, 219 | LibBase->Lib.lib_Node.ln_Name, 220 | LibBase->Lib.lib_OpenCnt)); 221 | 222 | MySegment = SegList; 223 | 224 | if (LibBase->Lib.lib_OpenCnt) 225 | { 226 | DEBUG_EXPUNGE(dprintf("LIB_Expunge: set LIBF_DELEXP\n")); 227 | LibBase->Lib.lib_Flags |= LIBF_DELEXP; 228 | return (int)NULL; 229 | } 230 | 231 | /* We don`t need a forbid() because Expunge and Close 232 | * are called with a pending forbid. 233 | * But let`s do it for savety if somebody does it by hand. 234 | */ 235 | Forbid(); 236 | DEBUG_EXPUNGE(dprintf("LIB_Expunge: remove the library\n")); 237 | Remove(&LibBase->Lib.lib_Node); 238 | Permit(); 239 | 240 | LibCleanup(LibBase); 241 | 242 | DEBUG_EXPUNGE(dprintf("LIB_Expunge: free the library\n")); 243 | FreeMem((APTR)((ULONG)(LibBase) - (ULONG)(LibBase->Lib.lib_NegSize)), 244 | LibBase->Lib.lib_NegSize + LibBase->Lib.lib_PosSize); 245 | 246 | DEBUG_EXPUNGE(dprintf("LIB_Expunge: return Segment 0x%lx to ramlib\n", 247 | MySegment)); 248 | return((ULONG) MySegment); 249 | } 250 | 251 | #ifdef __MORPHOS__ 252 | ULONG LIB_Expunge(void) 253 | { 254 | struct OpenPciLib *LibBase = (struct OpenPciLib *) REG_A6; 255 | #else 256 | ULONG ASM LIB_Expunge(REG(a6, struct OpenPciLib *LibBase)) 257 | { 258 | #endif 259 | DEBUG_EXPUNGE(dprintf("LIB_Expunge:\n")); 260 | return(LibExpunge(LibBase)); 261 | } 262 | 263 | /***********************************************************************/ 264 | /***********************************************************************/ 265 | /***********************************************************************/ 266 | /***********************************************************************/ 267 | /***********************************************************************/ 268 | /***********************************************************************/ 269 | /***********************************************************************/ 270 | /***********************************************************************/ 271 | /***********************************************************************/ 272 | 273 | #ifdef __MORPHOS__ 274 | struct OpenPciLib *LIB_Open(void) 275 | { 276 | struct OpenPciLib *LibBase = (struct OpenPciLib *) REG_A6; 277 | #else 278 | struct OpenPciLib * ASM LIB_Open(REG(a6, struct OpenPciLib *LibBase)) 279 | { 280 | #endif 281 | DEBUG_OPEN(dprintf("LIB_Open: 0x%lx <%s> OpenCount %ld\n", 282 | LibBase, 283 | LibBase->Lib.lib_Node.ln_Name, 284 | LibBase->Lib.lib_OpenCnt)); 285 | 286 | LibBase->Lib.lib_Flags &= ~LIBF_DELEXP; 287 | LibBase->Lib.lib_OpenCnt++; 288 | 289 | return(LibBase); 290 | } 291 | 292 | /***********************************************************************/ 293 | /***********************************************************************/ 294 | /***********************************************************************/ 295 | /***********************************************************************/ 296 | /***********************************************************************/ 297 | /***********************************************************************/ 298 | /***********************************************************************/ 299 | /***********************************************************************/ 300 | /***********************************************************************/ 301 | 302 | #ifdef __MORPHOS__ 303 | ULONG LIB_Close(void) 304 | { 305 | struct OpenPciLib *LibBase = (struct OpenPciLib *) REG_A6; 306 | #else 307 | ULONG ASM LIB_Close(REG(a6, struct OpenPciLib *LibBase)) 308 | { 309 | #endif 310 | DEBUG_CLOSE(dprintf("LIB_Close: 0x%lx <%s> OpenCount %ld\n", 311 | LibBase, 312 | LibBase->Lib.lib_Node.ln_Name, 313 | LibBase->Lib.lib_OpenCnt)); 314 | 315 | if ((--LibBase->Lib.lib_OpenCnt) > 0) 316 | { 317 | DEBUG_CLOSE(dprintf("LIB_Close: done\n")); 318 | } 319 | else 320 | { 321 | if (LibBase->Lib.lib_Flags & LIBF_DELEXP) 322 | { 323 | DEBUG_CLOSE(dprintf("LIB_Close: LIBF_DELEXP set\n")); 324 | return(LibExpunge(LibBase)); 325 | } 326 | } 327 | return(0); 328 | } 329 | 330 | /***********************************************************************/ 331 | /***********************************************************************/ 332 | /***********************************************************************/ 333 | /***********************************************************************/ 334 | /***********************************************************************/ 335 | /***********************************************************************/ 336 | /***********************************************************************/ 337 | /***********************************************************************/ 338 | /***********************************************************************/ 339 | 340 | ULONG LIB_Reserved(void) 341 | { 342 | DEBUG_NULL(dprintf("LIB_Reserved:\n")); 343 | 344 | return(0); 345 | } 346 | 347 | /* ---------------------------------------------------------------------------------------- 348 | ! __SASC stuff: 349 | ! 350 | ! This is only for SAS/C - its intention is to turn off internal CTRL-C handling 351 | ! for standard C functions and to avoid calls to exit() et al. 352 | ---------------------------------------------------------------------------------------- */ 353 | 354 | #ifdef __SASC 355 | 356 | //ULONG XCEXIT = NULL; /* These symbols may be referenced by */ 357 | //ULONG _XCEXIT = NULL; /* some functions of sc.lib, but should */ 358 | ULONG ONBREAK = NULL; /* never be used inside a shared library */ 359 | ULONG _ONBREAK = NULL; 360 | ULONG base = NULL; /* Note, that XCEXIT/ONBREAK actually */ 361 | ULONG _base = NULL; /* should have been defined as functions */ 362 | ULONG ProgramName = NULL; /* and not as ULONGs... */ 363 | ULONG _ProgramName = NULL; 364 | ULONG StackPtr = NULL; 365 | ULONG _StackPtr = NULL; 366 | ULONG oserr = NULL; 367 | ULONG _oserr = NULL; 368 | ULONG OSERR = NULL; 369 | ULONG _OSERR = NULL; 370 | 371 | void __regargs __chkabort(void) { } /* a shared library cannot be */ 372 | void __regargs _CXBRK(void) { } /* CTRL-C aborted when doing I/O */ 373 | 374 | #endif /* __SASC */ 375 | -------------------------------------------------------------------------------- /openpci.c.info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/openpci.c.info -------------------------------------------------------------------------------- /openpci.library: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/openpci.library -------------------------------------------------------------------------------- /openpci.library.notes: -------------------------------------------------------------------------------- 1 | o 08.10.2009 2.1beta4 2 | - Mediator : Removed requirement of GFX card for DMA buffer (if no GFX card DMA allocation 3 | disabled and return NULL). 4 | - Mediator : Added support for Voodoo Banshee(VendorID/ProductID=0x121a/0x0003) for DMA memory. 5 | - Mediator : Fixed S3 Virge 86C325(VendorID/ProductID=0x5333/0x8a01) DMA memory and added support 6 | for S3 Virge DX 86C375(VendorID/ProductID=0x5333/0x5631) for DMA memory(need some tests and 7 | feedback). 8 | - Added new MediatorA1200TX support (Thanks to Robert 'Phibrizzo' Krajcarz). 9 | 10 | o 05.06.2005 2.1beta3 11 | - Grex & Pegasos1/2 : Fixed a bug in pci_read_config_long() who return bad result for registernum >16 (Thanks to Guido Mersmann) 12 | - Add Mediator1200SX support (Thanks to Thomas Siegel) 13 | 14 | o 29.03.2005 2.1beta2 15 | - Prometheus : Fixed IO or Mem Address detection bit in base_size 16 | (Bit0 set to 1=IO Address, Bit0 set to 0=Mem Address) (Titan) 17 | 18 | o 25.03.2005 2.1beta1 19 | - Prometheus : Fixed Read/WriteConfXXX, pci_physic_to_logic_addr, pci_set_master & 20 | pci_obtain_card/pci_release_card requires prometheus.library v3 (Titan) 21 | - Pegasos1/2 & Grex : Fixed Address base value for ROM, pci_obtain_card/pci_release_card bug/crash (Titan) 22 | - Mediator : Fixed pci_obtain_card/pci_release_card (Titan) 23 | - Amithlon : Fixed pci_obtain_card/pci_release_card (Titan) 24 | 25 | o 21.03.2004 26 | - Fixed Interrupt Code for Grex and Pegasos (Titan) 27 | - Fixed memory leak : pcidev->reserved memory was not free when lib was flushed (Titan) 28 | - Removed warning (Titan) 29 | 30 | o 20.03.2004 31 | - pci_physic_to_logic_addr() function added in all wrappers (Titan) 32 | - pci_obtain_card() function added in all wrappers (Titan) 33 | - pci_release_card() function added in all wrappers (Titan) 34 | - cleanup and fixed PCIX support (interrupt) (Titan) 35 | - Internal changes in pci_dev->reserved structure (lock/unlock mechanism) (Titan) 36 | 37 | o 30.11.2003 38 | - Mediator : Added new MediatorZ4 board productID (Titan) 39 | 40 | o 22.11.2003 41 | - Cleanup Grex wrapper and debug (Titan) 42 | - Fixed Mediator wrapper (Titan) 43 | 44 | o 11.08.2003 45 | - Amithlon : Added powerpci 2.x support now that require powerpci.library 2.x (Titan) 46 | - Bug corrected in Amithlon (PowerPci) wrapper registernum and val was reversed thanks to Guido Mersmann (Titan) 47 | 48 | o 28.07.2003 49 | - Removed calls to quark include (Titan) 50 | - Added mosquark_private.h for quark calls (Titan) 51 | 52 | o 28.04.2003 53 | - YEAHHHHHHH Pegasos and Grex fixed that was an horrible bug in the MORPHOS functable 54 | all pci_outw/l() and pci_write_config_word/long() was trashed due to a bad cast (unsigned char) (Titan) 55 | - makefile, PCIX wrapper cleanup (disabled in pcibus.c need some tests) (Titan) 56 | - version bumped to 1.1 57 | 58 | o 27.04.2003 59 | - bug with C++ corrected libraries/openpci.h in pci_dev structure replaced unsigned int class by unsigned int devclass 60 | thanks to Soyeb Aswat for this bug report (Titan) 61 | 62 | o 25.04.2003 63 | - bug corrected in GrexOpenPci wrapper Gpci_interrupt.c added CYBPCIINTTAG_MACHINE, CODETYPE_M68K (Titan) 64 | 65 | o 24.03.2003 66 | - bug corrected in Amithlon (PowerPci) wrapper Apci_readwrite_config.c registernum 67 | and val was reversed thanks to Guido Mersmann (Titan) 68 | - version bumped to 1.04 69 | 70 | o 23.02.2003 71 | - debug.h New debug stuff for MOS we can disable debug ouput 72 | if DebugFlags is not enabled (Titan-cyfm) 73 | - New makefile with -mcpu=604e optimization 74 | 75 | o 15.02.2003 76 | - Fixed pci_allocdma_mem() now it return Logical address under Pegasos (cyfm) 77 | - Fixed Table allocation for Pegasos DMA Mem Alloc, 78 | now the Table is in the linkedlist and allocated dynamically (Titan) 79 | 80 | o 14.02.2003 81 | - Fixed GCC MOS build error with GrexOpenPci/GrexWrapper.c and GrexOpenPci/Grex.h 82 | include new libraries/cybpci.h include used (Titan) 83 | - Fixed GrexOpenPci stuff for Pegasos (cyfm) 84 | 85 | o 13.09.2002 86 | - Bug Fix in Prometheus Wrapper for the PCI CLASS REVISION 87 | openpci.library require prometheus.library v2.3 for Prometheus PCI Bus 88 | 89 | o 22.08.2002 90 | - Bug Fix in Prometheus Wrapper about pci_set_master and Init for detect PCI Card with Bus Master Capable thanks to Krashan 91 | 92 | o 18.08.2002 93 | - Amithlon IO Addr and Mem Addr are in BE format 94 | - Rom Addr and Rom Size added for Amithlon wrapper 95 | 96 | o 31.07.2002 97 | - Fix PowerPci Wrapper (add pci_set_irq()) 98 | - Fix Prometheus Wrapper and Bus Master detection 99 | 100 | o 23.06.2002 101 | - All the InOut function are inline and in InOut.h 102 | 103 | o 10.05.2002 104 | - Mediator A1200 DMA problem fixed 105 | 106 | o 09.05.2002 107 | - Grex A1200/A4000 and Pegasos Wrapper are finished 108 | 109 | o 23.03.2002 110 | - OpenPci.library v0.99b (Titan) 111 | - Grex 100% finished (in beta test) (Titan) 112 | - Prometheus 100% finished (in beta test) (Titan) 113 | - Removed function (You need to upgrade your includes and rebuild all sources) : 114 | openpci.library/pci_set_int 115 | openpci.library/pci_clear_int 116 | 117 | o 14.03.2002 118 | - Mediator 100% finished (Titan) 119 | - Prometheus 50% Finished (Titan) 120 | 121 | o 24.02.2002 122 | - Rewrite the main library with pointer function for a good wrapper (Titan) 123 | - All Specific Pci BUS files in are in a directory for add easily new other Pci BUS (Titan) 124 | 125 | o 09.02.2002 126 | - Begining (Titan) 127 | 128 | -- 129 | 130 | -------------------------------------------------------------------------------- /openpci.library.notes.info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/openpci.library.notes.info -------------------------------------------------------------------------------- /openpci.library_VERSION.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/openpci.library_VERSION.h -------------------------------------------------------------------------------- /openpci.library_VERSION.h.info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/openpci.library_VERSION.h.info -------------------------------------------------------------------------------- /openpci_protosWrapper.h: -------------------------------------------------------------------------------- 1 | #ifndef OPENPCI_PROTOSWRAP_H 2 | #define OPENPCI_PROTOSWRAP_H 3 | 4 | #ifndef EXEC_TYPES_H 5 | #include 6 | #endif 7 | #ifndef EXEC_INTERRUPTS_H 8 | #include 9 | #endif 10 | #ifndef UTILITY_TAGITEM_H 11 | #include 12 | #endif 13 | #ifndef DEVICES_TIMER_H 14 | #include 15 | #endif 16 | 17 | /* Return the bus type found */ 18 | extern unsigned short pci_bus(void); 19 | 20 | /* IN/OUT Function for PCI Bus */ 21 | /* Byte (8bits) Read/Write */ 22 | extern unsigned char (*pci_inb)(unsigned long address); 23 | extern void (*pci_outb)(unsigned char value, unsigned long address); 24 | 25 | /* Word (16bits) Read/Write */ 26 | extern unsigned short (*pci_inw)(unsigned long address); 27 | extern void (*pci_outw)(unsigned short value, unsigned long address); 28 | 29 | /* Long (32bits) Read/Write */ 30 | extern unsigned long (*pci_inl)(unsigned long address); 31 | extern void (*pci_outl)(unsigned long value, unsigned long address); 32 | 33 | /* Amiga Mem and Pci Mem Read/Write (must be a multiple of 16bytes) (it's a very fast mem bloc copy) */ 34 | extern void (*pci_to_hostcpy)(void *pcimemsrc, void *memdest, unsigned long packetsize); 35 | extern void (*host_to_pcicpy)(void *memsrc, void *pcimemdest, unsigned long packetsize); 36 | extern void (*pci_to_pcicpy)(void *pcimemsrc, void *pcimemdest, unsigned long packetsize); 37 | 38 | /* Pci Find Functions */ 39 | extern struct pci_dev *pci_find_device( unsigned short vendor, unsigned short device, struct pci_dev *pcidev); 40 | extern struct pci_dev *pci_find_class( unsigned long class, struct pci_dev *pcidev); 41 | extern struct pci_dev *pci_find_slot( unsigned char bus, unsigned long devfn); 42 | 43 | /* Pci Bus Read/Write Config functions */ 44 | extern unsigned char (*pci_read_config_byte)(unsigned char registernum,struct pci_dev *pcidev); 45 | extern unsigned short (*pci_read_config_word)(unsigned char registernum,struct pci_dev *pcidev); 46 | extern unsigned long (*pci_read_config_long)(unsigned char registernum,struct pci_dev *pcidev); 47 | extern void (*pci_write_config_byte)(unsigned char registernum, unsigned char val,struct pci_dev *pcidev); 48 | extern void (*pci_write_config_word)(unsigned char registernum, unsigned short val,struct pci_dev *pcidev); 49 | extern void (*pci_write_config_long)(unsigned char registernum, unsigned long val,struct pci_dev *pcidev); 50 | 51 | /* Pci Set Bus Master */ 52 | extern BOOL (*pci_set_master)(struct pci_dev *pcidev); 53 | 54 | /* Interrupt functions */ 55 | extern BOOL (*pci_add_intserver)(struct Interrupt *PciInterrupt, struct pci_dev *pcidev); 56 | extern void (*pci_rem_intserver)(struct Interrupt *PciInterrupt, struct pci_dev *pcidev); 57 | 58 | /* Alloc/Free DMA memory */ 59 | extern APTR (*pci_allocdma_mem)(unsigned long size, unsigned long flags); 60 | extern void (*pci_freedma_mem)(APTR buffer,unsigned long size); 61 | 62 | /* Logic<->Physic Addr conversion */ 63 | extern APTR (*pci_logic_to_physic_addr)(APTR PciLogicalAddr, struct pci_dev *pcidev); 64 | extern APTR (*pci_physic_to_logic_addr)(APTR PciPhysicalAddr,struct pci_dev *pcidev); 65 | 66 | /* Obtain/Release PCI card */ 67 | extern BOOL (*pci_obtain_card)(struct pci_dev *pcidev); 68 | extern void (*pci_release_card)(struct pci_dev *pcidev); 69 | 70 | #endif /* OPENPCI_PROTOSWRAP_H */ 71 | -------------------------------------------------------------------------------- /openpci_protosWrapper.h.info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/openpci_protosWrapper.h.info -------------------------------------------------------------------------------- /openpcidata.h: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: openpcidata.h,v 1.6 2003/07/28 18:47:27 titan Exp $ 3 | */ 4 | 5 | #ifndef OPENPCIDATA_HEADER 6 | #define OPENPCIDATA_HEADER 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | #define __USE_SYSBASE 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | #ifdef __MORPHOS__ 32 | 33 | #include 34 | #include 35 | 36 | /* Inlined Morphos private Quark call and structure */ 37 | #include "mosquark_private.h" 38 | 39 | #else 40 | 41 | #include 42 | 43 | #endif 44 | 45 | #include "compiler.h" 46 | 47 | #include "debug.h" 48 | #include "pcibus.h" 49 | #include "pci.h" 50 | 51 | #define MAX_PCI_CARD_NAME 100 52 | 53 | #ifdef __MORPHOS__ 54 | #pragma pack(2) 55 | #endif 56 | 57 | struct OpenPciLib 58 | { 59 | struct Library Lib; 60 | BPTR SegList; 61 | struct ExecBase *SBase; 62 | struct pci_dev *pcidev; 63 | struct pci_dev *root; 64 | unsigned char bus; 65 | }; 66 | 67 | /* Internal reserved structure */ 68 | struct OpenPciRes 69 | { 70 | void *board; 71 | BOOL pci_cardlocked; /* Is this PCI card is software locked ? */ 72 | char pci_cardname[MAX_PCI_CARD_NAME+1]; 73 | void *IntObject; /* Internal PCIX Interrupt object */ 74 | struct MinList *IntList; /* Internal CybPCI/PCIX Interrupt List */ 75 | }; 76 | 77 | #ifdef __MORPHOS__ 78 | #pragma pack() 79 | #endif 80 | 81 | extern struct OpenPciLib *OpenPciBase; 82 | 83 | #endif /* OPENPCIDATA_HEADER */ 84 | -------------------------------------------------------------------------------- /openpcidata.h.info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/openpcidata.h.info -------------------------------------------------------------------------------- /openpcifunctable.c: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: openpcifunctable.c,v 1.1.1.1 2002/05/09 13:35:52 titan Exp $ 3 | */ 4 | 5 | #include "openpcidata.h" 6 | #include "openpcifunctable.h" 7 | 8 | void LIB_Open(void); 9 | void LIB_Close(void); 10 | void LIB_Expunge(void); 11 | void LIB_Reserved(void); 12 | 13 | 14 | /* 15 | LibFuncTable == LibVectors 16 | 6 bytes between each function 17 | */ 18 | 19 | ULONG LibFuncTable[]= 20 | { 21 | #ifdef __MORPHOS__ 22 | FUNCARRAY_32BIT_NATIVE, 23 | #endif 24 | (ULONG) &LIB_Open, 25 | (ULONG) &LIB_Close, 26 | (ULONG) &LIB_Expunge, 27 | (ULONG) &LIB_Reserved, 28 | 29 | (ULONG) &LIB_pci_bus, 30 | (ULONG) &LIB_pci_inb, 31 | (ULONG) &LIB_pci_outb, 32 | (ULONG) &LIB_pci_inw, 33 | (ULONG) &LIB_pci_outw, 34 | (ULONG) &LIB_pci_inl, 35 | (ULONG) &LIB_pci_outl, 36 | (ULONG) &LIB_pci_to_hostcpy, 37 | (ULONG) &LIB_host_to_pcicpy, 38 | (ULONG) &LIB_pci_to_pcicpy, 39 | (ULONG) &LIB_pci_find_device, 40 | (ULONG) &LIB_pci_find_class, 41 | (ULONG) &LIB_pci_find_slot, 42 | (ULONG) &LIB_pci_read_config_byte, 43 | (ULONG) &LIB_pci_read_config_word, 44 | (ULONG) &LIB_pci_read_config_long, 45 | (ULONG) &LIB_pci_write_config_byte, 46 | (ULONG) &LIB_pci_write_config_word, 47 | (ULONG) &LIB_pci_write_config_long, 48 | (ULONG) &LIB_pci_set_master, 49 | (ULONG) &LIB_pci_add_intserver, 50 | (ULONG) &LIB_pci_rem_intserver, 51 | (ULONG) &LIB_pci_allocdma_mem, 52 | (ULONG) &LIB_pci_freedma_mem, 53 | (ULONG) &LIB_pci_logic_to_physic_addr, 54 | (ULONG) &LIB_pci_physic_to_logic_addr, 55 | (ULONG) &LIB_pci_obtain_card, 56 | (ULONG) &LIB_pci_release_card, 57 | 0xffffffff 58 | }; 59 | 60 | 61 | -------------------------------------------------------------------------------- /openpcifunctable.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef OPENPCIFUNCTABLE_H 3 | #define OPENPCIFUNCTABLE_H 4 | #include "openpci_protosWrapper.h" 5 | 6 | 7 | #ifdef __MORPHOS__ 8 | 9 | #include 10 | #ifndef BASE_EXT_DECL 11 | #define BASE_EXT_DECL 12 | #define BASE_EXT_DECL0 extern struct OpenPciLib *OpenPciBase; 13 | #endif /* !BASE_EXT_DECL */ 14 | #ifndef BASE_PAR_DECL 15 | #define BASE_PAR_DECL 16 | #define BASE_PAR_DECL0 void 17 | #endif /* !BASE_PAR_DECL */ 18 | #ifndef BASE_NAME 19 | #define BASE_NAME OpenPciBase 20 | #endif /* !BASE_NAME */ 21 | 22 | BASE_EXT_DECL0 23 | 24 | /* Return the bus type found */ 25 | unsigned short LIB_pci_bus(void) 26 | { 27 | return(pci_bus()); 28 | } 29 | 30 | /* IN/OUT Function for PCI Bus */ 31 | /* Byte (8bits) Read/Write */ 32 | unsigned char ASM LIB_pci_inb(void) 33 | { 34 | unsigned long address =(unsigned long) REG_A0; 35 | return( (*pci_inb)(address)); 36 | } 37 | void ASM LIB_pci_outb(void) 38 | { 39 | unsigned char value = (unsigned char) REG_D0; 40 | unsigned long address = (unsigned long) REG_A0; 41 | (*pci_outb)(value,address); 42 | } 43 | /* Word (16bits) Read/Write */ 44 | unsigned short ASM LIB_pci_inw(void) 45 | { 46 | unsigned long address = (unsigned long) REG_A0; 47 | return( (*pci_inw)(address)); 48 | } 49 | void ASM LIB_pci_outw(void) 50 | { 51 | unsigned short value = (unsigned short) REG_D0; 52 | unsigned long address = (unsigned long) REG_A0; 53 | (*pci_outw)(value,address); 54 | } 55 | 56 | /* Long (32bits) Read/Write */ 57 | unsigned long ASM LIB_pci_inl(void) 58 | { 59 | unsigned long address = (unsigned long) REG_A0; 60 | return( (*pci_inl)(address)); 61 | } 62 | void ASM LIB_pci_outl(void) 63 | { 64 | unsigned long value = (unsigned long) REG_D0; 65 | unsigned long address = (unsigned long) REG_A0; 66 | (*pci_outl)(value,address); 67 | } 68 | 69 | 70 | /* Amiga Mem and Pci Mem Read/Write (must be a multiple of 16bytes) (it's a very fast mem bloc copy) */ 71 | void ASM LIB_pci_to_hostcpy(void) 72 | { 73 | void *pcimemsrc = (void *) REG_A0; 74 | void *memdest = (void *) REG_A1; 75 | unsigned long packetsize = (unsigned long) REG_D0; 76 | (*pci_to_hostcpy)(pcimemsrc,memdest,packetsize); 77 | } 78 | void ASM LIB_host_to_pcicpy(void) 79 | { 80 | void *memsrc = (void *) REG_A0; 81 | void *pcimemdest = (void *) REG_A1; 82 | unsigned long packetsize = (unsigned long) REG_D0; 83 | (*host_to_pcicpy)(memsrc,pcimemdest,packetsize); 84 | } 85 | void ASM LIB_pci_to_pcicpy(void) 86 | { 87 | void *pcimemsrc = (void *) REG_A0; 88 | void *pcimemdest = (void *) REG_A1; 89 | unsigned long packetsize = (unsigned long) REG_D0; 90 | (*pci_to_pcicpy)(pcimemsrc,pcimemdest,packetsize); 91 | } 92 | 93 | /* Pci Find Functions */ 94 | struct pci_dev * ASM LIB_pci_find_device(void) 95 | { 96 | unsigned short vendor = (unsigned short) REG_D0; 97 | unsigned short device = (unsigned short) REG_D1; 98 | struct pci_dev *pcidev = (struct pci_dev *) REG_A0; 99 | return(pci_find_device(vendor,device,pcidev)); 100 | } 101 | 102 | struct pci_dev * ASM LIB_pci_find_class(void) 103 | { 104 | unsigned long class = (unsigned long) REG_D0; 105 | struct pci_dev *pcidev = (struct pci_dev *) REG_A0; 106 | return(pci_find_class(class,pcidev)); 107 | } 108 | struct pci_dev * ASM LIB_pci_find_slot(void) 109 | { 110 | unsigned char bus = (unsigned char) REG_D0; 111 | unsigned long devfn = (unsigned long) REG_D1; 112 | return(pci_find_slot(bus,devfn)); 113 | } 114 | 115 | /* Pci Bus Read/Write Config functions */ 116 | unsigned char ASM LIB_pci_read_config_byte(void) 117 | { 118 | unsigned char registernum = (unsigned char) REG_D0; 119 | struct pci_dev *pcidev = (struct pci_dev *) REG_A0; 120 | return( (*pci_read_config_byte)(registernum,pcidev)); 121 | } 122 | unsigned short ASM LIB_pci_read_config_word(void) 123 | { 124 | unsigned char registernum = (unsigned short) REG_D0; 125 | struct pci_dev *pcidev = (struct pci_dev *) REG_A0; 126 | return( (*pci_read_config_word)(registernum,pcidev)); 127 | } 128 | unsigned long ASM LIB_pci_read_config_long(void) 129 | { 130 | unsigned char registernum = (unsigned long) REG_D0; 131 | struct pci_dev *pcidev = (struct pci_dev *) REG_A0; 132 | return( (*pci_read_config_long)(registernum,pcidev)); 133 | } 134 | void ASM LIB_pci_write_config_byte(void) 135 | { 136 | unsigned char registernum = (unsigned char) REG_D0; 137 | unsigned char val = (unsigned char) REG_D1; 138 | struct pci_dev *pcidev = (struct pci_dev *) REG_A0; 139 | (*pci_write_config_byte)(registernum,val,pcidev); 140 | } 141 | void ASM LIB_pci_write_config_word(void) 142 | { 143 | unsigned char registernum = (unsigned char) REG_D0; 144 | unsigned short val = (unsigned short) REG_D1; 145 | struct pci_dev *pcidev = (struct pci_dev *) REG_A0; 146 | (*pci_write_config_word)(registernum,val,pcidev); 147 | } 148 | void ASM LIB_pci_write_config_long(void) 149 | { 150 | unsigned char registernum = (unsigned char) REG_D0; 151 | unsigned long val = (unsigned long) REG_D1; 152 | struct pci_dev *pcidev = (struct pci_dev *) REG_A0; 153 | (*pci_write_config_long)(registernum,val,pcidev); 154 | } 155 | 156 | /* Pci Set Bus Master */ 157 | BOOL ASM LIB_pci_set_master(void) 158 | { 159 | struct pci_dev *pcidev = (struct pci_dev *) REG_A0; 160 | return( (*pci_set_master)(pcidev)); 161 | } 162 | 163 | /* Interrupt functions */ 164 | BOOL ASM LIB_pci_add_intserver(void) 165 | { 166 | struct Interrupt *PciInterrupt = (struct Interrupt *) REG_A0; 167 | struct pci_dev *pcidev = (struct pci_dev *) REG_A1; 168 | return( (*pci_add_intserver)(PciInterrupt,pcidev)); 169 | } 170 | 171 | void ASM LIB_pci_rem_intserver(void) 172 | { 173 | struct Interrupt *PciInterrupt = (struct Interrupt *) REG_A0; 174 | struct pci_dev *pcidev = (struct pci_dev *) REG_A1; 175 | (*pci_rem_intserver)(PciInterrupt,pcidev); 176 | } 177 | 178 | /* Alloc and Free DMA memory for PCI card */ 179 | APTR ASM LIB_pci_allocdma_mem(void) 180 | { 181 | unsigned long size = (unsigned long) REG_D0; 182 | unsigned long flags = (unsigned long) REG_D1; 183 | return( (*pci_allocdma_mem)(size,flags)); 184 | } 185 | 186 | void ASM LIB_pci_freedma_mem(void) 187 | { 188 | APTR buffer = (APTR) REG_A0; 189 | unsigned long size = (unsigned long) REG_D0; 190 | (*pci_freedma_mem)(buffer,size); 191 | } 192 | 193 | /* Logic<->Physic Addr conversion */ 194 | APTR ASM LIB_pci_logic_to_physic_addr(void) 195 | { 196 | APTR PciLogicalAddr = (APTR) REG_A0; 197 | struct pci_dev *pcidev = (struct pci_dev *) REG_A1; 198 | return( (*pci_logic_to_physic_addr)(PciLogicalAddr,pcidev)); 199 | } 200 | 201 | /*************** New functions ***********************/ 202 | APTR ASM LIB_pci_physic_to_logic_addr(void) 203 | { 204 | APTR PciPhysicalAddr = (APTR) REG_A0; 205 | struct pci_dev *pcidev = (struct pci_dev *) REG_A1; 206 | return( (*pci_physic_to_logic_addr)(PciPhysicalAddr,pcidev)); 207 | } 208 | 209 | /* Obtain/Release PCI card */ 210 | BOOL ASM LIB_pci_obtain_card(void) 211 | { 212 | struct pci_dev *pcidev = (struct pci_dev *) REG_A0; 213 | return( (*pci_obtain_card)(pcidev)); 214 | } 215 | 216 | void ASM LIB_pci_release_card(void) 217 | { 218 | struct pci_dev *pcidev = (struct pci_dev *) REG_A0; 219 | (*pci_release_card)(pcidev); 220 | } 221 | 222 | #else /* __MORPHOS__ */ 223 | 224 | /* Return the bus type found */ 225 | unsigned short __saveds LIB_pci_bus(void) 226 | { 227 | return(pci_bus()); 228 | } 229 | 230 | /* IN/OUT Function for PCI Bus */ 231 | /* Byte (8bits) Read/Write */ 232 | unsigned char __saveds ASM LIB_pci_inb(REG(a0,unsigned long address)) 233 | { 234 | return( (*pci_inb)(address)); 235 | } 236 | void __saveds ASM LIB_pci_outb(REG(d0,unsigned char value), REG(a0,unsigned long address)) 237 | { 238 | (*pci_outb)(value,address); 239 | } 240 | /* Word (16bits) Read/Write */ 241 | unsigned short __saveds ASM LIB_pci_inw(REG(a0,unsigned long address)) 242 | { 243 | return( (*pci_inw)(address)); 244 | } 245 | void __saveds ASM LIB_pci_outw(REG(d0,unsigned short value), REG(a0,unsigned long address)) 246 | { 247 | (*pci_outw)(value,address); 248 | } 249 | 250 | /* Long (32bits) Read/Write */ 251 | unsigned long __saveds ASM LIB_pci_inl(REG(a0,unsigned long address)) 252 | { 253 | return( (*pci_inl)(address)); 254 | } 255 | void __saveds ASM LIB_pci_outl(REG(d0,unsigned long value), REG(a0,unsigned long address)) 256 | { 257 | (*pci_outl)(value,address); 258 | } 259 | 260 | 261 | /* Amiga Mem and Pci Mem Read/Write (must be a multiple of 16bytes) (it's a very fast mem bloc copy) */ 262 | void __saveds ASM LIB_pci_to_hostcpy(REG(a0,void *pcimemsrc), REG(a1,void *memdest), REG(d0,unsigned long packetsize)) 263 | { 264 | (*pci_to_hostcpy)(pcimemsrc,memdest,packetsize); 265 | } 266 | void __saveds ASM LIB_host_to_pcicpy(REG(a0,void *memsrc), REG(a1,void *pcimemdest), REG(d0,unsigned long packetsize)) 267 | { 268 | (*host_to_pcicpy)(memsrc,pcimemdest,packetsize); 269 | } 270 | void __saveds ASM LIB_pci_to_pcicpy(REG(a0,void *pcimemsrc), REG(a1,void *pcimemdest), REG(d0,unsigned long packetsize)) 271 | { 272 | (*pci_to_pcicpy)(pcimemsrc,pcimemdest,packetsize); 273 | } 274 | 275 | /* Pci Find Functions */ 276 | struct pci_dev * __saveds ASM LIB_pci_find_device(REG(d0,unsigned short vendor), REG(d1,unsigned short device), REG(a0,struct pci_dev *pcidev)) 277 | { 278 | return(pci_find_device(vendor,device,pcidev)); 279 | } 280 | struct pci_dev * __saveds ASM LIB_pci_find_class(REG(d0,unsigned long class), REG(a0,struct pci_dev *pcidev)) 281 | { 282 | return(pci_find_class(class,pcidev)); 283 | } 284 | struct pci_dev * __saveds ASM LIB_pci_find_slot(REG(d0,unsigned char bus), REG(d1,unsigned long devfn)) 285 | { 286 | return(pci_find_slot(bus,devfn)); 287 | } 288 | 289 | /* Pci Bus Read/Write Config functions */ 290 | unsigned char __saveds ASM LIB_pci_read_config_byte(REG(d0,unsigned char registernum),REG(a0,struct pci_dev *pcidev)) 291 | { 292 | return( (*pci_read_config_byte)(registernum,pcidev)); 293 | } 294 | unsigned short __saveds ASM LIB_pci_read_config_word(REG(d0,unsigned char registernum),REG(a0,struct pci_dev *pcidev)) 295 | { 296 | return( (*pci_read_config_word)(registernum,pcidev)); 297 | } 298 | unsigned long __saveds ASM LIB_pci_read_config_long(REG(d0,unsigned char registernum),REG(a0,struct pci_dev *pcidev)) 299 | { 300 | return( (*pci_read_config_long)(registernum,pcidev)); 301 | } 302 | void __saveds ASM LIB_pci_write_config_byte(REG(d0,unsigned char registernum), REG(d1,unsigned char val), REG(a0,struct pci_dev *pcidev)) 303 | { 304 | (*pci_write_config_byte)(registernum,val,pcidev); 305 | } 306 | void __saveds ASM LIB_pci_write_config_word(REG(d0,unsigned char registernum), REG(d1,unsigned short val), REG(a0,struct pci_dev *pcidev)) 307 | { 308 | (*pci_write_config_word)(registernum,val,pcidev); 309 | } 310 | void __saveds ASM LIB_pci_write_config_long(REG(d0,unsigned char registernum), REG(d1,unsigned long val), REG(a0,struct pci_dev *pcidev)) 311 | { 312 | (*pci_write_config_long)(registernum,val,pcidev); 313 | } 314 | 315 | /* Pci Set Bus Master */ 316 | BOOL __saveds ASM LIB_pci_set_master(REG(a0,struct pci_dev *pcidev)) 317 | { 318 | return( (*pci_set_master)(pcidev)); 319 | } 320 | 321 | /* Interrupt functions */ 322 | BOOL __saveds ASM LIB_pci_add_intserver(REG(a0,struct Interrupt *PciInterrupt),REG(a1,struct pci_dev *pcidev)) 323 | { 324 | return( (*pci_add_intserver)(PciInterrupt,pcidev)); 325 | } 326 | 327 | void __saveds ASM LIB_pci_rem_intserver(REG(a0,struct Interrupt *PciInterrupt),REG(a1,struct pci_dev *pcidev)) 328 | { 329 | (*pci_rem_intserver)(PciInterrupt,pcidev); 330 | } 331 | 332 | /* Alloc and Free DMA memory for PCI card */ 333 | APTR __saveds ASM LIB_pci_allocdma_mem(REG(d0,unsigned long size), REG(d1,unsigned long flags)) 334 | { 335 | return( (*pci_allocdma_mem)(size,flags)); 336 | } 337 | 338 | void __saveds ASM LIB_pci_freedma_mem(REG(a0,APTR buffer),REG(d0,unsigned long size)) 339 | { 340 | (*pci_freedma_mem)(buffer,size); 341 | } 342 | 343 | /* Logic<->Physic Addr conversion */ 344 | APTR __saveds ASM LIB_pci_logic_to_physic_addr(REG(a0,APTR PciLogicalAddr),REG(a1,struct pci_dev *pcidev)) 345 | { 346 | return( (*pci_logic_to_physic_addr)(PciLogicalAddr,pcidev)); 347 | } 348 | 349 | /*************** New functions ***********************/ 350 | 351 | APTR __saveds ASM LIB_pci_physic_to_logic_addr(REG(a0,APTR PciPhysicalAddr),REG(a1,struct pci_dev *pcidev)) 352 | { 353 | return( (*pci_physic_to_logic_addr)(PciPhysicalAddr,pcidev)); 354 | } 355 | 356 | /* Obtain/Release PCI card */ 357 | 358 | BOOL __saveds ASM LIB_pci_obtain_card(REG(a0,struct pci_dev *pcidev)) 359 | { 360 | return( (*pci_obtain_card)(pcidev)); 361 | } 362 | 363 | void __saveds ASM LIB_pci_release_card(REG(a0,struct pci_dev *pcidev)) 364 | { 365 | (*pci_release_card)(pcidev); 366 | } 367 | 368 | #endif 369 | 370 | #endif /* OPENPCIFUNCTABLE_H */ 371 | -------------------------------------------------------------------------------- /openpciinfo/OpenPciInfo.c: -------------------------------------------------------------------------------- 1 | /* 2 | OpenPciInfo v1.5 coded by Titan Email : bvernoux@wanadoo.fr 3 | 12/03/2005 4 | - New Pci card header (This header created on Sun Mar 6 09:38:14 PST 2005) 5 | - New tests 6 | - Cleaned warning 7 | 26/07/2002 8 | - Correct an Error in what's enable in the card for the FAST_BACK_TO_BACK 9 | 12/07/2002 10 | - Add Makefile for GCC MOS and modified some things for GCC MOS 11 | 21/02/2002 12 | - Modified ClassCode with 0x%06lx 13 | 17/02/2002 14 | Modified 10/04/2002 15 | - Added lot of information for developer on each card on the Bus 16 | 26/03/2002 17 | - use new flags for pci_allocdma_mem 18 | 10/04/2002 19 | - Support GrexA1200Bus, GrexA4000Bus and PegasosBus flags 20 | 12/04/2002 21 | - Modify strncpy to stccpy for speed-up Thanks to Zapek 22 | */ 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | 36 | #include 37 | #include 38 | 39 | #include "PCIBusInfo.h" 40 | 41 | #ifdef LATTICE 42 | //int CXBRK(void) { return(0); } /* Disable Lattice CTRL/C handling */ 43 | //int chkabort(void) { return(0); } /* really */ 44 | #endif 45 | 46 | struct Library *ExpansionBase = NULL; 47 | struct Library *OpenPciBase = NULL; 48 | 49 | int main(int argc, char **argv) 50 | { 51 | 52 | unsigned char bus=0; 53 | int j; 54 | 55 | unsigned char slotnum; 56 | unsigned char funcnum; 57 | // IRQ 58 | unsigned short irq; 59 | 60 | unsigned short vendorid,deviceid; 61 | 62 | unsigned long config; 63 | unsigned long memstart; 64 | unsigned long memend; 65 | unsigned long memflags; 66 | unsigned char mem; 67 | 68 | char VendorShort[100]; 69 | char VendorFull[100]; 70 | char DevName[100]; 71 | char DevNameDesc[100]; 72 | 73 | unsigned long dmamem,dmamem1; 74 | 75 | struct pci_dev *dev=NULL; 76 | 77 | // Version Number 78 | printf("%s\n\n",&ver[6]); 79 | 80 | 81 | if(( OpenPciBase=(struct Library *)OpenLibrary("openpci.library",MIN_OPENPCI_VERSION))==NULL) 82 | { 83 | printf("Error to open openpci.library v%ld or more\n",(long)MIN_OPENPCI_VERSION); 84 | return 10; 85 | } 86 | 87 | printf("openpci.library v%ld.%ld opened\n",(long)OpenPciBase->lib_Version,(long)OpenPciBase->lib_Revision); 88 | 89 | bus=pci_bus(); 90 | if(bus>0) 91 | { 92 | switch(bus) 93 | { 94 | case MediatorA1200Bus: 95 | printf("Bus Mediator A1200 detected\n"); 96 | break; 97 | case MediatorZ4Bus: 98 | printf("Bus Mediator Z4 detected\n"); 99 | break; 100 | case PrometheusBus: 101 | printf("Bus Prometheus detected\n"); 102 | break; 103 | case GrexA1200Bus: 104 | printf("Bus Grex A1200 detected\n"); 105 | break; 106 | case GrexA4000Bus: 107 | printf("Bus Grex A4000 detected\n"); 108 | break; 109 | case PegasosBus: 110 | printf("Bus Pegasos detected\n"); 111 | break; 112 | case PowerPciBus: 113 | printf("Amithlon PCI Bus detected\n"); 114 | break; 115 | default: 116 | printf("PCI Bus not detected\n"); 117 | } 118 | } 119 | 120 | if(bus) 121 | { 122 | while( (dev=pci_find_device(0xffff,0xffff,dev))!=NULL ) 123 | { 124 | 125 | printf("\n----------------------------------\n"); 126 | printf("Internal Configuration Space infos\n"); 127 | 128 | vendorid=pci_read_config_word(PCI_VENDOR_ID,dev); 129 | deviceid=pci_read_config_word(PCI_DEVICE_ID,dev); 130 | printf("VendorID : $%x \nDeviceID : $%x\n",vendorid,deviceid); 131 | 132 | config=pci_read_config_long(PCI_CLASS_REVISION,dev); 133 | printf("ClassRevision : $%08lx \n",config); 134 | 135 | config=(long)pci_read_config_byte(PCI_REVISION_ID,dev); 136 | printf("PCI_REVISION_ID $%02lx\n",config); 137 | 138 | config=(long)pci_read_config_byte(PCI_HEADER_TYPE,dev); 139 | printf("Header Type : $%02lx (0=Normal/1=Bridge/2=Cardbus)\n",config); 140 | if (config==0) 141 | { 142 | config=(long)pci_read_config_word(PCI_SUBSYSTEM_ID,dev); 143 | printf("PCI_SUBSYSTEM_ID $%04lx\n",config); 144 | } 145 | 146 | config=(long)pci_read_config_word(PCI_COMMAND,dev); 147 | printf("Command : $%04lx \n",config); 148 | 149 | if(config&PCI_COMMAND_IO) 150 | printf("I/O space PCI_COMMAND_IO\n"); 151 | 152 | if(config&PCI_COMMAND_MEMORY) 153 | printf("Memory space PCI_COMMAND_MEMORY\n"); 154 | 155 | if(config&PCI_COMMAND_MASTER) 156 | printf("Bus mastering PCI_COMMAND_MASTER\n"); 157 | 158 | if(config&PCI_COMMAND_SPECIAL) 159 | printf("Special cycles PCI_COMMAND_SPECIAL\n"); 160 | 161 | if(config&PCI_COMMAND_INVALIDATE) 162 | printf("Use memory write and invalidate PCI_COMMAND_INVALIDATE\n"); 163 | 164 | if(config&PCI_COMMAND_VGA_PALETTE) 165 | printf("Palette snooping PCI_COMMAND_VGA_PALETTE\n"); 166 | 167 | if(config&PCI_COMMAND_PARITY) 168 | printf("Parity checking PCI_COMMAND_PARITY\n"); 169 | 170 | if(config&PCI_COMMAND_WAIT) 171 | printf("Address/data stepping PCI_COMMAND_WAIT\n"); 172 | 173 | if(config&PCI_COMMAND_SERR) 174 | printf("SERR PCI_COMMAND_SERR\n"); 175 | 176 | if(config&PCI_COMMAND_FAST_BACK) 177 | printf("Fast-back to back writes PCI_COMMAND_FAST_BACK\n"); 178 | 179 | /* 180 | if(pci_set_master(dev)) 181 | { 182 | 183 | printf("Bus MASTER Enable\n"); 184 | }else 185 | { 186 | printf("I can't Enable Bus MASTER on this card\n"); 187 | } 188 | */ 189 | config=(long)pci_read_config_byte(PCI_LATENCY_TIMER,dev); 190 | printf("PCI_LATENCY_TIMER : $%02lx\n",config); 191 | printf("----------------------------------\n"); 192 | /* End of internal Configuration Space infos */ 193 | 194 | // Get The Pci Slot Number (5 device max on a PCI BUS (4 on Mediator1200)) 195 | slotnum=PCI_SLOT(dev->devfn); 196 | 197 | // Get The Pci Function Number (8 function max on each PCI device) 198 | funcnum=PCI_FUNC(dev->devfn); 199 | 200 | printf("Pci Device Slot Num : %d, Func Num : %d \n",slotnum,funcnum); 201 | 202 | // Vendor ID 203 | vendorid=dev->vendor; 204 | // Device ID 205 | deviceid=dev->device; 206 | VendorName(vendorid,VendorShort,VendorFull); 207 | DeviceName(vendorid,deviceid,DevName,DevNameDesc); 208 | 209 | printf("Vendor : %s \nDevice : %s %s\nVendorID : $%x \nDeviceID : $%x\n",VendorFull,DevName,DevNameDesc,vendorid,deviceid); 210 | printf("ClassCode: 0x%06lx\n",(long)dev->devclass); 211 | 212 | // IRQ 213 | irq=dev->irq; 214 | printf("IRQNumber: %d\n",irq); 215 | 216 | /* 217 | For BaseAddress0 to BaseAddress5 218 | */ 219 | mem=0; 220 | for(j=0;j<=5;j++) 221 | { 222 | 223 | memstart=dev->base_address[j]; 224 | memflags=dev->base_size[j]; 225 | 226 | if(memstart) 227 | { 228 | if(memflags&1) //IOAddress Bit0 at 1 229 | { 230 | // IOAddr 231 | memend=memstart+~(dev->base_size[j]&PCI_BASE_ADDRESS_IO_MASK); 232 | 233 | // Diplay in bytes or kbytes 234 | if(memend-memstart+1<=1024) 235 | { 236 | printf("IOAddr%d : $%08lx - $%08lx %ld bytes\n", 237 | j, 238 | memstart, 239 | memend, 240 | (unsigned long)(memend-memstart+1) ); 241 | 242 | }else 243 | { 244 | printf("IOAddr%d : $%08lx - $%08lx %ld kbytes\n", 245 | j, 246 | memstart, 247 | memend, 248 | (unsigned long)(memend-memstart+1)>>10 ); 249 | } 250 | }else 251 | { 252 | // Mem Address 253 | memend=memstart+~(dev->base_size[j]&PCI_BASE_ADDRESS_MEM_MASK); 254 | 255 | // Diplay in bytes or kbytes 256 | if(memend-memstart+1<=1024) 257 | { 258 | printf("MemAddr%d : $%08lx - $%08lx %ld bytes\n", 259 | j, 260 | memstart, 261 | memend, 262 | (unsigned long)(memend-memstart+1) ); 263 | }else 264 | { 265 | printf("MemAddr%d : $%08lx - $%08lx %ld kbytes\n", 266 | j, 267 | memstart, 268 | memend, 269 | (unsigned long)(memend-memstart+1)>>10 ); 270 | } 271 | 272 | } 273 | 274 | 275 | } 276 | 277 | } 278 | if(dev->rom_address && dev->rom_size) 279 | printf( 280 | "RomAddr : $%08lx - $%08lx\nRomSize\t : %ld bytes %ld kbytes\n", 281 | dev->rom_address, 282 | dev->rom_address+~(dev->rom_size&PCI_ROM_ADDRESS_MASK), 283 | (unsigned long)(~(dev->rom_size&PCI_ROM_ADDRESS_MASK)+1), 284 | (~(dev->rom_size&PCI_ROM_ADDRESS_MASK)+1)/1024 285 | ); 286 | 287 | if(dev->master) 288 | printf("Bus Master Capable\n"); 289 | else 290 | { 291 | printf("No Bus Master Capable\n"); 292 | } 293 | 294 | // Support 66Mhz 295 | 296 | // Read PCI_STATUS 297 | config=pci_read_config_word(PCI_STATUS,dev); 298 | 299 | printf("Card PCI_STATUS\n"); 300 | //printf("Config PCI_STATUS 0x%x\n",config); 301 | 302 | if(config&PCI_STATUS_66MHZ) 303 | printf("Support 66 Mhz PCI 2.1 bus\n"); 304 | else 305 | { 306 | printf("Doesn't support 66 Mhz PCI 2.1 bus\n"); 307 | } 308 | 309 | if(config&PCI_STATUS_FAST_BACK) 310 | printf("Accept fast-back to back\n"); 311 | else 312 | { 313 | printf("Doesn't accept fast-back to back\n"); 314 | } 315 | 316 | // Read PCI_COMMAND 317 | config=pci_read_config_word(PCI_COMMAND,dev); 318 | printf("What's Enabled in the Card ?\n"); 319 | 320 | if(config&PCI_COMMAND_IO) 321 | printf("I/O space PCI_COMMAND_IO\n"); 322 | 323 | if(config&PCI_COMMAND_MEMORY) 324 | printf("Memory space PCI_COMMAND_MEMORY\n"); 325 | 326 | if(config&PCI_COMMAND_MASTER) 327 | printf("Bus mastering PCI_COMMAND_MASTER\n"); 328 | 329 | if(config&PCI_COMMAND_SPECIAL) 330 | printf("Special cycles PCI_COMMAND_SPECIAL\n"); 331 | 332 | if(config&PCI_COMMAND_INVALIDATE) 333 | printf("Use memory write and invalidate PCI_COMMAND_INVALIDATE\n"); 334 | 335 | if(config&PCI_COMMAND_VGA_PALETTE) 336 | printf("Palette snooping PCI_COMMAND_VGA_PALETTE\n"); 337 | 338 | if(config&PCI_COMMAND_PARITY) 339 | printf("Parity checking PCI_COMMAND_PARITY\n"); 340 | 341 | if(config&PCI_COMMAND_WAIT) 342 | printf("Address/data stepping PCI_COMMAND_WAIT\n"); 343 | 344 | if(config&PCI_COMMAND_SERR) 345 | printf("SERR PCI_COMMAND_SERR\n"); 346 | 347 | if(config&PCI_COMMAND_FAST_BACK) 348 | printf("Fast-back to back writes PCI_COMMAND_FAST_BACK\n"); 349 | 350 | //printf("\n"); 351 | } 352 | 353 | #if 1 354 | // Test Lib Functions 355 | // Find first Pci card 356 | dev=pci_find_device(0xffff,0xffff,0); 357 | if(dev) 358 | { 359 | 360 | /* DMA Mem Alloc/Free tests */ 361 | 362 | // Alloc DMA Mem 363 | dmamem=(unsigned long)pci_allocdma_mem(2048,MEM_PCI); 364 | if(dmamem) 365 | printf("2048bytes MEM_PCI DMA Mem Allocated : %lx\n",dmamem); 366 | 367 | // Alloc DMA Mem 368 | dmamem1=(unsigned long)pci_allocdma_mem(16384,MEM_PCI); 369 | if(dmamem1) 370 | printf("16384bytes MEM_PCI DMA Mem Allocated : %lx\n",dmamem1); 371 | 372 | // Free DMA Mem 373 | if(dmamem) 374 | { 375 | printf("Free Mem 2048\n"); 376 | pci_freedma_mem( (APTR)dmamem,2048); 377 | } 378 | 379 | // Alloc DMA Mem 380 | dmamem=(unsigned long)pci_allocdma_mem(2040,MEM_NONCACHEABLE); 381 | if(dmamem) 382 | printf("2040bytes MEM_NONCACHEABLE DMA Mem Allocated : %lx\n",dmamem); 383 | 384 | // Free DMA Mem 385 | if(dmamem) 386 | { 387 | printf("Free Mem 2040\n"); 388 | pci_freedma_mem( (APTR)dmamem,2040); 389 | } 390 | 391 | // Alloc DMA Mem 392 | dmamem=(unsigned long)pci_allocdma_mem(4096,MEM_NONCACHEABLE); 393 | if(dmamem) 394 | printf("4096bytes MEM_NONCACHEABLE DMA Mem Allocated : %lx\n",dmamem); 395 | 396 | // Free DMA Mem 397 | if(dmamem) 398 | { 399 | printf("Free Mem 4096\n"); 400 | pci_freedma_mem( (APTR)dmamem,4096); 401 | } 402 | 403 | // Free DMA Mem 404 | if(dmamem1) 405 | { 406 | printf("Free Mem 16384\n"); 407 | pci_freedma_mem( (APTR)dmamem1,16384); 408 | } 409 | 410 | 411 | // Maximum DMA Mem is 262144 bytes 412 | // Alloc DMA Mem 413 | dmamem=(unsigned long)pci_allocdma_mem(300000,MEM_NONCACHEABLE); 414 | if(dmamem) 415 | printf("300000 bytes MEM_NONCACHEABLE DMA Mem Allocated : %lx\n",dmamem); 416 | 417 | // Free DMA Mem 418 | if(dmamem) 419 | { 420 | printf("Free Mem 300000\n"); 421 | pci_freedma_mem( (APTR)dmamem,300000); 422 | } 423 | 424 | } 425 | #endif 426 | 427 | } 428 | CloseLibrary( (struct Library*)OpenPciBase ); 429 | return 0; 430 | } 431 | 432 | 433 | /* 434 | For know the VendorName Short and Full description 435 | return -1 if success or 0 if it's not founded 436 | */ 437 | 438 | int VendorName(unsigned short VendID,char *VendorShort,char *VendorFull) 439 | { 440 | int i; 441 | for(i=0;inil: $@ +e 66 | @#ppc-morphos-objdump --syms $@ | grep *UND* 67 | 68 | #cnet.device: cnet.o 69 | # $(CC) $< $(LFLAGS) -o $@ 70 | # 71 | #cnet.o: cnet.c $(HEADERS) 72 | # $(CC) $(CFLAGS) -c $< -o $@ 73 | # 74 | #cnet.device.elf: cnet_mos.o 75 | # $(CC_MOS) $< $(LFLAGS_MOS) -o $@ 76 | # 77 | #cnet_mos.o: cnet.c $(HEADERS) 78 | # $(CC_MOS) $(CFLAGS_MOS) -c $< -o $@ 79 | -------------------------------------------------------------------------------- /openpciinfo/pcibusinfo.h: -------------------------------------------------------------------------------- 1 | #ifndef PCIBusH 2 | #define PCIBusH 3 | 4 | // VendorName, DeviceName ...etc 5 | #include "pcihdr.h" 6 | 7 | char ver[]="$VER: OpenPciInfo v1.5 12.03.2005 by Titan"; 8 | 9 | int VendorName(unsigned short VendID,char *VendorShort,char *VendorFull); 10 | int DeviceName(unsigned short VendID,unsigned short DevID,char *DevName,char *DevNameDesc); 11 | 12 | #endif /* PCIBusH*/ 13 | 14 | -------------------------------------------------------------------------------- /openpciinfo/pcihdr.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/openpciinfo/pcihdr.h -------------------------------------------------------------------------------- /openpciinfo/smakefile: -------------------------------------------------------------------------------- 1 | all: 2 | sc lib=lib:debug.lib nostackcheck data=far code=far nosmallcode nosmalldata OpenPciInfo.c link to OpenPciInfo 3 | -------------------------------------------------------------------------------- /openpciinfo_HexDumpPCI/OpenPciInfo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/openpciinfo_HexDumpPCI/OpenPciInfo -------------------------------------------------------------------------------- /openpciinfo_HexDumpPCI/OpenPciInfo.c.info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/openpciinfo_HexDumpPCI/OpenPciInfo.c.info -------------------------------------------------------------------------------- /openpciinfo_HexDumpPCI/OpenPciInfo.info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/openpciinfo_HexDumpPCI/OpenPciInfo.info -------------------------------------------------------------------------------- /openpciinfo_HexDumpPCI/OpenPciInfo.lnk: -------------------------------------------------------------------------------- 1 | FROM LIB:c.o "OpenPciInfo.o" 2 | TO "OpenPciInfo" 3 | LIB lib:debug.lib lib:debug.lib LIB:scnb.lib LIB:amiga.lib 4 | 5 | -------------------------------------------------------------------------------- /openpciinfo_HexDumpPCI/OpenPciInfo_v1_7-HexDump.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/openpciinfo_HexDumpPCI/OpenPciInfo_v1_7-HexDump.zip -------------------------------------------------------------------------------- /openpciinfo_HexDumpPCI/build.info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/openpciinfo_HexDumpPCI/build.info -------------------------------------------------------------------------------- /openpciinfo_HexDumpPCI/delobject: -------------------------------------------------------------------------------- 1 | delete #?.o68k 2 | delete #?.oPPC 3 | delete #?.lnk 4 | delete #?.lst 5 | delete #?.lst.info 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /openpciinfo_HexDumpPCI/delobject.info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/openpciinfo_HexDumpPCI/delobject.info -------------------------------------------------------------------------------- /openpciinfo_HexDumpPCI/makefile: -------------------------------------------------------------------------------- 1 | # 2 | # OpenPciInfo gcc makefile 3 | # 4 | 5 | DEB = 6 | #DEB = -DDEBUG 7 | 8 | # -fomit-frame-pointer is evil on m68k gcc! 9 | CC_68K = gcc 10 | LD_68K = gcc 11 | LCFLAGS_68K = $(DEB) -Wall -O2 -m68020-60 -mregparm=3 -noixemul -nostdlib 12 | LDFLAGS_68K = -noixemul -nostdlib 13 | LIBS_68K = -lamiga 14 | 15 | CC_PPC = ppc-morphos-gcc 16 | LD_PPC = ppc-morphos-gcc 17 | LCFLAGS_PPC = $(DEB) -Wall -O2 -mcpu=604e -mmultiple -fomit-frame-pointer -noixemul 18 | LDFLAGS_PPC = -noixemul 19 | LIBS_PPC = -labox -lsyscall 20 | 21 | 22 | ############################################################################## 23 | # object files 24 | 25 | OBJS_68K = OpenPciInfo.o68k 26 | OBJS_PPC = OpenPciInfo.oPPC 27 | HEADERS = PciBusInfo.h debug.h 28 | 29 | ############################################################################## 30 | # standard targets 31 | 32 | .PHONY: all install clean 33 | 34 | 35 | all: OpenPciInfo.elf 36 | 37 | install: 38 | copy clone OpenPciInfo.elf c: 39 | 40 | clean: 41 | $(RM) $(OBJS_68K) $(OBJS_PPC) 42 | 43 | ############################################################################## 44 | # dependencies 45 | 46 | OpenPciInfo.oPPC: PciBusInfo.h 47 | 48 | ############################################################################## 49 | 50 | .SUFFIXES: 51 | .SUFFIXES: .c .oPPC .o68K 52 | 53 | %.o68K: %.c 54 | $(CC_68K) $(LCFLAGS_68K) -c $< -o $@ 55 | 56 | %.oPPC: %.c 57 | $(CC_PPC) $(LCFLAGS_PPC) -c $< -o $@ 58 | 59 | OpenPciInfo: $(OBJS_68K) 60 | $(LD_68K) $(LDFLAGS_68K) $^ -o $@ $(LIBS_68K) 61 | 62 | OpenPciInfo.elf: $(OBJS_PPC) 63 | $(LD_PPC) $(LDFLAGS_PPC) $^ -o $@.db $(LIBS_PPC) 64 | ppc-morphos-strip -o $@ --remove-section=.comment $@.db 65 | @protect >nil: $@ +e 66 | @#ppc-morphos-objdump --syms $@ | grep *UND* 67 | 68 | #cnet.device: cnet.o 69 | # $(CC) $< $(LFLAGS) -o $@ 70 | # 71 | #cnet.o: cnet.c $(HEADERS) 72 | # $(CC) $(CFLAGS) -c $< -o $@ 73 | # 74 | #cnet.device.elf: cnet_mos.o 75 | # $(CC_MOS) $< $(LFLAGS_MOS) -o $@ 76 | # 77 | #cnet_mos.o: cnet.c $(HEADERS) 78 | # $(CC_MOS) $(CFLAGS_MOS) -c $< -o $@ 79 | -------------------------------------------------------------------------------- /openpciinfo_HexDumpPCI/pcibusinfo.h: -------------------------------------------------------------------------------- 1 | #ifndef PCIBusH 2 | #define PCIBusH 3 | 4 | // VendorName, DeviceName ...etc 5 | #include "pcihdr.h" 6 | 7 | char ver[]="$VER: OpenPciInfo 8/16/32bit HexDump PCI config v1.7 03.05.2006 by Titan"; 8 | 9 | int VendorName(unsigned short VendID,char *VendorShort,char *VendorFull); 10 | int DeviceName(unsigned short VendID,unsigned short DevID,char *DevName,char *DevNameDesc); 11 | 12 | #endif /* PCIBusH*/ 13 | 14 | -------------------------------------------------------------------------------- /openpciinfo_HexDumpPCI/pcibusinfo.h.info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/openpciinfo_HexDumpPCI/pcibusinfo.h.info -------------------------------------------------------------------------------- /openpciinfo_HexDumpPCI/pcihdr.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/openpciinfo_HexDumpPCI/pcihdr.h -------------------------------------------------------------------------------- /openpciinfo_HexDumpPCI/smakefile: -------------------------------------------------------------------------------- 1 | all: 2 | sc lib=lib:debug.lib nostackcheck data=far code=far nosmallcode nosmalldata OpenPciInfo.c link to OpenPciInfo 3 | -------------------------------------------------------------------------------- /openpciinfo_TstObtainRelease/OpenPciInfo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/openpciinfo_TstObtainRelease/OpenPciInfo -------------------------------------------------------------------------------- /openpciinfo_TstObtainRelease/OpenPciInfo.c: -------------------------------------------------------------------------------- 1 | /* 2 | OpenPciInfo v1.5 TST Obtain/Release coded by Titan Email : bvernoux@wanadoo.fr 3 | 22/05/2005 4 | - Obtain/Release test code. 5 | 12/03/2005 6 | - New Pci card header (This header created on Sun Mar 6 09:38:14 PST 2005) 7 | - New tests 8 | - Cleaned warning 9 | 26/07/2002 10 | - Correct an Error in what's enable in the card for the FAST_BACK_TO_BACK 11 | 12/07/2002 12 | - Add Makefile for GCC MOS and modified some things for GCC MOS 13 | 21/02/2002 14 | - Modified ClassCode with 0x%06lx 15 | 17/02/2002 16 | Modified 10/04/2002 17 | - Added lot of information for developer on each card on the Bus 18 | 26/03/2002 19 | - use new flags for pci_allocdma_mem 20 | 10/04/2002 21 | - Support GrexA1200Bus, GrexA4000Bus and PegasosBus flags 22 | 12/04/2002 23 | - Modify strncpy to stccpy for speed-up Thanks to Zapek 24 | */ 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | 38 | #include 39 | #include 40 | 41 | #include "PCIBusInfo.h" 42 | 43 | #ifdef LATTICE 44 | //int CXBRK(void) { return(0); } /* Disable Lattice CTRL/C handling */ 45 | //int chkabort(void) { return(0); } /* really */ 46 | #endif 47 | 48 | struct Library *ExpansionBase = NULL; 49 | struct Library *OpenPciBase = NULL; 50 | 51 | void TestObtainRelease(struct pci_dev *dev) 52 | { 53 | BOOL result; 54 | printf("\nTestObtainRelease\n"); 55 | 56 | /* 57 | Test1 58 | */ 59 | result=pci_obtain_card(dev); 60 | printf("pci_obtain_card(0x%08lx)==%ld\n",dev,result); 61 | if(result==TRUE) 62 | { 63 | pci_release_card(dev); 64 | printf("pci_release_card(0x%08lx)\n",dev); 65 | }else 66 | printf("Error to obtain card\n"); 67 | 68 | /* 69 | Test2 70 | */ 71 | result=pci_obtain_card(dev); 72 | printf("pci_obtain_card(0x%08lx)==%ld\n",dev,result); 73 | if(result==TRUE) 74 | { 75 | pci_release_card(dev); 76 | printf("pci_release_card(0x%08lx)\n",dev); 77 | }else 78 | printf("Error to obtain card\n"); 79 | } 80 | 81 | int main(int argc, char **argv) 82 | { 83 | 84 | unsigned char bus=0; 85 | int j; 86 | 87 | unsigned char slotnum; 88 | unsigned char funcnum; 89 | // IRQ 90 | unsigned short irq; 91 | 92 | unsigned short vendorid,deviceid; 93 | 94 | unsigned long config; 95 | unsigned long memstart; 96 | unsigned long memend; 97 | unsigned long memflags; 98 | unsigned char mem; 99 | 100 | char VendorShort[100]; 101 | char VendorFull[100]; 102 | char DevName[100]; 103 | char DevNameDesc[100]; 104 | 105 | unsigned long dmamem,dmamem1; 106 | 107 | struct pci_dev *dev=NULL; 108 | 109 | // Version Number 110 | printf("%s\n\n",&ver[6]); 111 | 112 | 113 | if(( OpenPciBase=(struct Library *)OpenLibrary("openpci.library",MIN_OPENPCI_VERSION))==NULL) 114 | { 115 | printf("Error to open openpci.library v%ld or more\n",(long)MIN_OPENPCI_VERSION); 116 | return 10; 117 | } 118 | 119 | printf("openpci.library v%ld.%ld opened\n",(long)OpenPciBase->lib_Version,(long)OpenPciBase->lib_Revision); 120 | 121 | bus=pci_bus(); 122 | if(bus>0) 123 | { 124 | switch(bus) 125 | { 126 | case MediatorA1200Bus: 127 | printf("Bus Mediator A1200 detected\n"); 128 | break; 129 | case MediatorZ4Bus: 130 | printf("Bus Mediator Z4 detected\n"); 131 | break; 132 | case PrometheusBus: 133 | printf("Bus Prometheus detected\n"); 134 | break; 135 | case GrexA1200Bus: 136 | printf("Bus Grex A1200 detected\n"); 137 | break; 138 | case GrexA4000Bus: 139 | printf("Bus Grex A4000 detected\n"); 140 | break; 141 | case PegasosBus: 142 | printf("Bus Pegasos detected\n"); 143 | break; 144 | case PowerPciBus: 145 | printf("Amithlon PCI Bus detected\n"); 146 | break; 147 | default: 148 | printf("PCI Bus not detected\n"); 149 | } 150 | } 151 | 152 | if(bus) 153 | { 154 | while( (dev=pci_find_device(0xffff,0xffff,dev))!=NULL ) 155 | { 156 | printf("\n----------------------------------\n"); 157 | printf("Internal Configuration Space infos\n"); 158 | 159 | vendorid=pci_read_config_word(PCI_VENDOR_ID,dev); 160 | deviceid=pci_read_config_word(PCI_DEVICE_ID,dev); 161 | printf("VendorID : $%x \nDeviceID : $%x\n",vendorid,deviceid); 162 | 163 | config=pci_read_config_long(PCI_CLASS_REVISION,dev); 164 | printf("ClassRevision : $%08lx \n",config); 165 | 166 | config=(long)pci_read_config_byte(PCI_REVISION_ID,dev); 167 | printf("PCI_REVISION_ID $%02lx\n",config); 168 | 169 | config=(long)pci_read_config_byte(PCI_HEADER_TYPE,dev); 170 | printf("Header Type : $%02lx (0=Normal/1=Bridge/2=Cardbus)\n",config); 171 | if (config==0) 172 | { 173 | config=(long)pci_read_config_word(PCI_SUBSYSTEM_ID,dev); 174 | printf("PCI_SUBSYSTEM_ID $%04lx\n",config); 175 | } 176 | 177 | config=(long)pci_read_config_word(PCI_COMMAND,dev); 178 | printf("Command : $%04lx \n",config); 179 | 180 | if(config&PCI_COMMAND_IO) 181 | printf("I/O space PCI_COMMAND_IO\n"); 182 | 183 | if(config&PCI_COMMAND_MEMORY) 184 | printf("Memory space PCI_COMMAND_MEMORY\n"); 185 | 186 | if(config&PCI_COMMAND_MASTER) 187 | printf("Bus mastering PCI_COMMAND_MASTER\n"); 188 | 189 | if(config&PCI_COMMAND_SPECIAL) 190 | printf("Special cycles PCI_COMMAND_SPECIAL\n"); 191 | 192 | if(config&PCI_COMMAND_INVALIDATE) 193 | printf("Use memory write and invalidate PCI_COMMAND_INVALIDATE\n"); 194 | 195 | if(config&PCI_COMMAND_VGA_PALETTE) 196 | printf("Palette snooping PCI_COMMAND_VGA_PALETTE\n"); 197 | 198 | if(config&PCI_COMMAND_PARITY) 199 | printf("Parity checking PCI_COMMAND_PARITY\n"); 200 | 201 | if(config&PCI_COMMAND_WAIT) 202 | printf("Address/data stepping PCI_COMMAND_WAIT\n"); 203 | 204 | if(config&PCI_COMMAND_SERR) 205 | printf("SERR PCI_COMMAND_SERR\n"); 206 | 207 | if(config&PCI_COMMAND_FAST_BACK) 208 | printf("Fast-back to back writes PCI_COMMAND_FAST_BACK\n"); 209 | 210 | /* 211 | if(pci_set_master(dev)) 212 | { 213 | 214 | printf("Bus MASTER Enable\n"); 215 | }else 216 | { 217 | printf("I can't Enable Bus MASTER on this card\n"); 218 | } 219 | */ 220 | config=(long)pci_read_config_byte(PCI_LATENCY_TIMER,dev); 221 | printf("PCI_LATENCY_TIMER : $%02lx\n",config); 222 | config=pci_read_config_long(0x34,dev); 223 | config=config&0x000000FF; 224 | printf("CAP Ptr : $%08lx\n",config); 225 | if(config>0) 226 | { 227 | config=pci_read_config_long( (unsigned char)config,dev); 228 | printf("CAP Ptr1 Val : $%08lx\n",config); 229 | } 230 | printf("----------------------------------\n"); 231 | /* End of internal Configuration Space infos */ 232 | 233 | TestObtainRelease(dev); 234 | 235 | // Get The Pci Slot Number (5 device max on a PCI BUS (4 on Mediator1200)) 236 | slotnum=PCI_SLOT(dev->devfn); 237 | 238 | // Get The Pci Function Number (8 function max on each PCI device) 239 | funcnum=PCI_FUNC(dev->devfn); 240 | 241 | printf("Pci Device Slot Num : %d, Func Num : %d \n",slotnum,funcnum); 242 | 243 | // Vendor ID 244 | vendorid=dev->vendor; 245 | // Device ID 246 | deviceid=dev->device; 247 | VendorName(vendorid,VendorShort,VendorFull); 248 | DeviceName(vendorid,deviceid,DevName,DevNameDesc); 249 | 250 | printf("Vendor : %s \nDevice : %s %s\nVendorID : $%x \nDeviceID : $%x\n",VendorFull,DevName,DevNameDesc,vendorid,deviceid); 251 | printf("ClassCode: 0x%06lx\n",(long)dev->devclass); 252 | 253 | // IRQ 254 | irq=dev->irq; 255 | printf("IRQNumber: %d\n",irq); 256 | 257 | /* 258 | For BaseAddress0 to BaseAddress5 259 | */ 260 | mem=0; 261 | for(j=0;j<=5;j++) 262 | { 263 | 264 | memstart=dev->base_address[j]; 265 | memflags=dev->base_size[j]; 266 | 267 | if(memstart) 268 | { 269 | if(memflags&1) //IOAddress Bit0 at 1 270 | { 271 | // IOAddr 272 | memend=memstart+~(dev->base_size[j]&PCI_BASE_ADDRESS_IO_MASK); 273 | 274 | // Diplay in bytes or kbytes 275 | if(memend-memstart+1<=1024) 276 | { 277 | printf("IOAddr%d : $%08lx - $%08lx %ld bytes\n", 278 | j, 279 | memstart, 280 | memend, 281 | (unsigned long)(memend-memstart+1) ); 282 | 283 | }else 284 | { 285 | printf("IOAddr%d : $%08lx - $%08lx %ld kbytes\n", 286 | j, 287 | memstart, 288 | memend, 289 | (unsigned long)(memend-memstart+1)>>10 ); 290 | } 291 | }else 292 | { 293 | // Mem Address 294 | memend=memstart+~(dev->base_size[j]&PCI_BASE_ADDRESS_MEM_MASK); 295 | 296 | // Diplay in bytes or kbytes 297 | if(memend-memstart+1<=1024) 298 | { 299 | printf("MemAddr%d : $%08lx - $%08lx %ld bytes\n", 300 | j, 301 | memstart, 302 | memend, 303 | (unsigned long)(memend-memstart+1) ); 304 | }else 305 | { 306 | printf("MemAddr%d : $%08lx - $%08lx %ld kbytes\n", 307 | j, 308 | memstart, 309 | memend, 310 | (unsigned long)(memend-memstart+1)>>10 ); 311 | } 312 | 313 | } 314 | 315 | 316 | } 317 | 318 | } 319 | if(dev->rom_address && dev->rom_size) 320 | printf( 321 | "RomAddr : $%08lx - $%08lx\nRomSize\t : %ld bytes %ld kbytes\n", 322 | dev->rom_address, 323 | dev->rom_address+~(dev->rom_size&PCI_ROM_ADDRESS_MASK), 324 | (unsigned long)(~(dev->rom_size&PCI_ROM_ADDRESS_MASK)+1), 325 | (~(dev->rom_size&PCI_ROM_ADDRESS_MASK)+1)/1024 326 | ); 327 | 328 | if(dev->master) 329 | printf("Bus Master Capable\n"); 330 | else 331 | { 332 | printf("No Bus Master Capable\n"); 333 | } 334 | 335 | // Support 66Mhz 336 | 337 | // Read PCI_STATUS 338 | config=pci_read_config_word(PCI_STATUS,dev); 339 | 340 | printf("Card PCI_STATUS\n"); 341 | //printf("Config PCI_STATUS 0x%x\n",config); 342 | 343 | if(config&PCI_STATUS_66MHZ) 344 | printf("Support 66 Mhz PCI 2.1 bus\n"); 345 | else 346 | { 347 | printf("Doesn't support 66 Mhz PCI 2.1 bus\n"); 348 | } 349 | 350 | if(config&PCI_STATUS_FAST_BACK) 351 | printf("Accept fast-back to back\n"); 352 | else 353 | { 354 | printf("Doesn't accept fast-back to back\n"); 355 | } 356 | 357 | // Read PCI_COMMAND 358 | config=pci_read_config_word(PCI_COMMAND,dev); 359 | printf("What's Enabled in the Card ?\n"); 360 | 361 | if(config&PCI_COMMAND_IO) 362 | printf("I/O space PCI_COMMAND_IO\n"); 363 | 364 | if(config&PCI_COMMAND_MEMORY) 365 | printf("Memory space PCI_COMMAND_MEMORY\n"); 366 | 367 | if(config&PCI_COMMAND_MASTER) 368 | printf("Bus mastering PCI_COMMAND_MASTER\n"); 369 | 370 | if(config&PCI_COMMAND_SPECIAL) 371 | printf("Special cycles PCI_COMMAND_SPECIAL\n"); 372 | 373 | if(config&PCI_COMMAND_INVALIDATE) 374 | printf("Use memory write and invalidate PCI_COMMAND_INVALIDATE\n"); 375 | 376 | if(config&PCI_COMMAND_VGA_PALETTE) 377 | printf("Palette snooping PCI_COMMAND_VGA_PALETTE\n"); 378 | 379 | if(config&PCI_COMMAND_PARITY) 380 | printf("Parity checking PCI_COMMAND_PARITY\n"); 381 | 382 | if(config&PCI_COMMAND_WAIT) 383 | printf("Address/data stepping PCI_COMMAND_WAIT\n"); 384 | 385 | if(config&PCI_COMMAND_SERR) 386 | printf("SERR PCI_COMMAND_SERR\n"); 387 | 388 | if(config&PCI_COMMAND_FAST_BACK) 389 | printf("Fast-back to back writes PCI_COMMAND_FAST_BACK\n"); 390 | 391 | //printf("\n"); 392 | } 393 | 394 | #if 1 395 | // Test Lib Functions 396 | // Find first Pci card 397 | dev=pci_find_device(0xffff,0xffff,0); 398 | if(dev) 399 | { 400 | 401 | /* DMA Mem Alloc/Free tests */ 402 | 403 | // Alloc DMA Mem 404 | dmamem=(unsigned long)pci_allocdma_mem(2048,MEM_PCI); 405 | if(dmamem) 406 | printf("2048bytes MEM_PCI DMA Mem Allocated : %lx\n",dmamem); 407 | 408 | // Alloc DMA Mem 409 | dmamem1=(unsigned long)pci_allocdma_mem(16384,MEM_PCI); 410 | if(dmamem1) 411 | printf("16384bytes MEM_PCI DMA Mem Allocated : %lx\n",dmamem1); 412 | 413 | // Free DMA Mem 414 | if(dmamem) 415 | { 416 | printf("Free Mem 2048\n"); 417 | pci_freedma_mem( (APTR)dmamem,2048); 418 | } 419 | 420 | // Alloc DMA Mem 421 | dmamem=(unsigned long)pci_allocdma_mem(2040,MEM_NONCACHEABLE); 422 | if(dmamem) 423 | printf("2040bytes MEM_NONCACHEABLE DMA Mem Allocated : %lx\n",dmamem); 424 | 425 | // Free DMA Mem 426 | if(dmamem) 427 | { 428 | printf("Free Mem 2040\n"); 429 | pci_freedma_mem( (APTR)dmamem,2040); 430 | } 431 | 432 | // Alloc DMA Mem 433 | dmamem=(unsigned long)pci_allocdma_mem(4096,MEM_NONCACHEABLE); 434 | if(dmamem) 435 | printf("4096bytes MEM_NONCACHEABLE DMA Mem Allocated : %lx\n",dmamem); 436 | 437 | // Free DMA Mem 438 | if(dmamem) 439 | { 440 | printf("Free Mem 4096\n"); 441 | pci_freedma_mem( (APTR)dmamem,4096); 442 | } 443 | 444 | // Free DMA Mem 445 | if(dmamem1) 446 | { 447 | printf("Free Mem 16384\n"); 448 | pci_freedma_mem( (APTR)dmamem1,16384); 449 | } 450 | 451 | 452 | // Maximum DMA Mem is 262144 bytes 453 | // Alloc DMA Mem 454 | dmamem=(unsigned long)pci_allocdma_mem(300000,MEM_NONCACHEABLE); 455 | if(dmamem) 456 | printf("300000 bytes MEM_NONCACHEABLE DMA Mem Allocated : %lx\n",dmamem); 457 | 458 | // Free DMA Mem 459 | if(dmamem) 460 | { 461 | printf("Free Mem 300000\n"); 462 | pci_freedma_mem( (APTR)dmamem,300000); 463 | } 464 | 465 | } 466 | #endif 467 | 468 | } 469 | CloseLibrary( (struct Library*)OpenPciBase ); 470 | return 0; 471 | } 472 | 473 | 474 | /* 475 | For know the VendorName Short and Full description 476 | return -1 if success or 0 if it's not founded 477 | */ 478 | 479 | int VendorName(unsigned short VendID,char *VendorShort,char *VendorFull) 480 | { 481 | int i; 482 | for(i=0;inil: $@ +e 66 | @#ppc-morphos-objdump --syms $@ | grep *UND* 67 | 68 | #cnet.device: cnet.o 69 | # $(CC) $< $(LFLAGS) -o $@ 70 | # 71 | #cnet.o: cnet.c $(HEADERS) 72 | # $(CC) $(CFLAGS) -c $< -o $@ 73 | # 74 | #cnet.device.elf: cnet_mos.o 75 | # $(CC_MOS) $< $(LFLAGS_MOS) -o $@ 76 | # 77 | #cnet_mos.o: cnet.c $(HEADERS) 78 | # $(CC_MOS) $(CFLAGS_MOS) -c $< -o $@ 79 | -------------------------------------------------------------------------------- /openpciinfo_TstObtainRelease/pcibusinfo.h: -------------------------------------------------------------------------------- 1 | #ifndef PCIBusH 2 | #define PCIBusH 3 | 4 | // VendorName, DeviceName ...etc 5 | #include "pcihdr.h" 6 | 7 | char ver[]="$VER: OpenPciInfo v1.5 TSTObtainRelease 22.05.2005 by Titan"; 8 | 9 | int VendorName(unsigned short VendID,char *VendorShort,char *VendorFull); 10 | int DeviceName(unsigned short VendID,unsigned short DevID,char *DevName,char *DevNameDesc); 11 | 12 | #endif /* PCIBusH*/ 13 | 14 | -------------------------------------------------------------------------------- /openpciinfo_TstObtainRelease/pcibusinfo.h.info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/openpciinfo_TstObtainRelease/pcibusinfo.h.info -------------------------------------------------------------------------------- /openpciinfo_TstObtainRelease/pcihdr.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/openpciinfo_TstObtainRelease/pcihdr.h -------------------------------------------------------------------------------- /openpciinfo_TstObtainRelease/smakefile: -------------------------------------------------------------------------------- 1 | all: 2 | sc lib=lib:debug.lib nostackcheck data=far code=far nosmallcode nosmalldata OpenPciInfo.c link to OpenPciInfo 3 | -------------------------------------------------------------------------------- /pci_allocfree_dma_mem.c: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: pci_allocfree_dma_mem.c,v 1.1.1.1 2002/05/09 13:35:57 titan Exp $ 3 | */ 4 | 5 | #include "openpcidata.h" 6 | 7 | /* Alloc and Free DMA memory for PCI card */ 8 | APTR (*pci_allocdma_mem)(unsigned long size, unsigned long flags); 9 | 10 | void (*pci_freedma_mem)(APTR buffer,unsigned long size); 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /pci_find.c: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: pci_find.c,v 1.2 2003/05/01 16:06:44 titan Exp $ 3 | */ 4 | 5 | #include "openpcidata.h" 6 | 7 | struct pci_dev *pci_find_device( unsigned short vendor, unsigned short device, struct pci_dev *pcidev) 8 | { 9 | //DEBUG(dprintf("OpenPciBase->root = 0x%08lx\n",OpenPciBase->root)); 10 | //DEBUG(dprintf("OpenPciBase = 0x%08lx\n",OpenPciBase)); 11 | 12 | DEBUG(dprintf("pci_find_device(vendor,device,pcidev) parameters : vendor=0x%04lx device=0x%04lx pcidev=0x%08lx\n",vendor,device,pcidev)); 13 | 14 | /* If pcidev=0 then we start at root else we start at next device */ 15 | if(pcidev==NULL) 16 | { 17 | OpenPciBase->pcidev=OpenPciBase->root; 18 | }else 19 | OpenPciBase->pcidev=OpenPciBase->pcidev->next; 20 | 21 | /* If the vendor and the device is at 0xffff we give the first founded device */ 22 | if(vendor==0xffff && device==0xffff) 23 | return(OpenPciBase->pcidev); 24 | 25 | while(OpenPciBase->pcidev) 26 | { 27 | DEBUG(dprintf("While pci_find_device : vendor=0x%04lx device=0x%04lx pcidev=0x%08lx\n",OpenPciBase->pcidev->vendor,OpenPciBase->pcidev->device,OpenPciBase->pcidev)); 28 | 29 | if(OpenPciBase->pcidev->vendor==vendor && OpenPciBase->pcidev->device==device) 30 | { 31 | return(OpenPciBase->pcidev); 32 | } 33 | OpenPciBase->pcidev=OpenPciBase->pcidev->next; 34 | } 35 | 36 | /* No Pci card found */ 37 | return NULL; 38 | 39 | } 40 | 41 | struct pci_dev *pci_find_class( unsigned long class, struct pci_dev *pcidev) 42 | { 43 | 44 | DEBUG(dprintf("pci_find_class(class,pcidev) parameters : class=0x%08lx pcidev=0x%08lx\n",class,pcidev)); 45 | 46 | /* If pcidev=0 then we start at root else we start at next device */ 47 | if(pcidev==NULL) 48 | { 49 | OpenPciBase->pcidev=OpenPciBase->root; 50 | }else 51 | OpenPciBase->pcidev=OpenPciBase->pcidev->next; 52 | 53 | 54 | while(OpenPciBase->pcidev) 55 | { 56 | DEBUG(dprintf("While pci_find_class : devclass=0x%04lx pcidev=0x%08lx\n",OpenPciBase->pcidev->devclass,OpenPciBase->pcidev)); 57 | 58 | if(OpenPciBase->pcidev->devclass==class) 59 | { 60 | return(OpenPciBase->pcidev); 61 | } 62 | OpenPciBase->pcidev=OpenPciBase->pcidev->next; 63 | } 64 | 65 | /* No Pci card found */ 66 | return NULL; 67 | 68 | } 69 | 70 | struct pci_dev *pci_find_slot( unsigned char bus, unsigned long devfn) 71 | { 72 | /* We start at the root device */ 73 | OpenPciBase->pcidev=OpenPciBase->root; 74 | 75 | while(OpenPciBase->pcidev) 76 | { 77 | if(OpenPciBase->pcidev->devfn==devfn) 78 | { 79 | return(OpenPciBase->pcidev); 80 | } 81 | OpenPciBase->pcidev=OpenPciBase->pcidev->next; 82 | } 83 | 84 | /* No Pci card found */ 85 | return NULL; 86 | } 87 | 88 | -------------------------------------------------------------------------------- /pci_in_out.c: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: pci_in_out.c,v 1.1.1.1 2002/05/09 13:35:56 titan Exp $ 3 | */ 4 | 5 | #include "openpcidata.h" 6 | 7 | /* IN/OUT Function for PCI Bus */ 8 | /* Byte (8bits) Read/Write */ 9 | unsigned char (*pci_inb)(unsigned long address); 10 | void (*pci_outb)(unsigned char value, unsigned long address); 11 | 12 | /* Word (16bits) Read/Write */ 13 | unsigned short (*pci_inw)(unsigned long address); 14 | void (*pci_outw)(unsigned short value, unsigned long address); 15 | 16 | /* Long (32bits) Read/Write */ 17 | unsigned long (*pci_inl)(unsigned long address); 18 | void (*pci_outl)(unsigned long value, unsigned long address); 19 | 20 | /* Amiga Mem and Pci Mem Read/Write (must be a multiple of 16bytes) (it's a very fast mem bloc copy) */ 21 | void (*pci_to_hostcpy)(void *pcimemsource, void *memdest, unsigned long packetsize); 22 | void (*host_to_pcicpy)(void *memsrc, void *pcimemdest, unsigned long packetsize); 23 | void (*pci_to_pcicpy)(void *pcimemsrc, void *pcimemdest, unsigned long packetsize); 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /pci_interrupt.c: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: pci_interrupt.c,v 1.1.1.1 2002/05/09 13:35:56 titan Exp $ 3 | */ 4 | 5 | #include "openpcidata.h" 6 | 7 | /* 8 | Add interrupt server 9 | */ 10 | BOOL (*pci_add_intserver)(struct Interrupt *PciInterrupt, struct pci_dev *pcidev); 11 | 12 | void (*pci_set_int)(struct pci_dev *pcidev); 13 | 14 | void (*pci_clear_int)(struct pci_dev *pcidev); 15 | 16 | void (*pci_rem_intserver)(struct Interrupt *PciInterrupt, struct pci_dev *pcidev); 17 | 18 | -------------------------------------------------------------------------------- /pci_logictophysic_addr.c: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: pci_logictophysic_addr.c,v 1.1.1.1 2002/05/09 13:36:00 titan Exp $ 3 | */ 4 | 5 | #include "openpcidata.h" 6 | 7 | /* Logic<->Physic Addr conversion */ 8 | APTR (*pci_logic_to_physic_addr)(APTR PciLogicalAddr, struct pci_dev *pcidev); 9 | APTR (*pci_physic_to_logic_addr)(APTR PciPhysicalAddr, struct pci_dev *pcidev); 10 | 11 | -------------------------------------------------------------------------------- /pci_obtainrelease_card.c: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: pci_obtainrelease_card.c,v 1.1.1.1 2002/05/09 13:36:00 titan Exp $ 3 | */ 4 | 5 | #include "openpcidata.h" 6 | 7 | /* Obtain/Release PCI card */ 8 | BOOL (*pci_obtain_card)(struct pci_dev *pcidev); 9 | void (*pci_release_card)(struct pci_dev *pcidev); 10 | 11 | -------------------------------------------------------------------------------- /pci_readwrite_config.c: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: pci_readwrite_config.c,v 1.1.1.1 2002/05/09 13:35:56 titan Exp $ 3 | */ 4 | 5 | #include "openpcidata.h" 6 | 7 | /* Read Config */ 8 | unsigned char (*pci_read_config_byte)(unsigned char registernum, struct pci_dev *dev); 9 | 10 | unsigned short (*pci_read_config_word)(unsigned char registernum, struct pci_dev *dev); 11 | 12 | unsigned long (*pci_read_config_long)(unsigned char registernum, struct pci_dev *dev); 13 | 14 | /* Write Config */ 15 | void (*pci_write_config_byte)(unsigned char registernum, unsigned char val, struct pci_dev *dev); 16 | 17 | void (*pci_write_config_word)(unsigned char registernum, unsigned short val, struct pci_dev *dev); 18 | 19 | void (*pci_write_config_long)(unsigned char registernum, unsigned long val, struct pci_dev *dev); 20 | 21 | -------------------------------------------------------------------------------- /pci_set_master.c: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: pci_set_master.c,v 1.1.1.1 2002/05/09 13:35:56 titan Exp $ 3 | */ 4 | 5 | #include "openpcidata.h" 6 | 7 | BOOL (*pci_set_master)(struct pci_dev *dev); 8 | -------------------------------------------------------------------------------- /pcibus.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/pcibus.c -------------------------------------------------------------------------------- /pcibus.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef PciBusH 3 | #define PciBusH 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | 17 | #include 18 | #include 19 | #include 20 | 21 | #include "internlibraries/openpci.h" 22 | 23 | #include "compiler.h" 24 | 25 | #ifndef ULONG 26 | #define ULONG unsigned long 27 | #endif 28 | 29 | #ifdef __GNUC__ 30 | extern struct Library *ExpansionBase; 31 | #endif 32 | 33 | extern unsigned short pci_bus(void); 34 | extern unsigned short FindPCIBus(void); 35 | extern BOOL ASM OpenPCIBus(REG(d0,int pcibus)); 36 | extern void FreePciDevStruct(void); 37 | 38 | #endif /* PCIBusH*/ 39 | -------------------------------------------------------------------------------- /ppcinline/lowlevel.h: -------------------------------------------------------------------------------- 1 | /* Automatically generated header! Do not edit! */ 2 | 3 | #ifndef _PPCINLINE_LOWLEVEL_H 4 | #define _PPCINLINE_LOWLEVEL_H 5 | 6 | #ifndef __PPCINLINE_MACROS_H 7 | #include 8 | #endif /* !__PPCINLINE_MACROS_H */ 9 | 10 | #ifndef LOWLEVEL_BASE_NAME 11 | #define LOWLEVEL_BASE_NAME LowLevelBase 12 | #endif /* !LOWLEVEL_BASE_NAME */ 13 | 14 | #define AddKBInt(intRoutine, intData) \ 15 | LP2(0x3c, APTR, AddKBInt, APTR, intRoutine, a0, APTR, intData, a1, \ 16 | , LOWLEVEL_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0) 17 | 18 | #define AddTimerInt(intRoutine, intData) \ 19 | LP2(0x4e, APTR, AddTimerInt, APTR, intRoutine, a0, APTR, intData, a1, \ 20 | , LOWLEVEL_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0) 21 | 22 | #define AddVBlankInt(intRoutine, intData) \ 23 | LP2(0x6c, APTR, AddVBlankInt, APTR, intRoutine, a0, APTR, intData, a1, \ 24 | , LOWLEVEL_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0) 25 | 26 | #define ElapsedTime(context) \ 27 | LP1(0x66, ULONG, ElapsedTime, struct EClockVal *, context, a0, \ 28 | , LOWLEVEL_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0) 29 | 30 | #define GetKey() \ 31 | LP0(0x30, ULONG, GetKey, \ 32 | , LOWLEVEL_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0) 33 | 34 | #define GetLanguageSelection() \ 35 | LP0(0x24, UBYTE, GetLanguageSelection, \ 36 | , LOWLEVEL_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0) 37 | 38 | #define QueryKeys(queryArray, arraySize) \ 39 | LP2NR(0x36, QueryKeys, struct KeyQuery *, queryArray, a0, unsigned long, arraySize, d1, \ 40 | , LOWLEVEL_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0) 41 | 42 | #define ReadJoyPort(port) \ 43 | LP1(0x1e, ULONG, ReadJoyPort, unsigned long, port, d0, \ 44 | , LOWLEVEL_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0) 45 | 46 | #define RemKBInt(intHandle) \ 47 | LP1NR(0x42, RemKBInt, APTR, intHandle, a1, \ 48 | , LOWLEVEL_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0) 49 | 50 | #define RemTimerInt(intHandle) \ 51 | LP1NR(0x54, RemTimerInt, APTR, intHandle, a1, \ 52 | , LOWLEVEL_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0) 53 | 54 | #define RemVBlankInt(intHandle) \ 55 | LP1NR(0x72, RemVBlankInt, APTR, intHandle, a1, \ 56 | , LOWLEVEL_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0) 57 | 58 | #define SetJoyPortAttrsA(portNumber, tagList) \ 59 | LP2(0x84, BOOL, SetJoyPortAttrsA, unsigned long, portNumber, d0, struct TagItem *, tagList, a1, \ 60 | , LOWLEVEL_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0) 61 | 62 | #ifndef NO_PPCINLINE_STDARG 63 | #define SetJoyPortAttrs(a0, ...) \ 64 | ({ULONG _tags[] = { __VA_ARGS__ }; SetJoyPortAttrsA((a0), (struct TagItem *)_tags);}) 65 | #endif /* !NO_PPCINLINE_STDARG */ 66 | 67 | #define StartTimerInt(intHandle, timeInterval, continuous) \ 68 | LP3NR(0x60, StartTimerInt, APTR, intHandle, a1, unsigned long, timeInterval, d0, long, continuous, d1, \ 69 | , LOWLEVEL_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0) 70 | 71 | #define StopTimerInt(intHandle) \ 72 | LP1NR(0x5a, StopTimerInt, APTR, intHandle, a1, \ 73 | , LOWLEVEL_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0) 74 | 75 | #define SystemControlA(tagList) \ 76 | LP1(0x48, ULONG, SystemControlA, struct TagItem *, tagList, a1, \ 77 | , LOWLEVEL_BASE_NAME, IF_CACHEFLUSHALL, NULL, 0, IF_CACHEFLUSHALL, NULL, 0) 78 | 79 | #ifndef NO_PPCINLINE_STDARG 80 | #define SystemControl(...) \ 81 | ({ULONG _tags[] = { __VA_ARGS__ }; SystemControlA((struct TagItem *)_tags);}) 82 | #endif /* !NO_PPCINLINE_STDARG */ 83 | 84 | #endif /* !_PPCINLINE_LOWLEVEL_H */ 85 | -------------------------------------------------------------------------------- /pragmas/openpci_pragmas.h: -------------------------------------------------------------------------------- 1 | /* Return the bus type found*/ 2 | #pragma libcall OpenPciBase pci_bus 1e 0 3 | /* IN/OUT Function for PCI Bus*/ 4 | /* Byte (8bits) Read/Write*/ 5 | #pragma libcall OpenPciBase pci_inb 24 801 6 | #pragma libcall OpenPciBase pci_outb 2a 8002 7 | /* Word (16bits) Read/Write*/ 8 | #pragma libcall OpenPciBase pci_inw 30 801 9 | #pragma libcall OpenPciBase pci_outw 36 8002 10 | /* Long (32bits) Read/Write*/ 11 | #pragma libcall OpenPciBase pci_inl 3c 801 12 | #pragma libcall OpenPciBase pci_outl 42 8002 13 | /* Amiga Mem and Pci Mem Read/Write (must be a multiple of 8bytes)*/ 14 | #pragma libcall OpenPciBase pci_to_hostcpy 48 09803 15 | #pragma libcall OpenPciBase host_to_pcicpy 4e 09803 16 | #pragma libcall OpenPciBase pci_to_pcicpy 54 09803 17 | /* Pci Find Functions*/ 18 | #pragma libcall OpenPciBase pci_find_device 5a 81003 19 | #pragma libcall OpenPciBase pci_find_class 60 8002 20 | #pragma libcall OpenPciBase pci_find_slot 66 1002 21 | /* Pci Bus Read/Write Config functions*/ 22 | #pragma libcall OpenPciBase pci_read_config_byte 6c 8002 23 | #pragma libcall OpenPciBase pci_read_config_word 72 8002 24 | #pragma libcall OpenPciBase pci_read_config_long 78 8002 25 | #pragma libcall OpenPciBase pci_write_config_byte 7e 81003 26 | #pragma libcall OpenPciBase pci_write_config_word 84 81003 27 | #pragma libcall OpenPciBase pci_write_config_long 8a 81003 28 | /* Pci Set Bus Master*/ 29 | #pragma libcall OpenPciBase pci_set_master 90 801 30 | /* Interrupt functions*/ 31 | #pragma libcall OpenPciBase pci_add_intserver 96 9802 32 | #pragma libcall OpenPciBase pci_rem_intserver 9c 9802 33 | /* Pci Alloc/Free DMA memory*/ 34 | #pragma libcall OpenPciBase pci_allocdma_mem a2 1002 35 | #pragma libcall OpenPciBase pci_freedma_mem a8 0802 36 | /* Logic<->Physic Addr conversion*/ 37 | #pragma libcall OpenPciBase pci_logic_to_physic_addr ae 9802 38 | #pragma libcall OpenPciBase pci_physic_to_logic_addr b4 9802 39 | /* Obtain/Release PCI card*/ 40 | #pragma libcall OpenPciBase pci_obtain_card ba 801 41 | #pragma libcall OpenPciBase pci_release_card c0 801 42 | -------------------------------------------------------------------------------- /proto/openpci.h: -------------------------------------------------------------------------------- 1 | /* Automatically generated header! Do not edit! */ 2 | 3 | #ifndef PROTO_OPENPCI_H 4 | #define PROTO_OPENPCI_H 5 | 6 | #include 7 | #include "pragmas/openpci_pragmas.h" 8 | 9 | #ifndef __NOLIBBASE__ 10 | extern struct Library * 11 | #ifdef __CONSTLIBBASEDECL__ 12 | __CONSTLIBBASEDECL__ 13 | #endif /* __CONSTLIBBASEDECL__ */ 14 | OpenPciBase; 15 | #endif /* !__NOLIBBASE__ */ 16 | 17 | #endif /* PROTO_OPENPCI_H */ 18 | -------------------------------------------------------------------------------- /proto/openpci.h.info: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeperk/OpenPCI/2fb43b98a2241ea7bc4c4716b3210052c3eb876a/proto/openpci.h.info -------------------------------------------------------------------------------- /smakefile: -------------------------------------------------------------------------------- 1 | all: openpci.library 2 | 3 | openpci.library: openpci.o\ 4 | pci_find.o pci_readwrite_config.o pci_interrupt.o pci_set_master.o\ 5 | pci_allocfree_dma_mem.o pci_in_out.o pci_logictophysic_addr.o\ 6 | pci_obtainrelease_card.o openpcifunctable.o pcibus.o debug.o GrexOpenPci/memory.o\ 7 | PrometheusOpenPci/PrometheusWrapper.o\ 8 | PrometheusOpenPci/Ppci_readwrite_config.o PrometheusOpenPci/Ppci_set_master.o PrometheusOpenPci/Ppci_allocfree_dma.o\ 9 | PrometheusOpenPci/Ppci_interrupt.o PrometheusOpenPci/Ppci_in_out.o PrometheusOpenPci/Ppci_logictophysic_addr.o PrometheusOpenPci/Ppci_obtainrelease_card.o\ 10 | 11 | SLINK WITH FULLsmakefile.wth 12 | #Copy openpci.library libs:openpci.library 13 | #avail flush 14 | 15 | openpci.o: openpci.c openpci.library_VERSION.h 16 | # $(CC) $*.c DisAssemble ram:openpci.asm 17 | $(CC) $*.c 18 | 19 | openpcifunctable.o: openpcifunctable.c openpcidata.h openpcifunctable.h 20 | $(CC) $*.c 21 | 22 | pcibus.o: pcibus.c openpcidata.h 23 | $(CC) $*.c 24 | 25 | pci_find.o: pci_find.c openpcidata.h 26 | # $(CC) $*.c DisAssemble ram:pcifind.asm 27 | $(CC) $*.c 28 | 29 | pci_in_out.o: pci_in_out.c openpcidata.h 30 | $(CC) $*.c 31 | 32 | pci_interrupt.o: pci_interrupt.c openpcidata.h 33 | $(CC) $*.c 34 | 35 | pci_set_master.o: pci_set_master.c openpcidata.h 36 | $(CC) $*.c 37 | 38 | pci_readwrite_config.o: pci_readwrite_config.c openpcidata.h 39 | $(CC) $*.c 40 | 41 | pci_allocfree_dma_mem.o: pci_allocfree_dma_mem.c openpcidata.h 42 | $(CC) $*.c 43 | 44 | pci_logictophysic_addr.o: pci_logictophysic_addr.c openpcidata.h 45 | $(CC) $*.c 46 | 47 | pci_obtainrelease_card.o: pci_obtainrelease_card.c openpcidata.h 48 | $(CC) $*.c 49 | 50 | debug.o: debug.c debug.h 51 | $(CC) $*.c 52 | 53 | memory.o: memory.c memory.h 54 | $(CC) $*.c 55 | 56 | #InOut.o: InOut.a 57 | # $(CC) $*.a 58 | 59 | #InOut.o: InOut.c 60 | # $(CC) $*.c DisAssemble ram:InOut.asm 61 | 62 | # PROMETHEUS WRAPPER 63 | PrometheusWrapper.o: PrometheusOpenPci/PrometheusWrapper.c openpcidata.h openpci_protosWrapper.h PrometheusOpenPci/PrometheusWrapper.h 64 | $(CC) $*.c debug=full 65 | 66 | Ppci_readwrite_config.o: PrometheusOpenPci/Ppci_readwrite_config.c openpcidata.h 67 | $(CC) $*.c 68 | 69 | Ppci_set_master.o: PrometheusOpenPci/Ppci_set_master.c openpcidata.h 70 | $(CC) $*.c 71 | 72 | Ppci_allocfree_dma.o: PrometheusOpenPci/Ppci_allocfree_dma.c openpcidata.h 73 | $(CC) $*.c 74 | 75 | Ppci_interrupt.o: PrometheusOpenPci/Ppci_interrupt.c openpcidata.h 76 | $(CC) $*.c 77 | 78 | Ppci_in_out.o: PrometheusOpenPci/Ppci_in_out.c openpcidata.h InOut.h 79 | $(CC) $*.c 80 | 81 | Ppci_logictophysic_addr.o: PrometheusOpenPci/Ppci_logictophysic_addr.c openpcidata.h 82 | $(CC) $*.c 83 | 84 | Ppci_obtainrelease_card.o: PrometheusOpenPci/Ppci_obtainrelease_card.c openpcidata.h 85 | $(CC) $*.c 86 | -------------------------------------------------------------------------------- /smakefile.wth: -------------------------------------------------------------------------------- 1 | FROM openpci.o 2 | pci_find.o pci_readwrite_config.o pci_interrupt.o pci_set_master.o 3 | pci_allocfree_dma_mem.o pci_logictophysic_addr.o pci_obtainrelease_card.o pci_in_out.o 4 | openpcifunctable.o pcibus.o debug.o 5 | GrexOpenPci/GrexWrapper.o 6 | GrexOpenPci/Gpci_readwrite_config.o GrexOpenPci/Gpci_set_master.o 7 | GrexOpenPci/Gpci_allocfree_dma.o GrexOpenPci/Gpci_interrupt.o 8 | GrexOpenPci/Gpci_in_out.o GrexOpenPci/Gpci_logictophysic_addr.o GrexOpenPci/Gpci_obtainrelease_card.o GrexOpenPci/memory.o 9 | PrometheusOpenPci/PrometheusWrapper.o 10 | PrometheusOpenPci/Ppci_readwrite_config.o PrometheusOpenPci/Ppci_set_master.o 11 | PrometheusOpenPci/Ppci_allocfree_dma.o PrometheusOpenPci/Ppci_interrupt.o 12 | PrometheusOpenPci/Ppci_in_out.o PrometheusOpenPci/Ppci_logictophysic_addr.o PrometheusOpenPci/Ppci_obtainrelease_card.o 13 | PowerPciOpenPci/PowerPciWrapper.o 14 | PowerPciOpenPci/Apci_readwrite_config.o PowerPciOpenPci/Apci_set_master.o PowerPciOpenPci/Apci_allocfree_dma.o 15 | PowerPciOpenPci/Apci_interrupt.o PowerPciOpenPci/Apci_in_out.o PowerPciOpenPci/Apci_logicphysic_addr.o PowerPciOpenPci/Apci_obtainrelease_card.o 16 | 17 | LIB lib:sc.lib lib:amiga.lib lib:debug.lib 18 | NODEBUG 19 | NOICONS 20 | TO openpci.library 21 | --------------------------------------------------------------------------------