20,11 → 20,11 |
|
/** |
------------ |
CVS : $Id: srp.c,v 1.3 2003-01-07 17:07:51 pj Exp $ |
CVS : $Id: srp.c,v 1.4 2003-11-05 15:04:15 giacomo Exp $ |
|
File: $File$ |
Revision: $Revision: 1.3 $ |
Last update: $Date: 2003-01-07 17:07:51 $ |
Revision: $Revision: 1.4 $ |
Last update: $Date: 2003-11-05 15:04:15 $ |
------------ |
|
Stack Resource Policy. see srp.h for general details... |
525,6 → 525,7 |
{ |
SRP_mutex_resource_des *lev = (SRP_mutex_resource_des *)(resource_table[l]); |
SRP_mutex_t *mut; |
SYS_FLAGS f; |
|
mut = m->opt; |
|
531,7 → 532,7 |
if (mut->owner != NIL) |
return (EBUSY); |
|
kern_cli(); |
f = kern_fsave(); |
|
/* the mutex isn't in the srpstack, because it is not busy */ |
|
546,7 → 547,7 |
kern_free(m->opt,sizeof(SRP_mutex_t)); |
m->opt = NULL; |
} |
kern_sti(); |
kern_frestore(f); |
|
return 0; |
} |
556,19 → 557,20 |
SRP_mutex_resource_des *lev = (SRP_mutex_resource_des *)(resource_table[l]); |
SRP_mutex_t *mut; |
DWORD oldsysceiling; |
SYS_FLAGS f; |
|
kern_cli(); |
f = kern_fsave(); |
|
mut = (SRP_mutex_t *)m->opt; |
if (!mut) { |
/* if the mutex is not initialized */ |
kern_sti(); |
kern_frestore(f); |
return (EINVAL); |
} |
|
if (mut->owner == exec_shadow) { |
/* the task already owns the mutex */ |
kern_sti(); |
kern_frestore(f); |
return (EDEADLK); |
} |
|
581,7 → 583,7 |
// mut->use[exec_shadow], |
// lev->proc_preempt[exec_shadow].preempt,exec_shadow); |
kern_raise(XSRP_INVALID_LOCK, exec_shadow); |
kern_sti(); |
kern_frestore(f); |
return (EINVAL); |
} |
|
637,7 → 639,7 |
} |
} |
|
kern_sti(); |
kern_frestore(f); |
|
return 0; |
} |
658,13 → 660,11 |
|
if (mut->owner != exec_shadow) { |
/* the mutex is owned by another task!!! */ |
kern_sti(); |
return (EPERM); |
} |
|
if (!lev->srpstack || lev->srpstack != mut) { |
/* the mutex is not the top of the stack!!! (erroneous nesting!) */ |
kern_sti(); |
return (EINVAL); |
} |
|