source: rtems/cpukit/score/src/percpuasm.c @ 2afb22b

5
Last change on this file since 2afb22b was f9aa34d, checked in by Sebastian Huber <sebastian.huber@…>, on 11/11/16 at 13:12:03

score: Add Per_CPU_Control::Interrupt_frame

Update #2809.

  • Property mode set to 100644
File size: 3.2 KB
Line 
1/*
2 * Copyright (c) 2012, 2016 embedded brains GmbH.  All rights reserved.
3 *
4 *  embedded brains GmbH
5 *  Dornierstr. 4
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
24/*
25 * In case a CPU port needs another alignment, then add this here and make sure
26 * it is a power of two greater than or equal to two.
27 */
28RTEMS_STATIC_ASSERT(
29  CPU_ALIGNMENT == 2
30    || CPU_ALIGNMENT == 4
31    || CPU_ALIGNMENT == 8
32    || CPU_ALIGNMENT == 16
33    || CPU_ALIGNMENT == 32,
34  CPU_ALIGNMENT
35);
36
37/*
38 * In case a CPU port needs another heap alignment, then add this here and make
39 * sure it is a power of two greater than or equal to two.
40 */
41RTEMS_STATIC_ASSERT(
42  CPU_HEAP_ALIGNMENT == 2
43    || CPU_HEAP_ALIGNMENT == 4
44    || CPU_HEAP_ALIGNMENT == 8
45    || CPU_HEAP_ALIGNMENT == 16
46    || CPU_HEAP_ALIGNMENT == 32,
47  CPU_HEAP_ALIGNMENT_0
48);
49
50RTEMS_STATIC_ASSERT(
51  CPU_HEAP_ALIGNMENT >= CPU_ALIGNMENT,
52  CPU_HEAP_ALIGNMENT_1
53);
54
55RTEMS_STATIC_ASSERT(
56  sizeof(void *) == CPU_SIZEOF_POINTER,
57  CPU_SIZEOF_POINTER
58);
59
60#if defined( __SIZEOF_POINTER__ )
61  RTEMS_STATIC_ASSERT(
62    CPU_SIZEOF_POINTER == __SIZEOF_POINTER__,
63    __SIZEOF_POINTER__
64  );
65#endif
66
67#if CPU_PER_CPU_CONTROL_SIZE > 0
68  RTEMS_STATIC_ASSERT(
69    sizeof( CPU_Per_CPU_control ) == CPU_PER_CPU_CONTROL_SIZE,
70    CPU_PER_CPU_CONTROL_SIZE
71  );
72#endif
73
74#if defined( RTEMS_SMP )
75  RTEMS_STATIC_ASSERT(
76    sizeof( Per_CPU_Control_envelope ) == PER_CPU_CONTROL_SIZE,
77    PER_CPU_CONTROL_SIZE
78  );
79#endif
80
81RTEMS_STATIC_ASSERT(
82  offsetof(Per_CPU_Control, isr_nest_level) == PER_CPU_ISR_NEST_LEVEL,
83  PER_CPU_ISR_NEST_LEVEL
84);
85
86RTEMS_STATIC_ASSERT(
87  offsetof(Per_CPU_Control, isr_dispatch_disable)
88    == PER_CPU_ISR_DISPATCH_DISABLE,
89  PER_CPU_ISR_DISPATCH_DISABLE
90);
91
92RTEMS_STATIC_ASSERT(
93  offsetof(Per_CPU_Control, thread_dispatch_disable_level)
94    == PER_CPU_THREAD_DISPATCH_DISABLE_LEVEL,
95  PER_CPU_THREAD_DISPATCH_DISABLE_LEVEL
96);
97
98RTEMS_STATIC_ASSERT(
99  offsetof(Per_CPU_Control, executing) == PER_CPU_OFFSET_EXECUTING,
100  PER_CPU_OFFSET_EXECUTING
101);
102
103RTEMS_STATIC_ASSERT(
104  offsetof(Per_CPU_Control, heir) == PER_CPU_OFFSET_HEIR,
105  PER_CPU_OFFSET_HEIR
106);
107
108RTEMS_STATIC_ASSERT(
109  offsetof(Per_CPU_Control, dispatch_necessary) == PER_CPU_DISPATCH_NEEDED,
110  PER_CPU_DISPATCH_NEEDED
111);
112
113#if defined(RTEMS_SMP)
114RTEMS_STATIC_ASSERT(
115  offsetof(Per_CPU_Control, Interrupt_frame) == PER_CPU_INTERRUPT_FRAME_AREA,
116  PER_CPU_INTERRUPT_FRAME_AREA
117);
118
119RTEMS_STATIC_ASSERT(
120  sizeof( CPU_Interrupt_frame ) == CPU_INTERRUPT_FRAME_SIZE,
121  CPU_INTERRUPT_FRAME_SIZE
122);
123#endif
124
125#if CPU_ALLOCATE_INTERRUPT_STACK == TRUE \
126  || CPU_HAS_SOFTWARE_INTERRUPT_STACK == TRUE
127  RTEMS_STATIC_ASSERT(
128    offsetof(Per_CPU_Control, interrupt_stack_low)
129      == PER_CPU_INTERRUPT_STACK_LOW,
130    PER_CPU_INTERRUPT_STACK_LOW
131  );
132
133  RTEMS_STATIC_ASSERT(
134    offsetof(Per_CPU_Control, interrupt_stack_high)
135      == PER_CPU_INTERRUPT_STACK_HIGH,
136    PER_CPU_INTERRUPT_STACK_HIGH
137  );
138#endif
Note: See TracBrowser for help on using the repository browser.