Lines Matching +full:0 +full:x80

23 static int nerrs = 0;
29 memset(&sa, 0, sizeof(sa)); in sethandler()
33 if (sigaction(sig, &sa, 0)) in sethandler()
41 memset(&sa, 0, sizeof(sa)); in clearhandler()
44 if (sigaction(sig, &sa, 0)) in clearhandler()
58 if (sigsetjmp(jmpbuf, 1) != 0) { in try_outb()
62 : : [port] "Nd" (port), "a" (0)); in try_outb()
71 printf("[FAIL]\toutb to 0x%02hx failed\n", port); in expect_ok()
75 printf("[OK]\toutb to 0x%02hx worked\n", port); in expect_ok()
81 printf("[FAIL]\toutb to 0x%02hx worked\n", port); in expect_gp()
85 printf("[OK]\toutb to 0x%02hx failed\n", port); in expect_gp()
92 CPU_SET(0, &cpuset); in main()
93 if (sched_setaffinity(0, sizeof(cpuset), &cpuset) != 0) in main()
94 err(1, "sched_setaffinity to CPU 0"); in main()
96 expect_gp(0x80); in main()
97 expect_gp(0xed); in main()
103 printf("[RUN]\tenable 0x80\n"); in main()
104 if (ioperm(0x80, 1, 1) != 0) { in main()
105 printf("[OK]\tioperm(0x80, 1, 1) failed (%d) -- try running as root\n", in main()
107 return 0; in main()
109 expect_ok(0x80); in main()
110 expect_gp(0xed); in main()
112 printf("[RUN]\tdisable 0x80\n"); in main()
113 if (ioperm(0x80, 1, 0) != 0) { in main()
114 printf("[FAIL]\tioperm(0x80, 1, 0) failed (%d)", errno); in main()
117 expect_gp(0x80); in main()
118 expect_gp(0xed); in main()
121 if (ioperm(0x80, 1, 1) != 0) { in main()
122 printf("[FAIL]\tioperm(0x80, 1, 0) failed (%d)", errno); in main()
130 if (child == 0) { in main()
132 expect_ok(0x80); in main()
133 expect_gp(0xed); in main()
134 printf("[RUN]\tchild: Extend permissions to 0x81\n"); in main()
135 if (ioperm(0x81, 1, 1) != 0) { in main()
136 printf("[FAIL]\tioperm(0x81, 1, 1) failed (%d)", errno); in main()
139 printf("[RUN]\tchild: Drop permissions to 0x80\n"); in main()
140 if (ioperm(0x80, 1, 0) != 0) { in main()
141 printf("[FAIL]\tioperm(0x80, 1, 0) failed (%d)", errno); in main()
144 expect_gp(0x80); in main()
145 return 0; in main()
148 if (waitpid(child, &status, 0) != child || in main()
152 } else if (WEXITSTATUS(status) != 0) { in main()
160 /* Verify that the child dropping 0x80 did not affect the parent */ in main()
162 expect_ok(0x80); in main()
166 if (setresuid(1, 1, 1) != 0) { in main()
168 return 0; in main()
171 printf("[RUN]\tdisable 0x80\n"); in main()
172 if (ioperm(0x80, 1, 0) != 0) { in main()
173 printf("[FAIL]\tioperm(0x80, 1, 0) failed (%d)", errno); in main()
178 printf("[RUN]\tenable 0x80 again\n"); in main()
179 if (ioperm(0x80, 1, 1) == 0) { in main()
184 return 0; in main()