source: rtems/cpukit/score/src/percpuasm.c @ e8fffc2d

4.115
Last change on this file since e8fffc2d was c499856, checked in by Chris Johns <chrisj@…>, on 03/20/14 at 21:10:47

Change all references of rtems.com to rtems.org.

  • Property mode set to 100644
File size: 1.8 KB
Line 
1/*
2 * Copyright (c) 2012 embedded brains GmbH.  All rights reserved.
3 *
4 *  embedded brains GmbH
5 *  Obere Lagerstr. 30
6 *  82178 Puchheim
7 *  Germany
8 *  <rtems@embedded-brains.de>
9 *
10 * The license and distribution terms for this file may be
11 * found in the file LICENSE in this distribution or at
12 * http://www.rtems.org/license/LICENSE.
13 */
14
15#if HAVE_CONFIG_H
16  #include "config.h"
17#endif
18
19#include <rtems/score/cpu.h>
20
21#define _RTEMS_PERCPU_DEFINE_OFFSETS
22#include <rtems/score/percpu.h>
23
24RTEMS_STATIC_ASSERT(
25  sizeof(void *) == CPU_SIZEOF_POINTER,
26  CPU_SIZEOF_POINTER
27);
28
29#if defined( __SIZEOF_POINTER__ )
30  RTEMS_STATIC_ASSERT(
31    CPU_SIZEOF_POINTER == __SIZEOF_POINTER__,
32    __SIZEOF_POINTER__
33  );
34#endif
35
36RTEMS_STATIC_ASSERT(
37  sizeof( CPU_Per_CPU_control ) == CPU_PER_CPU_CONTROL_SIZE,
38  CPU_PER_CPU_CONTROL_SIZE
39);
40
41#if defined( RTEMS_SMP )
42  RTEMS_STATIC_ASSERT(
43    sizeof( Per_CPU_Control_envelope ) == PER_CPU_CONTROL_SIZE,
44    PER_CPU_CONTROL_SIZE
45  );
46#endif
47
48RTEMS_STATIC_ASSERT(
49  offsetof(Per_CPU_Control, isr_nest_level) == PER_CPU_ISR_NEST_LEVEL,
50  PER_CPU_ISR_NEST_LEVEL
51);
52
53RTEMS_STATIC_ASSERT(
54  offsetof(Per_CPU_Control, thread_dispatch_disable_level)
55    == PER_CPU_THREAD_DISPATCH_DISABLE_LEVEL,
56  PER_CPU_THREAD_DISPATCH_DISABLE_LEVEL
57);
58
59RTEMS_STATIC_ASSERT(
60  offsetof(Per_CPU_Control, dispatch_necessary) == PER_CPU_DISPATCH_NEEDED,
61  PER_CPU_DISPATCH_NEEDED
62);
63
64#if CPU_ALLOCATE_INTERRUPT_STACK == TRUE \
65  || CPU_HAS_SOFTWARE_INTERRUPT_STACK == TRUE
66  RTEMS_STATIC_ASSERT(
67    offsetof(Per_CPU_Control, interrupt_stack_low)
68      == PER_CPU_INTERRUPT_STACK_LOW,
69    PER_CPU_INTERRUPT_STACK_LOW
70  );
71
72  RTEMS_STATIC_ASSERT(
73    offsetof(Per_CPU_Control, interrupt_stack_high)
74      == PER_CPU_INTERRUPT_STACK_HIGH,
75    PER_CPU_INTERRUPT_STACK_HIGH
76  );
77#endif
Note: See TracBrowser for help on using the repository browser.