1 /* GNU/Linux S/390 specific low level interface, for the remote server
3 Copyright (C) 2001-2016 Free Software Foundation, Inc.
5 This file is part of GDB.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20 /* This file is used for both 31-bit and 64-bit S/390 systems. */
23 #include "linux-low.h"
24 #include "elf/common.h"
26 #include <asm/ptrace.h>
27 #include "nat/gdb_ptrace.h"
31 #ifndef HWCAP_S390_HIGH_GPRS
32 #define HWCAP_S390_HIGH_GPRS 512
36 #define HWCAP_S390_TE 1024
40 #define HWCAP_S390_VX 2048
43 /* Defined in auto-generated file s390-linux32.c. */
44 void init_registers_s390_linux32 (void);
45 extern const struct target_desc
*tdesc_s390_linux32
;
47 /* Defined in auto-generated file s390-linux32v1.c. */
48 void init_registers_s390_linux32v1 (void);
49 extern const struct target_desc
*tdesc_s390_linux32v1
;
51 /* Defined in auto-generated file s390-linux32v2.c. */
52 void init_registers_s390_linux32v2 (void);
53 extern const struct target_desc
*tdesc_s390_linux32v2
;
55 /* Defined in auto-generated file s390-linux64.c. */
56 void init_registers_s390_linux64 (void);
57 extern const struct target_desc
*tdesc_s390_linux64
;
59 /* Defined in auto-generated file s390-linux64v1.c. */
60 void init_registers_s390_linux64v1 (void);
61 extern const struct target_desc
*tdesc_s390_linux64v1
;
63 /* Defined in auto-generated file s390-linux64v2.c. */
64 void init_registers_s390_linux64v2 (void);
65 extern const struct target_desc
*tdesc_s390_linux64v2
;
67 /* Defined in auto-generated file s390-te-linux64.c. */
68 void init_registers_s390_te_linux64 (void);
69 extern const struct target_desc
*tdesc_s390_te_linux64
;
71 /* Defined in auto-generated file s390-vx-linux64.c. */
72 void init_registers_s390_vx_linux64 (void);
73 extern const struct target_desc
*tdesc_s390_vx_linux64
;
75 /* Defined in auto-generated file s390-tevx-linux64.c. */
76 void init_registers_s390_tevx_linux64 (void);
77 extern const struct target_desc
*tdesc_s390_tevx_linux64
;
79 /* Defined in auto-generated file s390x-linux64.c. */
80 void init_registers_s390x_linux64 (void);
81 extern const struct target_desc
*tdesc_s390x_linux64
;
83 /* Defined in auto-generated file s390x-linux64v1.c. */
84 void init_registers_s390x_linux64v1 (void);
85 extern const struct target_desc
*tdesc_s390x_linux64v1
;
87 /* Defined in auto-generated file s390x-linux64v2.c. */
88 void init_registers_s390x_linux64v2 (void);
89 extern const struct target_desc
*tdesc_s390x_linux64v2
;
91 /* Defined in auto-generated file s390x-te-linux64.c. */
92 void init_registers_s390x_te_linux64 (void);
93 extern const struct target_desc
*tdesc_s390x_te_linux64
;
95 /* Defined in auto-generated file s390x-vx-linux64.c. */
96 void init_registers_s390x_vx_linux64 (void);
97 extern const struct target_desc
*tdesc_s390x_vx_linux64
;
99 /* Defined in auto-generated file s390x-tevx-linux64.c. */
100 void init_registers_s390x_tevx_linux64 (void);
101 extern const struct target_desc
*tdesc_s390x_tevx_linux64
;
103 #define s390_num_regs 52
105 static int s390_regmap
[] = {
106 PT_PSWMASK
, PT_PSWADDR
,
108 PT_GPR0
, PT_GPR1
, PT_GPR2
, PT_GPR3
,
109 PT_GPR4
, PT_GPR5
, PT_GPR6
, PT_GPR7
,
110 PT_GPR8
, PT_GPR9
, PT_GPR10
, PT_GPR11
,
111 PT_GPR12
, PT_GPR13
, PT_GPR14
, PT_GPR15
,
113 PT_ACR0
, PT_ACR1
, PT_ACR2
, PT_ACR3
,
114 PT_ACR4
, PT_ACR5
, PT_ACR6
, PT_ACR7
,
115 PT_ACR8
, PT_ACR9
, PT_ACR10
, PT_ACR11
,
116 PT_ACR12
, PT_ACR13
, PT_ACR14
, PT_ACR15
,
121 PT_FPR0_HI
, PT_FPR1_HI
, PT_FPR2_HI
, PT_FPR3_HI
,
122 PT_FPR4_HI
, PT_FPR5_HI
, PT_FPR6_HI
, PT_FPR7_HI
,
123 PT_FPR8_HI
, PT_FPR9_HI
, PT_FPR10_HI
, PT_FPR11_HI
,
124 PT_FPR12_HI
, PT_FPR13_HI
, PT_FPR14_HI
, PT_FPR15_HI
,
126 PT_FPR0
, PT_FPR1
, PT_FPR2
, PT_FPR3
,
127 PT_FPR4
, PT_FPR5
, PT_FPR6
, PT_FPR7
,
128 PT_FPR8
, PT_FPR9
, PT_FPR10
, PT_FPR11
,
129 PT_FPR12
, PT_FPR13
, PT_FPR14
, PT_FPR15
,
135 #define s390_num_regs_3264 68
138 static int s390_regmap_3264
[] = {
139 PT_PSWMASK
, PT_PSWADDR
,
141 PT_GPR0
, PT_GPR0
, PT_GPR1
, PT_GPR1
,
142 PT_GPR2
, PT_GPR2
, PT_GPR3
, PT_GPR3
,
143 PT_GPR4
, PT_GPR4
, PT_GPR5
, PT_GPR5
,
144 PT_GPR6
, PT_GPR6
, PT_GPR7
, PT_GPR7
,
145 PT_GPR8
, PT_GPR8
, PT_GPR9
, PT_GPR9
,
146 PT_GPR10
, PT_GPR10
, PT_GPR11
, PT_GPR11
,
147 PT_GPR12
, PT_GPR12
, PT_GPR13
, PT_GPR13
,
148 PT_GPR14
, PT_GPR14
, PT_GPR15
, PT_GPR15
,
150 PT_ACR0
, PT_ACR1
, PT_ACR2
, PT_ACR3
,
151 PT_ACR4
, PT_ACR5
, PT_ACR6
, PT_ACR7
,
152 PT_ACR8
, PT_ACR9
, PT_ACR10
, PT_ACR11
,
153 PT_ACR12
, PT_ACR13
, PT_ACR14
, PT_ACR15
,
157 PT_FPR0
, PT_FPR1
, PT_FPR2
, PT_FPR3
,
158 PT_FPR4
, PT_FPR5
, PT_FPR6
, PT_FPR7
,
159 PT_FPR8
, PT_FPR9
, PT_FPR10
, PT_FPR11
,
160 PT_FPR12
, PT_FPR13
, PT_FPR14
, PT_FPR15
,
165 static int s390_regmap_3264
[] = {
166 PT_PSWMASK
, PT_PSWADDR
,
168 -1, PT_GPR0
, -1, PT_GPR1
,
169 -1, PT_GPR2
, -1, PT_GPR3
,
170 -1, PT_GPR4
, -1, PT_GPR5
,
171 -1, PT_GPR6
, -1, PT_GPR7
,
172 -1, PT_GPR8
, -1, PT_GPR9
,
173 -1, PT_GPR10
, -1, PT_GPR11
,
174 -1, PT_GPR12
, -1, PT_GPR13
,
175 -1, PT_GPR14
, -1, PT_GPR15
,
177 PT_ACR0
, PT_ACR1
, PT_ACR2
, PT_ACR3
,
178 PT_ACR4
, PT_ACR5
, PT_ACR6
, PT_ACR7
,
179 PT_ACR8
, PT_ACR9
, PT_ACR10
, PT_ACR11
,
180 PT_ACR12
, PT_ACR13
, PT_ACR14
, PT_ACR15
,
184 PT_FPR0_HI
, PT_FPR1_HI
, PT_FPR2_HI
, PT_FPR3_HI
,
185 PT_FPR4_HI
, PT_FPR5_HI
, PT_FPR6_HI
, PT_FPR7_HI
,
186 PT_FPR8_HI
, PT_FPR9_HI
, PT_FPR10_HI
, PT_FPR11_HI
,
187 PT_FPR12_HI
, PT_FPR13_HI
, PT_FPR14_HI
, PT_FPR15_HI
,
195 s390_cannot_fetch_register (int regno
)
201 s390_cannot_store_register (int regno
)
207 s390_collect_ptrace_register (struct regcache
*regcache
, int regno
, char *buf
)
209 int size
= register_size (regcache
->tdesc
, regno
);
210 const struct regs_info
*regs_info
= (*the_low_target
.regs_info
) ();
211 struct usrregs_info
*usr
= regs_info
->usrregs
;
212 int regaddr
= usr
->regmap
[regno
];
214 if (size
< sizeof (long))
216 memset (buf
, 0, sizeof (long));
218 if ((regno
^ 1) < usr
->num_regs
219 && usr
->regmap
[regno
^ 1] == regaddr
)
221 collect_register (regcache
, regno
& ~1, buf
);
222 collect_register (regcache
, (regno
& ~1) + 1,
223 buf
+ sizeof (long) - size
);
225 else if (regaddr
== PT_PSWMASK
)
227 /* Convert 4-byte PSW mask to 8 bytes by clearing bit 12 and copying
228 the basic addressing mode bit from the PSW address. */
229 char *addr
= alloca (register_size (regcache
->tdesc
, regno
^ 1));
230 collect_register (regcache
, regno
, buf
);
231 collect_register (regcache
, regno
^ 1, addr
);
233 buf
[size
] |= (addr
[0] & 0x80);
235 else if (regaddr
== PT_PSWADDR
)
237 /* Convert 4-byte PSW address to 8 bytes by clearing the addressing
238 mode bit (which gets copied to the PSW mask instead). */
239 collect_register (regcache
, regno
, buf
+ sizeof (long) - size
);
240 buf
[sizeof (long) - size
] &= ~0x80;
242 else if ((regaddr
>= PT_GPR0
&& regaddr
<= PT_GPR15
)
243 || regaddr
== PT_ORIGGPR2
)
244 collect_register (regcache
, regno
, buf
+ sizeof (long) - size
);
246 collect_register (regcache
, regno
, buf
);
248 else if (regaddr
!= -1)
249 collect_register (regcache
, regno
, buf
);
253 s390_supply_ptrace_register (struct regcache
*regcache
,
254 int regno
, const char *buf
)
256 int size
= register_size (regcache
->tdesc
, regno
);
257 const struct regs_info
*regs_info
= (*the_low_target
.regs_info
) ();
258 struct usrregs_info
*usr
= regs_info
->usrregs
;
259 int regaddr
= usr
->regmap
[regno
];
261 if (size
< sizeof (long))
263 if ((regno
^ 1) < usr
->num_regs
264 && usr
->regmap
[regno
^ 1] == regaddr
)
266 supply_register (regcache
, regno
& ~1, buf
);
267 supply_register (regcache
, (regno
& ~1) + 1,
268 buf
+ sizeof (long) - size
);
270 else if (regaddr
== PT_PSWMASK
)
272 /* Convert 8-byte PSW mask to 4 bytes by setting bit 12 and copying
273 the basic addressing mode into the PSW address. */
274 char *mask
= alloca (size
);
275 char *addr
= alloca (register_size (regcache
->tdesc
, regno
^ 1));
276 memcpy (mask
, buf
, size
);
278 supply_register (regcache
, regno
, mask
);
280 collect_register (regcache
, regno
^ 1, addr
);
282 addr
[0] |= (buf
[size
] & 0x80);
283 supply_register (regcache
, regno
^ 1, addr
);
285 else if (regaddr
== PT_PSWADDR
)
287 /* Convert 8-byte PSW address to 4 bytes by truncating, but
288 keeping the addressing mode bit (which was set from the mask). */
289 char *addr
= alloca (size
);
291 collect_register (regcache
, regno
, addr
);
292 amode
= addr
[0] & 0x80;
293 memcpy (addr
, buf
+ sizeof (long) - size
, size
);
296 supply_register (regcache
, regno
, addr
);
298 else if ((regaddr
>= PT_GPR0
&& regaddr
<= PT_GPR15
)
299 || regaddr
== PT_ORIGGPR2
)
300 supply_register (regcache
, regno
, buf
+ sizeof (long) - size
);
302 supply_register (regcache
, regno
, buf
);
304 else if (regaddr
!= -1)
305 supply_register (regcache
, regno
, buf
);
308 /* Provide only a fill function for the general register set. ps_lgetregs
309 will use this for NPTL support. */
312 s390_fill_gregset (struct regcache
*regcache
, void *buf
)
315 const struct regs_info
*regs_info
= (*the_low_target
.regs_info
) ();
316 struct usrregs_info
*usr
= regs_info
->usrregs
;
318 for (i
= 0; i
< usr
->num_regs
; i
++)
320 if (usr
->regmap
[i
] < PT_PSWMASK
321 || usr
->regmap
[i
] > PT_ACR15
)
324 s390_collect_ptrace_register (regcache
, i
,
325 (char *) buf
+ usr
->regmap
[i
]);
329 /* Fill and store functions for extended register sets. */
333 s390_fill_gprs_high (struct regcache
*regcache
, void *buf
)
335 int r0h
= find_regno (regcache
->tdesc
, "r0h");
338 for (i
= 0; i
< 16; i
++)
339 collect_register (regcache
, r0h
+ 2 * i
, (char *) buf
+ 4 * i
);
343 s390_store_gprs_high (struct regcache
*regcache
, const void *buf
)
345 int r0h
= find_regno (regcache
->tdesc
, "r0h");
348 for (i
= 0; i
< 16; i
++)
349 supply_register (regcache
, r0h
+ 2 * i
, (const char *) buf
+ 4 * i
);
354 s390_store_last_break (struct regcache
*regcache
, const void *buf
)
358 p
= (const char *) buf
+ 8 - register_size (regcache
->tdesc
, 0);
359 supply_register_by_name (regcache
, "last_break", p
);
363 s390_fill_system_call (struct regcache
*regcache
, void *buf
)
365 collect_register_by_name (regcache
, "system_call", buf
);
369 s390_store_system_call (struct regcache
*regcache
, const void *buf
)
371 supply_register_by_name (regcache
, "system_call", buf
);
375 s390_store_tdb (struct regcache
*regcache
, const void *buf
)
377 int tdb0
= find_regno (regcache
->tdesc
, "tdb0");
378 int tr0
= find_regno (regcache
->tdesc
, "tr0");
381 for (i
= 0; i
< 4; i
++)
382 supply_register (regcache
, tdb0
+ i
, (const char *) buf
+ 8 * i
);
384 for (i
= 0; i
< 16; i
++)
385 supply_register (regcache
, tr0
+ i
, (const char *) buf
+ 8 * (16 + i
));
389 s390_fill_vxrs_low (struct regcache
*regcache
, void *buf
)
391 int v0
= find_regno (regcache
->tdesc
, "v0l");
394 for (i
= 0; i
< 16; i
++)
395 collect_register (regcache
, v0
+ i
, (char *) buf
+ 8 * i
);
399 s390_store_vxrs_low (struct regcache
*regcache
, const void *buf
)
401 int v0
= find_regno (regcache
->tdesc
, "v0l");
404 for (i
= 0; i
< 16; i
++)
405 supply_register (regcache
, v0
+ i
, (const char *) buf
+ 8 * i
);
409 s390_fill_vxrs_high (struct regcache
*regcache
, void *buf
)
411 int v16
= find_regno (regcache
->tdesc
, "v16");
414 for (i
= 0; i
< 16; i
++)
415 collect_register (regcache
, v16
+ i
, (char *) buf
+ 16 * i
);
419 s390_store_vxrs_high (struct regcache
*regcache
, const void *buf
)
421 int v16
= find_regno (regcache
->tdesc
, "v16");
424 for (i
= 0; i
< 16; i
++)
425 supply_register (regcache
, v16
+ i
, (const char *) buf
+ 16 * i
);
428 static struct regset_info s390_regsets
[] = {
429 { 0, 0, 0, 0, GENERAL_REGS
, s390_fill_gregset
, NULL
},
431 { PTRACE_GETREGSET
, PTRACE_SETREGSET
, NT_S390_HIGH_GPRS
, 0,
432 EXTENDED_REGS
, s390_fill_gprs_high
, s390_store_gprs_high
},
434 /* Last break address is read-only; no fill function. */
435 { PTRACE_GETREGSET
, -1, NT_S390_LAST_BREAK
, 0, EXTENDED_REGS
,
436 NULL
, s390_store_last_break
},
437 { PTRACE_GETREGSET
, PTRACE_SETREGSET
, NT_S390_SYSTEM_CALL
, 0,
438 EXTENDED_REGS
, s390_fill_system_call
, s390_store_system_call
},
439 /* TDB is read-only. */
440 { PTRACE_GETREGSET
, -1, NT_S390_TDB
, 0, EXTENDED_REGS
,
441 NULL
, s390_store_tdb
},
442 { PTRACE_GETREGSET
, PTRACE_SETREGSET
, NT_S390_VXRS_LOW
, 0,
443 EXTENDED_REGS
, s390_fill_vxrs_low
, s390_store_vxrs_low
},
444 { PTRACE_GETREGSET
, PTRACE_SETREGSET
, NT_S390_VXRS_HIGH
, 0,
445 EXTENDED_REGS
, s390_fill_vxrs_high
, s390_store_vxrs_high
},
450 static const gdb_byte s390_breakpoint
[] = { 0, 1 };
451 #define s390_breakpoint_len 2
453 /* Implementation of linux_target_ops method "sw_breakpoint_from_kind". */
455 static const gdb_byte
*
456 s390_sw_breakpoint_from_kind (int kind
, int *size
)
458 *size
= s390_breakpoint_len
;
459 return s390_breakpoint
;
463 s390_get_pc (struct regcache
*regcache
)
465 if (register_size (regcache
->tdesc
, 0) == 4)
468 collect_register_by_name (regcache
, "pswa", &pswa
);
469 return pswa
& 0x7fffffff;
474 collect_register_by_name (regcache
, "pswa", &pc
);
480 s390_set_pc (struct regcache
*regcache
, CORE_ADDR newpc
)
482 if (register_size (regcache
->tdesc
, 0) == 4)
485 collect_register_by_name (regcache
, "pswa", &pswa
);
486 pswa
= (pswa
& 0x80000000) | (newpc
& 0x7fffffff);
487 supply_register_by_name (regcache
, "pswa", &pswa
);
491 unsigned long pc
= newpc
;
492 supply_register_by_name (regcache
, "pswa", &pc
);
497 s390_get_hwcap (const struct target_desc
*tdesc
)
499 int wordsize
= register_size (tdesc
, 0);
500 unsigned char *data
= alloca (2 * wordsize
);
503 while ((*the_target
->read_auxv
) (offset
, data
, 2 * wordsize
) == 2 * wordsize
)
507 unsigned int *data_p
= (unsigned int *)data
;
508 if (data_p
[0] == AT_HWCAP
)
513 unsigned long *data_p
= (unsigned long *)data
;
514 if (data_p
[0] == AT_HWCAP
)
518 offset
+= 2 * wordsize
;
525 s390_check_regset (int pid
, int regset
, int regsize
)
527 gdb_byte
*buf
= alloca (regsize
);
531 iov
.iov_len
= regsize
;
533 if (ptrace (PTRACE_GETREGSET
, pid
, (long) regset
, (long) &iov
) >= 0
539 /* For a 31-bit inferior, whether the kernel supports using the full
541 static int have_hwcap_s390_high_gprs
= 0;
544 s390_arch_setup (void)
546 const struct target_desc
*tdesc
;
547 struct regset_info
*regset
;
549 /* Check whether the kernel supports extra register sets. */
550 int pid
= pid_of (current_thread
);
551 int have_regset_last_break
552 = s390_check_regset (pid
, NT_S390_LAST_BREAK
, 8);
553 int have_regset_system_call
554 = s390_check_regset (pid
, NT_S390_SYSTEM_CALL
, 4);
555 int have_regset_tdb
= s390_check_regset (pid
, NT_S390_TDB
, 256);
556 int have_regset_vxrs
= s390_check_regset (pid
, NT_S390_VXRS_LOW
, 128)
557 && s390_check_regset (pid
, NT_S390_VXRS_HIGH
, 256);
559 /* Assume 31-bit inferior process. */
560 if (have_regset_system_call
)
561 tdesc
= tdesc_s390_linux32v2
;
562 else if (have_regset_last_break
)
563 tdesc
= tdesc_s390_linux32v1
;
565 tdesc
= tdesc_s390_linux32
;
567 /* On a 64-bit host, check the low bit of the (31-bit) PSWM
568 -- if this is one, we actually have a 64-bit inferior. */
572 struct regcache
*regcache
= new_register_cache (tdesc
);
574 fetch_inferior_registers (regcache
, find_regno (tdesc
, "pswm"));
575 collect_register_by_name (regcache
, "pswm", &pswm
);
576 free_register_cache (regcache
);
582 (s390_get_hwcap (tdesc_s390x_linux64v2
) & HWCAP_S390_TE
) != 0;
583 if (have_regset_vxrs
)
585 (s390_get_hwcap (tdesc_s390x_linux64v2
) & HWCAP_S390_VX
) != 0;
587 if (have_regset_vxrs
)
588 tdesc
= (have_regset_tdb
? tdesc_s390x_tevx_linux64
:
589 tdesc_s390x_vx_linux64
);
590 else if (have_regset_tdb
)
591 tdesc
= tdesc_s390x_te_linux64
;
592 else if (have_regset_system_call
)
593 tdesc
= tdesc_s390x_linux64v2
;
594 else if (have_regset_last_break
)
595 tdesc
= tdesc_s390x_linux64v1
;
597 tdesc
= tdesc_s390x_linux64
;
600 /* For a 31-bit inferior, check whether the kernel supports
601 using the full 64-bit GPRs. */
604 if (s390_get_hwcap (tdesc
) & HWCAP_S390_HIGH_GPRS
)
606 have_hwcap_s390_high_gprs
= 1;
608 have_regset_tdb
= (s390_get_hwcap (tdesc
) & HWCAP_S390_TE
) != 0;
609 if (have_regset_vxrs
)
610 have_regset_vxrs
= (s390_get_hwcap (tdesc
) & HWCAP_S390_VX
) != 0;
612 if (have_regset_vxrs
)
613 tdesc
= (have_regset_tdb
? tdesc_s390_tevx_linux64
:
614 tdesc_s390_vx_linux64
);
615 else if (have_regset_tdb
)
616 tdesc
= tdesc_s390_te_linux64
;
617 else if (have_regset_system_call
)
618 tdesc
= tdesc_s390_linux64v2
;
619 else if (have_regset_last_break
)
620 tdesc
= tdesc_s390_linux64v1
;
622 tdesc
= tdesc_s390_linux64
;
626 /* Update target_regsets according to available register sets. */
627 for (regset
= s390_regsets
; regset
->size
>= 0; regset
++)
628 if (regset
->get_request
== PTRACE_GETREGSET
)
629 switch (regset
->nt_type
)
632 case NT_S390_HIGH_GPRS
:
633 regset
->size
= have_hwcap_s390_high_gprs
? 64 : 0;
636 case NT_S390_LAST_BREAK
:
637 regset
->size
= have_regset_last_break
? 8 : 0;
639 case NT_S390_SYSTEM_CALL
:
640 regset
->size
= have_regset_system_call
? 4 : 0;
643 regset
->size
= have_regset_tdb
? 256 : 0;
645 case NT_S390_VXRS_LOW
:
646 regset
->size
= have_regset_vxrs
? 128 : 0;
648 case NT_S390_VXRS_HIGH
:
649 regset
->size
= have_regset_vxrs
? 256 : 0;
655 current_process ()->tdesc
= tdesc
;
660 s390_breakpoint_at (CORE_ADDR pc
)
662 unsigned char c
[s390_breakpoint_len
];
663 read_inferior_memory (pc
, c
, s390_breakpoint_len
);
664 return memcmp (c
, s390_breakpoint
, s390_breakpoint_len
) == 0;
667 /* Breakpoint/Watchpoint support. */
669 /* The "supports_z_point_type" linux_target_ops method. */
672 s390_supports_z_point_type (char z_type
)
683 /* Support for hardware single step. */
686 s390_supports_hardware_single_step (void)
691 static struct usrregs_info s390_usrregs_info
=
697 static struct regsets_info s390_regsets_info
=
699 s390_regsets
, /* regsets */
701 NULL
, /* disabled_regsets */
704 static struct regs_info regs_info
=
706 NULL
, /* regset_bitmap */
711 static struct usrregs_info s390_usrregs_info_3264
=
717 static struct regsets_info s390_regsets_info_3264
=
719 s390_regsets
, /* regsets */
721 NULL
, /* disabled_regsets */
724 static struct regs_info regs_info_3264
=
726 NULL
, /* regset_bitmap */
727 &s390_usrregs_info_3264
,
728 &s390_regsets_info_3264
731 static const struct regs_info
*
732 s390_regs_info (void)
734 if (have_hwcap_s390_high_gprs
)
737 const struct target_desc
*tdesc
= current_process ()->tdesc
;
739 if (register_size (tdesc
, 0) == 4)
740 return ®s_info_3264
;
742 return ®s_info_3264
;
748 struct linux_target_ops the_low_target
= {
751 s390_cannot_fetch_register
,
752 s390_cannot_store_register
,
753 NULL
, /* fetch_register */
756 NULL
, /* breakpoint_kind_from_pc */
757 s390_sw_breakpoint_from_kind
,
761 s390_supports_z_point_type
,
766 s390_collect_ptrace_register
,
767 s390_supply_ptrace_register
,
768 NULL
, /* siginfo_fixup */
769 NULL
, /* new_process */
770 NULL
, /* new_thread */
772 NULL
, /* prepare_to_resume */
773 NULL
, /* process_qsupported */
774 NULL
, /* supports_tracepoints */
775 NULL
, /* get_thread_area */
776 NULL
, /* install_fast_tracepoint_jump_pad */
778 NULL
, /* get_min_fast_tracepoint_insn_len */
779 NULL
, /* supports_range_stepping */
780 NULL
, /* breakpoint_kind_from_current_state */
781 s390_supports_hardware_single_step
,
785 initialize_low_arch (void)
787 /* Initialize the Linux target descriptions. */
789 init_registers_s390_linux32 ();
790 init_registers_s390_linux32v1 ();
791 init_registers_s390_linux32v2 ();
792 init_registers_s390_linux64 ();
793 init_registers_s390_linux64v1 ();
794 init_registers_s390_linux64v2 ();
795 init_registers_s390_te_linux64 ();
796 init_registers_s390_vx_linux64 ();
797 init_registers_s390_tevx_linux64 ();
798 init_registers_s390x_linux64 ();
799 init_registers_s390x_linux64v1 ();
800 init_registers_s390x_linux64v2 ();
801 init_registers_s390x_te_linux64 ();
802 init_registers_s390x_vx_linux64 ();
803 init_registers_s390x_tevx_linux64 ();
805 initialize_regsets_info (&s390_regsets_info
);
806 initialize_regsets_info (&s390_regsets_info_3264
);