Left: | ||
Right: |
OLD | NEW |
---|---|
(Empty) | |
1 /* Copyright (c) 2015, Google Inc. | |
Ben Chan
2015/04/02 19:06:27
this is a new file but the header including the li
| |
2 * All rights reserved. | |
3 * | |
4 * Redistribution and use in source and binary forms, with or without | |
5 * modification, are permitted provided that the following conditions are | |
6 * met: | |
7 * | |
8 * * Redistributions of source code must retain the above copyright | |
9 * notice, this list of conditions and the following disclaimer. | |
10 * * Redistributions in binary form must reproduce the above | |
11 * copyright notice, this list of conditions and the following disclaimer | |
12 * in the documentation and/or other materials provided with the | |
13 * distribution. | |
14 * * Neither the name of Google Inc. nor the names of its | |
15 * contributors may be used to endorse or promote products derived from | |
16 * this software without specific prior written permission. | |
17 * | |
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ | |
29 | |
30 /* minidump_format.h: A cross-platform reimplementation of minidump-related | |
31 * portions of DbgHelp.h from the Windows Platform SDK. | |
32 * | |
33 * (This is C99 source, please don't corrupt it with C++.) | |
34 * | |
35 * This file contains the necessary definitions to read minidump files | |
36 * produced on sh4. These files may be read on any platform provided | |
37 * that the alignments of these structures on the processing system are | |
38 * identical to the alignments of these structures on the producing system. | |
39 * For this reason, precise-sized types are used. The structures defined | |
40 * by this file have been laid out to minimize alignment problems by | |
41 * ensuring that all members are aligned on their natural boundaries. | |
42 * In some cases, tail-padding may be significant when different ABIs specify | |
43 * different tail-padding behaviors. To avoid problems when reading or | |
44 * writing affected structures, MD_*_SIZE macros are provided where needed, | |
45 * containing the useful size of the structures without padding. | |
46 * | |
47 * Structures that are defined by Microsoft to contain a zero-length array | |
48 * are instead defined here to contain an array with one element, as | |
49 * zero-length arrays are forbidden by standard C and C++. In these cases, | |
50 * *_minsize constants are provided to be used in place of sizeof. For a | |
51 * cleaner interface to these sizes when using C++, see minidump_size.h. | |
52 * | |
53 * These structures are also sufficient to populate minidump files. | |
54 * | |
55 * Because precise data type sizes are crucial for this implementation to | |
56 * function properly and portably, a set of primitive types with known sizes | |
57 * are used as the basis of each structure defined by this file. | |
58 * | |
59 */ | |
60 | |
61 /* | |
62 * SH4 support | |
63 */ | |
64 | |
65 #ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_SHX_H__ | |
66 #define GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_SHX_H__ | |
67 | |
68 #define MD_CONTEXT_SHX_FPR_COUNT 16 | |
69 | |
70 /* | |
71 * Note that these structures *do not* map directly to the CONTEXT | |
72 * structure defined in WinNT.h in the Windows Mobile SDK. That structure | |
73 * does not accomodate VFPv3, and I'm unsure if it was ever used in the | |
74 * wild anyway, as Windows CE only seems to produce "cedumps" which | |
75 * are not exactly minidumps. | |
Ted Mielczarek
2015/04/02 12:24:35
You cargo-culted this from minidump_cpu_arm, but t
| |
76 */ | |
77 typedef struct { | |
78 /* 32 32-bit floating point registers, f0 .. f31. */ | |
79 uint32_t fregs[MD_CONTEXT_SHX_FPR_COUNT]; | |
80 uint32_t xfregs[MD_CONTEXT_SHX_FPR_COUNT]; | |
81 | |
82 uint32_t fpscr; /* FPU status register */ | |
83 uint32_t fpul; /* FPU transfer register */ | |
84 } MDFloatingSaveAreaSH4; | |
85 | |
86 #define MD_CONTEXT_SHX_GPR_COUNT 16 | |
87 | |
88 typedef struct { | |
89 /* The next field determines the layout of the structure, and which parts | |
90 * of it are populated | |
91 */ | |
92 uint32_t context_flags; | |
93 | |
94 /* 16 32-bit integer registers, r0 .. r15 | |
95 * Note the following fixed uses: | |
96 * r15 is the stack pointer | |
97 */ | |
98 uint32_t iregs[MD_CONTEXT_SHX_GPR_COUNT]; | |
99 | |
100 uint32_t pc; | |
101 uint32_t pr; | |
102 | |
103 uint32_t mach; | |
104 uint32_t macl; | |
105 | |
106 /* The next field is included with MD_CONTEXT_SHX_FP */ | |
107 MDFloatingSaveAreaSH4 float_save; | |
108 | |
109 } MDRawContextSH4; | |
110 | |
111 | |
112 /* Indices into iregs for registers with a dedicated or conventional | |
113 * purpose. | |
114 */ | |
115 enum MDSH4RegisterNumbers { | |
116 MD_CONTEXT_SH4_REG_FP = 14, | |
117 MD_CONTEXT_SH4_REG_SP = 15, | |
118 }; | |
119 | |
120 /* This value was chosen to avoid likely conflicts with MD_CONTEXT_* | |
121 * for other CPUs. */ | |
122 #define MD_CONTEXT_SHX_OLD 0x000000c0 /* CONTEXT_SH4 (Super-H, includes SH3) */ | |
Ted Mielczarek
2015/04/02 12:24:35
I would just drop this constant, it's not actually
| |
123 | |
124 #define MD_CONTEXT_SHX 0x02000000 | |
Ted Mielczarek
2015/04/02 12:24:35
I kind of wish these constants were all back in mi
| |
125 #define MD_CONTEXT_SHX_INTEGER (MD_CONTEXT_SHX | 0x00000002) | |
126 #define MD_CONTEXT_SHX_FP (MD_CONTEXT_SHX | 0x00000004) | |
127 | |
128 #define MD_CONTEXT_SHX_ALL (MD_CONTEXT_SHX_INTEGER | MD_CONTEXT_SHX_FP) | |
129 | |
130 #endif /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_SH4_H__ */ | |
OLD | NEW |