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

4.115
Last change on this file since 8581725 was 10fd4aac, checked in by Sebastian Huber <sebastian.huber@…>, on 08/02/13 at 11:54:08

score/cpu: Add CPU_Per_CPU_control

Add CPU port specific per-CPU control.

  • Property mode set to 100644
File size: 1.6 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.com/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, dispatch_necessary) == PER_CPU_DISPATCH_NEEDED,
55  PER_CPU_DISPATCH_NEEDED
56);
57
58#if CPU_ALLOCATE_INTERRUPT_STACK == TRUE \
59  || CPU_HAS_SOFTWARE_INTERRUPT_STACK == TRUE
60  RTEMS_STATIC_ASSERT(
61    offsetof(Per_CPU_Control, interrupt_stack_low)
62      == PER_CPU_INTERRUPT_STACK_LOW,
63    PER_CPU_INTERRUPT_STACK_LOW
64  );
65
66  RTEMS_STATIC_ASSERT(
67    offsetof(Per_CPU_Control, interrupt_stack_high)
68      == PER_CPU_INTERRUPT_STACK_HIGH,
69    PER_CPU_INTERRUPT_STACK_HIGH
70  );
71#endif
Note: See TracBrowser for help on using the repository browser.