removed junk

This commit is contained in:
Jeff Hill
2001-03-08 22:05:58 +00:00
parent 26a35b488f
commit 1ee4d67709
8 changed files with 0 additions and 810 deletions

View File

@@ -1,6 +0,0 @@
this directory contains the posix os dependent source for
the EPICS ca server

View File

@@ -1,7 +0,0 @@
WORK IN PROGRESS
this directory contains the posix real time os dependent source for
the EPICS ca server

View File

@@ -1,8 +0,0 @@
!! WORK IN PROGRESS - this code isnt yet thread safe !!
this directory contains the vxWorks os dependent source for
the EPICS ca server. This is a multi-threaded port of the
server.

View File

@@ -1,130 +0,0 @@
/*
*
* caServerOS.c
* $Id$
*
*
* $Log$
* Revision 1.2 1996/09/16 18:27:09 jhill
* vxWorks port changes
*
* Revision 1.1 1996/09/04 22:06:43 jhill
* installed
*
* Revision 1.1.1.1 1996/06/20 00:28:06 jhill
* ca server installation
*
*
*/
#include <taskLib.h>
#include <task_params.h>
//
// CA server
//
#include <server.h>
//
// aServerOS::operator -> ()
//
inline caServerI * caServerOS::operator -> ()
{
return &this->cas;
}
//
// casBeaconTimer::expire()
//
void casBeaconTimer::expire()
{
os->sendBeacon ();
}
//
// casBeaconTimer::again()
//
osiBool casBeaconTimer::again()
{
return osiTrue;
}
//
// casBeaconTimer::delay()
//
const osiTime casBeaconTimer::delay()
{
return os->getBeaconPeriod();
}
//
// caServerOS::init()
//
caStatus caServerOS::init()
{
this->pBTmr = new casBeaconTimer((*this)->getBeaconPeriod(), *this);
if (!this->pBTmr) {
errlogPrintf("CAS: Unable to start server beacon\n");
return S_cas_noMemory;
}
//
// WRS still passes pointers in ints
//
assert (sizeof(int)==sizeof(&this->cas));
this->tid = taskSpawn (
REQ_SRVR_NAME,
REQ_SRVR_PRI,
REQ_SRVR_OPT,
REQ_SRVR_STACK,
(FUNCPTR) caServerEntry, // get your act together WRS
(int) &this->cas, // get your act together WRS
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
if (this->tid==ERROR) {
return S_cas_noMemory;
}
return S_cas_success;
}
//
// caServerOS::~caServerOS()
//
caServerOS::~caServerOS()
{
if (this->pBTmr) {
delete this->pBTmr;
}
if (taskIdVerify(this->tid)==OK)
{
taskDelete(this->tid);
}
}
//
// caServerEntry()
//
void caServerEntry(caServerI *pCAS)
{
//
// forever
//
while (TRUE) {
pCAS->connectCB();
printf("process timer q here?\n");
}
}

View File

@@ -1,72 +0,0 @@
class casStreamEvWakeup;
//
// casStreamOS
//
class casStreamOS : public casStrmClient {
friend int casStrmServer (casStreamOS *);
friend int casStrmEvent (casStreamOS *);
public:
casStreamOS(caServerI &, casMsgIO &);
caStatus init();
~casStreamOS();
//
// process any incomming messages
//
casProcCond processInput();
caStatus start();
void eventSignal();
void eventFlush();
void show(unsigned level);
private:
SEM_ID eventSignalSem;
int clientTId;
int eventTId;
};
//
// vxWorks task entry
//
int casStrmServer (casStreamOS *);
int casStrmEvent (casStreamOS *);
class casDGEvWakeup;
//
// casDGOS
//
class casDGOS : public casDGClient {
friend int casDGServer (casDGOS *);
friend int casDGEvent (casDGOS *);
public:
casDGOS(caServerI &cas);
caStatus init();
~casDGOS();
//
// process any incomming messages
//
casProcCond processInput();
caStatus start();
void eventSignal();
void eventFlush();
void show(unsigned level);
private:
SEM_ID eventSignalSem;
int clientTId;
int eventTId;
};
//
// vxWorks task entry
//
int casDGServer (casDGOS *);
int casDGEvent (casDGOS *);

View File

@@ -1,214 +0,0 @@
/*
*
* casDGOS.c
* $Id$
*
*
* $Log$
* Revision 1.3 1997/06/30 23:38:46 jhill
* use %p for pointers
*
* Revision 1.2 1996/09/16 18:27:09 jhill
* vxWorks port changes
*
* Revision 1.1 1996/09/04 22:06:45 jhill
* installed
*
* Revision 1.1.1.1 1996/06/20 00:28:06 jhill
* ca server installation
*
*
*/
//
// CA server
//
#include <taskLib.h> // vxWorks
#include <server.h>
#include <task_params.h> // EPICS task priorities
//
// casDGOS::eventSignal()
//
void casDGOS::eventSignal()
{
STATUS st;
st = semGive(this->eventSignalSem);
assert (st==OK);
}
//
// casDGOS::eventFlush()
//
void casDGOS::eventFlush()
{
this->flush();
}
//
// casDGOS::casDGOS()
//
casDGOS::casDGOS(caServerI &cas) :
eventSignalSem(NULL),
casDGClient(cas),
clientTId(ERROR),
eventTId(ERROR)
{
}
//
// casDGOS::init()
//
caStatus casDGOS::init()
{
caStatus status;
this->eventSignalSem = semBCreate(SEM_Q_PRIORITY, SEM_EMPTY);
if (this->eventSignalSem == NULL) {
return S_cas_noMemory;
}
//
// init the base classes
//
status = this->casDGClient::init();
return status;
}
//
// casDGOS::~casDGOS()
//
casDGOS::~casDGOS()
{
if (taskIdVerify(this->clientTId)==OK) {
taskDelete(this->clientTId);
}
if (taskIdVerify(this->eventTId)==OK) {
taskDelete(this->eventTId);
}
if (this->eventSignalSem) {
semDelete(this->eventSignalSem);
}
}
//
// casDGOS::show()
//
void casDGOS::show(unsigned level)
{
this->casDGClient::show(level);
printf ("casDGOS at %p\n", this);
if (taskIdVerify(this->clientTId) == OK) {
taskShow(this->clientTId, level);
}
if (taskIdVerify(this->eventTId) == OK) {
printf("casDGOS task id = %x\n", this->eventTId);
}
if (this->eventSignalSem) {
semShow(this->eventSignalSem, level);
}
}
/*
* casClientStart ()
*/
caStatus casDGOS::start()
{
//
// no (void *) vxWorks task arg
//
assert (sizeof(int) >= sizeof(this));
this->clientTId = taskSpawn(
CAST_SRVR_NAME,
CAST_SRVR_PRI,
CAST_SRVR_OPT,
CAST_SRVR_STACK,
(FUNCPTR) casDGServer, // get your act together wrs
(int) this, // get your act together wrs
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
if (this->clientTId==ERROR) {
return S_cas_noMemory;
}
this->eventTId = taskSpawn(
CA_EVENT_NAME,
CA_CLIENT_PRI,
CA_CLIENT_OPT,
CAST_SRVR_STACK,
(FUNCPTR) casDGEvent, // get your act together wrs
(int) this, // get your act together wrs
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
if (this->eventTId==ERROR) {
return S_cas_noMemory;
}
return S_cas_success;
}
/*
* casDGOS::processInput ()
* - a noop
*/
casProcCond casDGOS::processInput ()
{
return casProcOk;
}
//
// casDGServer()
//
int casDGServer (casDGOS *pDGOS)
{
//
// block for the next DG until the connection closes
//
while (TRUE) {
pDGOS->process();
}
}
//
// casDGEvent()
//
int casDGEvent (casDGOS *pDGOS)
{
STATUS status;
casProcCond cond;
//
// Wait for event queue entry
//
while (TRUE) {
status = semTake(pDGOS->eventSignalSem, WAIT_FOREVER);
assert (status!=OK);
cond = pDGOS->eventSysProcess();
if (cond != casProcOk) {
printf("DG event sys process failed\n");
}
}
}

View File

@@ -1,112 +0,0 @@
//
// $Id$
//
// casOSD.h - Channel Access Server OS Dependent for posix
//
//
// Some BSD calls have crept in here
//
// $Log$
// Revision 1.6 1999/09/02 21:50:29 jhill
// o changed UDP to non-blocking IO
// o cleaned up (consolodated) UDP interface class structure
//
// Revision 1.5 1997/08/05 00:47:26 jhill
// fixed warnings
//
// Revision 1.4 1997/06/13 09:16:17 jhill
// connect proto changes
//
// Revision 1.3 1996/11/02 00:55:00 jhill
// many improvements
//
// Revision 1.2 1996/09/16 18:27:10 jhill
// vxWorks port changes
//
// Revision 1.1 1996/09/04 22:06:46 jhill
// installed
//
// Revision 1.1.1.1 1996/06/20 00:28:06 jhill
// ca server installation
//
//
#ifndef includeCASOSDH
#define includeCASOSDH
class caServerI;
class caServerOS;
//
// casBeaconTimer
//
class casBeaconTimer : public osiTimer {
public:
casBeaconTimer (const osiTime &delay, caServerOS &osIn) :
os (osIn), osiTimer(delay) {}
void expire();
const osiTime delay();
osiBool again();
const char *name()
{
return "casBeaconTimer";
}
private:
caServerOS &os;
int taskId;
};
class casServerReg;
class caServerOS;
//
// vxWorks task entry
//
void caServerEntry(caServerI *pCAS);
//
// caServerOS
//
class caServerOS {
friend class casServerReg;
friend void caServerEntry(caServerI *pCAS);
public:
caServerOS (caServerI &casIn) :
cas (casIn), pBTmr (NULL), tid(ERROR) {}
caStatus init ();
~caServerOS ();
inline caServerI * operator -> ();
private:
// caServerI &cas;
casBeaconTimer *pBTmr;
};
//
// casIntfOS
//
class casIntfOS : public casIntfIO, public tsDLNode<casIntfOS>
{
public:
casIntfOS (caServerI &casIn) :
cas (casIn), pRdReg (NULL) {}
caStatus init (caServerI &casIn, const caNetAddr &addr,
bool autoBeaconAddr, bool addConfigBeaconAddr);
~casIntfOS();
void recvCB ();
void sendCB () {}; // NOOP satifies template
casDGIO *newDGIO (casDGClient &dgClientIn) const;
private:
caServerI &cas;
int tid;
};
// no additions below this line
#endif // includeCASOSDH

View File

@@ -1,261 +0,0 @@
//
// casStreamOS.cc
// $Id$
//
//
// $Log$
// Revision 1.6 1998/09/24 20:53:54 jhill
// cosmetic
//
// Revision 1.5 1997/08/05 00:47:27 jhill
// fixed warnings
//
// Revision 1.4 1997/06/30 23:38:47 jhill
// use %p for pointers
//
// Revision 1.3 1996/11/02 00:55:01 jhill
// many improvements
//
// Revision 1.2 1996/09/16 18:27:11 jhill
// vxWorks port changes
//
// Revision 1.1 1996/09/04 22:06:46 jhill
// installed
//
// Revision 1.1.1.1 1996/06/20 00:28:06 jhill
// ca server installation
//
//
//
//
// CA server
//
#include<server.h>
#include <task_params.h> // EPICS task priorities
//
// casStreamOS::eventSignal()
//
void casStreamOS::eventSignal()
{
STATUS st;
st = semGive(this->eventSignalSem);
assert (st==OK);
}
//
// casStreamOS::eventFlush()
//
void casStreamOS::eventFlush()
{
this->flush();
}
//
// casStreamOS::casStreamOS()
//
casStreamOS::casStreamOS(caServerI &cas, casMsgIO &ioIn) :
casStrmClient(cas, ioIn),
eventSignalSem(NULL),
clientTId(NULL),
eventTId(NULL)
{
caStatus status;
this->eventSignalSem = semBCreate(SEM_Q_PRIORITY, SEM_EMPTY);
if (this->eventSignalSem == NULL) {
throw S_cas_noMemory;
}
//
// init the base classes
//
status = this->casStrmClient::init();
if (status) {
throw status;
}
}
//
// casStreamOS::~casStreamOS()
//
casStreamOS::~casStreamOS()
{
//
// attempt to flush out any remaining messages
//
this->flush();
if (taskIdVerify(this->clientTId)==OK &&
this->clientTId != taskIdSelf()) {
taskDelete(this->clientTId);
}
if (taskIdVerify(this->eventTId)==OK &&
this->eventTId != taskIdSelf()) {
taskDelete(this->eventTId);
}
if (this->eventSignalSem) {
semDelete(this->eventSignalSem);
}
}
//
// casStreamOS::show()
//
void casStreamOS::show(unsigned level)
{
this->casStrmClient::show(level);
printf("casStreamOS at %p\n", this);
if (taskIdVerify(this->clientTId)==OK) {
taskShow(this->clientTId, level);
}
if (taskIdVerify(this->eventTId)==OK) {
printf("casStreamOS task id %x\n", this->eventTId);
}
if (this->eventSignalSem) {
semShow(this->eventSignalSem, level);
}
}
//
// casClientStart ()
//
caStatus casStreamOS::start()
{
//
// no (void *) vxWorks task arg
//
assert (sizeof(int) >= sizeof(this));
this->clientTId = taskSpawn(
CA_CLIENT_NAME,
CA_CLIENT_PRI,
CA_CLIENT_OPT,
CA_CLIENT_STACK,
(FUNCPTR) casStrmServer, // get your act together wrs
(int) this, // get your act together wrs
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
if (this->clientTId==ERROR) {
return S_cas_noMemory;
}
this->eventTId = taskSpawn(
CA_EVENT_NAME,
CA_CLIENT_PRI,
CA_CLIENT_OPT,
CA_CLIENT_STACK,
(FUNCPTR) casStrmEvent, // get your act together wrs
(int) this, // get your act together wrs
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
if (this->eventTId==ERROR) {
return S_cas_noMemory;
}
return S_cas_success;
}
//
// casStreamOS::processInput()
//
casProcCond casStreamOS::processInput()
{
caStatus status;
# ifdef DEBUG
printf(
"Resp bytes to send=%d, Req bytes pending %d\n",
this->outBuf::bytesPresent(),
this->inBuf::bytesPresent());
# endif
status = this->processMsg();
switch (status) {
case S_cas_ioBlocked:
case S_cas_success:
return casProcOk;
default:
errMessage (status,
"unexpected error processing client's input");
return casProcDisconnect;
}
}
//
// casStrmServer()
//
int casStrmServer (casStreamOS *pStrmOS)
{
inBuf::fillCondition fillCond;
casProcCond procCond;
//
// block for the next message until the connection closes
//
while (TRUE) {
//
// copy in new messages
//
fillCond = pStrmOS->fill();
procCond = pStrmOS->processInput();
if (fillCond == casFillDisconnect ||
procCond == casProcDisconnect) {
delete pStrmOS;
//
// NO CODE HERE
// (see delete above)
//
return OK;
}
//
// force the output buffer to flush prior to
// blocking for more input (if no input bytes are
// pending)
//
if (pStrmOS->bytesAvailable()<=0u) {
pStrmOS->flush();
}
}
}
//
// casStrmEvent()
//
int casStrmEvent(casStreamOS *pStrmOS)
{
STATUS status;
casProcCond cond;
//
// Wait for event queue entry
//
while (TRUE) {
status = semTake(pStrmOS->eventSignalSem, WAIT_FOREVER);
assert (status==OK);
cond = pStrmOS->casEventSys::process();
if (cond != casProcOk) {
printf("Stream event sys process failed\n");
}
}
}