1 /* M68K specific core note handling.
2    This file is part of elfutils.
3 
4    This file is free software; you can redistribute it and/or modify
5    it under the terms of either
6 
7      * the GNU Lesser General Public License as published by the Free
8        Software Foundation; either version 3 of the License, or (at
9        your option) any later version
10 
11    or
12 
13      * the GNU General Public License as published by the Free
14        Software Foundation; either version 2 of the License, or (at
15        your option) any later version
16 
17    or both in parallel, as here.
18 
19    elfutils is distributed in the hope that it will be useful, but
20    WITHOUT ANY WARRANTY; without even the implied warranty of
21    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
22    General Public License for more details.
23 
24    You should have received copies of the GNU General Public License and
25    the GNU Lesser General Public License along with this program.  If
26    not, see <http://www.gnu.org/licenses/>.  */
27 
28 
29 #ifdef HAVE_CONFIG_H
30 # include <config.h>
31 #endif
32 
33 #include <elf.h>
34 #include <inttypes.h>
35 #include <stddef.h>
36 #include <stdio.h>
37 #include <sys/time.h>
38 
39 #define BACKEND	m68k_
40 #include "libebl_CPU.h"
41 
42 static const Ebl_Register_Location prstatus_regs[] =
43   {
44     { .offset = 0, .regno = 1, .count = 14, .bits = 32 }, /* d1-d7, a0-a6 */
45     { .offset = 14 * 4, .regno = 0, .count = 1, .bits = 32 }, /* d0 */
46     { .offset = 15 * 4, .regno = 15, .count = 1, .bits = 32 }, /* a7 */
47     { .offset = 18 * 4, .regno = 24, .count = 1, .bits = 32 } /* pc */
48   };
49 #define PRSTATUS_REGS_SIZE	(20 * 4)
50 
51 #define ULONG			uint32_t
52 #define PID_T			int32_t
53 #define	UID_T			uint16_t
54 #define	GID_T			uint16_t
55 #define ALIGN_INT		2
56 #define ALIGN_ULONG		2
57 #define ALIGN_PID_T		2
58 #define ALIGN_UID_T		2
59 #define ALIGN_GID_T		2
60 #define ALIGN_PRSTATUS		2
61 #define TYPE_ULONG		ELF_T_WORD
62 #define TYPE_PID_T		ELF_T_SWORD
63 #define TYPE_UID_T		ELF_T_HALF
64 #define TYPE_GID_T		ELF_T_HALF
65 
66 static const Ebl_Register_Location fpregset_regs[] =
67   {
68     { .offset = 0, .regno = 16, .count = 8, .bits = 96 }, /* fp0-fp7 */
69   };
70 #define FPREGSET_SIZE	(27 * 4)
71 
72 #include "linux-core-note.c"
73