10#if defined(MANUX_CONDITION_AUDIT) && defined(MANUX_KMALLOC)
15#if defined(MANUX_CONDITION_AUDIT) && defined(MANUX_KMALLOC)
20typedef struct _CelluleCondition {
22 struct _CelluleCondition * suivant;
25typedef struct _ListeConditions {
26 CelluleCondition * tete;
27 CelluleCondition * queue;
34ListeConditions * listeConditionsCreer(
void)
36 ListeConditions * result;
38 result = (ListeConditions *)
kmalloc(
sizeof(ListeConditions));
51void listeConditionsInserer(ListeConditions * l,
Condition *
c)
53 CelluleCondition * cell = (CelluleCondition *)
kmalloc(
sizeof(CelluleCondition));
61 if (l->queue !=
NULL) {
62 l->queue->suivant = cell;
65 if (l->tete ==
NULL) {
74static ListeConditions * listeConditions =
NULL;
79void conditionsAfficherEtat(
void)
81 CelluleCondition * cell;
84 printk(
"\nEtat des variables de condition sur le systeme :\n\n");
85 printk(
"Cond | s | d | Attente\n");
86 printk(
"--------+------+------+--------\n");
88 if (listeConditions !=
NULL) {
89 for (cell = listeConditions->tete; cell !=
NULL; cell = cell->suivant){
90 printk(
"0x%x | %4d | %4d | ",
92 cell->condition->nbSignaler,
93 cell->condition->nbDiffuser);
94 for (cellT = cell->condition->tachesEnAttente.tete ;
101 printk(
"--------+------+------+--------\n");
114#if defined(MANUX_CONDITION_AUDIT)
115 cond->nbSignaler = 0;
116 cond->nbDiffuser = 0;
118 if (listeConditions ==
NULL) {
119 listeConditions = listeConditionsCreer();
121 if (listeConditions !=
NULL) {
122 listeConditionsInserer(listeConditions, cond);
180#if defined(MANUX_CONDITION_AUDIT)
205#if defined(MANUX_CONDITION_AUDIT)
#define tacheEnCoursAutoriserPreemption()
Autoriser la préemption pour la tâche en cours.
#define tacheEnCoursInterdirePreemption()
Empêcher la préemption pour la tâche en cours.
void conditionAttendre(Condition *cond, ExclusionMutuelle *em)
Attente de la prochaine occurence d'une condition.
void conditionInitialiser(Condition *cond)
Initialisation d'une condition.
void conditionSignaler(Condition *cond)
Signaler une occurence d'une condition.
void conditionDiffuser(Condition *cond)
Signaler une occurence d'une condition à toutes les tâches en attente.
void exclusionMutuelleEntrer(ExclusionMutuelle *em)
Entrée en exclusion mutuelle.
void exclusionMutuelleSortir(ExclusionMutuelle *em)
void printk(char *format,...)
Fonction principale d'affichage dans le noyau.
void * kmalloc(size_t n)
Allocation d'une zone de n octets.
void insererCelluleTache(ListeTache *listeTaches, struct _Tache *tache, CelluleTache *celluleTache)
struct _Tache * extraireTache(ListeTache *listeTaches)
void initialiserListeTache(ListeTache *listeTache)
ListeTache listeTachesPretes
: La liste des tâches prêtes sur le système
Tache * tacheEnCours
: L'identification de la tâche en cours
void ordonnanceur(void)
Basculer vers la prochaine tache à exécuter.
struct _CelluleTache * suivant
Définition des exclusions mutuelles.
: Définition du type décrivant une tache.
Définition des conditions.
ListeTache tachesEnAttente