port_io.h 734 B

123456789101112131415161718192021222324252627282930313233343536
  1. #pragma once
  2. #include <types/types.h>
  3. typedef uint16_t port_id_t;
  4. #define PORT_PIC1 (0x20)
  5. #define PORT_PIC2 (0xa0)
  6. #define PORT_PIC1_COMMAND (PORT_PIC1)
  7. #define PORT_PIC1_DATA ((PORT_PIC1) + 1)
  8. #define PORT_PIC2_COMMAND (PORT_PIC2)
  9. #define PORT_PIC2_DATA ((PORT_PIC2) + 1)
  10. #define PORT_KEYBOARD_COMMAND (0x64)
  11. #define PORT_KEYBOARD_DATA (0x60)
  12. #define PORT_PIT_CONTROL (0x43)
  13. #define PORT_PIT_COUNT (0x40)
  14. #define PORT_KEYDATA 0x0060u
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. extern void asm_outb(port_id_t port_number, uint8_t data);
  19. extern uint8_t asm_inb(port_id_t port_number);
  20. extern void asm_hlt(void);
  21. extern void asm_cli(void);
  22. extern void asm_sti(void);
  23. extern void asm_enable_sse(void);
  24. #ifdef __cplusplus
  25. }
  26. #endif