xtr.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #pragma once
  2. #include "software-modes.h"
  3. #include "task-list-32-tasks.h"
  4. // Task routine type
  5. typedef void (* RoutineTaskType) (USER_MODE) ;
  6. // kernel_createTask
  7. void kernel_createTask (INIT_MODE_
  8. uint64_t * inStackBufferAddress,
  9. uint32_t inStackBufferSize,
  10. RoutineTaskType inTaskRoutine) ;
  11. struct TaskControlBlock ;
  12. void kernel_makeTaskReady (IRQ_MODE_ TaskControlBlock * inTaskPtr);
  13. TaskControlBlock * descriptorPointerForTaskIndex (const uint8_t inTaskIndex) ;
  14. uint8_t indexForDescriptorTask (const TaskControlBlock * inTaskPtr) ; // should be not nullptr
  15. // Task termination
  16. void taskSelfTerminates(USER_MODE) asm ("task.self.terminates");
  17. void service_taskSelfTerminates(KERNEL_MODE) asm ("service.task.self.terminates");
  18. //$service task.self.terminates
  19. // Task suspension
  20. void kernel_blockOnDeadline (KERNEL_MODE_ const uint32_t inDeadline);
  21. // Task reactivation
  22. void irq_makeTasksReadyFromCurrentDate (IRQ_MODE);
  23. // Synchronization
  24. void kernel_blockRunningTaskInList (KERNEL_MODE_ TaskList & ioWaitingList);
  25. bool irq_makeTaskReadyFromList (IRQ_MODE_ TaskList & ioWaitingList);