staticvoid expect_ok(unsignedshort port)
{ if (!try_outb(port)) {
printf("[FAIL]\toutb to 0x%02hx failed\n", port); exit(1);
}
printf("[OK]\toutb to 0x%02hx worked\n", port);
}
staticvoid expect_gp(unsignedshort port)
{ if (try_outb(port)) {
printf("[FAIL]\toutb to 0x%02hx worked\n", port); exit(1);
}
printf("[OK]\toutb to 0x%02hx failed\n", port);
}
int main(void)
{
cpu_set_t cpuset;
CPU_ZERO(&cpuset);
CPU_SET(0, &cpuset); if (sched_setaffinity(0, sizeof(cpuset), &cpuset) != 0)
err(1, "sched_setaffinity to CPU 0");
expect_gp(0x80);
expect_gp(0xed);
/* * Probe for ioperm support. Note that clearing ioperm bits * works even as nonroot.
*/
printf("[RUN]\tenable 0x80\n"); if (ioperm(0x80, 1, 1) != 0) {
printf("[OK]\tioperm(0x80, 1, 1) failed (%d) -- try running as root\n",
errno); return 0;
}
expect_ok(0x80);
expect_gp(0xed);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.