[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tyndur-devel] [PATCH 1/3] libc: Interrupthandlern die Int-Nummer uebergeben



* libc: Interrupthandler kriegen jetzt die Interruptnummer als Parameter
        uebergeben.
* floppy, kbc, cdi/core: Notwendige Aenderungen damit das kompiliert
---
 src/modules/cdi/lib/misc.c      |    2 +-
 src/modules/floppy/floppy.c     |    4 ++--
 src/modules/include/rpc.h       |    2 +-
 src/modules/kbc/keyboard.c      |    4 ++--
 src/modules/kbc/mouse.c         |    2 +-
 src/modules/kbc/mouse.h         |    2 +-
 src/modules/lib/rpc/messaging.c |    6 +++---
 7 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/src/modules/cdi/lib/misc.c b/src/modules/cdi/lib/misc.c
index 6e102ea..4a22f78 100644
--- a/src/modules/cdi/lib/misc.c
+++ b/src/modules/cdi/lib/misc.c
@@ -23,7 +23,7 @@ static struct cdi_device* driver_irq_device = NULL;
 /**
  * Interner IRQ-Handler, der den IRQ-Handler des Treibers aufruft
  */
-static void irq_handler(void)
+static void irq_handler(byte irq)
 {
     driver_irq_handler(driver_irq_device);
 }
diff --git a/src/modules/floppy/floppy.c b/src/modules/floppy/floppy.c
index 188d787..b0de3b3 100644
--- a/src/modules/floppy/floppy.c
+++ b/src/modules/floppy/floppy.c
@@ -141,7 +141,7 @@ void    floppy_select_drive(byte drive);
 void    floppy_send_byte(byte cmd);
 byte    floppy_read_byte(void);
 void    floppy_set_motor(bool state);
-void    floppy_irq_handler(void);
+void    floppy_irq_handler(byte irq);
 bool    floppy_wait_irq(int num);
 void    floppy_int_sense(void);
 void    floppy_reset(void);
@@ -482,7 +482,7 @@ byte floppy_read_byte()
 /**
  * Wird aufgerufen wenn der IRQ6 auftritt
  */
-void floppy_irq_handler()
+void floppy_irq_handler(byte irq)
 {
     DEBUG_MSG("IRQ");
     p();
diff --git a/src/modules/include/rpc.h b/src/modules/include/rpc.h
index 2fc4542..bd2e2ac 100644
--- a/src/modules/include/rpc.h
+++ b/src/modules/include/rpc.h
@@ -57,7 +57,7 @@ extern handler_function_t rpc_response_handler;
 
 void init_messaging(void);
 bool register_message_handler(char* fnname, handler_function_t handler);
-void register_intr_handler(byte intr, void (*handler)(void));
+void register_intr_handler(byte intr, void (*handler)(byte));
 
 dword rpc_get_dword(pid_t pid, char* function_name, size_t data_length, char* data);
 int rpc_get_int(pid_t pid, char* function_name, size_t data_length, char* data);
diff --git a/src/modules/kbc/keyboard.c b/src/modules/kbc/keyboard.c
index 412119d..19acb07 100644
--- a/src/modules/kbc/keyboard.c
+++ b/src/modules/kbc/keyboard.c
@@ -65,7 +65,7 @@ static void rpc_register_callback(pid_t pid, dword cid, size_t data_size,
 /**
  * IRQ-Hander
  */
-static void kbd_irq_handler(void);
+static void kbd_irq_handler(byte irq);
 
 
 /**
@@ -120,7 +120,7 @@ void keyboard_init(void)
 /**
  * IRQ-Hander
  */
-void kbd_irq_handler() {
+void kbd_irq_handler(byte irq) {
     uint8_t scancode;
     uint8_t keycode = 0;
     bool break_code = FALSE;
diff --git a/src/modules/kbc/mouse.c b/src/modules/kbc/mouse.c
index 0b16dbe..9b25f65 100644
--- a/src/modules/kbc/mouse.c
+++ b/src/modules/kbc/mouse.c
@@ -146,7 +146,7 @@ void mouse_install()
     mouse_cycle = 0;
 }
 
-void mouse_irq_handler()
+void mouse_irq_handler(byte irq)
 {
     byte status = inb(0x64);
     if (!(status & 0x20)) {
diff --git a/src/modules/kbc/mouse.h b/src/modules/kbc/mouse.h
index 12b107d..c5cc11f 100644
--- a/src/modules/kbc/mouse.h
+++ b/src/modules/kbc/mouse.h
@@ -10,7 +10,7 @@ void mouse_write(byte a_write);
 byte mouse_read(void);
 void mouse_install(void);
 
-void mouse_irq_handler(void);
+void mouse_irq_handler(byte irq);
 
 size_t mouse_read_handler(lostio_filehandle_t* filehandle, void* buf,
     size_t blocksize, size_t blockcount);
diff --git a/src/modules/lib/rpc/messaging.c b/src/modules/lib/rpc/messaging.c
index 388866e..cee2ac1 100644
--- a/src/modules/lib/rpc/messaging.c
+++ b/src/modules/lib/rpc/messaging.c
@@ -44,7 +44,7 @@ typedef struct {
     handler_function_t handler;
 } msg_handler_t;
 
-void (*intr_handler[256])(void) = { NULL };
+void (*intr_handler[256])(byte) = { NULL };
 msg_handler_t message_handler[MAX_MESSAGE_HANDLERS];
 
 handler_function_t rpc_response_handler = NULL;
@@ -95,7 +95,7 @@ bool register_message_handler(char* fnname, handler_function_t handler)
     return TRUE;
 }
 
-void register_intr_handler(byte intr, void (*handler)(void))
+void register_intr_handler(byte intr, void (*handler)(byte))
 {
     intr_handler[intr] = handler;
     add_intr_handler(intr);
@@ -116,7 +116,7 @@ void librpc_c_rpc_handler(dword caller_pid, dword data_size, char* data)
     if (function < 256) {
         // Interrupt-Handler
         if ((intr_handler[function] != NULL) && (caller_pid == my_pid)) {
-            intr_handler[function]();
+            intr_handler[function](function);
         }
     } else if ((function >= RPC_SIGNALS_START) && (function <=
         RPC_SIGNALS_END))
-- 
1.6.0.6