mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-09-15 07:27:42 -04:00
System calls for mouse position
This commit is contained in:
parent
7f7d415fa3
commit
f0d3982a59
@ -14,6 +14,7 @@
|
|||||||
#include "rtc.hpp"
|
#include "rtc.hpp"
|
||||||
#include "kernel_utils.hpp"
|
#include "kernel_utils.hpp"
|
||||||
#include "vesa.hpp"
|
#include "vesa.hpp"
|
||||||
|
#include "mouse.hpp"
|
||||||
#include "vfs/vfs.hpp"
|
#include "vfs/vfs.hpp"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
@ -257,6 +258,14 @@ void sc_vesa_redraw(interrupt::syscall_regs* regs){
|
|||||||
vesa::redraw(new_buffer);
|
vesa::redraw(new_buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void sc_mouse_x(interrupt::syscall_regs* regs){
|
||||||
|
regs->rax = mouse::x();
|
||||||
|
}
|
||||||
|
|
||||||
|
void sc_mouse_y(interrupt::syscall_regs* regs){
|
||||||
|
regs->rax = mouse::y();
|
||||||
|
}
|
||||||
|
|
||||||
} //End of anonymous namespace
|
} //End of anonymous namespace
|
||||||
|
|
||||||
void system_call_entry(interrupt::syscall_regs* regs){
|
void system_call_entry(interrupt::syscall_regs* regs){
|
||||||
@ -416,6 +425,14 @@ void system_call_entry(interrupt::syscall_regs* regs){
|
|||||||
sc_vesa_redraw(regs);
|
sc_vesa_redraw(regs);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 0x1100:
|
||||||
|
sc_mouse_x(regs);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 0x1101:
|
||||||
|
sc_mouse_y(regs);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
k_print_line("Invalid system call");
|
k_print_line("Invalid system call");
|
||||||
break;
|
break;
|
||||||
|
@ -24,6 +24,9 @@ uint64_t get_red_shift();
|
|||||||
uint64_t get_green_shift();
|
uint64_t get_green_shift();
|
||||||
uint64_t get_blue_shift();
|
uint64_t get_blue_shift();
|
||||||
|
|
||||||
|
uint64_t mouse_x();
|
||||||
|
uint64_t mouse_y();
|
||||||
|
|
||||||
void redraw(char* buffer);
|
void redraw(char* buffer);
|
||||||
|
|
||||||
} // end of namespace graphics
|
} // end of namespace graphics
|
||||||
|
@ -58,3 +58,11 @@ void graphics::redraw(char* buffer){
|
|||||||
: [buffer] "g" (buffer)
|
: [buffer] "g" (buffer)
|
||||||
: "rax", "rbx");
|
: "rax", "rbx");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint64_t graphics::mouse_x(){
|
||||||
|
return syscall_get(0x1100);
|
||||||
|
}
|
||||||
|
|
||||||
|
uint64_t graphics::mouse_y(){
|
||||||
|
return syscall_get(0x1101);
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user