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 36*8bf82b34SMark Johnston #define GDB_REG_SP 13 37*8bf82b34SMark Johnston #define GDB_REG_LR 14 38be050429SOlivier Houchard #define GDB_REG_PC 15 39be050429SOlivier Houchard 40be050429SOlivier Houchard static __inline size_t 41a92526f3SMark Johnston gdb_cpu_regsz(int regnum) 42be050429SOlivier Houchard { 43a92526f3SMark Johnston /* 44a92526f3SMark Johnston * GDB expects the FPA registers f0-f7, each 96 bits wide, to be placed 45a92526f3SMark Johnston * in between the PC and CSPR in response to a "g" packet. 46a92526f3SMark Johnston */ 47a92526f3SMark Johnston return (regnum >= 16 && regnum <= 23 ? 12 : sizeof(int)); 48be050429SOlivier Houchard } 49be050429SOlivier Houchard 50be050429SOlivier Houchard static __inline int 51be050429SOlivier Houchard gdb_cpu_query(void) 52be050429SOlivier Houchard { 53be050429SOlivier Houchard return (0); 54be050429SOlivier Houchard } 55be050429SOlivier Houchard 56beb24065SJonathan T. Looney static __inline void * 57beb24065SJonathan T. Looney gdb_begin_write(void) 58beb24065SJonathan T. Looney { 59beb24065SJonathan T. Looney 60beb24065SJonathan T. Looney return (NULL); 61beb24065SJonathan T. Looney } 62beb24065SJonathan T. Looney 63beb24065SJonathan T. Looney static __inline void 64beb24065SJonathan T. Looney gdb_end_write(void *arg __unused) 65beb24065SJonathan T. Looney { 66beb24065SJonathan T. Looney 67beb24065SJonathan T. Looney } 68beb24065SJonathan T. Looney 69be050429SOlivier Houchard void *gdb_cpu_getreg(int, size_t *); 70be050429SOlivier Houchard void gdb_cpu_setreg(int, void *); 71be050429SOlivier Houchard int gdb_cpu_signal(int, int); 72be050429SOlivier Houchard 73be050429SOlivier Houchard #endif /* !_MACHINE_GDB_MACHDEP_H_ */ 74