[SeaBIOS] [PATCH 03/12] Update invoke_mouse_handler() to use need_hop_back()

Kevin O'Connor kevin at koconnor.net
Tue Sep 30 20:38:37 CEST 2014


Make the mouse handler stack_hop_back() code similar to the other
users that use need_stack_hop().

Signed-off-by: Kevin O'Connor <kevin at koconnor.net>
---
 src/mouse.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/mouse.c b/src/mouse.c
index 100255d..466f55a 100644
--- a/src/mouse.c
+++ b/src/mouse.c
@@ -275,8 +275,13 @@ handle_15c2(struct bregs *regs)
 }
 
 static void
-invoke_mouse_handler(u16 ebda_seg)
+invoke_mouse_handler(void)
 {
+    if (need_hop_back()) {
+        stack_hop_back(0, 0, invoke_mouse_handler);
+        return;
+    }
+    u16 ebda_seg = get_ebda_seg();
     u16 status = GET_EBDA(ebda_seg, mouse_data[0]);
     u16 X      = GET_EBDA(ebda_seg, mouse_data[1]);
     u16 Y      = GET_EBDA(ebda_seg, mouse_data[2]);
@@ -330,5 +335,5 @@ process_mouse(u8 data)
     }
 
     SET_EBDA(ebda_seg, mouse_flag1, 0);
-    stack_hop_back(ebda_seg, 0, invoke_mouse_handler);
+    invoke_mouse_handler();
 }
-- 
1.9.3




More information about the SeaBIOS mailing list