Hi all,
the following structs are quite similar in purpose, but only one of them is debug-friendly:
enum device_path_type { DEVICE_PATH_NONE = 0, DEVICE_PATH_ROOT, DEVICE_PATH_PCI_DOMAIN, DEVICE_PATH_PCI_BUS, DEVICE_PATH_PCI, DEVICE_PATH_PNP, DEVICE_PATH_I2C, DEVICE_PATH_APIC, DEVICE_PATH_APIC_CLUSTER, DEVICE_PATH_CPU, DEVICE_PATH_CPU_BUS, DEVICE_PATH_IOPORT, }; #define TYPENAME(a,b,c,d) ((a<<24)|(b<<16)|(c<<8)|(d)) enum device_id_type { DEVICE_ID_NONE = 0, DEVICE_ID_ROOT = TYPENAME('R','O','O','T'), DEVICE_ID_PCI_DOMAIN = TYPENAME('P','C','I','D'), DEVICE_ID_PCI = TYPENAME(' ','P','C','I'), DEVICE_ID_PNP = TYPENAME(' ','P','N','P'), DEVICE_ID_I2C = TYPENAME(' ','I','2','C'), DEVICE_ID_APIC = TYPENAME('A','P','I','C'), DEVICE_ID_APIC_CLUSTER = TYPENAME('A','P','C','C'), DEVICE_ID_CPU = TYPENAME(' ','C','P','U'), DEVICE_ID_CPU_BUS = TYPENAME(' ','B','U','S'), };
The only difference in the listing is that device_id_type does not have DEVICE_ID_PCI_BUS and DEVICE_ID_IOPORT.
Comments?
Regards, Carl-Daniel