Skip to content

Commit

Permalink
selftests/nolibc: simplify call to ioperm
Browse files Browse the repository at this point in the history
Since commit 53fcfaf ("tools/nolibc/unistd: add syscall()") nolibc
has support for syscall(2).
Use it to get rid of some ifdef-ery.

Signed-off-by: Thomas Weißschuh <[email protected]>
Signed-off-by: Willy Tarreau <[email protected]>
  • Loading branch information
t-8ch authored and wtarreau committed Aug 6, 2023
1 parent ba859b2 commit b637c87
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions tools/testing/selftests/nolibc/nolibc-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -1050,11 +1050,7 @@ int main(int argc, char **argv, char **envp)
* exit with status code 2N+1 when N is written to 0x501. We
* hard-code the syscall here as it's arch-dependent.
*/
#if defined(_NOLIBC_SYS_H)
else if (my_syscall3(__NR_ioperm, 0x501, 1, 1) == 0)
#else
else if (ioperm(0x501, 1, 1) == 0)
#endif
else if (syscall(__NR_ioperm, 0x501, 1, 1) == 0)
__asm__ volatile ("outb %%al, %%dx" :: "d"(0x501), "a"(0));
/* if it does nothing, fall back to the regular panic */
#endif
Expand Down

0 comments on commit b637c87

Please sign in to comment.