Compare commits

..

18 Commits

Author SHA1 Message Date
89dbcc1ccc avoid crash in vxWorks 6 when SNL name is long 2022-03-01 17:54:29 +01:00
3915c844ef disable compiler optimization section-anchors which caused problems in some SNL code 2022-03-01 14:47:48 +01:00
b8f2e72469 using (unnecessary) internal task flags fails in VxWorks 6 2022-03-01 14:44:34 +01:00
208dde05ed fix for SL6: make has no undefine 2022-02-17 16:55:55 +01:00
e7b0e072ce VxWorks 6.9 returns EISCONN when using sendto() with addr on TCP 2022-02-10 17:17:29 +01:00
75aa484a28 use git commit in version string if possible 2022-02-09 11:52:26 +01:00
afea9794a3 fix require VxWorks 6.9 compiler flags 2022-02-09 11:06:54 +01:00
911045f381 install header needed by iocmon module 2022-02-09 10:58:46 +01:00
f5df23b41f allow muitiple preprocessor lines at beginning of file 2022-02-09 10:57:48 +01:00
7198988be9 install headers needed by misc module 2022-02-07 11:07:24 +01:00
a536645042 don't build shared host libraries to avoid installing compatibility breaking libraries 2022-02-04 09:36:06 +01:00
542e9a79cf disable (unneeded) software incompatible with newer compilers 2022-02-04 09:36:06 +01:00
bfc70acdee Add cross compilation for VxWorks 6.9 2022-02-04 09:36:06 +01:00
6fcdcb625e make sure to build for 32 bit only as EPICS 3.13 is not 64 bit safe 2022-02-04 09:36:06 +01:00
3e11de6700 PSI preprocess rule 2022-02-04 09:36:06 +01:00
8add5e6d99 PSI config 2022-02-04 09:36:06 +01:00
zimoch
25eb8981d1 allow for variable system clock 2022-02-04 09:36:05 +01:00
zimoch
cdbeac4c8c SLS version of aai and aao. Main difference: record allocates buffer for array 2022-02-04 09:36:05 +01:00
21 changed files with 236 additions and 50 deletions

7
.gitignore vendored Normal file
View File

@@ -0,0 +1,7 @@
O.*
bin
dbd
include
lib
man
templates

View File

@@ -59,7 +59,7 @@ G++_STRICT = $(G++) -Wtraditional
#ARCH_DEP_CFLAGS = -D_X86_ -Dlinux -D_USE_BSD
ARCH_DEP_CFLAGS = -D_X86_ -Dlinux
ARCH_DEP_CFLAGS = -D_X86_ -Dlinux -m32
ARCH_DEP_LDFLAGS =
#glibc FAQ

View File

@@ -0,0 +1,18 @@
# CONFIG.Vx.ppc604_long,v 1.1.2.1 2002/12/05 20:44:26 jba Exp
#
# This file is maintained by the EPICS community.
# Vx GNU cross compiler suffix
CMPLR_SUFFIX = ppc
# For Vx directories of form:
# $(VX_DIR)/$(HOST_ARCH).$(ARCH_CLASS)/bin
ARCH_CLASS = ppc
# Architecture specific build flags
ARCH_DEP_CPPFLAGS = -mcpu=604 -D_GNU_TOOL -DTRUE=1
ARCH_DEP_CFLAGS = --no-builtin -mstrict-align -mlongcall
ARCH_DEP_CXXFLAGS = $(ARCH_DEP_CFLAGS)
# ARCH_DEP_CFLAGS+= -fsigned-char #May need for calcPerform.c

View File

@@ -0,0 +1,17 @@
# CONFIG.Vx.ppc604_long,v 1.1.2.1 2002/12/05 20:44:26 jba Exp
#
# This file is maintained by the EPICS community.
GCC_OPT_YES = -O2
# Vx GNU cross compiler suffix
CMPLR_SUFFIX = ppc
# For Vx directories of form:
# $(VX_DIR)/$(HOST_ARCH).$(ARCH_CLASS)/bin
ARCH_CLASS = ppc
# Architecture specific build flags
ARCH_DEP_CPPFLAGS = -mcpu=604 -DCPU=PPC604 -D_VXWORKS_COMPATIBILITY_MODE -DBSD=44
ARCH_DEP_CFLAGS = -mstrict-align -mlongcall -fno-implicit-fp -fno-strict-aliasing -fno-section-anchors
VENDOR_DEP_CFLAGS = -std=c99

View File

@@ -36,16 +36,19 @@ DIRS += dbtools
DIRS += rsrv
DIRS += rec
DIRS += as
DIRS += drv
DIRS += dev
DIRS += devOpt
#DIRS += drv
#DIRS += dev
DIRS += dev/softDev
DIRS += dev/symbDev
DIRS += dev/testDev
#DIRS += devOpt
DIRS += iocCore
#
# if CPLUSPLUS isnt empty then include C++ src codes
#
DIRS += $(patsubst %,gdd,$(strip $(CPLUSPLUS)))
DIRS += $(patsubst %,cas,$(strip $(CPLUSPLUS)))
#DIRS += $(patsubst %,gdd,$(strip $(CPLUSPLUS)))
#DIRS += $(patsubst %,cas,$(strip $(CPLUSPLUS)))
EPICS_BASE = $(TOP)

View File

@@ -8,6 +8,7 @@
# only.
#
INSTALL_LOCATION=/usr/local/epics/base-3.13.10
# The host architecture performing the build,
# i.e.: the arch running DCT/getrel/etc.
@@ -54,7 +55,7 @@ endif
# sbs_pc6
# vxipc
#
CROSS_COMPILER_TARGET_ARCHS=
CROSS_COMPILER_TARGET_ARCHS=T2-ppc604 V69-ppc604
# If only a subset of the host architectures perform

View File

@@ -0,0 +1,9 @@
VX_DIR = /afs/psi.ch/project/vxworks/Tornado2.2
GCC = $(GNU_BIN)/cc$(CMPLR_SUFFIX)
CPP = $(GNU_BIN)/cc$(CMPLR_SUFFIX) -x c -E
G++ = $(GNU_BIN)/cc$(CMPLR_SUFFIX)
# Compiler bug: Optimization corrupts floating point calculations
VX_OPT = NO
GCC_OPT_NO =

View File

@@ -0,0 +1,20 @@
VXWORKS_VERSION = 6.9
VXWORKS_MAJOR_VERSION = 6
WIND_HOST_TYPE = x86-linux2
WIND_BASE=/afs/psi.ch/project/vxworks/VxWorks$(VXWORKS_VERSION)
LD_LIBRARY_PATH+=:$(WIND_BASE)/lmapi-5.0/$(WIND_HOST_TYPE)/lib
export WIND_BASE LD_LIBRARY_PATH
VX_DIR = $(WIND_BASE)/vxworks-$(VXWORKS_VERSION)
OP_SYS_INCLUDES += -I$(VX_DIR)/target/h/wrn/coreip
GNU_DIR := $(wildcard $(WIND_BASE)/gnu/*-vxworks-*/$(WIND_HOST_TYPE))
GNU_BIN = $(GNU_DIR)/bin
GCC_EXEC_PREFIX = $(GNU_DIR)/libexec/gcc
GCC = $(GNU_BIN)/cc$(CMPLR_SUFFIX)
CPP = $(GNU_BIN)/cc$(CMPLR_SUFFIX) -x c -E
G++ = $(GNU_BIN)/cc$(CMPLR_SUFFIX)
NM = $(VX_DIR)/host/binutils/$(WIND_HOST_TYPE)/bin/nm$(CMPLR_SUFFIX)

View File

@@ -160,10 +160,12 @@ endif
$(SNC) $(TARGET_SNCFLAGS) $(SNCFLAGS) $*.i
%.c: ../%.stt
@echo "converting $<"
ln -s $< $*.st
$(SNC) $(TARGET_SNCFLAGS) $(SNCFLAGS) $*.st
@$(RM) $*.st
@echo "preprocessing $*.stt"
@$(RM) $*.i
$(CPP) $(CPPFLAGS) $(CPPSNCFLAGS) $< > $*.i
@echo "converting $*.i"
@$(RM) $@
$(SNC) $(TARGET_SNCFLAGS) $(SNCFLAGS) $*.i
# Capfast Rules:
%.db: %.edf

View File

@@ -21,6 +21,9 @@ LIBOBJS = \
repeater.o conn.o syncgrp.o if_depen.o bsd_depen.o vxWorks_depen.o \
catime.o convert.o
#needed by misc module
INC = addrList.h net_convert.h
LIBNAME = caLib
include $(TOP)/config/RULES.Vx

View File

@@ -56,6 +56,9 @@ LIBOBJS = \
dbcar.o \
devLib.o
#needed by iocmon module
INC = dbCa.h
PROD += initHooks.o
LIBNAME = dbLib

View File

@@ -32,6 +32,7 @@ $ver_str = "$ver_str.$upd_name" if $upd_name;
$ver_str = "$ver_str.$upd_level" if $upd_level;
print "Found EPICS Version $ver_str\n";
$git_commit = `git describe --always --dirty 2>/dev/null` and chomp($git_commit), $cvs_date=$git_commit;
open OUT, ">epicsVersion.h";

View File

@@ -1,10 +1,3 @@
/*************************************************************************\
* Copyright (c) 2002 Southeastern Universities Research Association, as
* Operator of Thomas Jefferson National Accelerator Facility.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* recAai.c */
/* recAai.c - Record Support Routines for Array Analog In records */
@@ -13,6 +6,36 @@
* Current Author: Dave Barker
* Date: 10/24/93
*
* C E B A F
*
* Continuous Electron Beam Accelerator Facility
* Newport News, Virginia, USA.
*
* Copyright SURA CEBAF 1993.
*
* Experimental Physics and Industrial Control System (EPICS)
*
* Copyright 1991, the Regents of the University of California,
* and the University of Chicago Board of Governors.
*
* This software was produced under U.S. Government contracts:
* (W-7405-ENG-36) at the Los Alamos National Laboratory,
* and (W-31-109-ENG-38) at Argonne National Laboratory.
*
* Initial development by:
* The Controls and Automation Group (AT-8)
* Ground Test Accelerator
* Accelerator Technology Division
* Los Alamos National Laboratory
*
* Co-developed with
* The Controls and Computing Group
* Accelerator Systems Division
* Advanced Photon Source
* Argonne National Laboratory
*
* Modification Log:
* -----------------
*/
#include <vxWorks.h>
@@ -83,6 +106,7 @@ struct aaidset { /* aai dset */
DEVSUPFUN init_record; /*returns: (-1,0)=>(failure,success)*/
DEVSUPFUN get_ioint_info;
DEVSUPFUN read_aai; /*returns: (-1,0)=>(failure,success)*/
DEVSUPFUN special_linconv;
};
/*sizes of field types*/
@@ -102,6 +126,17 @@ static long init_record(paai,pass)
if (pass==0){
if(paai->nelm<=0) paai->nelm=1;
if(paai->ftvl == 0) {
paai->bptr = (char *)calloc(paai->nelm,MAX_STRING_SIZE);
} else {
if(paai->ftvl>DBF_ENUM) paai->ftvl=2;
paai->bptr = (char *)calloc(paai->nelm,sizeofTypes[paai->ftvl]);
}
if(paai->nelm==1) {
paai->nord = 1;
} else {
paai->nord = 0;
}
return(0);
}
recGblInitConstantLink(&paai->siml,DBF_USHORT,&paai->simm);
@@ -184,8 +219,10 @@ static long get_array_info(paddr,no_elements,offset)
long *offset;
{
struct aaiRecord *paai=(struct aaiRecord *)paddr->precord;
/*
*no_elements = paai->nelm;
*/
*no_elements = paai ->nord;
*offset = 0;
return(0);
}
@@ -196,7 +233,11 @@ static long put_array_info(paddr,nNew)
{
struct aaiRecord *paai=(struct aaiRecord *)paddr->precord;
/*
paai->nelm = nNew;
*/
paai->nord = nNew;
if(paai->nord > paai->nelm) paai->nord = paai->nelm;
return(0);
}

View File

@@ -1,14 +1,3 @@
/*************************************************************************\
* Copyright (c) 2002 Southeastern Universities Research Association, as
* Operator of Thomas Jefferson National Accelerator Facility.
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
* National Laboratory.
* Copyright (c) 2002 The Regents of the University of California, as
* Operator of Los Alamos National Laboratory.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* recAao.c */
/* recAao.c - Record Support Routines for Array Analog Out records */
@@ -16,6 +5,37 @@
* Original Author: Dave Barker
* Current Author: Dave Barker
* Date: 10/28/93
*
* C E B A F
*
* Continuous Electron Beam Accelerator Facility
* Newport News, Virginia, USA.
*
* Copyright SURA CEBAF 1993.
*
* Experimental Physics and Industrial Control System (EPICS)
*
* Copyright 1991, the Regents of the University of California,
* and the University of Chicago Board of Governors.
*
* This software was produced under U.S. Government contracts:
* (W-7405-ENG-36) at the Los Alamos National Laboratory,
* and (W-31-109-ENG-38) at Argonne National Laboratory.
*
* Initial development by:
* The Controls and Automation Group (AT-8)
* Ground Test Accelerator
* Accelerator Technology Division
* Los Alamos National Laboratory
*
* Co-developed with
* The Controls and Computing Group
* Accelerator Systems Division
* Advanced Photon Source
* Argonne National Laboratory
*
* Modification Log:
* -----------------
*/
#include <vxWorks.h>
@@ -84,6 +104,7 @@ struct aaodset { /* aao dset */
DEVSUPFUN init_record; /*returns: (-1,0)=>(failure,success)*/
DEVSUPFUN get_ioint_info;
DEVSUPFUN write_aao; /*returns: (-1,0)=>(failure,success)*/
DEVSUPFUN special_linconv;
};
/*sizes of field types*/
@@ -103,6 +124,17 @@ static long init_record(paao,pass)
if (pass==0){
if(paao->nelm<=0) paao->nelm=1;
if(paao->ftvl == 0) {
paao->bptr = (char *)calloc(paao->nelm,MAX_STRING_SIZE);
} else {
if(paao->ftvl>DBF_ENUM) paao->ftvl=2;
paao->bptr = (char *)calloc(paao->nelm,sizeofTypes[paao->ftvl]);
}
if(paao->nelm==1) {
paao->nord = 1;
} else {
paao->nord = 0;
}
return(0);
}
recGblInitConstantLink(&paao->siml,DBF_USHORT,&paao->simm);
@@ -182,8 +214,11 @@ static long get_array_info(paddr,no_elements,offset)
long *offset;
{
struct aaoRecord *paao=(struct aaoRecord *)paddr->precord;
/*
*no_elements = paao->nelm;
*/
*no_elements = paao ->nord;
*offset = 0;
return(0);
}
@@ -194,7 +229,12 @@ static long put_array_info(paddr,nNew)
{
struct aaoRecord *paao=(struct aaoRecord *)paddr->precord;
/*
paao->nelm = nNew;
*/
paao->nord = nNew;
if(paao->nord > paao->nelm) paao->nord = paao->nelm;
return(0);
}

View File

@@ -20,6 +20,9 @@ OBJS = \
caserverio.o caservertask.o camsgtask.o camessage.o \
rsrv_init.o cast_server.o online_notify.o globalsource.o
#needed by misc module
INC = server.h
PROD = rsrvLib
include $(TOP)/config/RULES.Vx

View File

@@ -121,6 +121,13 @@ int lock_needed;
while(pclient->send.stk&&!pclient->disconnect){
if (pclient->proto == IPPROTO_TCP)
status = send(
pclient->sock,
pclient->send.buf,
pclient->send.stk,
NULL);
else
status = sendto(
pclient->sock,
pclient->send.buf,

View File

@@ -144,7 +144,7 @@ typedef struct state_program SPROG;
/* Task parameters */
#define SPAWN_STACK_SIZE 10000
#define SPAWN_OPTIONS VX_DEALLOC_STACK | VX_FP_TASK | VX_STDIO
#define SPAWN_OPTIONS VX_FP_TASK | VX_STDIO
#define SPAWN_PRIORITY 100
/* Function declarations for internal sequencer funtions */

View File

@@ -23,6 +23,7 @@
#define ANSI
#include "seq.h"
#include "tickLib.h"
#include "sysLib.h"
#include "logLib.h"
/* See seqCom.h for function prototypes (ANSI standard) */
@@ -108,7 +109,7 @@ long seq_pvGet(SS_ID ssId, long pvId)
}
/* Synchronous (-a option): wait for completion (10s timeout) */
sem_status = semTake(pSS->getSemId, 600);
sem_status = semTake(pSS->getSemId, sysClkRateGet()*10);
if (sem_status != OK)
{
logMsg ("semTake error=%d\n", sem_status, 0,0,0,0,0);
@@ -538,7 +539,7 @@ VOID seq_delayInit(SS_ID ssId, long delayId, float delay)
pSS = (SSCB *)ssId;
/* Convert delay time to tics & save */
pSS->delay[delayId] = delay * 60.0;
pSS->delay[delayId] = delay * sysClkRateGet();
ndelay = delayId + 1;
if (ndelay > pSS->numDelays)

View File

@@ -38,6 +38,7 @@
#include "seq.h"
#include "usrLib.h"
#include "tickLib.h"
#include "sysLib.h"
#include "string.h"
/* User functions */
@@ -62,6 +63,7 @@ int tid;
STATE *pST;
int nss, status;
float time;
float clockrate;
char file_name[100];
/* convert (possible) name to task id */
@@ -100,6 +102,7 @@ int tid;
printf("\n");
/* Print state set info */
clockrate=sysClkRateGet();
for (nss = 0, pSS = pSP->pSS; nss < pSP->numSS; nss++, pSS++)
{
printf(" State Set: \"%s\"\n", pSS->pSSName);
@@ -118,7 +121,7 @@ int tid;
pST = pSS->pStates + pSS->prevState;
printf(" Previous state = \"%s\"\n", pST->pStateName);
time = (tickGet() - pSS->timeEntered)/60.0;
time = (tickGet() - pSS->timeEntered)/clockrate;
printf("\tElapsed time since state was entered = %.1f seconds)\n",
time);
#ifdef DEBUG
@@ -157,7 +160,7 @@ char *pStr; /* optional pattern matching string */
return 0;
}
pSP = seqQryFind(tid);
if (tid == NULL)
if (tid == 0)
return 0;
printf("State Program: \"%s\"\n", pSP->pProgName);

View File

@@ -47,6 +47,7 @@
#include "taskwd.h"
#include "logLib.h"
#include "tickLib.h"
#include "sysLib.h"
#include "taskVarLib.h"
/* Function declarations */
@@ -75,7 +76,6 @@ char *pTaskName; /* Parent task name */
char task_name[TASK_NAME_SIZE+10];
extern VOID ss_entry();
extern int seqAuxTaskId;
pSP->taskId = taskIdSelf(); /* my task id */
pSS = pSP->pSS;
pSS->taskId = pSP->taskId;
@@ -89,15 +89,11 @@ char *pTaskName; /* Parent task name */
/* Initiate connect & monitor requests to database channels. */
seq_connect(pSP);
/* Additional state set task names are derived from the first ss */
if (strlen(pTaskName) > TASK_NAME_SIZE)
pTaskName[TASK_NAME_SIZE] = 0;
/* Create each additional state set task */
for (nss = 1, pSS = pSP->pSS + 1; nss < pSP->numSS; nss++, pSS++)
{
/* Form task name from program name + state set number */
sprintf(task_name, "%s_%d", pTaskName, nss);
sprintf(task_name, "%.*s_%d", TASK_NAME_SIZE, pTaskName, nss);
/* Spawn the task */
task_id = taskSpawn(
@@ -242,9 +238,11 @@ SSCB *pSS;
LOCAL VOID seq_waitConnect(SPROG *pSP, SSCB *pSS)
{
STATUS status;
long _10sec;
long delay;
delay = 600; /* 10, 20, 30, 40, 40,... sec */
_10sec = sysClkRateGet()*10;
delay = _10sec; /* 10, 20, 30, 40, 40,... sec */
while (pSP->connCount < pSP->assignCount)
{
status = semTake(pSS->syncSemId, delay);
@@ -253,8 +251,8 @@ LOCAL VOID seq_waitConnect(SPROG *pSP, SSCB *pSS)
logMsg("%d of %d assigned channels have connected\n",
pSP->connCount, pSP->assignCount, 0,0,0,0);
}
if (delay < 2400)
delay = delay + 600;
if (delay < 4*_10sec)
delay = delay + _10sec;
}
}
/*
@@ -379,7 +377,8 @@ int tid; /* task being deleted */
SPROG *pSP;
SEM_ID cleanupSem;
int status;
int _10sec;
pSP = seqFindProg(tid);
if (pSP == NULL)
return -1; /* not a state program task */
@@ -392,9 +391,10 @@ int tid; /* task being deleted */
(FUNCPTR)seq_cleanup, tid, (int)pSP, (int)cleanupSem, 0,0,0,0,0,0,0);
/* Wait for cleanup task completion */
_10sec = sysClkRateGet()*10;
for (;;)
{
status = semTake(cleanupSem, 600);
status = semTake(cleanupSem, _10sec);
if (status == OK)
break;
logMsg("sprog_delete waiting for seq_cleanup\n", 0,0,0,0,0,0);
@@ -418,7 +418,7 @@ LOCAL long seq_cleanup(int tid, SPROG *pSP, SEM_ID cleanupSem)
#endif /*DEBUG_CLEANUP*/
/* Wait for log semaphore (in case a task is doing a write) */
semTake(pSP->logSemId, 600);
semTake(pSP->logSemId, sysClkRateGet()*10);
/* Remove tasks' watchdog & suspend all state set tasks except self */
#ifdef DEBUG_CLEANUP

View File

@@ -109,8 +109,8 @@ extern int line_num; /* input file line no. */
state_program /* define a state program */
: program_name definitions state_set_list { program($3); }
| program_name definitions state_set_list global_c { program($3); }
| pp_code program_name definitions state_set_list { program($4); }
| pp_code program_name definitions state_set_list global_c{ program($4); }
| pp_codes program_name definitions state_set_list { program($4); }
| pp_codes program_name definitions state_set_list global_c{ program($4); }
| error { snc_err("state program"); }
;
@@ -374,7 +374,14 @@ for_stmt
pp_code /* pre-processor code (e.g. # 1 "test.st") */
: PP_SYMBOL NUMBER STRING CR { pp_code($2, $3, ""); }
| PP_SYMBOL NUMBER CR { pp_code($2, 0, ""); }
| PP_SYMBOL NUMBER STRING NUMBER CR { pp_code($2, $3, $4); }
| PP_SYMBOL STRING CR { /* Silently consume #pragma lines */ }
;
pp_codes /* one or more pp_code */
: pp_code
| pp_codes pp_code
;
global_c