Subversion Repositories shark

Rev

Blame | Last modification | View Log | RSS feed

#ifndef __HLPGRAPH_H_INCLUDED__
#define __HLPGRAPH_H_INCLUDED__

#include <kernel/kern.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <modules/sem.h>
#include <drivers/shark_fb26.h>
#include "hlp.h"
//#include <modules/srp.h>
//#include <modules/pi.h>
//#include <modules/npp.h>

/* shared resource list */
typedef struct mutex_struct_list {
  mutex_t m;
  int color; /* color associated to mutex (for graphics) */
  char *name;
  struct mutex_struct_list *next;
} mutex_list_t;

typedef enum { LOAD, LOCK, UNLOCK } action_type_t ;

/* task action's description list */
typedef struct action_struct {
  action_type_t type;

  int time; /* lunghezza dell'azione (ignorato per lock/unlock) */

  mutex_list_t *mutex; /* null se type e' 0,
                          punta al mutex lockato/unlockato se type e' 1 */

 
  struct action_struct *next;
} action_list_t;

/* elenco dei task del sistema */
typedef struct taskconf_list_struct {
  PID pid;
  char *name;
  int i;
  DWORD period; /* periodo */
  DWORD wcet; /* richiesta di carico totale */
  mutex_list_t *mutexlist; /* the mutexes used by task */
  action_list_t *actionlist; /* l'elenco di azioni che compie il task */
  struct taskconf_list_struct *next;
} taskconf_list_t;

#endif