source: rtems-schedsim/schedsim/shell/schedsim_smpsimple/smp_stub.c @ 726b27c

Last change on this file since 726b27c was 726b27c, checked in by Joel Sherrill <joel.sherrill@…>, on 12/13/13 at 17:01:48

schedsim: Update to latest RTEMS. Works Uniprocessor

  • Property mode set to 100644
File size: 1.5 KB
Line 
1/*
2 *  RTEMS SMP Support for Single Core
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#include <rtems.h>
13#include <rtems/bspIo.h>
14#include <rtems/bspsmp.h>
15#include <stdlib.h>
16
17uint32_t Schedsim_Current_cpu;
18extern uint32_t Schedsim_Maximum_CPUs_From_Command_Line;
19
20void bsp_smp_secondary_cpu_initialize(int cpu)
21{
22  Schedsim_Current_cpu = 0;
23}
24
25int bsp_smp_processor_id(void)
26{
27  return Schedsim_Current_cpu;
28}
29
30uint32_t bsp_smp_initialize(
31  uint32_t configured_cpu_count
32)
33{
34  if ( configured_cpu_count < Schedsim_Maximum_CPUs_From_Command_Line ) {
35    printf(
36      "ERROR - Maximum cores per confdefs.h is %d\n",
37      configured_cpu_count
38    );
39    exit( 1 );
40  }
41
42  /* return the number of CPUs */
43  return Schedsim_Maximum_CPUs_From_Command_Line;
44}
45
46void bsp_smp_broadcast_interrupt(void)
47{
48}
49
50void bsp_smp_broadcast_message(
51  uint32_t  message
52)
53{
54}
55
56void bsp_smp_interrupt_cpu(
57  int cpu
58)
59{
60}
61
62void bsp_smp_delay( int max )
63{
64}
65
66void bsp_smp_wait_for(
67  volatile unsigned int *address,
68  unsigned int           desired,
69  int                    maximum_usecs
70)
71{
72  int iterations;
73  volatile int i;
74  volatile unsigned int *p = address;
75
76  for (iterations=0 ;  iterations < maximum_usecs ; iterations++ ) {
77    *p = desired;
78    /* XXX hack to make simulator happy */
79  }
80}
81
Note: See TracBrowser for help on using the repository browser.