138465Smsmith/* nto-tdep.h - QNX Neutrino target header. 238465Smsmith 338465Smsmith Copyright 2003 Free Software Foundation, Inc. 438465Smsmith 538465Smsmith Contributed by QNX Software Systems Ltd. 638465Smsmith 738465Smsmith This file is part of GDB. 838465Smsmith 938465Smsmith This program is free software; you can redistribute it and/or modify 1038465Smsmith it under the terms of the GNU General Public License as published by 1138465Smsmith the Free Software Foundation; either version 2 of the License, or 1238465Smsmith (at your option) any later version. 1338465Smsmith 1438465Smsmith This program is distributed in the hope that it will be useful, 1538465Smsmith but WITHOUT ANY WARRANTY; without even the implied warranty of 1638465Smsmith MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1738465Smsmith GNU General Public License for more details. 1838465Smsmith 1938465Smsmith You should have received a copy of the GNU General Public License 2038465Smsmith along with this program; if not, write to the Free Software 2138465Smsmith Foundation, Inc., 59 Temple Place - Suite 330, 2238465Smsmith Boston, MA 02111-1307, USA. */ 2338465Smsmith 2438465Smsmith#ifndef _NTO_TDEP_H 2538465Smsmith#define _NTO_TDEP_H 2638465Smsmith 27119483Sobrien#include "defs.h" 28119483Sobrien#include "solist.h" 29119483Sobrien 3038465Smsmith/* Generic functions in nto-tdep.c. */ 3138465Smsmith 3238465Smsmithextern void nto_init_solib_absolute_prefix (void); 3338465Smsmith 3438465Smsmithchar **nto_parse_redirection (char *start_argv[], char **in, 3538465Smsmith char **out, char **err); 36329010Skevans 37329010Skevansint proc_iterate_over_mappings (int (*func) (int, CORE_ADDR)); 3840775Smsmith 3943491Sjkhvoid nto_relocate_section_addresses (struct so_list *, struct section_table *); 4040775Smsmith 4140775Smsmithint nto_map_arch_to_cputype (const char *); 4240775Smsmith 4340775Smsmithint nto_find_and_open_solib (char *, unsigned, char **); 4440775Smsmith 4540775Smsmith/* Dummy function for initializing nto_target_ops on targets which do 4640775Smsmith not define a particular regset. */ 4740775Smsmithvoid nto_dummy_supply_regset (char *regs); 4840775Smsmith 4940775Smsmith/* Target operations defined for Neutrino targets (<target>-nto-tdep.c). */ 5040775Smsmith 5140775Smsmithstruct nto_target_ops 5240775Smsmith{ 5340775Smsmith int nto_internal_debugging; 5440775Smsmith unsigned nto_cpuinfo_flags; 5540775Smsmith int nto_cpuinfo_valid; 5640775Smsmith 5740775Smsmith int (*nto_regset_id) (int); 5840775Smsmith void (*nto_supply_gregset) (char *); 5940775Smsmith void (*nto_supply_fpregset) (char *); 6040775Smsmith void (*nto_supply_altregset) (char *); 6138465Smsmith void (*nto_supply_regset) (int, char *); 6238465Smsmith int (*nto_register_area) (int, int, unsigned *); 6338465Smsmith int (*nto_regset_fill) (int, char *); 6440775Smsmith struct link_map_offsets *(*nto_fetch_link_map_offsets) (void); 6538465Smsmith}; 6640775Smsmith 6740775Smsmithextern struct nto_target_ops current_nto_target; 6840775Smsmith 6940775Smsmith/* For 'maintenance debug nto-debug' command. */ 7040775Smsmith#define nto_internal_debugging \ 7140775Smsmith (current_nto_target.nto_internal_debugging) 7240775Smsmith 7340775Smsmith/* The CPUINFO flags from the remote. Currently used by 7438465Smsmith i386 for fxsave but future proofing other hosts. 7540775Smsmith This is initialized in procfs_attach or nto_start_remote 7640775Smsmith depending on our host/target. It would only be invalid 7740775Smsmith if we were talking to an older pdebug which didn't support 7840775Smsmith the cpuinfo message. */ 7940775Smsmith#define nto_cpuinfo_flags \ 8040775Smsmith (current_nto_target.nto_cpuinfo_flags) 8140775Smsmith 8240775Smsmith/* True if successfully retrieved cpuinfo from remote. */ 8340775Smsmith#define nto_cpuinfo_valid \ 8440775Smsmith (current_nto_target.nto_cpuinfo_valid) 8540775Smsmith 8640775Smsmith/* Given a register, return an id that represents the Neutrino 8740775Smsmith regset it came from. If reg == -1 update all regsets. */ 8840775Smsmith#define nto_regset_id(reg) \ 8940775Smsmith (*current_nto_target.nto_regset_id) (reg) 9040775Smsmith 9140775Smsmith#define nto_supply_gregset(regs) \ 9240775Smsmith (*current_nto_target.nto_supply_gregset) (regs) 9340775Smsmith 9440775Smsmith#define nto_supply_fpregset(regs) \ 9540775Smsmith (*current_nto_target.nto_supply_fpregset) (regs) 9640775Smsmith 9740775Smsmith#define nto_supply_altregset(regs) \ 9840775Smsmith (*current_nto_target.nto_supply_altregset) (regs) 9940775Smsmith 10040775Smsmith/* Given a regset, tell gdb about registers stored in data. */ 10140775Smsmith#define nto_supply_regset(regset, data) \ 10240775Smsmith (*current_nto_target.nto_supply_regset) (regset, data) 10340775Smsmith 104135929Sru/* Given a register and regset, calculate the offset into the regset 10540775Smsmith and stuff it into the last argument. If regno is -1, calculate the 10640775Smsmith size of the entire regset. Returns length of data, -1 if unknown 10740775Smsmith regset, 0 if unknown register. */ 10840775Smsmith#define nto_register_area(reg, regset, off) \ 10940775Smsmith (*current_nto_target.nto_register_area) (reg, regset, off) 11040775Smsmith 11140775Smsmith/* Build the Neutrino register set info into the data buffer. 11240775Smsmith Return -1 if unknown regset, 0 otherwise. */ 11340775Smsmith#define nto_regset_fill(regset, data) \ 11440775Smsmith (*current_nto_target.nto_regset_fill) (regset, data) 11540775Smsmith 11640775Smsmith/* Gives the fetch_link_map_offsets function exposure outside of 11740775Smsmith solib-svr4.c so that we can override relocate_section_addresses(). */ 11840775Smsmith#define nto_fetch_link_map_offsets() \ 11940775Smsmith (*current_nto_target.nto_fetch_link_map_offsets) () 12040775Smsmith 12140775Smsmith/* Keep this consistant with neutrino syspage.h. */ 12240775Smsmithenum 123135929Sru{ 12440775Smsmith CPUTYPE_X86, 12540775Smsmith CPUTYPE_PPC, 12640775Smsmith CPUTYPE_MIPS, 12740775Smsmith CPUTYPE_SPARE, 12840775Smsmith CPUTYPE_ARM, 12940775Smsmith CPUTYPE_SH, 13040775Smsmith CPUTYPE_UNKNOWN 13140775Smsmith}; 13240775Smsmith 13340775Smsmithenum 13438465Smsmith{ 13540775Smsmith OSTYPE_QNX4, 13640775Smsmith OSTYPE_NTO 13738465Smsmith}; 13840775Smsmith 13940775Smsmith/* These correspond to the DSMSG_* versions in dsmsgs.h. */ 14040775Smsmithenum 14140775Smsmith{ 14240775Smsmith NTO_REG_GENERAL, 14340775Smsmith NTO_REG_FLOAT, 14440775Smsmith NTO_REG_SYSTEM, 14540775Smsmith NTO_REG_ALT, 14640775Smsmith NTO_REG_END 14740775Smsmith}; 14840775Smsmith 14940775Smsmithtypedef char qnx_reg64[8]; 15040775Smsmith 15140775Smsmithtypedef struct _debug_regs 15240775Smsmith{ 15340775Smsmith qnx_reg64 padding[1024]; 154198537Sbrueffer} nto_regset_t; 15540775Smsmith 15640775Smsmith#endif 15740775Smsmith