From 74a4d8c26dd3c1e9febcb717cfd6cb6512991a7a Mon Sep 17 00:00:00 2001 From: "Charles.Forsyth" Date: Fri, 22 Dec 2006 21:39:35 +0000 Subject: 20060303 --- os/port/edf.h | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 os/port/edf.h (limited to 'os/port/edf.h') diff --git a/os/port/edf.h b/os/port/edf.h new file mode 100644 index 00000000..dfd2b4a9 --- /dev/null +++ b/os/port/edf.h @@ -0,0 +1,53 @@ +enum { + Maxsteps = 200 * 100 * 2, /* 100 periods of 200 procs */ + + /* Edf.flags field */ + Admitted = 0x01, + Sporadic = 0x02, + Yieldonblock = 0x04, + Sendnotes = 0x08, + Deadline = 0x10, + Yield = 0x20, + Extratime = 0x40, + + Infinity = ~0ULL, +}; + +typedef struct Edf Edf; + +struct Edf { + /* time intervals */ + vlong D; /* Deadline */ + vlong Delta; /* Inherited deadline */ + vlong T; /* period */ + vlong C; /* Cost */ + vlong S; /* Slice: time remaining in this period */ + /* times */ + vlong r; /* (this) release time */ + vlong d; /* (this) deadline */ + vlong t; /* Start of next period, t += T at release */ + vlong s; /* Time at which this proc was last scheduled */ + /* for schedulability testing */ + vlong testDelta; + int testtype; /* Release or Deadline */ + vlong testtime; + Proc *testnext; + /* other */ + ushort flags; + Timer; + /* Stats */ + vlong edfused; + vlong extraused; + vlong aged; + ulong periods; + ulong missed; +}; + +extern Lock edftestlock; /* for atomic admitting/expelling */ + +#pragma varargck type "t" vlong +#pragma varargck type "U" uvlong + +/* Interface: */ +Edf* edflock(Proc*); +void edfunlock(void); -- cgit v1.2.3