xref: /freebsd/sys/i386/include/gdb_machdep.h (revision 95ee2897e98f5d444f26ed2334cc7c439f9c16c6)
186cb007fSWarner Losh /*-
2*4d846d26SWarner Losh  * SPDX-License-Identifier: BSD-2-Clause
383ef78beSPedro F. Giffuni  *
472d44f31SMarcel Moolenaar  * Copyright (c) 2004 Marcel Moolenaar
572d44f31SMarcel Moolenaar  * All rights reserved.
672d44f31SMarcel Moolenaar  *
772d44f31SMarcel Moolenaar  * Redistribution and use in source and binary forms, with or without
872d44f31SMarcel Moolenaar  * modification, are permitted provided that the following conditions
972d44f31SMarcel Moolenaar  * are met:
1072d44f31SMarcel Moolenaar  *
1172d44f31SMarcel Moolenaar  * 1. Redistributions of source code must retain the above copyright
1272d44f31SMarcel Moolenaar  *    notice, this list of conditions and the following disclaimer.
1372d44f31SMarcel Moolenaar  * 2. Redistributions in binary form must reproduce the above copyright
1472d44f31SMarcel Moolenaar  *    notice, this list of conditions and the following disclaimer in the
1572d44f31SMarcel Moolenaar  *    documentation and/or other materials provided with the distribution.
1672d44f31SMarcel Moolenaar  *
1772d44f31SMarcel Moolenaar  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
1872d44f31SMarcel Moolenaar  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
1972d44f31SMarcel Moolenaar  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
2072d44f31SMarcel Moolenaar  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
2172d44f31SMarcel Moolenaar  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2272d44f31SMarcel Moolenaar  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2372d44f31SMarcel Moolenaar  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2472d44f31SMarcel Moolenaar  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2572d44f31SMarcel Moolenaar  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2672d44f31SMarcel Moolenaar  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2772d44f31SMarcel Moolenaar  */
2872d44f31SMarcel Moolenaar 
2972d44f31SMarcel Moolenaar #ifndef _MACHINE_GDB_MACHDEP_H_
3072d44f31SMarcel Moolenaar #define	_MACHINE_GDB_MACHDEP_H_
3172d44f31SMarcel Moolenaar 
3272d44f31SMarcel Moolenaar #define	GDB_BUFSZ	400
335eb95e11SJohn Baldwin #define	GDB_NREGS	16
3472d44f31SMarcel Moolenaar #define	GDB_REG_PC	8
3572d44f31SMarcel Moolenaar 
3672d44f31SMarcel Moolenaar static __inline size_t
gdb_cpu_regsz(int regnum __unused)3772d44f31SMarcel Moolenaar gdb_cpu_regsz(int regnum __unused)
3872d44f31SMarcel Moolenaar {
3972d44f31SMarcel Moolenaar 	return (sizeof(int));
4072d44f31SMarcel Moolenaar }
4172d44f31SMarcel Moolenaar 
4272d44f31SMarcel Moolenaar static __inline int
gdb_cpu_query(void)4372d44f31SMarcel Moolenaar gdb_cpu_query(void)
4472d44f31SMarcel Moolenaar {
4572d44f31SMarcel Moolenaar 	return (0);
4672d44f31SMarcel Moolenaar }
4772d44f31SMarcel Moolenaar 
48beb24065SJonathan T. Looney static __inline void *
gdb_begin_write(void)49beb24065SJonathan T. Looney gdb_begin_write(void)
50beb24065SJonathan T. Looney {
51beb24065SJonathan T. Looney 
52beb24065SJonathan T. Looney 	return (NULL);
53beb24065SJonathan T. Looney }
54beb24065SJonathan T. Looney 
55beb24065SJonathan T. Looney static __inline void
gdb_end_write(void * arg __unused)56beb24065SJonathan T. Looney gdb_end_write(void *arg __unused)
57beb24065SJonathan T. Looney {
58beb24065SJonathan T. Looney 
59beb24065SJonathan T. Looney }
60beb24065SJonathan T. Looney 
6172d44f31SMarcel Moolenaar void *gdb_cpu_getreg(int, size_t *);
62bcc5241cSMarcel Moolenaar void gdb_cpu_setreg(int, void *);
6372d44f31SMarcel Moolenaar int gdb_cpu_signal(int, int);
647446b088SMitchell Horne void gdb_cpu_stop_reason(int, int);
6572d44f31SMarcel Moolenaar 
6672d44f31SMarcel Moolenaar #endif /* !_MACHINE_GDB_MACHDEP_H_ */
67