models.h 709 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifndef CX_ZIVUOS_MODELS_H_INCLUDED
  2. #define CX_ZIVUOS_MODELS_H_INCLUDED
  3. #include <stdint.h>
  4. #include <stdbool.h>
  5. typedef uint16_t zv_pid_t;
  6. typedef uint8_t zv_priority_t;
  7. typedef enum zv_state_e {
  8. ZV_EMPTY,
  9. ZV_WORKING,
  10. ZV_READY,
  11. ZV_INTERRUPTED,
  12. ZV_INTERRUPT_WAITING,
  13. ZV_WAITING
  14. } zv_state_t;
  15. typedef union zv_universal_u {
  16. uintptr_t unumber;
  17. intptr_t number;
  18. void *pointer;
  19. char *string;
  20. } zv_universal_t;
  21. struct zv_kernel_s;
  22. struct zv_process_s;
  23. typedef zv_state_t (*zv_worker_t) (
  24. struct zv_kernel_s *,
  25. struct zv_process_s *
  26. );
  27. #define ZV_LOWEST_PRIORITY UINT8_MAX
  28. #define ZV_ERROR_PID UINT16_MAX
  29. #define ZV_NULL_PARAM ((zv_universal_t) NULL)
  30. #endif