gate.h 828 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2021-07-16 JasonHu first version
  9. */
  10. #ifndef __X86_GATE_H__
  11. #define __X86_GATE_H__
  12. #include <rtconfig.h>
  13. #define IDT_LIMIT 0x000007ff
  14. #define IDT_PADDR 0x003F0800
  15. #define IDT_VADDR (KERNEL_VADDR_START + IDT_PADDR)
  16. #define MAX_IDT_NR (IDT_LIMIT/8)
  17. #define IDT_OFF2PTR(idt, off) (idt + off)
  18. /* DA: Descriptor Attribute */
  19. #define DA_TASK_GATE 0x85
  20. #define DA_386_CALL_GATE 0x8C
  21. #define DA_386_INTR_GATE 0x8E
  22. #define DA_386_TRAP_GATE 0x8F
  23. #define DA_GATE_DPL0 0
  24. #define DA_GATE_DPL1 1
  25. #define DA_GATE_DPL2 2
  26. #define DA_GATE_DPL3 3
  27. #ifndef __ASSEMBLY__
  28. void rt_hw_gate_init(void);
  29. #endif
  30. #endif /* __X86_GATE_H__ */