Merged changes from 3.14 branch

Includes everything up to revno 12352 on 2012-07-31
This commit is contained in:
Andrew Johnson
2012-07-31 14:04:38 -05:00
18 changed files with 168 additions and 148 deletions

View File

@ -15,8 +15,8 @@ define RELEASE_FLAGS_template
RELEASE_INCLUDES += $$(addprefix -I,$$(wildcard $$(strip $$($(1)))/include/compiler/$$(CMPLR_CLASS)))
RELEASE_INCLUDES += $$(addprefix -I,$$(wildcard $$(strip $$($(1)))/include/os/$$(OS_CLASS)))
RELEASE_INCLUDES += $$(addprefix -I,$$(wildcard $$(strip $$($(1)))/include))
RELEASE_DBDFLAGS += $$(addprefix -I,$$(wildcard $$(strip $$($(1)))/dbd))
RELEASE_DBFLAGS += $$(addprefix -I,$$(wildcard $$(strip $$($(1)))/db))
RELEASE_DBD_DIRS += $$(wildcard $$(strip $$($(1)))/dbd)
RELEASE_DB_DIRS += $$(wildcard $$(strip $$($(1)))/db)
RELEASE_PERL_MODULE_DIRS += $$(wildcard $$($(1)_LIB)/perl)
endef
$(foreach top, $(RELEASE_TOPS), $(eval $(call RELEASE_FLAGS_template,$(top)) ))

View File

@ -19,33 +19,30 @@ vpath bpt%.data $(USR_VPATH) $(GENERIC_SRC_DIRS) $(COMMON_DIR)
vpath %.acf $(USR_VPATH) $(GENERIC_SRC_DIRS) $(COMMON_DIR)
vpath %.acs $(USR_VPATH) $(GENERIC_SRC_DIRS) $(COMMON_DIR)
##################################################### dbdflags
##################################################### dbflags dbdflags
# dbExpand
INSTALL_DBDFLAGS += -I $(INSTALL_DBD)
INSTALL_DBFLAGS += -I $(INSTALL_DB)
DBDFLAGS = $(USR_DBDFLAGS) $(addprefix -I,. .. $(COMMON_DIR) $(SRC_DIRS)) $(INSTALL_DBDFLAGS) $(RELEASE_DBDFLAGS)
DBFLAGS = $($*_DBFLAGS) $(USR_DBFLAGS) -I. -I.. -I$(COMMON_DIR) $(INSTALL_DBFLAGS) $(RELEASE_DBFLAGS)
DBD_SEARCH_DIRS = . .. $(COMMON_DIR) $(SRC_DIRS) $(INSTALL_DBD) $(RELEASE_DBD_DIRS)
DB_SEARCH_DIRS = . .. $(COMMON_DIR) $(SRC_DIRS) $(INSTALL_DB) $(RELEASE_DB_DIRS)
#####################################################
DBDFLAGS = $(USR_DBDFLAGS) $(addprefix -I,$(DBD_SEARCH_DIRS))
DBFLAGS = $($*_DBFLAGS) $(USR_DBFLAGS) $(addprefix -I,$(DB_SEARCH_DIRS))
##################################################### Targets
# ---------------------------------------------------
# To allow os specific dbd files AND have the -j option work properly,
# add the following lines to your ioc application Makefile
#
# # These lines may be committed to RULES.Db for a future base release.
# CROSS_TARGET_OS_TYPES = $(sort $(foreach target, \
# $(CROSS_COMPILER_TARGET_ARCHS),$(firstword $(subst -, ,$(target)))))
# DBD += $(foreach type, $(CROSS_TARGET_OS_TYPES), $(DBD_$(type)))
#
# and then add something like the following os specific lines
CROSS_TARGET_OS_TYPES = $(sort $(foreach target, \
$(EPICS_HOST_ARCH) $(CROSS_COMPILER_TARGET_ARCHS),$(firstword $(subst -, ,$(target)))))
DBD += $(foreach type, $(CROSS_TARGET_OS_TYPES), $(DBD_$(type)))
# Users add os specific dbd files to a Makefile as follows
#
# DBD_vxWorks += abcVx.dbd
# DBD_RTEMS += abcRTEMS.dbd
# DBD_solaris += abcSolaris.dbd
#
##################################################### Targets
# Following line added for backward compatibilty
DBD += $(DBDNAME)
# ---------------------------------------------------
DBDINC_NAME = $(patsubst %.h,%,$(patsubst %.dbd,%,$(DBDINC)))
DBD += $(addsuffix .dbd,$(DBDINC_NAME))
@ -102,7 +99,7 @@ ACF_CPPFLAGS = $(ACF_CPPFLAGS_$(GNU))
ACF_INCLUDES = -I. $(TARGET_INCLUDES) $(USR_INCLUDES)\
$(SRC_INCLUDES) -I$(INSTALL_DB)
ACFDEPENDS_CMD = $(MKMF) -m $@ $(subst -I,,$(ACF_INCLUDES)) $(COMMONDEP_TARGET) $<
ACFDEPENDS_CMD = $(MKMF) -m $@ $(ACF_INCLUDES) $(COMMONDEP_TARGET) $<
ACF_CMD = $(CPP) $(ACF_CPPFLAGS) $(ACF_INCLUDES) $< > $@
##################################################### dependancies
@ -115,8 +112,6 @@ DBDDEPENDS_FILES += $(addsuffix $(DEP),$(HINC) \
$(patsubst $(COMMON_DIR)/%,%, \
$(filter-out $(COMMON_DIR)/bpt%.dbd,$(COMMON_DBDS))))
MAKEDBDEPENDS = $(PERL) $(TOOLS)/makeDbDepends.pl
#####################################################
ifndef T_A
@ -215,12 +210,13 @@ menu%.h$(DEP): menu%.dbd
%.db$(RAW)$(DEP): %.substitutions
@$(RM) $@
$(MAKEDBDEPENDS) $(COMMONDEP_TARGET) $< $(TEMPLATE_FILENAME) > $@
$(MKMF) -m$@ $(DBFLAGS) $(COMMONDEP_TARGET) $< $(TEMPLATE_FILENAME)
@echo "$(COMMONDEP_TARGET): $(TEMPLATE_FILENAME)" >> $@
@echo "$@: $(TEMPLATE_FILENAME)" >> $@
%.db$(RAW)$(DEP): %.template
@$(RM) $@
@$(MAKEDBDEPENDS) $(COMMONDEP_TARGET) $< > $@
$(MKMF) -m$@ $(DBFLAGS) $(COMMONDEP_TARGET) $<
%.acf$(DEP): %.acs
@$(RM) $@

View File

@ -17,7 +17,7 @@ ifeq ($(BUILD_CLASS),CROSS)
# prefix of compiler tools
CMPLR_SUFFIX =
CMPLR_PREFIX = $(addsuffix -,$(GNU_TARGET))
CMPLR_PREFIX = $(GNU_TARGET)-
# Provide a link-time path for shared libraries
SHRLIBDIR_RPATH_LDFLAGS_YES += $(SHRLIB_DEPLIB_DIRS:%=-Wl,-rpath-link,%)

View File

@ -0,0 +1,10 @@
# CONFIG.linux-arm.Common
#
# $Revision-Id$
#
# Definitions for linux-arm host builds
# Sites may override these definitions in CONFIG_SITE.linux-arm.Common
#-------------------------------------------------------
#Include definitions common to unix hosts
include $(CONFIG)/os/CONFIG.UnixCommon.Common

View File

@ -0,0 +1,10 @@
# CONFIG.linux-arm.linux-arm
#
# $Revision-Id$
#
# Definitions for native linux-arm builds
# Sites may override these definitions in CONFIG_SITE.linux-arm.linux-arm
#-------------------------------------------------------
# Include common gnu compiler definitions
include $(CONFIG)/CONFIG.gnuCommon

View File

@ -6,5 +6,5 @@
# Site override definitions for cygwin-x86 host builds
#-------------------------------------------------------
CROSS_COMPILER_TARGET_ARCHS =
#CROSS_COMPILER_TARGET_ARCHS =

View File

@ -0,0 +1,7 @@
# CONFIG_SITE.linux-arm.linux-arm
#
# $Revision-Id$
#
# Site specific definitions for native linux-arm builds
#-------------------------------------------------------

View File

@ -5,8 +5,10 @@
# Site specific definitions for linux-x86 host - linux-arm target builds
#-------------------------------------------------------
# Diamond:
# Tools install path
#GNU_DIR = /home/targetOS/linux-arm/host/x86-linux/gcc_3.3.3
# anj@aps:
#GNU_DIR = /local/anj/cross-arm/gcc-3.4.5-glibc-2.3.6/arm-linux
GNU_DIR = /net/phoebus/vw/zynq-2011.09
# GNU crosscompiler target name
GNU_TARGET = arm-xilinx-linux-gnueabi

View File

@ -907,43 +907,52 @@ static void dbBreakBody(void)
pgphentry->userPvt = pnewbrkTable;
}
static void dbRecordHead(char *recordType,char *name, int visible)
static void dbRecordHead(char *recordType, char *name, int visible)
{
DBENTRY *pdbentry;
long status;
char *badch;
DBENTRY *pdbentry;
long status;
badch = strpbrk(name, " \"'.$");
if (badch) {
epicsPrintf("Bad character '%c' in record name \"%s\"\n",
*badch, name);
}
pdbentry = dbAllocEntry(pdbbase);
if(ellCount(&tempList))
yyerrorAbort("dbRecordHead: tempList not empty");
if (ellCount(&tempList))
yyerrorAbort("dbRecordHead: tempList not empty");
allocTemp(pdbentry);
status = dbFindRecordType(pdbentry,recordType);
if(status) {
epicsPrintf("Record \"%s\" is of unknown type \"%s\" - ",
status = dbFindRecordType(pdbentry, recordType);
if (status) {
epicsPrintf("Record \"%s\" is of unknown type \"%s\" - ",
name, recordType);
yyerrorAbort(NULL);
return;
yyerrorAbort(NULL);
return;
}
/*Duplicate records ok if the same type */
status = dbCreateRecord(pdbentry,name);
if(status==S_dbLib_recExists) {
if(strcmp(recordType,dbGetRecordTypeName(pdbentry))!=0) {
epicsPrintf("Record %s already defined with different type %s\n",
name, dbGetRecordTypeName(pdbentry));
if (status==S_dbLib_recExists) {
if (strcmp(recordType, dbGetRecordTypeName(pdbentry))!=0) {
epicsPrintf("Record \"%s\" already defined with different type "
"\"%s\"\n", name, dbGetRecordTypeName(pdbentry));
yyerror(NULL);
duplicate = TRUE;
return;
} else if (dbRecordsOnceOnly) {
epicsPrintf("Record \"%s\" already defined (dbRecordsOnceOnly is set)\n",
name);
yyerror(NULL);
duplicate = TRUE;
}
} else if(status) {
epicsPrintf("Can't create record \"%s\" of type \"%s\"\n",
name, recordType);
yyerrorAbort(NULL);
duplicate = TRUE;
return;
}
else if (dbRecordsOnceOnly) {
epicsPrintf("Record \"%s\" already defined (dbRecordsOnceOnly is "
"set)\n", name);
yyerror(NULL);
duplicate = TRUE;
}
}
if(visible) dbVisibleRecord(pdbentry);
else if (status) {
epicsPrintf("Can't create record \"%s\" of type \"%s\"\n",
name, recordType);
yyerrorAbort(NULL);
}
if (visible)
dbVisibleRecord(pdbentry);
}
static void dbRecordField(char *name,char *value)

View File

@ -25,6 +25,7 @@
#include <stdio.h>
#include <assert.h>
#include <syslog.h>
#include <limits.h>
#include <rtems.h>
#include <rtems/error.h>
@ -369,16 +370,15 @@ epicsThreadSleep (double seconds)
{
rtems_status_code sc;
rtems_interval delay;
extern double rtemsTicksPerTwoSeconds_double;
if (seconds <= 0.0) {
delay = 0;
extern double rtemsTicksPerSecond_double;
if (seconds > 0.0) {
seconds *= rtemsTicksPerSecond_double;
seconds += 0.99999999; /* 8 9s here is optimal */
delay = (seconds >= INT_MAX) ? INT_MAX : (int) seconds;
}
else {
delay = seconds * rtemsTicksPerTwoSeconds_double;
delay = (delay + 1) / 2;
if (delay == 0)
delay++;
else { /* seconds <= 0 or NAN */
delay = 0;
}
sc = rtems_task_wake_after (delay);
if(sc != RTEMS_SUCCESSFUL)

View File

@ -781,18 +781,15 @@ epicsShareFunc void epicsShareAPI epicsThreadSleep ( double seconds )
static const unsigned mSecPerSec = 1000;
DWORD milliSecDelay;
if ( seconds <= 0.0 ) {
if ( seconds > 0.0 ) {
seconds *= mSecPerSec;
seconds += 0.99999999; /* 8 9s here is optimal */
milliSecDelay = ( seconds >= INFINITE ) ?
INFINITE - 1 : ( DWORD ) seconds;
}
else { /* seconds <= 0 or NAN */
milliSecDelay = 0u;
}
else if ( seconds >= INFINITE / mSecPerSec ) {
milliSecDelay = INFINITE - 1;
}
else {
milliSecDelay = ( DWORD ) ( ( seconds * mSecPerSec ) + 0.5 );
if ( milliSecDelay == 0 ) {
milliSecDelay = 1;
}
}
Sleep ( milliSecDelay );
}

View File

@ -675,9 +675,15 @@ epicsShareFunc void epicsShareAPI epicsThreadSleep(double seconds)
struct timespec remainingTime;
double nanoseconds;
delayTime.tv_sec = (time_t)seconds;
nanoseconds = (seconds - (double)delayTime.tv_sec) *1e9;
delayTime.tv_nsec = (long)nanoseconds;
if (seconds > 0) {
delayTime.tv_sec = seconds;
nanoseconds = (seconds - delayTime.tv_sec) *1e9;
delayTime.tv_nsec = nanoseconds;
}
else {
delayTime.tv_sec = 0;
delayTime.tv_nsec = 0;
}
while (nanosleep(&delayTime, &remainingTime) == -1 &&
errno == EINTR)
delayTime = remainingTime;

View File

@ -19,6 +19,7 @@
#include <stdlib.h>
#include <stddef.h>
#include <stdio.h>
#include <limits.h>
#include <vxWorks.h>
#include <taskLib.h>
@ -300,11 +301,13 @@ void epicsThreadSleep(double seconds)
STATUS status;
int ticks;
if(seconds<=0.0) {
if (seconds > 0.0) {
seconds *= sysClkRateGet();
seconds += 0.99999999; /* 8 9s here is optimal */
ticks = (seconds >= INT_MAX) ? INT_MAX : (int) seconds;
}
else { /* seconds <= 0 or NAN */
ticks = 0;
} else {
ticks = seconds*sysClkRateGet() + 0.5;
if(ticks<=0) ticks = 1;
}
status = taskDelay(ticks);
if(status) errlogPrintf("epicsThreadSleep\n");

View File

@ -21,10 +21,10 @@ $app_top = cwd();
$bad_ident_chars = '[^0-9A-Za-z_]';
&GetUser; # Ensure we know who's in charge
&readReleaseFiles("configure/RELEASE", \%release, \@apps);
&expandRelease(\%release);
&get_commandline_opts; # Check command-line options
&GetUser; # Ensure we know who's in charge
#
# Declare two default callback routines for file copy plus two
@ -164,7 +164,7 @@ exit 0; # END OF SCRIPT
# Get commandline options and check for validity
#
sub get_commandline_opts { #no args
getopts("a:b:dhilp:T:t:") or Cleanup(1);
getopts("a:b:dhilp:T:t:u:") or Cleanup(1);
# Options help
Cleanup(0) if $opt_h;
@ -395,7 +395,7 @@ EOF
-d Enable debug messages
-i Specifies that ioc boot directories will be generated
-l List valid application types for this installation
If this is specified the other options are not used
If this is specified the other options are not used
-p app Set the application name for use with -i
If not specified, you will be prompted
-T top Set the template top directory (where the application templates are)
@ -405,6 +405,7 @@ EOF
-t type Set the application type (-l for a list of valid types)
If not specified, type is taken from environment
If not found in environment, \"default\" is used
-u user Set username; overrides OS defaults
Environment:
EPICS_MBA_DEF_APP_TYPE Application type you want to use as default
@ -419,10 +420,7 @@ EOF
}
sub GetUser {
# add to this list if new possibilities arise,
# currently it's UNIX and WIN32:
$user = $ENV{USER} || $ENV{USERNAME} || Win32::LoginName();
$user =~ s/\s+//g; # Bl**dy Windows stupidity...
$user = $opt_u || $ENV{USER} || $ENV{USERNAME} || Win32::LoginName();
unless ($user) {
print "Strange, I cannot figure out your user name!\n";
@ -430,5 +428,6 @@ sub GetUser {
$user = <STDIN>;
chomp $user;
}
$user =~ tr/-a-zA-Z0-9_:;[]<>//cd; # Sanitize; these are the legal chars
die "No user name" unless $user;
}

View File

@ -1,24 +0,0 @@
eval 'exec perl -S $0 ${1+"$@"}' # -*- Mode: perl -*-
if $running_under_some_shell; # makeDbDepends.pl
# Called from within RULES.Db in the Db directories.
# Searches .substitutions and .template files (from the command line) for
# file ["']xxx["'] {
# and
# include "xxx"
# entries to include in the DEPENDS file
use strict;
my $target = shift @ARGV;
my %depends;
while (my $line = <>) {
$depends{$2}++ if $line =~ m/^ \s* file \s* (["']?) (\S*) \1 /x;
$depends{$1}++ if $line =~ m/^ \s* include \s* "(.*)" /x;
}
if (%depends) {
my @depends = keys %depends;
print "$target: @depends\n";
}

View File

@ -25,39 +25,39 @@
#
#-----------------------------------------------------------------------
use Getopt::Std;
use strict;
use FindBin;
use lib "$FindBin::Bin/../../lib/perl";
use EPICS::Getopts;
my $version = 'mkmf.pl,v 1.5 2002/03/25 21:33:24 jba Exp $ ';
my $endline = $/;
my %output;
my @includes;
use vars qw( $opt_d $opt_m );
getopts( 'dm:' ) || die "\aSyntax: $0 [-d] [-m dependsFile] includeDirs objFile srcFile\n";
our ( $opt_d, $opt_m, @opt_I);
getopts( 'dm:I@' ) || die "\aSyntax: $0 [-d] [-m dependsFile] [-I incdir [-I incdir]...] objFile srcFile [srcfile]... \n";
my $debug = $opt_d;
my $depFile = $opt_m;
print "$0 $version\n" if $debug;
# directory list
my @dirs;
my $i;
foreach $i (0 .. $#ARGV-2) {
push @dirs, $ARGV[$i];
}
my $objFile = $ARGV[$#ARGV-1];
my $srcFile = $ARGV[$#ARGV];
my @incdirs = @opt_I;
my $objFile = shift or die "No target file argument";
my @srcFiles=@ARGV;
if( $debug ) {
print "DEBUG: dirs= @dirs\n";
print "DEBUG: source= $srcFile\n";
print "DEBUG: object= $objFile\n";
print "$0 $version\n";
print "DEBUG: incdirs= @incdirs\n";
print "DEBUG: objFile= $objFile\n";
print "DEBUG: srcFiles= @srcFiles\n";
}
print "Generating dependencies for $objFile\n" if $debug;
scanFile($srcFile);
scanIncludesList();
foreach my $srcFile (@srcFiles) {
scanFile($srcFile);
scanIncludesList();
}
$depFile = 'depends' unless $depFile;
@ -118,7 +118,7 @@ sub scanIncludesList {
}
#-----------------------------------------
# find filename on #include line
# find filename on #include and file lines
sub findNextIncName {
my $line = shift;
my $is_subst = shift;
@ -130,6 +130,7 @@ sub findNextIncName {
if ($is_subst) {
return 0 if not $line =~ /^\s*file\s*([^\s{]*)/;
$incname = $1;
$incname = substr $incname, 1, length($incname)-2 if $incname =~ /^".+?"$/;
} else {
return 0 if not $line =~ /^#?\s*include\s*('.*?'|<.*?>|".*?")/;
$incname = substr $1, 1, length($1)-2;
@ -139,7 +140,7 @@ sub findNextIncName {
return $incname if -f $incname;
return 0 if ( $incname =~ /^\// || $incname =~ /^\\/ );
foreach $dir ( @dirs ) {
foreach $dir ( @incdirs ) {
chomp($dir);
$incfile = "$dir/$incname";
print "DEBUG: checking for $incname in $dir\n" if $debug;

View File

@ -24,21 +24,24 @@ case $sysname in
Linux )
os=linux
cpu=`uname -m`
case $cpu in i386 | i486 | i586 | i686 )
cpu=x86
;;
case $cpu in
i386 | i486 | i586 | i686 )
cpu=x86 ;;
x86_64 )
;; # $cpu is correct
armv6l | armv7l )
cpu=arm ;;
esac
if [ ${cpu} = "x86_64" ]; then
cpu=x86_64
fi
echo ${os}-${cpu}${suffix}
;;
Darwin )
os=darwin
cpu=`uname -m`
case $cpu in
"Power Macintosh") cpu=ppc ;;
i386 | x86_64 ) cpu=x86 ;;
"Power Macintosh")
cpu=ppc ;;
i386 | x86_64 )
cpu=x86 ;;
esac
echo ${os}-${cpu}${suffix}
;;

View File

@ -24,10 +24,11 @@ print "$EpicsHostArch$suffix";
sub GetEpicsHostArch { # no args
$arch=$Config{'archname'};
if ($arch =~ /sun4-solaris/) { return "solaris-sparc";
if ($arch =~ /sun4-solaris/) { return "solaris-sparc";
} elsif ($arch =~ m/i86pc-solaris/) { return "solaris-x86";
} elsif ($arch =~ m/i[3-6]86-linux/) { return "linux-x86";
} elsif ($arch =~ m/x86_64-linux/) { return "linux-x86_64";
} elsif ($arch =~ m/i[3-6]86-linux/){ return "linux-x86";
} elsif ($arch =~ m/x86_64-linux/) { return "linux-x86_64";
} elsif ($arch =~ m/arm-linux/) { return "linux-arm";
} elsif ($arch =~ m/MSWin32-x86/) { return "win32-x86";
} elsif ($arch =~ m/cygwin/) { return "cygwin-x86";
} elsif ($arch =~ m/darwin/) {