aboutsummaryrefslogtreecommitdiffstats
path: root/gpxe/src/include
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-06-30 15:34:05 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-06-30 15:34:05 -0700
commitacf9a9fcc779b9b8afb926dbd1a3858aa0ba7af3 (patch)
tree0bab52968aaca4d76da1f99c4b97d35b81993ef4 /gpxe/src/include
parenta776840538b8f52053aa005952f713a498132565 (diff)
downloadsyslinux.git-acf9a9fcc779b9b8afb926dbd1a3858aa0ba7af3.tar.gz
syslinux.git-acf9a9fcc779b9b8afb926dbd1a3858aa0ba7af3.tar.xz
syslinux.git-acf9a9fcc779b9b8afb926dbd1a3858aa0ba7af3.zip
gPXE: Missing files from gPXE syncsyslinux-3.70-pre30syslinux-3.70
Files that should have been added before...
Diffstat (limited to 'gpxe/src/include')
-rw-r--r--gpxe/src/include/gpxe/gdbserial.h19
-rw-r--r--gpxe/src/include/gpxe/gdbstub.h73
-rw-r--r--gpxe/src/include/gpxe/gdbudp.h22
3 files changed, 114 insertions, 0 deletions
diff --git a/gpxe/src/include/gpxe/gdbserial.h b/gpxe/src/include/gpxe/gdbserial.h
new file mode 100644
index 00000000..1863e907
--- /dev/null
+++ b/gpxe/src/include/gpxe/gdbserial.h
@@ -0,0 +1,19 @@
+#ifndef _GPXE_GDBSERIAL_H
+#define _GPXE_GDBSERIAL_H
+
+/** @file
+ *
+ * GDB remote debugging over serial
+ *
+ */
+
+struct gdb_transport;
+
+/**
+ * Set up the serial transport
+ *
+ * @ret transport suitable for starting the GDB stub or NULL on error
+ */
+struct gdb_transport *gdbserial_configure ( void );
+
+#endif /* _GPXE_GDBSERIAL_H */
diff --git a/gpxe/src/include/gpxe/gdbstub.h b/gpxe/src/include/gpxe/gdbstub.h
new file mode 100644
index 00000000..bf5d24d2
--- /dev/null
+++ b/gpxe/src/include/gpxe/gdbstub.h
@@ -0,0 +1,73 @@
+#ifndef _GPXE_GDBSTUB_H
+#define _GPXE_GDBSTUB_H
+
+/** @file
+ *
+ * GDB remote debugging
+ *
+ */
+
+#include <stdint.h>
+#include <gpxe/tables.h>
+#include <gdbmach.h>
+
+/**
+ * A transport mechanism for the GDB protocol
+ *
+ */
+struct gdb_transport {
+ /** Transport name */
+ const char *name;
+ /**
+ * Set up the transport given a list of arguments
+ *
+ * @v argc Number of arguments
+ * @v argv Argument list
+ * @ret Return status code
+ *
+ * Note that arguments start at argv[0].
+ */
+ int ( * init ) ( int argc, char **argv );
+ /**
+ * Perform a blocking read
+ *
+ * @v buf Buffer
+ * @v len Size of buffer
+ * @ret Number of bytes read into buffer
+ */
+ size_t ( * recv ) ( char *buf, size_t len );
+ /**
+ * Write, may block
+ *
+ * @v buf Buffer
+ * @v len Size of buffer
+ */
+ void ( * send ) ( const char *buf, size_t len );
+};
+
+#define __gdb_transport __table ( struct gdb_transport, gdb_transports, 01 )
+
+/**
+ * Look up GDB transport by name
+ *
+ * @v name Name of transport
+ * @ret GDB transport or NULL
+ */
+extern struct gdb_transport *find_gdb_transport ( const char *name );
+
+/**
+ * Break into the debugger using the given transport
+ *
+ * @v trans GDB transport
+ */
+extern void gdbstub_start ( struct gdb_transport *trans );
+
+/**
+ * Interrupt handler
+ *
+ * @signo POSIX signal number
+ * @regs CPU register snapshot
+ **/
+extern void gdbstub_handler ( int signo, gdbreg_t *regs );
+
+#endif /* _GPXE_GDBSTUB_H */
diff --git a/gpxe/src/include/gpxe/gdbudp.h b/gpxe/src/include/gpxe/gdbudp.h
new file mode 100644
index 00000000..1a990933
--- /dev/null
+++ b/gpxe/src/include/gpxe/gdbudp.h
@@ -0,0 +1,22 @@
+#ifndef _GPXE_GDBUDP_H
+#define _GPXE_GDBUDP_H
+
+/** @file
+ *
+ * GDB remote debugging over UDP
+ *
+ */
+
+struct sockaddr_in;
+struct gdb_transport;
+
+/**
+ * Set up the UDP transport with network address
+ *
+ * @name network device name
+ * @addr IP address and UDP listen port, may be NULL and fields may be zero
+ * @ret transport suitable for starting the GDB stub or NULL on error
+ */
+struct gdb_transport *gdbudp_configure ( const char *name, struct sockaddr_in *addr );
+
+#endif /* _GPXE_GDBUDP_H */