process.hpp 585 B

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