From ea6c242bffbda5298b4def632a98b00bb6ac775d Mon Sep 17 00:00:00 2001 From: Joshua Wise Date: Thu, 25 Sep 2008 21:52:52 -0400 Subject: [PATCH 1/1] Convert the poker to not bother to wait. --- tools/poke-rls-asm.S | 8 +------- tools/poke-rls.c | 5 +++-- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/tools/poke-rls-asm.S b/tools/poke-rls-asm.S index ee44854..980b4bf 100644 --- a/tools/poke-rls-asm.S +++ b/tools/poke-rls-asm.S @@ -4,17 +4,11 @@ poke: mov $0x1BADD00D, %ecx # Parameter: I/O port to set bit 2 of - mov 4(%esp), %dx + mov 4(%esp), %edx inl %dx, %eax or $4, %eax outl %eax, %dx - # Count down for a while - mov $0x10000, %edx -loop: - dec %edx - jz loop - # Maybe SMM poked something? mov %ecx, %eax ret diff --git a/tools/poke-rls.c b/tools/poke-rls.c index c6db7bc..01de181 100644 --- a/tools/poke-rls.c +++ b/tools/poke-rls.c @@ -2,6 +2,7 @@ #include #include #include +#include static uint16_t _get_PMBASE() { @@ -14,7 +15,7 @@ static uint16_t _get_PMBASE() } -extern unsigned int poke(short addr); +extern unsigned int poke(unsigned long addr); int main(int argc, char **argv) { @@ -25,7 +26,7 @@ int main(int argc, char **argv) perror("iopl"); return 1; } - + res = poke(_get_PMBASE() + 0x04); printf("found %p\n", res); } -- 2.43.0