diff options
author | Andreas Kling <kling@serenityos.org> | 2021-02-03 23:15:13 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-02-03 23:15:13 +0100 |
commit | d32ed28df4c2601dcded898cd66cfee120cffb74 (patch) | |
tree | 61e66c0c5c014ff75f8da2ca1c047dfb855b8da3 /Userland/Libraries/LibKeyboard | |
parent | a59b1825ce3ba5d6e6adf51ab2745c7212789c31 (diff) | |
download | serenity-d32ed28df4c2601dcded898cd66cfee120cffb74.zip |
LibC+LibKeyboard: Move getkeymap()+setkeymap() syscall wrappers to LibC
Diffstat (limited to 'Userland/Libraries/LibKeyboard')
-rw-r--r-- | Userland/Libraries/LibKeyboard/CharacterMap.cpp | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/Userland/Libraries/LibKeyboard/CharacterMap.cpp b/Userland/Libraries/LibKeyboard/CharacterMap.cpp index 059c6da20f..011a935ffc 100644 --- a/Userland/Libraries/LibKeyboard/CharacterMap.cpp +++ b/Userland/Libraries/LibKeyboard/CharacterMap.cpp @@ -29,6 +29,10 @@ #include <Kernel/API/Syscall.h> #include <LibKeyboard/CharacterMapFile.h> +#ifndef KERNEL +# include <serenity.h> +#endif + namespace Keyboard { #ifndef KERNEL @@ -54,8 +58,7 @@ CharacterMap::CharacterMap(const String& map_name, const CharacterMapData& map_d int CharacterMap::set_system_map() { - Syscall::SC_setkeymap_params params { m_character_map_data.map, m_character_map_data.shift_map, m_character_map_data.alt_map, m_character_map_data.altgr_map, m_character_map_data.shift_altgr_map, { m_character_map_name.characters(), m_character_map_name.length() } }; - return syscall(SC_setkeymap, ¶ms); + return setkeymap(m_character_map_name.characters(), m_character_map_data.map, m_character_map_data.shift_map, m_character_map_data.alt_map, m_character_map_data.altgr_map, m_character_map_data.shift_altgr_map); } Result<CharacterMap, OSError> CharacterMap::fetch_system_map() @@ -63,16 +66,8 @@ Result<CharacterMap, OSError> CharacterMap::fetch_system_map() CharacterMapData map_data; char keymap_name[50 + 1] = { 0 }; - Syscall::SC_getkeymap_params params { - map_data.map, map_data.shift_map, - map_data.alt_map, - map_data.altgr_map, - map_data.shift_altgr_map, - { keymap_name, sizeof(keymap_name) } - }; - int rc = syscall(SC_getkeymap, ¶ms); - if (rc < 0) { - return OSError(-rc); + if (getkeymap(keymap_name, sizeof(keymap_name), map_data.map, map_data.shift_map, map_data.alt_map, map_data.altgr_map, map_data.shift_altgr_map) < 0) { + return OSError(errno); } return CharacterMap { keymap_name, map_data }; |