Usermode/libc - Implementing POSIX/BSD sockets
[tpg/acess2.git] / Usermode / Applications / pcidump_src / main.c
index 0bdff40..2bae2c9 100644 (file)
@@ -14,7 +14,7 @@
 // === CONSTANTS ===\r
 const struct {\r
         int    ID;\r
-       char *Name;\r
+       char    *Name;\r
 } csaVENDORS[] = {\r
        {0x10EC, "Realtek"},\r
        {0x1106, "VIA Technologies, Inc."},\r
@@ -39,7 +39,7 @@ int main(int argc, char *argv[], char *envp[])
        \r
        printf("PCI Bus Dump\n");\r
        // --- Open PCI Directory\r
-       dp = open("/Devices/pci", /*OPEN_FLAG_READ|*/OPENFLAG_EXEC);\r
+       dp = open("/Devices/pci", OPENFLAG_READ|OPENFLAG_EXEC);\r
        if(dp == -1)\r
        {\r
                fprintf(stderr, "Non-Standard configuration or not running on Acess.\n");\r
@@ -63,25 +63,25 @@ int main(int argc, char *argv[], char *envp[])
                fp = open(tmpPath, OPENFLAG_READ);\r
                if(fp == -1)    continue;\r
                \r
-               read(fp, 2, &vendor);   read(fp, 2, &device);\r
+               read(fp, &vendor, 2);   read(fp, &device, 2);\r
                printf(" Vendor 0x%04x, Device 0x%04x\n", vendor, device);\r
                printf(" %s - %s\n", GetVendorName(vendor), GetDeviceName(vendor, device));\r
                \r
                // Reuse vendor and device\r
                seek(fp, 0x8, SEEK_SET);\r
-               read(fp, 2, &vendor);   read(fp, 2, &device);\r
+               read(fp, &vendor, 2);   read(fp, &device, 2);\r
                printf(" Revision 0x%04x, Class 0x%04x ()\n", vendor, device);\r
                \r
                // Read File\r
                #if DUMP_BARS\r
                seek(fp, 0x10, SEEK_SET);\r
                printf("Base Address Registers (BARs):\n");\r
-               read(fp, 4, &tmp32);    printf(" 0x%08x", tmp32);\r
-               read(fp, 4, &tmp32);    printf(" 0x%08x", tmp32);\r
-               read(fp, 4, &tmp32);    printf(" 0x%08x", tmp32);\r
-               read(fp, 4, &tmp32);    printf(" 0x%08x", tmp32);\r
-               read(fp, 4, &tmp32);    printf(" 0x%08x", tmp32);\r
-               read(fp, 4, &tmp32);    printf(" 0x%08x", tmp32);\r
+               read(fp, &tmp32, 4);    printf(" 0x%08x", tmp32);\r
+               read(fp, &tmp32, 4);    printf(" 0x%08x", tmp32);\r
+               read(fp, &tmp32, 4);    printf(" 0x%08x", tmp32);\r
+               read(fp, &tmp32, 4);    printf(" 0x%08x", tmp32);\r
+               read(fp, &tmp32, 4);    printf(" 0x%08x", tmp32);\r
+               read(fp, &tmp32, 4);    printf(" 0x%08x", tmp32);\r
                printf("\n");\r
                #endif\r
                printf("\n");\r

UCC git Repository :: git.ucc.asn.au