This is Unofficial EPICS BASE Doxygen Site
rtems_config.c File Reference
#include <rtems.h>
#include <bsp.h>
#include <rtems/confdefs.h>
+ Include dependency graph for rtems_config.c:

Go to the source code of this file.

Macros

#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
 
#define CONFIGURE_EXECUTIVE_RAM_SIZE   (2000*1024)
 
#define CONFIGURE_MAXIMUM_TASKS   rtems_resource_unlimited(30)
 
#define CONFIGURE_MAXIMUM_BARRIERS   rtems_resource_unlimited(30)
 
#define CONFIGURE_MAXIMUM_SEMAPHORES   rtems_resource_unlimited(500)
 
#define CONFIGURE_MAXIMUM_TIMERS   rtems_resource_unlimited(20)
 
#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES   rtems_resource_unlimited(5)
 
#define CONFIGURE_MAXIMUM_USER_EXTENSIONS   1
 
#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS   150
 
#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
 
#define CONFIGURE_MAXIMUM_DRIVERS   8
 
#define CONFIGURE_MICROSECONDS_PER_TICK   20000
 
#define CONFIGURE_INIT_TASK_PRIORITY   80
 
#define CONFIGURE_MALLOC_STATISTICS   1
 
#define CONFIGURE_INIT
 
#define CONFIGURE_INIT_TASK_INITIAL_MODES
 
#define CONFIGURE_INIT_TASK_ATTRIBUTES   (RTEMS_FLOATING_POINT | RTEMS_LOCAL)
 
#define CONFIGURE_INIT_TASK_STACK_SIZE   (16*1024)
 
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
 
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
 
#define CONFIGURE_FILESYSTEM_NFS
 
#define CONFIGURE_FILESYSTEM_IMFS
 
#define CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER
 

Functions

rtems_task Init (rtems_task_argument argument)
 

Macro Definition Documentation

#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER

Definition at line 56 of file rtems_config.c.

#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER

Definition at line 55 of file rtems_config.c.

#define CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER

Definition at line 67 of file rtems_config.c.

#define CONFIGURE_EXECUTIVE_RAM_SIZE   (2000*1024)

Definition at line 26 of file rtems_config.c.

#define CONFIGURE_FILESYSTEM_IMFS

Definition at line 59 of file rtems_config.c.

#define CONFIGURE_FILESYSTEM_NFS

Definition at line 58 of file rtems_config.c.

#define CONFIGURE_INIT

Definition at line 46 of file rtems_config.c.

#define CONFIGURE_INIT_TASK_ATTRIBUTES   (RTEMS_FLOATING_POINT | RTEMS_LOCAL)

Definition at line 51 of file rtems_config.c.

#define CONFIGURE_INIT_TASK_INITIAL_MODES
Value:
(RTEMS_PREEMPT | \
RTEMS_NO_TIMESLICE | \
RTEMS_NO_ASR | \
RTEMS_INTERRUPT_LEVEL(0))

Definition at line 47 of file rtems_config.c.

#define CONFIGURE_INIT_TASK_PRIORITY   80

Definition at line 42 of file rtems_config.c.

#define CONFIGURE_INIT_TASK_STACK_SIZE   (16*1024)

Definition at line 52 of file rtems_config.c.

#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS   150

Definition at line 36 of file rtems_config.c.

#define CONFIGURE_MALLOC_STATISTICS   1

Definition at line 44 of file rtems_config.c.

#define CONFIGURE_MAXIMUM_BARRIERS   rtems_resource_unlimited(30)

Definition at line 30 of file rtems_config.c.

#define CONFIGURE_MAXIMUM_DRIVERS   8

Definition at line 38 of file rtems_config.c.

#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES   rtems_resource_unlimited(5)

Definition at line 33 of file rtems_config.c.

#define CONFIGURE_MAXIMUM_SEMAPHORES   rtems_resource_unlimited(500)

Definition at line 31 of file rtems_config.c.

#define CONFIGURE_MAXIMUM_TASKS   rtems_resource_unlimited(30)

Definition at line 29 of file rtems_config.c.

#define CONFIGURE_MAXIMUM_TIMERS   rtems_resource_unlimited(20)

Definition at line 32 of file rtems_config.c.

#define CONFIGURE_MAXIMUM_USER_EXTENSIONS   1

Definition at line 34 of file rtems_config.c.

#define CONFIGURE_MICROSECONDS_PER_TICK   20000

Definition at line 40 of file rtems_config.c.

#define CONFIGURE_RTEMS_INIT_TASKS_TABLE

Definition at line 21 of file rtems_config.c.

#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM

Definition at line 37 of file rtems_config.c.

Function Documentation

rtems_task Init ( rtems_task_argument  argument)

Definition at line 565 of file rtems_init.c.

566 {
567  int result;
568  char *argv[3] = { NULL, NULL, NULL };
569  char *cp;
570  rtems_task_priority newpri;
571  rtems_status_code sc;
572  rtems_time_of_day now;
573 
574  /*
575  * Explain why we're here
576  */
577  logReset();
578 
579  /*
580  * Architecture-specific hooks
581  */
583  delayedPanic("epicsRtemsInitPreSetBootConfigFromNVRAM");
584  if (rtems_bsdnet_config.bootp == NULL) {
585  extern void setBootConfigFromNVRAM(void);
587  }
589  delayedPanic("epicsRtemsInitPostSetBootConfigFromNVRAM");
590 
591  /*
592  * Override RTEMS configuration
593  */
594  rtems_task_set_priority (
595  RTEMS_SELF,
597  &newpri);
598 
599  /*
600  * Create a reasonable environment
601  */
602  initConsole ();
603  putenv ("TERM=xterm");
604  putenv ("IOCSH_HISTSIZE=20");
605 
606  /*
607  * Display some OS information
608  */
609  printf("\n***** RTEMS Version: %s *****\n",
610  rtems_get_version_string());
611 
612  /*
613  * Start network
614  */
615  if ((cp = getenv("EPICS_TS_NTP_INET")) != NULL)
616  rtems_bsdnet_config.ntp_server[0] = cp;
617  if (rtems_bsdnet_config.network_task_priority == 0)
618  {
619  unsigned int p;
622  {
623  rtems_bsdnet_config.network_task_priority = epicsThreadGetOssPriorityValue(p);
624  }
625  }
626  printf("\n***** Initializing network *****\n");
627  rtems_bsdnet_initialize_network();
628  printf("\n***** Setting up file system *****\n");
629  initialize_remote_filesystem(argv, initialize_local_filesystem(argv));
630  fixup_hosts();
631 
632  /*
633  * More environment: iocsh prompt and hostname
634  */
635  {
636  char hostname[1024];
637  gethostname(hostname, 1023);
638  char *cp = mustMalloc(strlen(hostname)+3, "iocsh prompt");
639  sprintf(cp, "%s> ", hostname);
640  epicsEnvSet ("IOCSH_PS1", cp);
641  epicsEnvSet("IOC_NAME", hostname);
642  }
643 
644  /*
645  * Use BSP-supplied time of day if available otherwise supply default time.
646  * It is very likely that other time synchronization facilities in EPICS
647  * will soon override this value.
648  */
649  if (rtems_clock_get(RTEMS_CLOCK_GET_TOD,&now) != RTEMS_SUCCESSFUL) {
650  now.year = 2001;
651  now.month = 1;
652  now.day = 1;
653  now.hour = 0;
654  now.minute = 0;
655  now.second = 0;
656  now.ticks = 0;
657  if ((sc = rtems_clock_set (&now)) != RTEMS_SUCCESSFUL)
658  printf ("***** Can't set time: %s\n", rtems_status_text (sc));
659  }
660  if (getenv("TZ") == NULL) {
661  const char *tzp = envGetConfigParamPtr(&EPICS_TZ);
662  if (!tzp || *tzp)
663  printf("Warning: No timezone information, times will be displayed in UTC.\n");
664  else
665  epicsEnvSet("TZ", tzp);
666  }
667  tzset();
668  osdTimeRegister();
669 
670  /*
671  * Run the EPICS startup script
672  */
673  printf ("***** Preparing EPICS application *****\n");
674  iocshRegisterRTEMS ();
675  set_directory (argv[1]);
676  epicsEnvSet ("IOC_STARTUP_SCRIPT", argv[1]);
677  atexit(exitHandler);
678  errlogFlush();
679  printf ("***** Starting EPICS application *****\n");
680  result = main ((sizeof argv / sizeof argv[0]) - 1, argv);
681  printf ("***** IOC application terminating *****\n");
682  epicsThreadSleep(1.0);
683  epicsExit(result);
684 }
void errlogFlush(void)
Definition: errlog.c:529
pvac::PutEvent result
Definition: clientSync.cpp:117
LIBCOM_API const ENV_PARAM EPICS_TZ
int epicsRtemsInitPreSetBootConfigFromNVRAM(struct rtems_bsdnet_config *config)
struct rtems_bsdnet_config rtems_bsdnet_config
LIBCOM_API const char *epicsStdCall envGetConfigParamPtr(const ENV_PARAM *pParam)
Get a configuration parameter&#39;s value or default string.
Definition: envSubr.c:81
#define printf
Definition: epicsStdio.h:41
#define NULL
Definition: catime.c:38
void osdTimeRegister(void)
Definition: osdTime.cpp:36
LIBCOM_API void epicsStdCall epicsEnvSet(const char *name, const char *value)
Set an environment variable&#39;s value.
Definition: osdEnv.c:35
#define epicsThreadPriorityIocsh
Definition: epicsThread.h:84
int main(int argc, char **argv)
Definition: acctstMain.c:17
int epicsThreadGetOssPriorityValue(unsigned int osiPriority)
Definition: osdThread.c:98
LIBCOM_API void epicsExit(int status)
Calls epicsExitCallAtExits(), then the OS exit() routine.
Definition: epicsExit.c:182
int putenv(char *)
LIBCOM_API epicsThreadBooleanStatus epicsStdCall epicsThreadHighestPriorityLevelBelow(unsigned int priority, unsigned *pPriorityJustBelow)
Definition: osdThread.c:740
LIBCOM_API void epicsStdCall epicsThreadSleep(double seconds)
Block the calling thread for at least the specified time.
Definition: osdThread.c:790
#define epicsThreadPriorityScanLow
Definition: epicsThread.h:82
void setBootConfigFromNVRAM(void)
void * mustMalloc(int size, const char *msg)
Definition: rtems_init.c:105
int epicsRtemsInitPostSetBootConfigFromNVRAM(struct rtems_bsdnet_config *config)