]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/nto-tdep.h
Copyright updates for 2007.
[thirdparty/binutils-gdb.git] / gdb / nto-tdep.h
CommitLineData
1b883d35
KW
1/* nto-tdep.h - QNX Neutrino target header.
2
6aba47ca 3 Copyright (C) 2003, 2007 Free Software Foundation, Inc.
1b883d35
KW
4
5 Contributed by QNX Software Systems Ltd.
6
7 This file is part of GDB.
8
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
197e01b6
EZ
21 Foundation, Inc., 51 Franklin Street, Fifth Floor,
22 Boston, MA 02110-1301, USA. */
1b883d35
KW
23
24#ifndef _NTO_TDEP_H
25#define _NTO_TDEP_H
26
27#include "defs.h"
28#include "solist.h"
d737fd7f
KW
29#include "osabi.h"
30#include "regset.h"
1b883d35
KW
31
32/* Target operations defined for Neutrino targets (<target>-nto-tdep.c). */
33
34struct nto_target_ops
35{
1b883d35 36/* For 'maintenance debug nto-debug' command. */
d737fd7f 37 int internal_debugging;
1b883d35
KW
38
39/* The CPUINFO flags from the remote. Currently used by
40 i386 for fxsave but future proofing other hosts.
41 This is initialized in procfs_attach or nto_start_remote
42 depending on our host/target. It would only be invalid
43 if we were talking to an older pdebug which didn't support
44 the cpuinfo message. */
d737fd7f 45 unsigned cpuinfo_flags;
1b883d35
KW
46
47/* True if successfully retrieved cpuinfo from remote. */
d737fd7f 48 int cpuinfo_valid;
1b883d35
KW
49
50/* Given a register, return an id that represents the Neutrino
51 regset it came from. If reg == -1 update all regsets. */
d737fd7f 52 int (*regset_id) (int);
1b883d35 53
d737fd7f 54 void (*supply_gregset) (char *);
1b883d35 55
d737fd7f 56 void (*supply_fpregset) (char *);
1b883d35 57
d737fd7f 58 void (*supply_altregset) (char *);
1b883d35
KW
59
60/* Given a regset, tell gdb about registers stored in data. */
d737fd7f 61 void (*supply_regset) (int, char *);
1b883d35
KW
62
63/* Given a register and regset, calculate the offset into the regset
64 and stuff it into the last argument. If regno is -1, calculate the
65 size of the entire regset. Returns length of data, -1 if unknown
66 regset, 0 if unknown register. */
d737fd7f 67 int (*register_area) (int, int, unsigned *);
1b883d35
KW
68
69/* Build the Neutrino register set info into the data buffer.
70 Return -1 if unknown regset, 0 otherwise. */
d737fd7f 71 int (*regset_fill) (int, char *);
1b883d35
KW
72
73/* Gives the fetch_link_map_offsets function exposure outside of
74 solib-svr4.c so that we can override relocate_section_addresses(). */
d737fd7f
KW
75 struct link_map_offsets *(*fetch_link_map_offsets) (void);
76
77/* Used by nto_elf_osabi_sniffer to determine if we're connected to an
78 Neutrino target. */
79 enum gdb_osabi (*is_nto_target) (bfd *abfd);
80};
81
82extern struct nto_target_ops current_nto_target;
83
84#define nto_internal_debugging (current_nto_target.internal_debugging)
85
86#define nto_cpuinfo_flags (current_nto_target.cpuinfo_flags)
87
88#define nto_cpuinfo_valid (current_nto_target.cpuinfo_valid)
89
90#define nto_regset_id (current_nto_target.regset_id)
91
92#define nto_supply_gregset (current_nto_target.supply_gregset)
93
94#define nto_supply_fpregset (current_nto_target.supply_fpregset)
95
96#define nto_supply_altregset (current_nto_target.supply_altregset)
97
98#define nto_supply_regset (current_nto_target.supply_regset)
99
100#define nto_register_area (current_nto_target.register_area)
101
102#define nto_regset_fill (current_nto_target.regset_fill)
103
104#define nto_fetch_link_map_offsets \
105(current_nto_target.fetch_link_map_offsets)
106
107#define nto_is_nto_target (current_nto_target.is_nto_target)
1b883d35
KW
108
109/* Keep this consistant with neutrino syspage.h. */
110enum
111{
112 CPUTYPE_X86,
113 CPUTYPE_PPC,
114 CPUTYPE_MIPS,
115 CPUTYPE_SPARE,
116 CPUTYPE_ARM,
117 CPUTYPE_SH,
118 CPUTYPE_UNKNOWN
119};
120
121enum
122{
123 OSTYPE_QNX4,
124 OSTYPE_NTO
125};
126
127/* These correspond to the DSMSG_* versions in dsmsgs.h. */
128enum
129{
130 NTO_REG_GENERAL,
131 NTO_REG_FLOAT,
132 NTO_REG_SYSTEM,
133 NTO_REG_ALT,
134 NTO_REG_END
135};
136
137typedef char qnx_reg64[8];
138
139typedef struct _debug_regs
140{
141 qnx_reg64 padding[1024];
142} nto_regset_t;
143
d737fd7f
KW
144/* Generic functions in nto-tdep.c. */
145
146void nto_init_solib_absolute_prefix (void);
147
148void nto_set_target(struct nto_target_ops *);
149
150char **nto_parse_redirection (char *start_argv[], char **in,
151 char **out, char **err);
152
153int proc_iterate_over_mappings (int (*func) (int, CORE_ADDR));
154
155void nto_relocate_section_addresses (struct so_list *,
156 struct section_table *);
157
158int nto_map_arch_to_cputype (const char *);
159
160int nto_find_and_open_solib (char *, unsigned, char **);
161
162enum gdb_osabi nto_elf_osabi_sniffer (bfd *abfd);
163
164void nto_initialize_signals (void);
165
166void nto_generic_supply_gpregset (const struct regset *, struct regcache *,
167 int, const void *, size_t);
168
169void nto_generic_supply_fpregset (const struct regset *, struct regcache *,
170 int, const void *, size_t);
171
172void nto_generic_supply_altregset (const struct regset *, struct regcache *,
173 int, const void *, size_t);
174
175/* Dummy function for initializing nto_target_ops on targets which do
176 not define a particular regset. */
177void nto_dummy_supply_regset (char *regs);
178
179int nto_in_dynsym_resolve_code (CORE_ADDR pc);
180
1b883d35 181#endif