process.hpp 662 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #pragma once
  2. #include <kernel/interrupt.h>
  3. #include <kernel/task.h>
  4. #include <types/types.h>
  5. #ifdef __cplusplus
  6. #include <kernel/mm.hpp>
  7. #include <types/list.hpp>
  8. struct process;
  9. struct thread;
  10. struct process_attr {
  11. uint16_t system : 1;
  12. };
  13. struct thread {
  14. void* eip;
  15. process* owner;
  16. regs_32 regs;
  17. uint32_t eflags;
  18. uint32_t esp;
  19. };
  20. struct process {
  21. mm_list mms;
  22. types::list<thread> thds;
  23. void* kernel_esp;
  24. process_attr attr;
  25. };
  26. // in process.cpp
  27. extern process* current_process;
  28. extern "C" void NORETURN init_scheduler();
  29. void context_switch(irq0_data* intrpt_data);
  30. #else
  31. void NORETURN init_scheduler();
  32. #endif