1be050429SOlivier Houchard /*- 2af3dc4a7SPedro F. Giffuni * SPDX-License-Identifier: BSD-2-Clause-FreeBSD 3af3dc4a7SPedro F. Giffuni * 4be050429SOlivier Houchard * Copyright (c) 2006 Olivier Houchard 5be050429SOlivier Houchard * All rights reserved. 6be050429SOlivier Houchard * 7be050429SOlivier Houchard * Redistribution and use in source and binary forms, with or without 8be050429SOlivier Houchard * modification, are permitted provided that the following conditions 9be050429SOlivier Houchard * are met: 10be050429SOlivier Houchard * 11be050429SOlivier Houchard * 1. Redistributions of source code must retain the above copyright 12be050429SOlivier Houchard * notice, this list of conditions and the following disclaimer. 13be050429SOlivier Houchard * 2. Redistributions in binary form must reproduce the above copyright 14be050429SOlivier Houchard * notice, this list of conditions and the following disclaimer in the 15be050429SOlivier Houchard * documentation and/or other materials provided with the distribution. 16be050429SOlivier Houchard * 17be050429SOlivier Houchard * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18be050429SOlivier Houchard * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19be050429SOlivier Houchard * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20be050429SOlivier Houchard * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21be050429SOlivier Houchard * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22be050429SOlivier Houchard * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23be050429SOlivier Houchard * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24be050429SOlivier Houchard * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25be050429SOlivier Houchard * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26be050429SOlivier Houchard * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27be050429SOlivier Houchard * 28be050429SOlivier Houchard * $FreeBSD$ 29be050429SOlivier Houchard */ 30be050429SOlivier Houchard 31be050429SOlivier Houchard #ifndef _MACHINE_GDB_MACHDEP_H_ 32be050429SOlivier Houchard #define _MACHINE_GDB_MACHDEP_H_ 33be050429SOlivier Houchard 34be050429SOlivier Houchard #define GDB_BUFSZ 400 35be050429SOlivier Houchard #define GDB_NREGS 26 36be050429SOlivier Houchard #define GDB_REG_PC 15 37be050429SOlivier Houchard 38be050429SOlivier Houchard static __inline size_t 39*a92526f3SMark Johnston gdb_cpu_regsz(int regnum) 40be050429SOlivier Houchard { 41*a92526f3SMark Johnston /* 42*a92526f3SMark Johnston * GDB expects the FPA registers f0-f7, each 96 bits wide, to be placed 43*a92526f3SMark Johnston * in between the PC and CSPR in response to a "g" packet. 44*a92526f3SMark Johnston */ 45*a92526f3SMark Johnston return (regnum >= 16 && regnum <= 23 ? 12 : sizeof(int)); 46be050429SOlivier Houchard } 47be050429SOlivier Houchard 48be050429SOlivier Houchard static __inline int 49be050429SOlivier Houchard gdb_cpu_query(void) 50be050429SOlivier Houchard { 51be050429SOlivier Houchard return (0); 52be050429SOlivier Houchard } 53be050429SOlivier Houchard 54beb24065SJonathan T. Looney static __inline void * 55beb24065SJonathan T. Looney gdb_begin_write(void) 56beb24065SJonathan T. Looney { 57beb24065SJonathan T. Looney 58beb24065SJonathan T. Looney return (NULL); 59beb24065SJonathan T. Looney } 60beb24065SJonathan T. Looney 61beb24065SJonathan T. Looney static __inline void 62beb24065SJonathan T. Looney gdb_end_write(void *arg __unused) 63beb24065SJonathan T. Looney { 64beb24065SJonathan T. Looney 65beb24065SJonathan T. Looney } 66beb24065SJonathan T. Looney 67be050429SOlivier Houchard void *gdb_cpu_getreg(int, size_t *); 68be050429SOlivier Houchard void gdb_cpu_setreg(int, void *); 69be050429SOlivier Houchard int gdb_cpu_signal(int, int); 70be050429SOlivier Houchard 71be050429SOlivier Houchard #endif /* !_MACHINE_GDB_MACHDEP_H_ */ 72