tss.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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-08-06 JasonHu first version
  9. */
  10. #ifndef __X86_TSS_H__
  11. #define __X86_TSS_H__
  12. #include <rtdef.h>
  13. #include <rtconfig.h>
  14. #define KERNEL_STACK_TOP_PHY 0x9f000
  15. #define KERNEL_STACK_TOP (KERNEL_VADDR_START + KERNEL_STACK_TOP_PHY)
  16. struct rt_hw_tss
  17. {
  18. rt_uint32_t backlink;
  19. rt_uint32_t esp0;
  20. rt_uint32_t ss0;
  21. rt_uint32_t esp1;
  22. rt_uint32_t ss1;
  23. rt_uint32_t esp2;
  24. rt_uint32_t ss2;
  25. rt_uint32_t cr3;
  26. rt_uint32_t eip;
  27. rt_uint32_t eflags;
  28. rt_uint32_t eax;
  29. rt_uint32_t ecx;
  30. rt_uint32_t edx;
  31. rt_uint32_t ebx;
  32. rt_uint32_t esp;
  33. rt_uint32_t ebp;
  34. rt_uint32_t esi;
  35. rt_uint32_t edi;
  36. rt_uint32_t es;
  37. rt_uint32_t cs;
  38. rt_uint32_t ss;
  39. rt_uint32_t ds;
  40. rt_uint32_t fs;
  41. rt_uint32_t gs;
  42. rt_uint32_t ldtr;
  43. rt_uint32_t trap;
  44. rt_uint32_t iobase;
  45. };
  46. typedef struct rt_hw_tss rt_hw_tss_t;
  47. void rt_hw_tss_init();
  48. rt_hw_tss_t *rt_hw_tss_get();
  49. void rt_hw_tss_set_kstacktop(rt_ubase_t top);
  50. #endif /* __X86_TSS_H__ */