Add RTEMS initialization hooks.
This commit is contained in:
@@ -40,7 +40,12 @@ affect vxWorks-(intel) targets.</p>
|
||||
<p>Added space for user extensions. This provides the infrastructure for the
|
||||
spy command.</p>
|
||||
<p>Fixed error in epicsThreadGetName for non-EPICS threads.</p>
|
||||
|
||||
<p>Added hooks for application routines to supply special network configuration
|
||||
parameters.
|
||||
The RTEMS startup code calls epicsRtemsInitPreSetBootConfigFromNVRAM just
|
||||
before reading values from NVRAM and
|
||||
epicsRtemsInitPostSetBootConfigFromNVRAM just afterwards. See
|
||||
epicsRtemsInitHooks.h for prototypes and global variables.</p>
|
||||
|
||||
<h4>libCom</h4>
|
||||
|
||||
|
||||
@@ -10,12 +10,16 @@
|
||||
TOP=../../..
|
||||
include $(TOP)/configure/CONFIG
|
||||
|
||||
INC += epicsRtemsInitHooks.h
|
||||
|
||||
SRCS += rtems_init.c
|
||||
SRCS += rtems_config.c
|
||||
SRCS += rtems_netconfig.c
|
||||
SRCS += rtems_util.c
|
||||
SRCS += rtems_dummyreg.c
|
||||
SRCS += setBootConfigFromNVRAM.c
|
||||
SRCS += epicsRtemsInitHookPre.c
|
||||
SRCS += epicsRtemsInitHookPost.c
|
||||
|
||||
LIBRARY_RTEMS = rtemsCom
|
||||
LIBRARY_SRCS = $(SRCS) $(BUILD_ARCHS)
|
||||
|
||||
19
src/RTEMS/base/epicsRtemsInitHookPost.c
Normal file
19
src/RTEMS/base/epicsRtemsInitHookPost.c
Normal file
@@ -0,0 +1,19 @@
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2006 The University of Chicago, as Operator of Argonne
|
||||
* 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.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
* Dummy version -- use if application does not provide its own version
|
||||
* $Id$
|
||||
*/
|
||||
#include "epicsRtemsInitHooks.h"
|
||||
|
||||
int
|
||||
epicsRtemsInitPostSetBootConfigFromNVRAM(struct rtems_bsdnet_config *config)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
19
src/RTEMS/base/epicsRtemsInitHookPre.c
Normal file
19
src/RTEMS/base/epicsRtemsInitHookPre.c
Normal file
@@ -0,0 +1,19 @@
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2006 The University of Chicago, as Operator of Argonne
|
||||
* 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.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
* Dummy version -- use if application does not provide its own version
|
||||
* $Id$
|
||||
*/
|
||||
#include "epicsRtemsInitHooks.h"
|
||||
|
||||
int
|
||||
epicsRtemsInitPreSetBootConfigFromNVRAM(struct rtems_bsdnet_config *config)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
21
src/RTEMS/base/epicsRtemsInitHooks.h
Normal file
21
src/RTEMS/base/epicsRtemsInitHooks.h
Normal file
@@ -0,0 +1,21 @@
|
||||
/*************************************************************************\
|
||||
* Copyright (c) 2006 The University of Chicago, as Operator of Argonne
|
||||
* 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.
|
||||
\*************************************************************************/
|
||||
|
||||
/*
|
||||
* Hooks into RTEMS startup code
|
||||
* $Id$
|
||||
*/
|
||||
#include <bsp.h>
|
||||
#include <rtems/rtems_bsdnet.h>
|
||||
|
||||
extern char *env_nfsServer;
|
||||
extern char *env_nfsPath;
|
||||
extern char *env_nfsMountPoint;
|
||||
|
||||
int epicsRtemsInitPreSetBootConfigFromNVRAM(struct rtems_bsdnet_config *config);
|
||||
int epicsRtemsInitPostSetBootConfigFromNVRAM(struct rtems_bsdnet_config *config);
|
||||
@@ -39,6 +39,8 @@
|
||||
#include <osiUnistd.h>
|
||||
#include <iocsh.h>
|
||||
|
||||
#include "epicsRtemsInitHooks.h"
|
||||
|
||||
static void
|
||||
logReset (void)
|
||||
{
|
||||
@@ -178,9 +180,6 @@ initialize_remote_filesystem(const char **argv, int hasLocalFilesystem)
|
||||
argv[1] = path;
|
||||
}
|
||||
#else
|
||||
extern char *env_nfsServer;
|
||||
extern char *env_nfsPath;
|
||||
extern char *env_nfsMountPoint;
|
||||
char *server_name;
|
||||
char *server_path;
|
||||
char *mount_point;
|
||||
@@ -431,10 +430,12 @@ Init (rtems_task_argument ignored)
|
||||
/*
|
||||
* Architecture-specific hooks
|
||||
*/
|
||||
epicsRtemsInitPreSetBootConfigFromNVRAM(&rtems_bsdnet_config);
|
||||
if (rtems_bsdnet_config.bootp == NULL) {
|
||||
extern void setBootConfigFromNVRAM(void);
|
||||
setBootConfigFromNVRAM();
|
||||
}
|
||||
epicsRtemsInitPostSetBootConfigFromNVRAM(&rtems_bsdnet_config);
|
||||
|
||||
/*
|
||||
* Override RTEMS configuration
|
||||
|
||||
@@ -262,7 +262,7 @@ setBootConfigFromNVRAM(void)
|
||||
rtems_bsdnet_config.domainname = cp1;
|
||||
rtems_bsdnet_config.hostname = env("HOSTNAME", "iocNobody");
|
||||
rtems_bsdnet_config.ifconfig->ip_address = env("IPADDR0", "192.168.0.2");
|
||||
rtems_bsdnet_bootp_boot_file_name = env("BOOTFILE", "epics/iocNobody/bin/RTEMS-uC5282/myApp.boot");
|
||||
rtems_bsdnet_bootp_boot_file_name = env("BOOTFILE", "uC5282App.boot");
|
||||
rtems_bsdnet_bootp_cmdline = env("CMDLINE", "epics/iocBoot/iocNobody/st.cmd");
|
||||
if ((cp1 = env("NFSMOUNT", NULL)) != NULL) {
|
||||
char *cp2, *cp3;
|
||||
@@ -293,6 +293,6 @@ void
|
||||
setBootConfigFromNVRAM(void)
|
||||
{
|
||||
printf("SYSTEM HAS NO NON-VOLATILE RAM!\n");
|
||||
printf("YOU MUST USE BOOTP/DHCP TO OBTAIN NETWORK CONFIGURATION\n");
|
||||
printf("YOU MUST USE SOME OTHER METHOD TO OBTAIN NETWORK CONFIGURATION\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user