Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 /* Copyright (c) 2006, Google Inc. | 1 /* Copyright (c) 2006, Google Inc. |
2 * All rights reserved. | 2 * All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
87 uint32_t fpscr_pad; | 87 uint32_t fpscr_pad; |
88 uint32_t fpscr; /* Status/control */ | 88 uint32_t fpscr; /* Status/control */ |
89 } MDFloatingSaveAreaPPC; /* Based on ppc_float_state */ | 89 } MDFloatingSaveAreaPPC; /* Based on ppc_float_state */ |
90 | 90 |
91 | 91 |
92 #define MD_VECTORSAVEAREA_PPC_VR_COUNT 32 | 92 #define MD_VECTORSAVEAREA_PPC_VR_COUNT 32 |
93 | 93 |
94 typedef struct { | 94 typedef struct { |
95 /* Vector registers (including vscr) are 128 bits, but mach/ppc/_types.h | 95 /* Vector registers (including vscr) are 128 bits, but mach/ppc/_types.h |
96 * exposes them as four 32-bit quantities. */ | 96 * exposes them as four 32-bit quantities. */ |
97 uint128_t save_vr[MD_VECTORSAVEAREA_PPC_VR_COUNT]; | 97 uint128_struct save_vr[MD_VECTORSAVEAREA_PPC_VR_COUNT]; |
98 uint128_t save_vscr; /* Status/control */ | 98 uint128_struct save_vscr; /* Status/control */ |
99 uint32_t save_pad5[4]; | 99 uint32_t save_pad5[4]; |
100 uint32_t save_vrvalid; /* Identifies which vector registers are saved */ | 100 uint32_t save_vrvalid; /* Identifies which vector registers are saved*/ |
Ted Mielczarek
2013/03/06 13:41:49
I know the lack of a trailing space here probably
Mark Mentovai
2013/03/06 13:58:45
Ted Mielczarek wrote:
| |
101 uint32_t save_pad6[7]; | 101 uint32_t save_pad6[7]; |
102 } MDVectorSaveAreaPPC; /* ppc_vector_state */ | 102 } MDVectorSaveAreaPPC; /* ppc_vector_state */ |
103 | 103 |
104 | 104 |
105 #define MD_CONTEXT_PPC_GPR_COUNT 32 | 105 #define MD_CONTEXT_PPC_GPR_COUNT 32 |
106 | 106 |
107 /* Use the same 32-bit alignment when accessing this structure from 64-bit code | 107 /* Use the same 32-bit alignment when accessing this structure from 64-bit code |
108 * as is used natively in 32-bit code. #pragma pack is a MSVC extension | 108 * as is used natively in 32-bit code. #pragma pack is a MSVC extension |
109 * supported by gcc. */ | 109 * supported by gcc. */ |
110 #if defined(__SUNPRO_C) || defined(__SUNPRO_CC) | 110 #if defined(__SUNPRO_C) || defined(__SUNPRO_CC) |
111 #pragma pack(4) | 111 #pragma pack(4) |
112 #else | 112 #else |
113 #pragma pack(push, 4) | 113 #pragma pack(push, 4) |
114 #endif | 114 #endif |
115 | 115 |
116 typedef struct { | 116 typedef struct { |
117 /* context_flags is not present in ppc_thread_state, but it aids | 117 /* context_flags is not present in ppc_thread_state, but it aids |
118 * identification of MDRawContextPPC among other raw context types, | 118 * identification of MDRawContextPPC among other raw context types, |
119 * and it guarantees alignment when we get to float_save. */ | 119 * and it guarantees alignment when we get to float_save. */ |
120 uint32_t context_flags; | 120 uint32_t context_flags; |
121 | 121 |
122 uint32_t srr0; /* Machine status save/restore: stores pc | 122 uint32_t srr0; /* Machine status save/restore: stores pc |
123 * (instruction) */ | 123 * (instruction) */ |
124 uint32_t srr1; /* Machine status save/restore: stores msr | 124 uint32_t srr1; /* Machine status save/restore: stores msr |
125 * (ps, program/machine state) */ | 125 * (ps, program/machine state) */ |
126 /* ppc_thread_state contains 32 fields, r0 .. r31. Here, an array is | 126 /* ppc_thread_state contains 32 fields, r0 .. r31. Here, an array is |
127 * used for brevity. */ | 127 * used for brevity. */ |
128 uint32_t gpr[MD_CONTEXT_PPC_GPR_COUNT]; | 128 uint32_t gpr[MD_CONTEXT_PPC_GPR_COUNT]; |
129 uint32_t cr; /* Condition */ | 129 uint32_t cr; /* Condition */ |
130 uint32_t xer; /* Integer (fiXed-point) exception */ | 130 uint32_t xer; /* Integer (fiXed-point) exception */ |
131 uint32_t lr; /* Link */ | 131 uint32_t lr; /* Link */ |
132 uint32_t ctr; /* Count */ | 132 uint32_t ctr; /* Count */ |
133 uint32_t mq; /* Multiply/Quotient (PPC 601, POWER only) */ | 133 uint32_t mq; /* Multiply/Quotient (PPC 601, POWER only) */ |
134 uint32_t vrsave; /* Vector save */ | 134 uint32_t vrsave; /* Vector save */ |
Mark Mentovai
2013/03/04 20:24:46
Looks like these were supposed to line up with flo
| |
135 | 135 |
136 /* float_save and vector_save aren't present in ppc_thread_state, but | 136 /* float_save and vector_save aren't present in ppc_thread_state, but |
137 * are represented in separate structures that still define a thread's | 137 * are represented in separate structures that still define a thread's |
138 * context. */ | 138 * context. */ |
139 MDFloatingSaveAreaPPC float_save; | 139 MDFloatingSaveAreaPPC float_save; |
140 MDVectorSaveAreaPPC vector_save; | 140 MDVectorSaveAreaPPC vector_save; |
141 } MDRawContextPPC; /* Based on ppc_thread_state */ | 141 } MDRawContextPPC; /* Based on ppc_thread_state */ |
142 | 142 |
143 #if defined(__SUNPRO_C) || defined(__SUNPRO_CC) | 143 #if defined(__SUNPRO_C) || defined(__SUNPRO_CC) |
144 #pragma pack(0) | 144 #pragma pack(0) |
145 #else | 145 #else |
146 #pragma pack(pop) | 146 #pragma pack(pop) |
147 #endif | 147 #endif |
148 | 148 |
149 /* For (MDRawContextPPC).context_flags. These values indicate the type of | 149 /* For (MDRawContextPPC).context_flags. These values indicate the type of |
150 * context stored in the structure. MD_CONTEXT_PPC is Breakpad-defined. Its | 150 * context stored in the structure. MD_CONTEXT_PPC is Breakpad-defined. Its |
151 * value was chosen to avoid likely conflicts with MD_CONTEXT_* for other | 151 * value was chosen to avoid likely conflicts with MD_CONTEXT_* for other |
152 * CPUs. */ | 152 * CPUs. */ |
153 #define MD_CONTEXT_PPC 0x20000000 | 153 #define MD_CONTEXT_PPC 0x20000000 |
154 #define MD_CONTEXT_PPC_BASE (MD_CONTEXT_PPC | 0x00000001) | 154 #define MD_CONTEXT_PPC_BASE (MD_CONTEXT_PPC | 0x00000001) |
155 #define MD_CONTEXT_PPC_FLOATING_POINT (MD_CONTEXT_PPC | 0x00000008) | 155 #define MD_CONTEXT_PPC_FLOATING_POINT (MD_CONTEXT_PPC | 0x00000008) |
156 #define MD_CONTEXT_PPC_VECTOR (MD_CONTEXT_PPC | 0x00000020) | 156 #define MD_CONTEXT_PPC_VECTOR (MD_CONTEXT_PPC | 0x00000020) |
157 | 157 |
158 #define MD_CONTEXT_PPC_FULL MD_CONTEXT_PPC_BASE | 158 #define MD_CONTEXT_PPC_FULL MD_CONTEXT_PPC_BASE |
159 #define MD_CONTEXT_PPC_ALL (MD_CONTEXT_PPC_FULL | \ | 159 #define MD_CONTEXT_PPC_ALL (MD_CONTEXT_PPC_FULL | \ |
160 MD_CONTEXT_PPC_FLOATING_POINT | \ | 160 MD_CONTEXT_PPC_FLOATING_POINT | \ |
161 MD_CONTEXT_PPC_VECTOR) | 161 MD_CONTEXT_PPC_VECTOR) |
162 | 162 |
163 #endif /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_PPC_H__ */ | 163 #endif /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_PPC_H__ */ |
LEFT | RIGHT |