diff options
| author | Michael Brown | 2024-09-04 14:29:30 +0200 |
|---|---|---|
| committer | Michael Brown | 2024-09-05 14:00:39 +0200 |
| commit | 2b82007571dbe02b85338dc9fa85251cd5d68028 (patch) | |
| tree | b99584c83a74fbeb298c1ff4c13e2c89f5eaf41c /src/include | |
| parent | [build] Centralise dummy architecture-specific headers (diff) | |
| download | ipxe-2b82007571dbe02b85338dc9fa85251cd5d68028.tar.gz ipxe-2b82007571dbe02b85338dc9fa85251cd5d68028.tar.xz ipxe-2b82007571dbe02b85338dc9fa85251cd5d68028.zip | |
[gdb] Allow CPU architectures to omit support for GDB
Move the <gdbmach.h> file to <bits/gdbmach.h>, and provide a common
dummy implementation for all architectures that have not yet
implemented support for GDB.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/bits/gdbmach.h | 45 | ||||
| -rw-r--r-- | src/include/ipxe/gdbstub.h | 2 |
2 files changed, 46 insertions, 1 deletions
diff --git a/src/include/bits/gdbmach.h b/src/include/bits/gdbmach.h new file mode 100644 index 000000000..7e349856f --- /dev/null +++ b/src/include/bits/gdbmach.h @@ -0,0 +1,45 @@ +#ifndef _BITS_GDBMACH_H +#define _BITS_GDBMACH_H + +/** @file + * + * Dummy GDB architecture specifics + * + * This file is included only if the architecture does not provide its + * own version of this file. + * + */ + +#include <stdint.h> + +typedef unsigned long gdbreg_t; + +/* Register snapshot */ +enum { + /* Not yet implemented */ + GDBMACH_NREGS, +}; + +#define GDBMACH_SIZEOF_REGS ( GDBMACH_NREGS * sizeof ( gdbreg_t ) ) + +static inline void gdbmach_set_pc ( gdbreg_t *regs, gdbreg_t pc ) { + /* Not yet implemented */ + ( void ) regs; + ( void ) pc; +} + +static inline void gdbmach_set_single_step ( gdbreg_t *regs, int step ) { + /* Not yet implemented */ + ( void ) regs; + ( void ) step; +} + +static inline void gdbmach_breakpoint ( void ) { + /* Not yet implemented */ +} + +extern int gdbmach_set_breakpoint ( int type, unsigned long addr, size_t len, + int enable ); +extern void gdbmach_init ( void ); + +#endif /* _BITS_GDBMACH_H */ diff --git a/src/include/ipxe/gdbstub.h b/src/include/ipxe/gdbstub.h index 13ca33ddb..2240cca42 100644 --- a/src/include/ipxe/gdbstub.h +++ b/src/include/ipxe/gdbstub.h @@ -11,7 +11,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); #include <stdint.h> #include <ipxe/tables.h> -#include <gdbmach.h> +#include <bits/gdbmach.h> /** * A transport mechanism for the GDB protocol |
