diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2009-01-01 21:00:59 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2009-01-01 21:00:59 -0500 |
commit | a83ff550b4cbf0b1bc35f493c8715a69a9e28b7e (patch) | |
tree | 3b434ad53bc40b2960bcd0d7abe05e2596f23372 /src/mouse.c | |
parent | 7f343097712ebdd1f11953c867e208da899b4ba3 (diff) | |
download | seabios-a83ff550b4cbf0b1bc35f493c8715a69a9e28b7e.tar.gz |
Reduce stack usage of hw irq handlers.
Avoid using call16_int() -- it consumes too much stack space.
Instead, use a new function (call16_simpint). This assumes that
the handler wont corrupt regs - which should be a safe assumption,
because if they did corrupt regs they wouldn't work on any bios.
Avoid enabling irqs in the hw irq handlers - there are no loops in the
handlers that could cause any notable latency.
Diffstat (limited to 'src/mouse.c')
-rw-r--r-- | src/mouse.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mouse.c b/src/mouse.c index 6c74fc1e..65baa20d 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -319,6 +319,8 @@ int74_function() SET_EBDA2(ebda_seg, mouse_flag1, 0); u32 func = GET_EBDA2(ebda_seg, far_call_pointer); + + irq_enable(); asm volatile( "pushl %0\n" "pushw %w1\n" // status @@ -328,10 +330,11 @@ int74_function() "lcallw *8(%%esp)\n" "addl $12, %%esp\n" "cld\n" - : "+a" (func), "+b" (status), "+c" (X), "+d" (Y) : - : "esi", "edi", "ebp", "cc" + : "r"(func), "r"(status), "r"(X), "r"(Y) + : "cc" ); + irq_disable(); } // INT74h : PS/2 mouse hardware interrupt @@ -342,9 +345,7 @@ handle_74() if (! CONFIG_PS2_MOUSE) goto done; - irq_enable(); int74_function(); - irq_disable(); done: eoi_pic2(); |