blob: 0b53873e4eba6e698c8643dce9373e311bafb3b7 (
plain)
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
|
/**
* @file
*
* @brief ARMV7M Interrupt Service Enter and Leave
*/
/*
* Copyright (c) 2011, 2017 Sebastian Huber. All rights reserved.
*
* embedded brains GmbH
* Dornierstr. 4
* 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.org/license/LICENSE.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <rtems/score/armv7m.h>
#include <rtems/score/isr.h>
#include <rtems/score/threaddispatch.h>
#ifdef ARM_MULTILIB_ARCH_V7M
void _ARMV7M_Interrupt_service_enter( void )
{
Per_CPU_Control *cpu_self = _Per_CPU_Get();
++cpu_self->thread_dispatch_disable_level;
++cpu_self->isr_nest_level;
}
void _ARMV7M_Interrupt_service_leave( void )
{
Per_CPU_Control *cpu_self = _Per_CPU_Get();
--cpu_self->thread_dispatch_disable_level;
--cpu_self->isr_nest_level;
/*
* Optimistically activate a pendable service call if a thread dispatch is
* necessary. The _ARMV7M_Pendable_service_call() will check that a thread
* dispatch is allowed.
*/
if ( cpu_self->dispatch_necessary ) {
_ARMV7M_SCB->icsr = ARMV7M_SCB_ICSR_PENDSVSET;
}
}
#endif /* ARM_MULTILIB_ARCH_V7M */
|