X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Modules%2FInput%2FPS2KbMouse%2Fmain.c;h=c5ad4e8bd6be9e9504efbb2de9fa530b9474ff74;hb=a2495c6ea4f4cab16b5d339ae511428e92e89e73;hp=353befb53b790265cdb487c3f1fbb098896c87c7;hpb=3764c294f21229bdf700f436fa4884f5e76e0d3a;p=tpg%2Facess2.git diff --git a/Modules/Input/PS2KbMouse/main.c b/Modules/Input/PS2KbMouse/main.c index 353befb5..c5ad4e8b 100644 --- a/Modules/Input/PS2KbMouse/main.c +++ b/Modules/Input/PS2KbMouse/main.c @@ -5,22 +5,44 @@ */ #include #include +#include "common.h" // === IMPORTS === -extern int KB_Install(char **Arguments); -extern int Mouse_Install(char **Arguments); +// TODO: Allow runtime/compile-time switching +// Maybe PCI will have it? +// Integrator-CP +#if 0 +#define KEYBOARD_IRQ 3 +#define KEYBOARD_BASE 0x18000000 +#define MOUSE_IRQ 4 +#define MOUSE_BASE 0x19000000 +#endif +// Realview +#if 1 +#define KEYBOARD_IRQ 20 +#define KEYBOARD_BASE 0x10006000 +#define MOUSE_IRQ 21 +#define MOUSE_BASE 0x10007000 +#endif // === PROTOTYPES === int PS2_Install(char **Arguments); // === GLOBALS === -MODULE_DEFINE(0, 0x0100, Input_PS2KbMouse, PS2_Install, NULL, NULL); -MODULE_DEFINE(0, 0x0100, PS2Keyboard, KB_Install, NULL, NULL); +MODULE_DEFINE(0, 0x0100, Input_PS2KbMouse, PS2_Install, NULL, NULL); // Shuts the makefile up +MODULE_DEFINE(0, 0x0100, PS2Keyboard, KB_Install, NULL, "Input_PS2KbMouse", NULL); +MODULE_DEFINE(0, 0x0100, PS2Mouse, PS2Mouse_Install, NULL, "Input_PS2KbMouse", NULL); // === CODE === int PS2_Install(char **Arguments) { -// KB_Install(Arguments); -// Mouse_Install(Arguments); + #if ARCHDIR_is_x86 || ARCHDIR_is_x86_64 + KBC8042_Init(); + gpMouse_EnableFcn = KBC8042_EnableMouse; + #elif ARCHDIR_is_armv7 + PL050_Init(KEYBOARD_BASE, KEYBOARD_IRQ, MOUSE_BASE, MOUSE_IRQ); + gpMouse_EnableFcn = PL050_EnableMouse; + #endif + return MODULE_ERR_OK; }