summaryrefslogtreecommitdiffstats
path: root/sbe/image/proc_sbe_fixed.H
blob: 16701f747fa09845ddc2b542293b069e07011d8e (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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
//-----------------------------------------------------------------------------
// *! (C) Copyright International Business Machines Corp. 2014
// *! All Rights Reserved -- Property of IBM
// *! *** IBM Confidential ***
//-----------------------------------------------------------------------------

/// \file proc_sbe_fixed.H
/// \brief Define the layout of fixed-position data in the P9 SBE reference
/// and IPL images
///
/// Contains struct ProcSbeFixed which contains functions, rings and
/// attributes whose pointers are stored in the fixed and fixed_toc section
///
/// This file defines the layout of the special .fixed data section of P9 SBE
/// reference and IPL images.  The .fixed section is guaranteed to appear at a
/// fixed offset from the beginning of the image, containing data required to
/// be manipulated when images are resident in non-volatile memories, thereby
/// avoiding having to search the TOC. Data manipulated during in-memory image
/// processing can always be easily located using the SBE-XIP TOC APIs.  All
/// of the data stored in .fixed can also still be referenced via the SBE-XIP
/// TOC.
///
/// This header file can be #include-ed into either C or SBE assembly language
/// source code.  In C, it creates simple structures 'ProcChipAttributes',
/// 'PervAttributes', 'CoreAttributes', 'EQAttributes' and 'EXAttributes' that
/// contain attribute information that are sized per XML definition per entry.
///
/// PPE image data is always stored big-endian, so applications on little-endian
/// hosts will need to perform the appropriate endian converison when reading or
/// writing images via this header.
///
/// In assembler code, this header creates macros '.proc_sbe_fixed_proc_chip',
/// '.proc_sbe_fixed_perv', '.proc_sbe_fixed_core', '.proc_sbe_fixed_ex',
/// '.proc_sbe_fixed_eq', that is expanded exactly once in the file
/// 'sbe_base_header.S', creating the actual data allocation of the data
/// equivalent to the C structure.  Assembler code references the data symbols
/// as normal.
///
/// To simplify programming a 'mini-TOC' is also provided for this data in
/// the .fixed_toc section.  This section is comprised of SbeXipHashedToc
/// structures. When a symbol is indedxed in .fixed, a blank SbeXipHashedToc
/// stucture is added to .fixed_toc.  During image normalization the array of
/// SbeXipHashedToc is filled in as each symbol in .fixed is re-indexed into
/// .fixed_toc.

#ifndef __PROC_SBE_FIXED_H__
#define __PROC_SBE_FIXED_H__

#include "p9_sbe.H"
#include "plat_target_parms.H"
#include "fapi2AttributeIds.H"

#ifdef __ASSEMBLER__
         .macro     .proc_sbe_fixed_system
	     .section   .fixed, "a", @progbits
	     .balign    8
         .global    G_system_attributes
G_system_attributes:
#else

extern "C" {
namespace fapi2attr {
typedef struct SystemAttributes_t {
#endif

#include "proc_sbe_fixed_system.H"

#ifdef __ASSEMBLER__
	.endm
#else
} SystemAttributes;
} // fapi2
} // C
#endif

#ifdef __ASSEMBLER__
         .macro     .proc_sbe_fixed_proc_chip
	     .section   .fixed, "a", @progbits
	     .balign    8
         .global    G_proc_chip_attributes
G_proc_chip_attributes:
#else

extern "C" {
namespace fapi2attr {
typedef struct ProcChipAttributes_t {
#endif

#include "proc_sbe_fixed_proc_chip.H"

#ifdef __ASSEMBLER__
	.endm
#else
} ProcChipAttributes;
} // fapi2
} // C
#endif

///
/// Pervasive Target Attributes
#ifdef __ASSEMBLER__
         .macro	    .proc_sbe_fixed_perv
	     .section   .fixed, "a", @progbits
	     .balign    8
         .global    G_perv_attributes
G_perv_attributes:
#else
namespace fapi2attr {
typedef struct PervAttributes_t {
#endif

#include "proc_sbe_fixed_perv.H"

#ifdef __ASSEMBLER__
	.endm
#else
} PervAttributes;
} // fapi2
#endif

///
/// Core (EC) Target Attributes
#ifdef __ASSEMBLER__
        .macro     .proc_sbe_fixed_core
        .section   .fixed, "a", @progbits
	    .balign    8
        .global     G_core_attributes
G_core_attributes:
#else
namespace fapi2attr {
typedef struct CoreAttributes_t {
#endif

#include "proc_sbe_fixed_core.H"

#ifdef __ASSEMBLER__
	.endm
#else
} CoreAttributes;
} // fapi2
#endif

///
/// EX Target Attributes
#ifdef __ASSEMBLER__
         .macro	    .proc_sbe_fixed_ex
	     .section   .fixed, "a", @progbits
	     .balign    8
         .global    G_ex_attributes
G_ex_attributes:
#else
namespace fapi2attr {
typedef struct EXAttributes_t {
#endif

#include "proc_sbe_fixed_ex.H"

#ifdef __ASSEMBLER__
	.endm
#else
} EXAttributes;
} // fapi2
#endif

///
/// EQ Target Attributes
#ifdef __ASSEMBLER__
         .macro	    .proc_sbe_fixed_eq
	     .section   .fixed, "a", @progbits
	     .balign    8
         .global    G_eq_attributes
G_eq_attributes:
#else
namespace fapi2attr {
typedef struct EQAttributes_t {
#endif

#include "proc_sbe_fixed_eq.H"

#ifdef __ASSEMBLER__
	.endm
#else
} EQAttributes;
} // fapi2
#endif


#endif  // __PROC_SBE_FIXED_H__
OpenPOWER on IntegriCloud