dont implement via header file
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/* osi/os/vxWorks/osiInterrupt.c */
|
||||
|
||||
/* Author: Marty Kraimer Date: 25AUG99 */
|
||||
/* Author: Marty Kraimer Date: 28JAN2000 */
|
||||
|
||||
/********************COPYRIGHT NOTIFICATION**********************************
|
||||
This software was developed under a United States Government license
|
||||
@@ -8,9 +8,20 @@ described on the COPYRIGHT_UniversityOfChicago file included as part
|
||||
of this distribution.
|
||||
****************************************************************************/
|
||||
|
||||
/* Entire implementation is in header file */
|
||||
#include <vxWorks.h>
|
||||
#include <intLib.h>
|
||||
#include <logLib.h>
|
||||
|
||||
static void dummy()
|
||||
#include "osiInterrupt.h"
|
||||
|
||||
|
||||
int interruptLock() {return(intLock();}
|
||||
|
||||
void interruptUnlock(int key) {intUnlock(key;}
|
||||
|
||||
int interruptIsInterruptContext() {return(intContext());}
|
||||
|
||||
void interruptContextMessage(const char *message)
|
||||
{
|
||||
logMsg((char *)message,0,0,0,0,0,0);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
#include <vxWorks.h>
|
||||
#include <intLib.h>
|
||||
#include <logLib.h>
|
||||
|
||||
|
||||
#define interruptLock intLock
|
||||
#define interruptUnlock intUnlock
|
||||
#define interruptIsInterruptContext intContext
|
||||
#define interruptContextMessage(MESSAGE) \
|
||||
(logMsg((char *)(MESSAGE),0,0,0,0,0,0))
|
||||
@@ -8,7 +8,55 @@ described on the COPYRIGHT_UniversityOfChicago file included as part
|
||||
of this distribution.
|
||||
****************************************************************************/
|
||||
|
||||
/* Entire implementation is in header file */
|
||||
#include <vxWorks.h>
|
||||
#include <rngLib.h>
|
||||
|
||||
static void dummy()
|
||||
{ }
|
||||
ringId ringCreate(int nbytes)
|
||||
{
|
||||
return((ringId)rngCreate(nbytes));
|
||||
}
|
||||
|
||||
void ringDelete(ringId id)
|
||||
{
|
||||
rngDelete((RING_ID)id);
|
||||
}
|
||||
|
||||
int ringGet(ringId id, char *value,int nbytes)
|
||||
{
|
||||
return(rngBufGet((RING_ID)id,value,nbytes);
|
||||
}
|
||||
|
||||
int ringPut(ringId id, char *value,int nbytes)
|
||||
{
|
||||
return(rngBufPut((RING_ID)id,value,nbytes));
|
||||
}
|
||||
|
||||
void ringFlush(ringId id)
|
||||
{
|
||||
ringFlush((RING_ID)id);
|
||||
}
|
||||
|
||||
int ringFreeBytes(ringId id)
|
||||
{
|
||||
return(rngFreeBytes((RING_ID)id));
|
||||
}
|
||||
|
||||
int ringUsedBytes(ringId id)
|
||||
{
|
||||
return(rngNBytes((RING_ID)id));
|
||||
}
|
||||
|
||||
int ringSize(ringId id)
|
||||
{
|
||||
return((rngFreeBytes((RING_ID)id) + rngNBytes((RING_ID)id)));
|
||||
}
|
||||
|
||||
int ringIsEmpty(ringId id)
|
||||
{
|
||||
return(rngIsEmpty((RING_ID)id));
|
||||
}
|
||||
|
||||
int ringIsFull(ringId id)
|
||||
{
|
||||
return(rngIsFull((RING_ID)id));
|
||||
}
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
#ifndef osiRingh
|
||||
#define osiRingh
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <rngLib.h>
|
||||
|
||||
#define ringId RING_ID
|
||||
|
||||
#define ringCreate rngCreate
|
||||
#define ringDelete rngDelete
|
||||
#define ringGet rngBufGet
|
||||
#define ringPut rngBufPut
|
||||
#define ringFlush rngFlush
|
||||
#define ringFreeBytes rngFreeBytes
|
||||
#define ringUsedBytes rngNBytes
|
||||
#define ringSize(ID) (rngFreeBytes((ID)) + rngNBytes((ID)))
|
||||
#define ringIsEmpty rngIsEmpty
|
||||
#define ringIsFull rngIsFull
|
||||
|
||||
#endif /* osiRingh */
|
||||
@@ -8,22 +8,106 @@ described on the COPYRIGHT_UniversityOfChicago file included as part
|
||||
of this distribution.
|
||||
****************************************************************************/
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <semLib.h>
|
||||
#include <time.h>
|
||||
#include <objLib.h>
|
||||
#include <sysLib.h>
|
||||
|
||||
#include "osiSem.h"
|
||||
#include "cantProceed.h"
|
||||
|
||||
|
||||
semBinaryId semBinaryMustCreate(int initialState)
|
||||
semBinaryId semBinaryCreate(int initialState)
|
||||
{
|
||||
semBinaryId id;
|
||||
id = semBinaryCreate(initialState);
|
||||
if(!id) cantProceed("semBinaryMustCreate");
|
||||
return(id);
|
||||
return((semBinaryId)semBCreate(SEM_Q_FIFO,(semEmpty ? SEM_EMPTY : SEM_FULL)));
|
||||
}
|
||||
|
||||
semMutexId semMutexMustCreate(void)
|
||||
void semBinaryDestroy(semBinaryId id)
|
||||
{
|
||||
semMutexId id;
|
||||
id = semMutexCreate();
|
||||
if(!id) cantProceed("semMutexMustCreate");
|
||||
return(id);
|
||||
semDelete((SEM_ID)id);
|
||||
}
|
||||
|
||||
void semBinaryGive(semBinaryId id)
|
||||
{
|
||||
semGive((SEM_ID)id);
|
||||
}
|
||||
|
||||
semTakeStatus semBinaryTake(semBinaryId id)
|
||||
{
|
||||
int status;
|
||||
status = semTake((SEM_ID)id,WAIT_FOREVER);
|
||||
return((status==OK ? semTakeOK : semTakeError));
|
||||
}
|
||||
|
||||
semTakeStatus semBinaryTakeTimeout(
|
||||
semBinaryId id, double timeOut)
|
||||
{
|
||||
int status;
|
||||
int ticks;
|
||||
ticks = (int)(timeOut * (double)sysClkRateGet());
|
||||
status = semTake((SEM_ID)id,ticks);
|
||||
if(status==OK) return(semTakeOK);
|
||||
if(errno==S_objLib_OBJ_TIMEOUT) return(semTakeTimeout);
|
||||
return(semTakeError);
|
||||
}
|
||||
|
||||
semTakeStatus semBinaryTakeNoWait(semBinaryId id)
|
||||
{
|
||||
int status;
|
||||
status = semTake((SEM_ID)id,NO_WAIT);
|
||||
if(status==OK) return(semTakeOK);
|
||||
if(errno==S_objLib_OBJ_UNAVAILABLE) return(semTakeTimeout);
|
||||
return(semTakeError);
|
||||
}
|
||||
|
||||
void semBinaryShow(semBinaryId id)
|
||||
{
|
||||
semShow((SEM_ID)id,1);
|
||||
}
|
||||
|
||||
semMutexId semMutexCreate(void)
|
||||
{
|
||||
return((semMutexId)
|
||||
semMCreate(SEM_DELETE_SAFE|SEM_INVERSION_SAFE|SEM_Q_PRIORITY));
|
||||
}
|
||||
|
||||
void semMutexDestroy(semMutexId id)
|
||||
{
|
||||
semDelete((SEM_ID)id);
|
||||
}
|
||||
|
||||
void semMutexGive(semMutexId id)
|
||||
{
|
||||
semGive((SEM_ID)id);
|
||||
}
|
||||
|
||||
semTakeStatus semMutexTake(semMutexId id)
|
||||
{
|
||||
int status;
|
||||
status = semTake((SEM_ID)id,WAIT_FOREVER);
|
||||
return((status==OK ? semTakeOK : semTakeError));
|
||||
}
|
||||
|
||||
semTakeStatus semMutexTakeTimeout(
|
||||
semMutexId id, double timeOut)
|
||||
{
|
||||
int status;
|
||||
status = semTake((SEM_ID)id,NO_WAIT);
|
||||
if(status==OK) return(semTakeOK);
|
||||
if(errno==S_objLib_OBJ_UNAVAILABLE) return(semTakeTimeout);
|
||||
return(semTakeError);
|
||||
}
|
||||
|
||||
semTakeStatus semMutexTakeNoWait(semMutexId id);
|
||||
{
|
||||
int status;
|
||||
status = semTake((SEM_ID)id,NO_WAIT);
|
||||
if(status==OK) return(semTakeOK);
|
||||
if(errno==S_objLib_OBJ_UNAVAILABLE) return(semTakeTimeout);
|
||||
return(semTakeError);
|
||||
}
|
||||
|
||||
void semMutexShow(semMutexId id);
|
||||
{
|
||||
semShow((SEM_ID)id,1);
|
||||
}
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
#ifndef osiSemh
|
||||
#define osiSemh
|
||||
|
||||
#include <vxWorks.h>
|
||||
#include <semLib.h>
|
||||
#include <time.h>
|
||||
#include <objLib.h>
|
||||
#include <sysLib.h>
|
||||
|
||||
#include "epicsAssert.h"
|
||||
|
||||
#define semBinaryId SEM_ID
|
||||
#define semMutexId SEM_ID
|
||||
#define semEmpty SEM_EMPTY
|
||||
#define semFull SEM_FULL
|
||||
|
||||
typedef enum {semTakeOK,semTakeTimeout,semTakeError} semTakeStatus;
|
||||
|
||||
#define semBinaryCreate(IS) semBCreate(SEM_Q_FIFO,(IS))
|
||||
semBinaryId semBinaryMustCreate(int initialState);
|
||||
#define semBinaryDestroy semDelete
|
||||
#define semBinaryGive semGive
|
||||
#define semBinaryTake(ID) \
|
||||
((semTake((ID),WAIT_FOREVER)==OK ? semTakeOK : semTakeError))
|
||||
#define semBinaryMustTake(ID) \
|
||||
assert(semTake((ID),WAIT_FOREVER)==OK)
|
||||
#define semBinaryTakeTimeout(ID,TIMEOUT) \
|
||||
((semTake((ID),((int)((TIMEOUT)*sysClkRateGet())))==OK ? semTakeOK \
|
||||
: (errno==S_objLib_OBJ_TIMEOUT ? semTakeTimeout : semTakeError)))
|
||||
#define semBinaryTakeNoWait(ID) \
|
||||
((semTake((ID),NO_WAIT)==OK ? semTakeOK \
|
||||
: (errno==S_objLib_OBJ_UNAVAILABLE ? semTakeTimeout : semTakeError)))
|
||||
|
||||
#define semBinaryShow(ID) semShow((ID),1)
|
||||
|
||||
#define semMutexCreate() \
|
||||
semMCreate(SEM_DELETE_SAFE|SEM_INVERSION_SAFE|SEM_Q_PRIORITY)
|
||||
semMutexId semMutexMustCreate();
|
||||
#define semMutexDestroy semDelete
|
||||
#define semMutexGive semGive
|
||||
#define semMutexTake(ID) \
|
||||
((semTake((ID),WAIT_FOREVER)==OK ? semTakeOK : semTakeError))
|
||||
#define semMutexMustTake(ID) \
|
||||
assert(semTake((ID),WAIT_FOREVER)==OK)
|
||||
#define semMutexTakeTimeout(ID,TIMEOUT) \
|
||||
((semTake((ID),((int)((TIMEOUT)*sysClkRateGet())))==OK ? semTakeOK \
|
||||
: (errno==S_objLib_OBJ_TIMEOUT ? semTakeTimeout : semTakeError)))
|
||||
#define semMutexTakeNoWait(ID) \
|
||||
((semTake((ID),NO_WAIT)==OK ? semTakeOK \
|
||||
: (errno==S_objLib_OBJ_UNAVAILABLE ? semTakeTimeout : semTakeError)))
|
||||
#define semMutexShow(ID) semShow((ID),1)
|
||||
|
||||
#endif /*osiSemh*/
|
||||
@@ -1,13 +0,0 @@
|
||||
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Author: Jeff Hill
|
||||
*/
|
||||
|
||||
#ifndef osdTimeh
|
||||
#define osdTimeh
|
||||
|
||||
/* NOOP */
|
||||
|
||||
#endif /* ifndef osdTimeh */
|
||||
Reference in New Issue
Block a user