4 #include "mlp_runtime.h"
8 // the root sese is accessible globally so
9 // buildcode can generate references to it
10 struct SESErecord* rootsese;
13 // the issuedQ, in this simple version, spits
14 // out SESErecord's in the order they were issued
15 static struct Queue* issuedQ;
18 // the class_age2instance maps an SESE class id and
19 // age value to a particular SESErecord instance
20 static struct SESErecord** class_age2instance;
23 // each core should have a current SESE
24 static struct SESErecord* current;
27 void mlpInit( int totalNumSESEs, int maxSESEage ) {
28 rootsese = (struct SESErecord*) malloc( sizeof( struct SESErecord ) );
30 issuedQ = createQueue();
32 class_age2instance = (struct SESErecord**) malloc( sizeof( struct SESErecord* ) *
41 struct SESErecord* mlpGetCurrent() {
46 void mlpIssue( struct SESErecord* sese ) {
47 addNewItem( issuedQ, (void*) sese );
51 struct SESErecord* mlpSchedule() {
52 assert( !isEmpty( issuedQ ) );
53 return (struct SESErecord*) getItem( issuedQ );
57 void mlpStall( struct SESErecord* sese ) {
62 void mlpNotifyExit( struct SESErecord* sese ) {