Merged changes from 3.14 branch

Up to revno 12420 inclusive.
This commit is contained in:
Andrew Johnson
2013-06-07 18:08:38 -05:00
27 changed files with 246 additions and 153 deletions

View File

@ -75,9 +75,12 @@ INSTALL_DBD = $(INSTALL_LOCATION)/dbd
INSTALL_DB = $(INSTALL_LOCATION)/db
INSTALL_CONFIG = $(INSTALL_LOCATION)/configure
#Directory for OS independant build created files
# Directory for OS independant build created files
COMMON_DIR = ../O.Common
# The IOC's path to $(TOP), may be overridden inside the application
IOCS_APPL_TOP = $(INSTALL_LOCATION)
#-------------------------------------------------------
# Make echo output - suppress echoing if make's '-s' flag is set
NOP = :

View File

@ -389,8 +389,7 @@ $(foreach file, $(DB_INSTALLS), $(eval $(call DB_INSTALLS_template, $(file))))
##################################################### register record,device,driver support
IOC_INST_TOP := $(firstword $(IOCS_APPL_TOP) \
$(shell $(PERL) $(TOOLS)/fullPathName.pl $(INSTALL_LOCATION) ) )
IOC_INST_TOP := $(shell $(PERL) $(TOOLS)/fullPathName.pl $(IOCS_APPL_TOP) )
%_registerRecordDeviceDriver.cpp: $(COMMON_DIR)/%.dbd
@$(RM) $@

View File

@ -1,13 +1,13 @@
#*************************************************************************
# Copyright (c) 2002 The University of Chicago, as Operator of Argonne
# Copyright (c) 2013 UChicago Argonne LLC, 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
# EPICS BASE is distributed subject to a Software License Agreement found
# in file LICENSE that is included with this distribution.
#*************************************************************************
#RULES.ioc
include $(CONFIG)/RULES_DIRS
build$(DIVIDER)$(ARCH) build: buildInstall
@ -15,23 +15,18 @@ install$(DIVIDER)$(ARCH) install: buildInstall
$(ARCH): buildInstall
ifeq ($(filter $(ARCH),$(BUILD_ARCHS)),$(ARCH))
buildInstall$(DIVIDER)$(ARCH) buildInstall: $(TARGETS)
buildInstall$(DIVIDER)$(ARCH) buildInstall: $(TARGETS)
clean$(DIVIDER)$(ARCH) clean:
clean$(DIVIDER)$(ARCH) clean:
$(RM) cdCommands envPaths dllPath.bat
else
buildInstall$(DIVIDER)$(ARCH) buildInstall:
clean$(DIVIDER)$(ARCH) clean:
buildInstall$(DIVIDER)$(ARCH) buildInstall:
clean$(DIVIDER)$(ARCH) clean:
endif
cdCommands envPaths dllPath.bat: $(wildcard $(TOP)/configure/RELEASE*) \
$(TOP)/configure/CONFIG $(INSTALL_BIN)
ifeq ($(IOCS_APPL_TOP),)
$(PERL) $(TOOLS)/convertRelease.pl -a $(ARCH) $@
else
$(wildcard $(TOP)/configure/CONFIG_SITE*) $(INSTALL_BIN)
$(PERL) $(TOOLS)/convertRelease.pl -a $(ARCH) -t $(IOCS_APPL_TOP) $@
endif
realclean:
$(RM) cdCommands envPaths dllPath.bat

View File

@ -63,11 +63,11 @@ help:
@echo " rebuild - Same as clean install"
@echo " archclean - Removes O.<arch> dirs but not O.Common dir"
@echo "\"Partial\" build targets supported by Makefiles:"
@echo " inc.<arch> - Installs <arch> only header files."
@echo " build.<arch> - Builds and installs <arch> only."
@echo " install.<arch> - Builds and installs <arch> only."
@echo " clean.<arch> - Cleans <arch> binaries in O.<arch> dirs only."
@echo " uninstall.<arch> - Remove bin & lib directories for <arch> only."
@echo " inc$(DIVIDER)<arch> - Installs <arch> only header files."
@echo " build$(DIVIDER)<arch> - Builds and installs <arch> only."
@echo " install$(DIVIDER)<arch> - Builds and installs <arch> only."
@echo " clean$(DIVIDER)<arch> - Cleans <arch> binaries in O.<arch> dirs only."
@echo " uninstall$(DIVIDER)<arch> - Remove bin & lib directories for <arch> only."
@echo "Targets supported by top level Makefile:"
@echo " archuninstall - Remove bin & lib directories created by this hostarch."
@echo " uninstall - Remove install directories created by this hostarch."

View File

@ -1938,8 +1938,8 @@ Termination Appear to be Ignored</a></h3>
<p>Short lived CA client applications that issue a CA put request and then
immediately exit the process (return from <code>main</code> or call
<code>exit</code>) may find that there request isn't executed. To guarantee
that the request is sent call <code>ca_flush</code> followed by
<code>ca_context_destroy</code> prior to terminating the process.</p>
that the request is sent call <code>ca_flush_io()</code> followed by
<code>ca_context_destroy()</code> prior to terminating the process.</p>
<h3><a name="Problems">ENOBUFS Messages</a></h3>
@ -2648,7 +2648,7 @@ get called in the correct order.</p>
resources used by the client library such as sockets and allocated memory are
automatically released by the system when the process exits and
ca_context_destroy() hasn't been called, but on light weight systems such as
vxWorks or RTEMS no cleanup occurs unless the application call
vxWorks or RTEMS no cleanup occurs unless the application calls
ca_context_destroy().</p>
<h4>Returns</h4>
@ -2661,16 +2661,10 @@ ca_context_destroy().</p>
<h3><code><a name="ca_create_channel">ca_create_channel()</a></code></h3>
<pre>#include &lt;cadef.h&gt;
typedef void ( *pCallBack ) (
struct connection_handler_args );
int ca_create_channel
(
const char *PROCESS_VARIABLE_NAME,
caCh *USERFUNC,
void *PUSER,
capri priority,
chid *PCHID
);</pre>
typedef void ( caCh ) (struct connection_handler_args);
int ca_create_channel (const char *PVNAME,
caCh *USERFUNC, void *PUSER,
capri PRIORITY, chid *PCHID );</pre>
<h4>Description</h4>
@ -2719,7 +2713,7 @@ time.</p>
<h4>Arguments</h4>
<dl>
<dt><code>PROCESS_VARIABLE_NAME</code></dt>
<dt><code>PVNAME</code></dt>
<dd>A nil terminated process variable name string. EPICS process control
function block database variable names are of the form "&lt;record
name&gt;.&lt;field name&gt;". If the field name and the period separator
@ -2818,17 +2812,15 @@ subscriptions (monitors) registered with the channel.</p>
<pre>#include &lt;cadef.h&gt;
int ca_put ( chtype TYPE,
chid CHID, void *PVALUE );
int ca_array_put ( chtype TYPE,
unsigned long COUNT,
int ca_array_put ( chtype TYPE, unsigned long COUNT,
chid CHID, const void *PVALUE);
typedef void ( *pCallBack ) (struct event_handler_args );
typedef void ( caEventCallBackFunc ) (struct event_handler_args);
int ca_put_callback ( chtype TYPE,
chid CHID, const void *PVALUE,
pCallBack PFUNC, void *USERARG );
int ca_array_put_callback ( chtype TYPE,
unsigned long COUNT,
caEventCallBackFunc PFUNC, void *USERARG );
int ca_array_put_callback ( chtype TYPE, unsigned long COUNT,
chid CHID, const void *PVALUE,
pCallBack PFUNC, void *USERARG );</pre>
caEventCallBackFunc PFUNC, void *USERARG );</pre>
<h4>Description</h4>
@ -2948,12 +2940,13 @@ int ca_get ( chtype TYPE,
chid CHID, void *PVALUE );
int ca_array_get ( chtype TYPE, unsigned long COUNT,
chid CHID, void *PVALUE );
typedef void ( *pCallBack ) (struct event_handler_args );
typedef void ( caEventCallBackFunc ) (struct event_handler_args);
int ca_get_callback ( chtype TYPE,
chid CHID, pCallBack USERFUNC, void *USERARG);
chid CHID,
caEventCallBackFunc USERFUNC, void *USERARG);
int ca_array_get_callback ( chtype TYPE, unsigned long COUNT,
chid CHID,
pCallBack USERFUNC, void *USERARG );</pre>
caEventCallBackFunc USERFUNC, void *USERARG);</pre>
<h4>Description</h4>
@ -3051,11 +3044,10 @@ when a CA get request is initiated.</p>
<h3><code><a name="ca_add_event">ca_create_subscription()</a></code></h3>
<pre>#include &lt;cadef.h&gt;
typedef void ( *pCallBack ) (
struct event_handler_args );
int ca_create_subscription ( chtype TYPE,
unsigned long COUNT, chid CHID,
unsigned long MASK, pCallBack USERFUNC, void *USERARG,
typedef void ( caEventCallBackFunc ) (struct event_handler_args);
int ca_create_subscription ( chtype TYPE, unsigned long COUNT,
chid CHID, unsigned long MASK,
caEventCallBackFunc USERFUNC, void *USERARG,
evid *PEVID );</pre>
<h4>Description</h4>
@ -3540,7 +3532,7 @@ get the lowest latency response to the arrival of CA messages.</p>
<h3><code><a name="ca_replace_printf_handler">ca_replace_printf_handler
()</a></code></h3>
<pre>#include &lt;cadef.h&gt;
typedef int caPrintfFunc ( const char *pFromat, va_list args );
typedef int caPrintfFunc ( const char *pFormat, va_list args );
int ca_replace_printf_handler ( caPrintfFunc *PFUNC );</pre>
<h4>Description</h4>
@ -3571,8 +3563,9 @@ SEVCHK ( status, "failed to install my printf handler" );</pre>
<h3><code><a name="ca_replace">ca_replace_access_rights_event()</a></code></h3>
<pre>#include &lt;cadef.h&gt;
typedef void ( *pCallBack )( struct access_rights_handler_args );
int ca_replace_access_rights_event ( chid CHAN, pCallBack PFUNC );</pre>
typedef void ( caEventCallBackFunc )(struct access_rights_handler_args);
int ca_replace_access_rights_event ( chid CHAN,
caEventCallBackFunc PFUNC );</pre>
<h4>Description</h4>
@ -4029,7 +4022,7 @@ SEVCHK ( status, Sync group delete failed );</pre>
<h3><code><a name="ca_sg_block">ca_sg_block()</a></code></h3>
<pre>#include &lt;cadef.h&gt;
int ca_sg_block ( CA_SYNC_GID GID, double timeout );</pre>
int ca_sg_block ( CA_SYNC_GID GID, double TIMEOUT );</pre>
<h4>Description</h4>
@ -4050,13 +4043,16 @@ access background activity while it is waiting.</p>
<h4>Arguments</h4>
<dl>
<dt>GID</dt>
<dt><code>GID</code></dt>
<dd>Identifier of the synchronous group.</dd>
<dt><code>TIMEOUT</code></dt>
<dd>The duration to block in this routine in seconds. A timeout of zero
seconds blocks forever.</dd>
</dl>
<h4>Examples</h4>
<pre>CA_SYNC_GID gid;
status = ca_sg_block(gid);
status = ca_sg_block(gid, 0.0);
SEVCHK(status, Sync group block failed);</pre>
<h4>Returns</h4>
@ -4267,8 +4263,8 @@ reissued.</p>
<h3><code><a name="ca_client_status">ca_client_status()</a></code></h3>
<pre>int ca_client_status ( unsigned level );
int ca_context_status ( struct ca_client_context *,
unsigned level );</pre>
int ca_context_status ( struct ca_client_context *CONTEXT,
unsigned LEVEL );</pre>
<h4>Description</h4>
@ -4279,7 +4275,7 @@ ca_client_status() prints information about the calling threads CA context.</p>
<h4>Arguments</h4>
<dl>
<dt><code>CONTEXT</code></dt>
<dd>A pointer to the CA context to join with.</dd>
<dd>A pointer to the CA context to examine.</dd>
<dt><code>LEVEL</code></dt>
<dd>The interest level. Increasing level produces increasing detail.</dd>
</dl>

View File

@ -755,6 +755,11 @@ long dbWriteRecordFP(
dctonly = ((level>1) ? FALSE : TRUE);
dbInitEntry(pdbbase,pdbentry);
if (precordTypename) {
if (*precordTypename == 0 || *precordTypename == '*')
precordTypename = 0;
}
if(!precordTypename) {
status = dbFirstRecordType(pdbentry);
if(status) {
@ -851,6 +856,10 @@ long dbWriteMenuFP(DBBASE *pdbbase,FILE *fp,const char *menuName)
fprintf(stderr,"pdbbase not specified\n");
return(-1);
}
if (menuName) {
if (*menuName == 0 || *menuName == '*')
menuName = 0;
}
pdbMenu = (dbMenu *)ellFirst(&pdbbase->menuList);
while(pdbMenu) {
if(menuName) {
@ -896,6 +905,11 @@ long dbWriteRecordTypeFP(
fprintf(stderr,"pdbbase not specified\n");
return(-1);
}
if (recordTypeName) {
if (*recordTypeName == 0 || *recordTypeName == '*')
recordTypeName = 0;
}
for(pdbRecordType = (dbRecordType *)ellFirst(&pdbbase->recordTypeList);
pdbRecordType; pdbRecordType = (dbRecordType *)ellNext(&pdbRecordType->node)) {
if(recordTypeName) {
@ -3172,8 +3186,9 @@ void dbDumpDevice(DBBASE *pdbbase,const char *recordTypeName)
devSup *pdevSup;
int gotMatch;
if(recordTypeName) {
if(recordTypeName[0]==0 || recordTypeName[0] == '*') recordTypeName = 0;
if (recordTypeName) {
if (*recordTypeName == 0 || *recordTypeName == '*')
recordTypeName = 0;
}
if(!pdbbase) {
fprintf(stderr,"pdbbase not specified\n");

View File

@ -31,7 +31,13 @@ static int yyAbort = 0;
%%
database: database database_item | database_item;
database: /* empty */
| database_item_list
;
database_item_list: database_item_list database_item
| database_item
;
database_item: include
| path

View File

@ -3,12 +3,14 @@
* 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
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*epicsConvert.h*/
#ifndef INC_epicsConvert_H
#define INC_epicsConvert_H
#include <shareLib.h>
#ifdef __cplusplus
@ -21,3 +23,4 @@ epicsShareFunc float epicsConvertDoubleToFloat(double value);
}
#endif
#endif /* INC_epicsConvert_H */

View File

@ -9,6 +9,9 @@
/* epicsStdlib.h */
/* Author: Eric Norum */
#ifndef INC_epicsStdlib_H
#define INC_epicsStdlib_H
#include <stdlib.h>
#include <limits.h>
@ -67,3 +70,4 @@ epicsShareFunc int
}
#endif
#endif /* INC_epicsStdlib_H */

View File

@ -300,11 +300,6 @@ epicsShareFunc long locationProbe (epicsAddressType addrType, char *pLocation);
#endif /* NO_DEVLIB_OLD_INTERFACE */
/*
* Some vxWorks convenience routines
*/
void bcopyLongs(char *source, char *destination, int nlongs);
#ifdef __cplusplus
}
#endif

View File

@ -3,11 +3,13 @@
* 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
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
#ifndef INC_epicsSignal_H
#define INC_epicsSignal_H
#ifdef __cplusplus
extern "C" {
#endif
@ -44,3 +46,4 @@ epicsShareFunc void epicsShareAPI epicsSignalRaiseSigAlarm ( struct epicsThreadO
}
#endif
#endif /* INC_epicsSignal_H */

View File

@ -19,3 +19,5 @@
#endif
#endif
#endif
void bcopyLongs(char *source, char *destination, int nlongs);

View File

@ -0,0 +1,46 @@
/*************************************************************************\
* Copyright (c) 2013 Dirk Zimoch, PSI
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* osi/os/WIN32/epicsFindSymbol.c */
#include <windows.h>
#define epicsExportSharedSymbols
#include "epicsFindSymbol.h"
static int epicsLoadErrorCode = 0;
epicsShareFunc void * epicsLoadLibrary(const char *name)
{
HMODULE lib;
epicsLoadErrorCode = 0;
lib = LoadLibrary(name);
if (lib == NULL)
{
epicsLoadErrorCode = GetLastError();
}
return lib;
}
epicsShareFunc const char *epicsLoadError(void)
{
static char buffer[100];
FormatMessage(
FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
epicsLoadErrorCode,
0,
buffer,
sizeof(buffer)-1, NULL );
return buffer;
}
epicsShareFunc void * epicsShareAPI epicsFindSymbol(const char *name)
{
return GetProcAddress(0, name);
}

View File

@ -3,8 +3,7 @@
* 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
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
@ -248,10 +247,7 @@ static void epicsParmCleanupWIN32 ( win32ThreadParam * pParm )
ellDelete ( & pGbl->threadList, & pParm->node );
LeaveCriticalSection ( & pGbl->mutex );
/* close the handle if its an implicit thread id */
if ( ! pParm->funptr ) {
CloseHandle ( pParm->handle );
}
free ( pParm );
TlsSetValue ( pGbl->tlsIndexThreadLibraryEPICS, 0 );
}

View File

@ -1,10 +1,9 @@
/*************************************************************************\
* Copyright (c) 2002 The University of Chicago, as Operator of Argonne
* Copyright (c) 2013 UChicago Argonne LLC, 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
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/* atReboot.cpp */
@ -16,17 +15,11 @@
#include "epicsDynLink.h"
#include "epicsExit.h"
/* osdThread references atRebootExtern just to make this module load*/
int atRebootExtern;
extern "C" {
typedef int (*sysAtReboot_t)(void(func)(void));
class atRebootRegister {
public:
atRebootRegister();
};
atRebootRegister::atRebootRegister()
void atRebootRegister(void)
{
STATUS status;
sysAtReboot_t sysAtReboot;
@ -46,4 +39,4 @@ atRebootRegister::atRebootRegister()
}
}
static atRebootRegister atRebootRegisterObj;
}

View File

@ -52,12 +52,8 @@ static int *taskIdList = 0;
int taskIdListSize = 0;
static SEM_ID epicsThreadListMutex = 0;
/*The following forces atReboot to be loaded*/
extern int atRebootExtern;
static struct pext {
int *pExtern;
struct pext *pext;
} pext = {&atRebootExtern, &pext};
/* This routine is found in atReboot.cpp */
extern void atRebootRegister(void);
/* definitions for implementation of epicsThreadPrivate */
static void **papTSD = 0;
@ -93,6 +89,7 @@ static int getOssPriorityValue(unsigned int osiPriority)
}
}
#define THREAD_SEM_FLAGS (SEM_DELETE_SAFE|SEM_INVERSION_SAFE|SEM_Q_PRIORITY)
static void epicsThreadInit(void)
{
static int lock = 0;
@ -104,13 +101,14 @@ static void epicsThreadInit(void)
taskDelay(1);
if (!done) {
epicsThreadOnceMutex = semMCreate(SEM_DELETE_SAFE|SEM_INVERSION_SAFE|SEM_Q_PRIORITY);
epicsThreadOnceMutex = semMCreate(THREAD_SEM_FLAGS);
assert(epicsThreadOnceMutex);
epicsThreadListMutex = semMCreate(SEM_DELETE_SAFE|SEM_INVERSION_SAFE|SEM_Q_PRIORITY);
epicsThreadListMutex = semMCreate(THREAD_SEM_FLAGS);
assert(epicsThreadListMutex);
taskIdList = calloc(ID_LIST_CHUNK, sizeof(int));
assert(taskIdList);
taskIdListSize = ID_LIST_CHUNK;
atRebootRegister();
done = 1;
}
lock = 0;

View File

@ -67,14 +67,18 @@ void osdNTPReport(void)
}
// vxWorks localtime_r interface does not match POSIX standards
// vxWorks localtime_r returns different things in different versions.
// It can't fail though, so we just ignore the return value.
int epicsTime_localtime(const time_t *clock, struct tm *result)
{
return localtime_r(clock, result) == OK ? epicsTimeOK : epicsTimeERROR;
localtime_r(clock, result);
return epicsTimeOK;
}
// vxWorks gmtime_r interface does not match POSIX standards
// vxWorks gmtime_r returns different things in different versions.
// It can't fail though, so we just ignore the return value.
int epicsTime_gmtime ( const time_t *pAnsiTime, struct tm *pTM )
{
return gmtime_r(pAnsiTime, pTM) == OK ? epicsTimeOK : epicsTimeERROR;
gmtime_r(pAnsiTime, pTM);
return epicsTimeOK;
}

View File

@ -3,11 +3,13 @@
* 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
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
#ifndef INC_osiPoolStatus_H
#define INC_osiPoolStatus_H
/*
* $Revision-Id$
*
@ -39,3 +41,4 @@ epicsShareFunc int epicsShareAPI osiSufficentSpaceInPool ( size_t contiguousBloc
#include "osdPoolStatus.h"
#endif /* INC_osiPoolStatus_H */

View File

@ -3,11 +3,13 @@
* 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
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
#ifndef INC_osiProcess_H
#define INC_osiProcess_H
/*
* $Revision-Id$
*
@ -44,3 +46,4 @@ epicsShareFunc osiSpawnDetachedProcessReturn epicsShareAPI osiSpawnDetachedProce
}
#endif
#endif /* INC_osiProcess_H */

View File

@ -48,17 +48,23 @@ MAIN(epicsTimeTest)
const int wasteTime = 100000;
const int nTimes = 10;
testPlan(16 + nTimes * 18);
testPlan(12 + nTimes * 18);
{
try {
const epicsTimeStamp epochTS = {0, 0};
epicsTime epochET = epochTS;
struct gm_tm_nano_sec epicsEpoch = epochET;
testOk1(epicsEpoch.ansi_tm.tm_sec == 0);
testOk1(epicsEpoch.ansi_tm.tm_min == 0);
testOk1(epicsEpoch.ansi_tm.tm_hour == 0);
testOk1(epicsEpoch.ansi_tm.tm_yday == 0);
testOk1(epicsEpoch.ansi_tm.tm_year == 90);
testOk(epicsEpoch.ansi_tm.tm_sec == 0 &&
epicsEpoch.ansi_tm.tm_min == 0 &&
epicsEpoch.ansi_tm.tm_hour == 0 &&
epicsEpoch.ansi_tm.tm_yday == 0 &&
epicsEpoch.ansi_tm.tm_year == 90,
"epicsTime_gmtime() for EPICS epoch");
}
catch ( ... ) {
testFail("epicsTime_gmtime() failed");
testAbort("Can't continue, check your OS!");
}
{ // badNanosecTest

View File

@ -1,6 +1,6 @@
#!/usr/bin/env perl
#*************************************************************************
# Copyright (c) 2010 UChicago Argonne LLC, as Operator of Argonne
# Copyright (c) 2013 UChicago Argonne LLC, as Operator of Argonne
# National Laboratory.
# Copyright (c) 2002 The Regents of the University of California, as
# Operator of Los Alamos National Laboratory.
@ -24,6 +24,9 @@ $Getopt::Std::OUTPUT_HELP_VERSION = 1;
# Is exception handler frame info required?
my $need_eh_frame = 0;
# Is module destructor needed?
my $need_mod_dtor = 0;
# Constructor and destructor names:
# Array contains names from input file.
# Hash is used to skip duplicate names.
@ -34,6 +37,7 @@ while (<>)
{
chomp;
$need_eh_frame++ if m/__? gxx_personality_v [0-9]/x;
$need_mod_dtor++ if m/__? cxa_atexit $/x;
next if m/__? GLOBAL_. (F | I._GLOBAL_.D) .+/x;
if (m/__? GLOBAL_ . D .+/x) {
my ($addr, $type, $name) = split ' ', $_, 3;
@ -55,8 +59,11 @@ push my @out,
'',
'/* Declarations */',
(map {cDecl($_)} @ctors, @dtors),
'',
'char __dso_handle = 0;',
'';
moduleDestructor() if $need_mod_dtor;
exceptionHandlerFrame() if $need_eh_frame;
push @out,
@ -81,6 +88,19 @@ if ($opt_o) {
print join "\n", @out;
}
# Outputs the C code for registering a module destructor
sub moduleDestructor {
my $mod_dtor = 'mod_dtor';
push @dtors, $mod_dtor;
push @out,
'/* Module destructor */',
"static void $mod_dtor(void) {",
' extern void __cxa_finalize(void *);',
'',
' __cxa_finalize(&__dso_handle);',
'}',
'';
}
# Outputs the C code for registering exception handler frame info
sub exceptionHandlerFrame {
@ -97,7 +117,11 @@ sub exceptionHandlerFrame {
'',
"static void $eh_ctor(void) {",
' extern void __register_frame_info (const void *, void *);',
' static struct { unsigned pad[8]; } object;',
' static struct {',
' void *a, *b, *c, *d;',
' unsigned long e;',
' void *f, *g;',
' } object;',
'',
' __register_frame_info(__EH_FRAME_BEGIN__, &object);',
'}',
@ -108,7 +132,6 @@ sub exceptionHandlerFrame {
' __deregister_frame_info(__EH_FRAME_BEGIN__);',
'}',
'';
return;
}
sub cName {