Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 320 → Rev 321

/shark/trunk/kernel/modules/nopm.c
20,11 → 20,11
 
/**
------------
CVS : $Id: nopm.c,v 1.4 2003-11-05 15:04:14 giacomo Exp $
CVS : $Id: nopm.c,v 1.5 2003-11-06 09:42:23 giacomo Exp $
 
File: $File$
Revision: $Revision: 1.4 $
Last update: $Date: 2003-11-05 15:04:14 $
Revision: $Revision: 1.5 $
Last update: $Date: 2003-11-06 09:42:23 $
------------
 
See modules/nopm.h.
286,6 → 286,7
if (p->owner != exec_shadow) {
/* the mutex is owned by another task!!! */
kern_printf("wrongunlock<owner=%i,unlocker=%i>",p->owner,exec_shadow);
kern_sti();
return (EPERM);
}
 
292,6 → 293,7
p->counter--;
if (p->counter!=0) {
/* we have multiple lock on this mutex */
kern_sti();
return 0;
}
/shark/trunk/kernel/modules/pc.c
20,11 → 20,11
 
/**
------------
CVS : $Id: pc.c,v 1.5 2003-11-05 19:16:38 giacomo Exp $
CVS : $Id: pc.c,v 1.6 2003-11-06 09:42:23 giacomo Exp $
 
File: $File$
Revision: $Revision: 1.5 $
Last update: $Date: 2003-11-05 19:16:38 $
Revision: $Revision: 1.6 $
Last update: $Date: 2003-11-06 09:42:23 $
------------
 
Priority Ceiling protocol. see pc.h for more details...
371,6 → 371,7
 
if (p->owner != exec_shadow) {
/* the mutex is owned by another task!!! */
kern_sti();
return (EPERM);
}
 
/shark/trunk/kernel/modules/srp.c
20,11 → 20,11
 
/**
------------
CVS : $Id: srp.c,v 1.4 2003-11-05 15:04:15 giacomo Exp $
CVS : $Id: srp.c,v 1.5 2003-11-06 09:42:23 giacomo Exp $
 
File: $File$
Revision: $Revision: 1.4 $
Last update: $Date: 2003-11-05 15:04:15 $
Revision: $Revision: 1.5 $
Last update: $Date: 2003-11-06 09:42:23 $
------------
 
Stack Resource Policy. see srp.h for general details...
660,11 → 660,13
 
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);
}
 
/shark/trunk/kernel/modules/pi.c
20,11 → 20,11
 
/**
------------
CVS : $Id: pi.c,v 1.4 2003-11-05 19:16:39 giacomo Exp $
CVS : $Id: pi.c,v 1.5 2003-11-06 09:42:23 giacomo Exp $
 
File: $File$
Revision: $Revision: 1.4 $
Last update: $Date: 2003-11-05 19:16:39 $
Revision: $Revision: 1.5 $
Last update: $Date: 2003-11-06 09:42:23 $
------------
 
Priority Inhertitance protocol. see pi.h for more details...
183,7 → 183,7
 
if (p->owner == exec_shadow) {
/* the task already owns the mutex */
kern_cli(f);
kern_frestore(f);
return (EDEADLK);
}
 
199,7 → 199,7
kern_context_load(proc_table[exec_shadow].context);
 
/* ... and reaquire the cli() before the test... */
kern_frestore(f);
kern_cli();
}
 
/* the mutex is free, We can lock it! */
257,6 → 257,7
 
if (p->owner != exec_shadow) {
/* the mutex is owned by another task!!! */
kern_sti();
return (EPERM);
}
 
/shark/trunk/kernel/modules/sem.c
20,11 → 20,11
 
/**
------------
CVS : $Id: sem.c,v 1.4 2003-11-05 15:04:15 giacomo Exp $
CVS : $Id: sem.c,v 1.5 2003-11-06 09:42:23 giacomo Exp $
 
File: $File$
Revision: $Revision: 1.4 $
Last update: $Date: 2003-11-05 15:04:15 $
Revision: $Revision: 1.5 $
Last update: $Date: 2003-11-06 09:42:23 $
------------
 
This file contains the Hartik 3.3.1 Semaphore functions
435,10 → 435,6
int sem_xwait(sem_t *s, int n, int wait)
{
struct sem_des *s1; /* It speeds up access */
SYS_FLAGS f;
f = kern_fsave();
kern_frestore(f);
 
if (*s < 0 || *s >= SEM_NSEMS_MAX || !sem_table[*s].used) {
errno = EINVAL;
447,7 → 443,7
 
/* We do not need to save context if we are sure we shall not block! */
if (wait == NON_BLOCK)
f = kern_fsave();
kern_cli();
else
proc_table[exec_shadow].context = kern_context_save();
 
461,13 → 457,13
 
if (s1->blocked.first != NIL || s1->count < n) {
errno = EAGAIN;
kern_frestore(f);
kern_sti();
return -1;
}
else
s1->count -= n;
 
kern_frestore(f);
kern_sti();
return 0;
}
/* The blocking wait is more complex... */
/shark/trunk/kernel/modules/nop.c
20,11 → 20,11
 
/**
------------
CVS : $Id: nop.c,v 1.4 2003-11-05 15:04:14 giacomo Exp $
CVS : $Id: nop.c,v 1.5 2003-11-06 09:42:22 giacomo Exp $
 
File: $File$
Revision: $Revision: 1.4 $
Last update: $Date: 2003-11-05 15:04:14 $
Revision: $Revision: 1.5 $
Last update: $Date: 2003-11-06 09:42:22 $
------------
 
Binary Semaphores. see nop.h for more details...
218,6 → 218,7
 
if (p->owner != exec_shadow) {
/* the mutex is owned by another task!!! */
kern_sti();
return (EPERM);
}