xref: /freebsd/sys/amd64/include/gdb_machdep.h (revision beb2406556f190519f91f573d984503bda34673b)
146280ae7SWarner Losh /*-
2c49761ddSPedro F. Giffuni  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3c49761ddSPedro 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  * $FreeBSD$
2972d44f31SMarcel Moolenaar  */
3072d44f31SMarcel Moolenaar 
3172d44f31SMarcel Moolenaar #ifndef _MACHINE_GDB_MACHDEP_H_
3272d44f31SMarcel Moolenaar #define	_MACHINE_GDB_MACHDEP_H_
3372d44f31SMarcel Moolenaar 
34c6325171SJohn Baldwin #define	GDB_BUFSZ	(GDB_NREGS * 16)
3572d44f31SMarcel Moolenaar #define	GDB_NREGS	56
36470d8317SMarcel Moolenaar #define	GDB_REG_PC	16
3772d44f31SMarcel Moolenaar 
3872d44f31SMarcel Moolenaar static __inline size_t
3972d44f31SMarcel Moolenaar gdb_cpu_regsz(int regnum)
4072d44f31SMarcel Moolenaar {
4172d44f31SMarcel Moolenaar 	return ((regnum > 16 && regnum < 24) ? 4 : 8);
4272d44f31SMarcel Moolenaar }
4372d44f31SMarcel Moolenaar 
4472d44f31SMarcel Moolenaar static __inline int
4572d44f31SMarcel Moolenaar gdb_cpu_query(void)
4672d44f31SMarcel Moolenaar {
4772d44f31SMarcel Moolenaar 	return (0);
4872d44f31SMarcel Moolenaar }
4972d44f31SMarcel Moolenaar 
50*beb24065SJonathan T. Looney void *gdb_begin_write(void);
5172d44f31SMarcel Moolenaar void *gdb_cpu_getreg(int, size_t *);
52bcc5241cSMarcel Moolenaar void gdb_cpu_setreg(int, void *);
53b1fb1bb1SMarcel Moolenaar int gdb_cpu_signal(int, int);
54*beb24065SJonathan T. Looney void gdb_end_write(void *);
5572d44f31SMarcel Moolenaar 
5672d44f31SMarcel Moolenaar #endif /* !_MACHINE_GDB_MACHDEP_H_ */
57