Add RTEMS initialization hooks.

This commit is contained in:
W. Eric Norum
2006-06-29 15:22:53 +00:00
parent 3d06949492
commit eff6f305c8
7 changed files with 75 additions and 6 deletions

View File

@@ -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)

View 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;
}

View 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;
}

View 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);

View File

@@ -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

View File

@@ -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