source: rtems/cpukit/score/cpu/powerpc/include/rtems/score/paravirt.h @ 0a7a30d

5
Last change on this file since 0a7a30d was 0a7a30d, checked in by Joel Sherrill <joel@…>, on Mar 12, 2018 at 7:53:09 PM

Add PowerPC paravirtualization support

Cannot read or write MSR when executing in user mode. This
is used when RTEMS_PARAVIRT is defined.

Provide alternate methods to disable/enable interrupts

Closes #3306.

  • Property mode set to 100644
File size: 1.8 KB
Line 
1/**
2 * @file
3 *
4 * @brief PowerPC Paravirtualization Definitions
5 *
6 * This include file contains definitions pertaining to paravirtualization
7 * of the PowerPC port.
8 */
9
10/*
11 *  COPYRIGHT (c) 2018.
12 *  On-Line Applications Research Corporation (OAR).
13 *
14 *  The license and distribution terms for this file may in
15 *  the file LICENSE in this distribution or at
16 *  http://www.rtems.org/license/LICENSE.
17 */
18
19
20#ifndef RTEMS_PARAVIRT
21#error "This file should only be included with paravirtualization is enabled."
22#endif
23
24#ifndef _RTEMS_SCORE_PARAVIRT_H
25#define _RTEMS_SCORE_PARAVIRT_H
26
27/**
28 * @defgroup ParavirtPowerPC Paravirtualization PowerPC Support
29 *
30 * @ingroup Score
31 *
32 * This handler encapulates the functionality (primarily conditional
33 * feature defines) related to paravirtualization on the PowerPC.
34 *
35 * Paravirtualization on the PowerPC makes the following assumptions:
36 *
37 *   - RTEMS executes in user space
38 *   - In user space there is no access to the MSR.
39 *   - Interrupt enable/disable support using the MSR must be disabled
40 *     and replaced with BSP provided methods which are adapted to the
41 *     hosting environment.
42 */
43
44#ifndef ASM
45
46#ifdef __cplusplus
47extern "C" {
48#endif
49
50#ifdef __cplusplus
51}
52#endif
53
54#endif  /* !ASM */
55
56/**
57 * In a paravirtualized environment, RTEMS executes in user space
58 * and cannot disable/enable external exceptions (e.g. interrupts).
59 * The BSP which acts as an adapter to the hosting environment will
60 * provide the interrupt enable/disable methods.
61 */
62#define PPC_DISABLE_INLINE_ISR_DISABLE_ENABLE
63
64/**
65 * In a paravirtualized environment, RTEMS executes in user space
66 * and cannot access the MSR.
67 *
68 * Try to have as little impact as possible with this define.  Leave
69 * the msr in the thread context because that would impact the definition
70 * of offsets for assembly code.
71 */
72#define PPC_DISABLE_MSR_ACCESS
73
74#endif
Note: See TracBrowser for help on using the repository browser.