at_keyboard.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * GRUB -- GRand Unified Bootloader
  3. * Copyright (C) 2007,2008,2009 Free Software Foundation, Inc.
  4. *
  5. * GRUB is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * GRUB is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #ifndef GRUB_AT_KEYBOARD_HEADER
  19. #define GRUB_AT_KEYBOARD_HEADER 1
  20. /* Used for sending commands to the controller. */
  21. #define KEYBOARD_COMMAND_ISREADY(x) !((x) & 0x02)
  22. #define KEYBOARD_COMMAND_READ 0x20
  23. #define KEYBOARD_COMMAND_WRITE 0x60
  24. #define KEYBOARD_COMMAND_ENABLE 0xf4
  25. #define KEYBOARD_COMMAND_REBOOT 0xfe
  26. #define KEYBOARD_AT_TRANSLATE 0x40
  27. #define KEYBOARD_AT_DISABLE 0x10
  28. #define KEYBOARD_ISMAKE(x) !((x) & 0x80)
  29. #define KEYBOARD_ISREADY(x) ((x) & 0x01)
  30. #define KEYBOARD_SCANCODE(x) ((x) & 0x7f)
  31. extern void grub_at_keyboard_init (void);
  32. extern void grub_at_keyboard_fini (void);
  33. int grub_at_keyboard_is_alive (void);
  34. #endif