Semaphore.h 587 B

1234567891011121314151617181920
  1. # include "task-list-32-tasks.h"
  2. class Semaphore {
  3. protected: TaskList mWaitingTaskList ;
  4. protected: uint32_t mValue ;
  5. public: Semaphore (const uint32_t inInitialValue) ;
  6. //$service semaphore.V
  7. public: void V (USER_MODE) asm ("semaphore.V") ;
  8. public: void sys_V (IRQ_MODE) asm ("service.semaphore.V") ;
  9. //$service semaphore.P
  10. public: void P (USER_MODE) asm ("semaphore.P") ;
  11. public: void sys_P (KERNEL_MODE) asm ("service.semaphore.P") ;
  12. // Disable copy
  13. private: Semaphore (const Semaphore &) = delete ;
  14. private: Semaphore & operator = (const Semaphore &) = delete ;
  15. };