3 * - By John Hodge (thePowersGang)
10 #include <acess/sys.h>
12 #define PCI_BASE "/Devices/pci"
14 int main(int argc, char *argv[]);
15 void show_device(int PFD, const char *File, int bVerbose);
18 int main(int argc, char *argv[])
20 int fd = open(PCI_BASE, OPENFLAG_READ);
24 while( SysReadDir(fd, name) )
26 if(name[0] == '.') continue ;
28 show_device(fd, name, 0);
34 void show_device(int PFD, const char *File, int bVerbose)
46 fd = _SysOpenChild(PFD, File, OPENFLAG_READ);
48 printf("%s - ERR (open failure)\n", File);
51 rv = read(fd, &pciinfo, sizeof(pciinfo));
52 if( rv != sizeof(pciinfo) ) {
53 printf("%s - ERR (read %i < %i)\n", File, rv, sizeof(pciinfo));
57 uint32_t class_if = pciinfo.revclass >> 8;
58 uint8_t revision = pciinfo.revclass & 0xFF;
59 printf("%s - %04x:%04x %06x:%02x\n",
61 pciinfo.vendor, pciinfo.device,