source: rtems-schedsim/schedsim/shell/shared/main_rtemsinit.c @ a2aad55

Last change on this file since a2aad55 was a2aad55, checked in by Joel Sherrill <joel.sherrill@…>, on May 1, 2013 at 12:41:56 AM

Remove CVS $

  • Property mode set to 100644
File size: 1.3 KB
Line 
1/*
2 *  Initialize RTEMS Shell Command Implmentation
3 *
4 *  COPYRIGHT (c) 1989-2013.
5 *  On-Line Applications Research Corporation (OAR).
6 *
7 *  The license and distribution terms for this file may be
8 *  found in the file LICENSE in this distribution or at
9 *  http://www.rtems.com/license/LICENSE.
10 */
11
12#ifdef HAVE_CONFIG_H
13#include "config.h"
14#endif
15
16#include <stdio.h>
17
18#include <rtems.h>
19#include "shell.h"
20#include <schedsim_shell.h>
21#include <rtems/stringto.h>
22
23#if defined(RTEMS_SMP)
24  #include <rtems/score/smp.h>
25#endif
26
27int rtems_shell_main_rtems_init(
28  int   argc,
29  char *argv[]
30)
31{
32#if defined(RTEMS_SMP)
33  long cpus;
34
35  if ( argc >= 2 ) {
36    if ( rtems_string_to_long(argv[1], &cpus, NULL, 0) ) {
37      printf( "Number of CPUs argument (%s) is not a number\n", argv[1] );
38      return -1;
39    }
40    rtems_configuration_smp_maximum_processors = cpus;
41  }
42#endif
43
44  //
45  // Initialize RTEMS
46  //
47  rtems_initialize_data_structures();
48  return 0;
49}
50
51rtems_shell_cmd_t rtems_shell_RTEMS_INIT_Command = {
52  "rtems_init",                 /* name */
53  "rtems_init [cpus]",          /* usage */
54  "rtems",                      /* topic */
55  rtems_shell_main_rtems_init,  /* command */
56  NULL,                         /* alias */
57  NULL                          /* next */
58};
Note: See TracBrowser for help on using the repository browser.