summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/percpuasm.c
blob: a79936bab4ee8229212c96d8c6077a293ef528a9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
 * Copyright (c) 2012 embedded brains GmbH.  All rights reserved.
 *
 *  embedded brains GmbH
 *  Obere Lagerstr. 30
 *  82178 Puchheim
 *  Germany
 *  <rtems@embedded-brains.de>
 *
 * The license and distribution terms for this file may be
 * found in the file LICENSE in this distribution or at
 * http://www.rtems.com/license/LICENSE.
 */

#if HAVE_CONFIG_H
  #include "config.h"
#endif

#include <rtems/score/cpu.h>

#define _RTEMS_PERCPU_DEFINE_OFFSETS
#include <rtems/score/percpu.h>

RTEMS_STATIC_ASSERT(
  sizeof(void *) == CPU_SIZEOF_POINTER,
  CPU_SIZEOF_POINTER
);

#ifdef __SIZEOF_POINTER__
  RTEMS_STATIC_ASSERT(
    CPU_SIZEOF_POINTER == __SIZEOF_POINTER__,
    __SIZEOF_POINTER__
  );
#endif

RTEMS_STATIC_ASSERT(
  offsetof(Per_CPU_Control, isr_nest_level) == PER_CPU_ISR_NEST_LEVEL,
  PER_CPU_ISR_NEST_LEVEL
);

RTEMS_STATIC_ASSERT(
  offsetof(Per_CPU_Control, dispatch_necessary) == PER_CPU_DISPATCH_NEEDED,
  PER_CPU_DISPATCH_NEEDED
);

#if CPU_ALLOCATE_INTERRUPT_STACK == TRUE \
  || CPU_HAS_SOFTWARE_INTERRUPT_STACK == TRUE
  RTEMS_STATIC_ASSERT(
    offsetof(Per_CPU_Control, interrupt_stack_low)
      == PER_CPU_INTERRUPT_STACK_LOW,
    PER_CPU_INTERRUPT_STACK_LOW
  );

  RTEMS_STATIC_ASSERT(
    offsetof(Per_CPU_Control, interrupt_stack_high)
      == PER_CPU_INTERRUPT_STACK_HIGH,
    PER_CPU_INTERRUPT_STACK_HIGH
  );
#endif