Subversion Repositories shark

Compare Revisions

Ignore whitespace Rev 352 → Rev 353

/shark/trunk/kernel/modules/sem.c
20,11 → 20,11
 
/**
------------
CVS : $Id: sem.c,v 1.5 2003-11-06 09:42:23 giacomo Exp $
CVS : $Id: sem.c,v 1.6 2003-12-10 16:55:01 giacomo Exp $
 
File: $File$
Revision: $Revision: 1.5 $
Last update: $Date: 2003-11-06 09:42:23 $
Revision: $Revision: 1.6 $
Last update: $Date: 2003-12-10 16:55:01 $
------------
 
This file contains the Hartik 3.3.1 Semaphore functions
69,10 → 69,10
#include <kernel/descr.h>
#include <kernel/var.h>
#include <kernel/func.h>
#include <kernel/trace.h>
#include <limits.h>
#include <fcntl.h>
 
#include <tracer.h>
 
/* Semaphores descriptor tables */
static struct sem_des {
360,7 → 360,7
LEVEL l; /* for readableness only */
 
/* tracer stuff */
trc_logevent(TRC_SEM_WAIT,s);
TRACER_LOGEVENT(FTrace_EVT_set_mutex_wait,3,*s,exec_shadow);
 
kern_epilogue_macro();
 
388,7 → 388,7
else {
s1->count--;
/* tracer stuff */
trc_logevent(TRC_SEM_WAIT,s);
TRACER_LOGEVENT(FTrace_EVT_set_mutex_wait,3,*s,exec_shadow);
kern_context_load(proc_table[exec_shadow].context);
}
 
412,9 → 412,6
 
s1 = &sem_table[*s];
 
/* tracer stuff */
//trc_logevent(TRC_SEM_WAITNB,s);
 
if (s1->blocked.first != NIL || s1->count == 0) {
errno = EAGAIN;
kern_frestore(f);
452,9 → 449,6
/* The non blocking wait is really simple! */
/* We do not suspend or schedule anything */
if (wait == NON_BLOCK) {
/* tracer */
//trc_logevent(TRC_SEM_WAITNB,s);
 
if (s1->blocked.first != NIL || s1->count < n) {
errno = EAGAIN;
kern_sti();
476,7 → 470,7
LEVEL l; /* for readableness only */
 
/* tracer */
trc_logevent(TRC_SEM_WAIT,s);
TRACER_LOGEVENT(FTrace_EVT_set_mutex_wait,3,*s,exec_shadow);
kern_epilogue_macro();
504,8 → 498,8
else {
s1->count -= n;
/* tracer */
trc_logevent(TRC_SEM_WAIT,s);
kern_context_load(proc_table[exec_shadow].context);
TRACER_LOGEVENT(FTrace_EVT_set_mutex_wait,3,*s,exec_shadow);
kern_context_load(proc_table[exec_shadow].context);
}
}
 
551,7 → 545,7
}
/* tracer */
trc_logevent(TRC_SEM_SIGNAL,s);
TRACER_LOGEVENT(FTrace_EVT_set_mutex_lock,1,*s,exec_shadow);
kern_frestore(f);
}
else {
576,7 → 570,7
}
/* tracer */
trc_logevent(TRC_SEM_SIGNAL,s);
TRACER_LOGEVENT(FTrace_EVT_set_mutex_lock,3,*s,exec_shadow);
kern_context_load(proc_table[exec_shadow].context);
}
626,7 → 620,7
}
/* tracer */
trc_logevent(TRC_SEM_SIGNAL,s);
TRACER_LOGEVENT(FTrace_EVT_set_mutex_lock,3,*s,exec_shadow);
/* Preempt if necessary */
if (fl) event_need_reschedule();
656,7 → 650,7
}
/* tracer */
trc_logevent(TRC_SEM_SIGNAL,s);
TRACER_LOGEVENT(FTrace_EVT_set_mutex_lock,3,*s,exec_shadow);
/* Preempt if necessary */
if (fl) scheduler();