20,11 → 20,11 |
|
/** |
------------ |
CVS : $Id: pistar.c,v 1.2 2004-09-02 13:18:53 trimarchi Exp $ |
CVS : $Id: pistar.c,v 1.3 2004-09-03 12:37:48 trimarchi Exp $ |
|
File: $File$ |
Revision: $Revision: 1.2 $ |
Last update: $Date: 2004-09-02 13:18:53 $ |
Revision: $Revision: 1.3 $ |
Last update: $Date: 2004-09-03 12:37:48 $ |
------------ |
|
Priority Inhertitance protocol. see pi.h for more details... |
83,7 → 83,6 |
PID owner; |
int nblocked; |
PID firstblocked; |
TIME wcet; |
} PISTAR_mutex_t; |
|
|
134,7 → 133,6 |
p->owner = NIL; |
p->nblocked = 0; |
p->firstblocked = NIL; |
p->wcet = ((PISTAR_mutexattr_t *)a)->wcet; |
|
m->mutexlevel = l; |
m->opt = (void *)p; |
170,7 → 168,7 |
module!)... and if the slice is greather than the critical sections, |
they never block! |
*/ |
static int PISTAR_lock(RLEVEL l, mutex_t *m) |
int PISTAR_lock(RLEVEL l, mutex_t *m, TIME wcet) |
{ |
PISTAR_mutex_resource_des *lev = (PISTAR_mutex_resource_des *)(resource_table[l]); |
PISTAR_mutex_t *p; |
211,7 → 209,7 |
kern_cli(); |
} |
fsf_get_server(&server, exec_shadow); |
if (fsf_get_remain_budget(server)>p->wcet) cond=1; |
if (fsf_get_remain_budget(server)>wcet) cond=1; |
else { |
SERVER_disable_server(fsf_get_server_level(),server); |
scheduler(); |
348,7 → 346,7 |
/* fill the mutex_resource_des descriptor */ |
m->m.init = PISTAR_init; |
m->m.destroy = PISTAR_destroy; |
m->m.lock = PISTAR_lock; |
m->m.lock = NULL; |
m->m.trylock = PISTAR_trylock; |
m->m.unlock = PISTAR_unlock; |
|
361,7 → 359,3 |
return l; |
} |
|
void PISTAR_change_mutex_wcet_parameter(mutex_t *m, TIME wcet) { |
((PISTAR_mutex_t *)(m))->wcet=wcet; |
} |
|