summaryrefslogtreecommitdiff
path: root/util/superiotool/superiotool.c
diff options
context:
space:
mode:
Diffstat (limited to 'util/superiotool/superiotool.c')
-rw-r--r--util/superiotool/superiotool.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/util/superiotool/superiotool.c b/util/superiotool/superiotool.c
index de512486e6..2ff56fb5c0 100644
--- a/util/superiotool/superiotool.c
+++ b/util/superiotool/superiotool.c
@@ -37,6 +37,11 @@ void regwrite(uint16_t port, uint8_t reg, uint8_t val)
outb(val, port + 1);
}
+int superio_unknown(const struct superio_registers reg_table[], uint16_t id)
+{
+ return !strncmp(get_superio_name(reg_table, id), "<unknown>", 9);
+}
+
const char *get_superio_name(const struct superio_registers reg_table[],
uint16_t id)
{
@@ -61,6 +66,9 @@ void dump_superio(const char *vendor, const struct superio_registers reg_table[]
int i, j, k, nodump;
int *idx;
+ if (!dump)
+ return;
+
for (i = 0; /* Nothing */; i++) {
if (reg_table[i].superio_id == EOT)
break;
@@ -107,6 +115,8 @@ void dump_superio(const char *vendor, const struct superio_registers reg_table[]
printf("NA ");
else if (idx[k] == RSVD)
printf("RR ");
+ else if (idx[k] == MISC) /* TODO */
+ printf("MM ");
else
printf("%02x ", idx[k]);
}
@@ -166,6 +176,7 @@ int main(int argc, char *argv[])
if (iopl(3) < 0) {
perror("iopl");
+ printf("Superiotool must be run as root.\n");
exit(1);
}