edf.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. enum {
  2. Maxsteps = 20 * 2 * 100, /* 100 periods of 20 procs */
  3. /* Edf.flags field */
  4. Admitted = 0x01,
  5. Sporadic = 0x02,
  6. Yieldonblock = 0x04,
  7. Sendnotes = 0x08,
  8. Deadline = 0x10,
  9. Yield = 0x20,
  10. Extratime = 0x40,
  11. Infinity = ~0ULL,
  12. };
  13. typedef struct Edf Edf;
  14. struct Edf {
  15. /* time intervals */
  16. vlong D; /* Deadline */
  17. vlong Delta; /* Inherited deadline */
  18. vlong T; /* period */
  19. vlong C; /* Cost */
  20. vlong S; /* Slice: time remaining in this period */
  21. /* times */
  22. vlong r; /* (this) release time */
  23. vlong d; /* (this) deadline */
  24. vlong t; /* Start of next period, t += T at release */
  25. vlong s; /* Time at which this proc was last scheduled */
  26. /* for schedulability testing */
  27. vlong testDelta;
  28. int testtype; /* Release or Deadline */
  29. vlong testtime;
  30. Proc *testnext;
  31. /* other */
  32. ushort flags;
  33. Timer;
  34. /* Stats */
  35. vlong edfused;
  36. vlong extraused;
  37. vlong aged;
  38. ulong periods;
  39. ulong missed;
  40. };
  41. extern Lock edftestlock; /* for atomic admitting/expelling */
  42. #pragma varargck type "t" vlong
  43. #pragma varargck type "U" uvlong
  44. /* Interface: */
  45. void edflock(void);
  46. void edfunlock(void);