Status of iocCore port

Marty Kraimer
Nov 18, 1999

This is a brief status of the iocCore port, what has changed since my last commit, and what needs to be done before we can run iocCore on something besides vxWorks.

In the following I state things as though the only remaining thing to do is implement osiSem and osiThread for other posixIOC. I realize that a bunck of problems will arise elsewhere when this is done but I really hope any such problems are minor.

Note also that I have only built for solaris and vxWorks.

makeBaseApp

The example does not work with the configure rules. We are working on this problem.

Make

Trying to build everything via a single Makefile in each source directory became too complicated. Janet has redone the build using Makefile.Host and Makefile.Ioc

We still are not handling single vs multithreaded properly. For now Makefile.Host is single threaded, Makefile.Ioc is multithreaded.

libCom

The osiXXX routines are very similar to what was previously checked in. Janet has implemented a generic version of osiWatchDog using Jeff's osiTimer. Thus for ports to other operating systems only osiSem and osiThread need to be implemented.

osiSem has changed since the last commit:

Some comments for Jeff ToDo before demonstration of iocCore of something besides vxWorks

Channel Access

In ca/os/posixIOC I have created files caOsDependent.h and caOsDependent..c. I hope that these are close to what is needed for a pthreads version of iocCore. Until osiSem and osiThread are implemented for posix this code can not be tested. See details about channel access below.
 

CASR

I deleted caswatchdog.c. It was not being built.

src/vxWorks

All vxWorks specific code is moved to src/vxWorks. If you are building for something besides vxWorks just comment out the build for vxWorks in src/Makefile.

Sequencer

The old sequencer has been moved to src/vxWorks. This is for compatibilty for existing vxWorks applications.

This version of the sequencer will not work on IOCS using the posixIOC version of Channel Access. The reason is the calls to ca_import and ca_import_cancel. The technique used for vxWorks will not work (at least easily) for pthreads since pthreads does not have task variables like vxWorks. Thus this needs to be rethought. Perhaps William already has solved this problem in his unbundled version of the sequencer.

RTMS

The following needs  to be done.

Details of CA conversion

This is mainly of interest to Jeff. I will guess that Jeff will want to restructure the code so these are notes about what I did.

As we knew up frount, the biggest problem was the use of the vxWorks task variable facility. This is used because ca clients do not have to call ca_initialize or pass a ca private pointer to each ca_xxx library routine.  I looked at what pthreads supports and came up with the following solution.

iocinf.h previously had the statements

GLBLTYPE struct CA_STATIC *ca_static;
This is replaced by the statements
#include "caOsDependent.h"
CA_OSD_CA_STATIC
caOsDependent.h is created in each ca/os/xxx directory. For posix (single threaded), vms, vxWorks, and win32 it just nhas the definitions:
#define CA_OSD_CA_STATIC \
 GLBLTYPE CA_STATIC *ca_static;
#define CA_OSD_GET_CA_STATIC
For posixIOC it is defined as:
#include <pthread.h>
#define CA_OSD_CA_STATIC \
        extern pthread_key_t *pca_key;
#define CA_OSD_GET_CA_STATIC \
  CA_STATIC *ca_static=(CA_STATIC *)pthread_getspecific(*pca_key);
Then each ca public routine (those defined in cadef.h) that use ca_static have
CA_OSD_GET_CA_STATIC
as the last definition at the start of the routine. A look at ca_task_initialize in ca/os/posixIOC/caOsDependent.c shows how things are initialized for a pthread implementation.

Most of the private ca routines (defined internally or in iocinf.h) that use ca_static were modified to have ca_static as their first argument.

Now for some details

V5_vxWorks_patch.c seemed to be obsolete code. It is gone.

The following are no longer part of the os specific code.

The following should not be part of the os specific code. Can we put them somewhere else? Maybe ca/bsd_depen.c ?


vxWorks_depen.c is now ca/os/vxWorks/caOsDependent.c. In addition

posix_depen.c is now ca/os/posix/caOsDependent.c.
 

ca/os/posixIOC/caOsDependent is the os specific code for a pthread implementation. Since osiSem and osiThread are not implemented for pthread I can not test this code. I hope it is close to ,what is needed.

vms_depen.c is now /home/phoebus/MRK/epics/base/src/ca/os/vms/caOsDependent.c. I removed the routines no longer needed. I can not test this.

windows_depen.c is now ca/os/win32/caOsDependent.c. I removed the routines no longer needed. I can not test this. Note that you will also want an IOC version.