From 31326b8b9fde2800bc6389437ff2b62694e44482 Mon Sep 17 00:00:00 2001 From: Eric Norum Date: Fri, 23 Jul 2010 09:21:02 -0700 Subject: [PATCH] Add RTEMS R4.10 support --- documentation/RELEASE_NOTES.html | 6 +++++ src/RTEMS/base/rtems_config.c | 5 ++++- src/RTEMS/base/rtems_init.c | 38 ++++++++++++++++++++++++++++++-- src/libCom/test/buckTest.c | 1 + 4 files changed, 47 insertions(+), 3 deletions(-) diff --git a/documentation/RELEASE_NOTES.html b/documentation/RELEASE_NOTES.html index 3b03612a1..6553aaa0b 100644 --- a/documentation/RELEASE_NOTES.html +++ b/documentation/RELEASE_NOTES.html @@ -77,6 +77,12 @@ but target-architecture-specific values must be set in a target-specific

Added build support for the latest Wind River release.

+

RTEMS 4.10 support

+ +

Added support for the latest release of RTEMS. There is no longer a +distinction between executive and malloc memory pools. The new mount() API +is used.

+

Dependency file generation

Changes to the way in which we generate header dependency files, which are diff --git a/src/RTEMS/base/rtems_config.c b/src/RTEMS/base/rtems_config.c index 4e089da5e..aa096c609 100644 --- a/src/RTEMS/base/rtems_config.c +++ b/src/RTEMS/base/rtems_config.c @@ -21,7 +21,7 @@ */ #define CONFIGURE_RTEMS_INIT_TASKS_TABLE -#if __RTEMS_MAJOR__>4 || ( __RTEMS_MAJOR__==4 && __RTEMS_MINOR__>9 ) +#if __RTEMS_MAJOR__>4 || (__RTEMS_MAJOR__==4 && __RTEMS_MINOR__>9) || (__RTEMS_MAJOR__==4 && __RTEMS_MINOR__==9 && __RTEMS_REVISION__==99) # define CONFIGURE_UNIFIED_WORK_AREAS #else # define CONFIGURE_EXECUTIVE_RAM_SIZE (2000*1024) @@ -55,6 +55,9 @@ rtems_task Init (rtems_task_argument argument); #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER +#define CONFIGURE_FILESYSTEM_NFS +#define CONFIGURE_FILESYSTEM_IMFS + /* * This should be made BSP dependent, not CPU dependent but I know of no * appropriate conditionals to use. diff --git a/src/RTEMS/base/rtems_init.c b/src/RTEMS/base/rtems_init.c index 3c72948b5..ab278532c 100644 --- a/src/RTEMS/base/rtems_init.c +++ b/src/RTEMS/base/rtems_init.c @@ -169,6 +169,41 @@ initialize_local_filesystem(char **argv) return 0; } +#ifndef OMIT_NFS_SUPPORT +#if __RTEMS_MAJOR__>4 || \ + (__RTEMS_MAJOR__==4 && __RTEMS_MINOR__>9) || \ + (__RTEMS_MAJOR__==4 && __RTEMS_MINOR__==9 && __RTEMS_REVISION__==99) +static int +nfsMount(char *uidhost, char *path, char *mntpoint) +{ + int devl = strlen(uidhost) + strlen(path) + 2; + char *dev; + int rval = -1; + + if ((dev = malloc(devl)) == NULL) { + fprintf(stderr,"nfsMount: out of memory\n"); + return -1; + } + sprintf(dev, "%s:%s", uidhost, path); + printf("Mount %s on %s\n", dev, mntpoint); + if (rtems_mkdir(mntpoint, S_IRWXU | S_IRWXG | S_IRWXO)) + printf("Warning -- unable to make directory \"%s\"\n", mntpoint); + if (mount(dev, mntpoint, RTEMS_FILESYSTEM_TYPE_NFS, + RTEMS_FILESYSTEM_READ_WRITE, NULL)) { + perror("mount failed"); + } + else { + rval = 0; + } + free(dev); + return rval; +} +#define NFS_INIT +#else +#define NFS_INIT rpcUdpInit(); nfsInit(0,0); +#endif +#endif + static void initialize_remote_filesystem(char **argv, int hasLocalFilesystem) { @@ -198,8 +233,7 @@ initialize_remote_filesystem(char **argv, int hasLocalFilesystem) int l = 0; printf ("***** Initializing NFS *****\n"); - rpcUdpInit(); - nfsInit(0,0); + NFS_INIT if (env_nfsServer && env_nfsPath && env_nfsMountPoint) { server_name = env_nfsServer; server_path = env_nfsPath; diff --git a/src/libCom/test/buckTest.c b/src/libCom/test/buckTest.c index 3134fec6a..4d5a4ee01 100644 --- a/src/libCom/test/buckTest.c +++ b/src/libCom/test/buckTest.c @@ -9,6 +9,7 @@ #include #include +#include #include "epicsAssert.h" #include "bucketLib.h"