Details
- Reviewers
emaste - Commits
- rS321298: acpidump: add ACPI NFIT (NVDIMM Firmware Interface Table)
Diff Detail
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
usr.sbin/acpi/acpidump/acpi.c | ||
---|---|---|
277–278 | We can address this one separately I think (a separate commit prior to the NFIT support). Also it should likely be if (subtable->Length < sizeof(ACPI_SUBTABLE_HEADER)) -- i.e., subtable length < 2 is invalid. And finally, we can probably just do (instead of errx) warn("invalid subtable length %d", subtable->Length); return; i.e., still print out other tables even if one is corrupt. | |
296 | Should acpi_walk_nfit get a length validation as well? | |
1174 | This one needs a different implementation -- I will discuss. |
usr.sbin/acpi/acpidump/acpi.c | ||
---|---|---|
1171 | Hmm, despite the rest of acpidump using %d, this should really be %u to correspond with the unsigned nfit->Type (and similarly for the rest of the printfs below) | |
1180 | These ones are actually UINT64 (or uint64_t) so they need to be cast to (uintmax_t) and printed with 0x%016jx (Address, Length, and MemoryMapping) I'd say the length should be in hex too. | |
1201–1202 | %016jx for these two (size, offset) | |
1226 | This one's not right: it's defined in the struct as LineOffset[1] but it's a placeholder for a variable sized array. Will discuss. | |
1230 | variable length array here too | |
1235–1236 | Vendor ID and Device ID in general are presented in hex -- probably 0x%04x | |
1238–1239 | also hex | |
1246–1250 | these are all 64-bit | |
1266–1269 | four 64-bit values | |
1275 | variable length |
usr.sbin/acpi/acpidump/acpi.c | ||
---|---|---|
297 | I realized after I shared the previous snippet with you that this should be warnx -- i.e., don't print a string corresponding to errno. Also by convention it's lower case i -- invalid subtable length | |
1201–1202 | RegionSize and RegionOffset are 64-bit so need %016jx | |
1275 | These ones still need to be fixed - I will explain. |
usr.sbin/acpi/acpidump/acpi.c | ||
---|---|---|
297 | oh, also should be %u here for unsigned argument | |
1177 | We should probably check the return value in status as well. An error is practically not going to occur, so exiting on error ought to be sufficient. Could just be if (status != uuid_s_ok) errx("uuid_to_string: status=%u", status) | |
1226 | Can leave this one out at first as well - we need to address all three of these variable length entries in a similar way. |
usr.sbin/acpi/acpidump/acpi.c | ||
---|---|---|
1149 | This one definitely makes more sense. Do you think I should change the style for other occurrences in this file? |
usr.sbin/acpi/acpidump/acpi.c | ||
---|---|---|
1149 | I think that's reasonable, but submit a separate diff for that change, and we'll commit it first. |