Skip to content

Instantly share code, notes, and snippets.

@richinseattle
Forked from abenbachir/do_hypercall.c
Created September 30, 2021 08:50
Show Gist options
  • Save richinseattle/c06d04e3e77cb4be2301a815427af058 to your computer and use it in GitHub Desktop.
Save richinseattle/c06d04e3e77cb4be2301a815427af058 to your computer and use it in GitHub Desktop.
Emitting hypercall in c
#define do_hypercall(nr, p1, p2, p3, p4) \
__asm__ __volatile__(".byte 0x0F,0x01,0xC1\n"::"a"(nr), \
"b"(p1), \
"c"(p2), \
"d"(p3), \
"S"(p4))
void main()
{
do_hypercall(100, 0, 0, 0, 0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment