[coreboot-gerrit] Change in coreboot[master]: libpayload: Move GDB functions to stdlib.h

Julius Werner (Code Review) gerrit at coreboot.org
Thu Apr 19 00:00:56 CEST 2018


Julius Werner has uploaded this change for review. ( https://review.coreboot.org/25730


Change subject: libpayload: Move GDB functions to stdlib.h
......................................................................

libpayload: Move GDB functions to stdlib.h

When GDB support is compiled in, halt() in libpayload will call
gdb_enter(). halt() is defined in <stdlib.h> and gdb_enter() in
<libpayload.h>. Usually files just include <libpayload.h> so this is not
a problem, but in some situatons a payload may just include <stdlib.h>
(or a file including it like <assert.h>), leading to an undeclared
identifier here. Move the GDB functions to <stdlib.h> to solve this.

Change-Id: I7b23b8ac9cd302aa6ef96f24565130490ac40071
Signed-off-by: Julius Werner <jwerner at chromium.org>
---
M payloads/libpayload/include/libpayload.h
M payloads/libpayload/include/stdlib.h
2 files changed, 5 insertions(+), 5 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/30/25730/1

diff --git a/payloads/libpayload/include/libpayload.h b/payloads/libpayload/include/libpayload.h
index 83658d1..43ecd05 100644
--- a/payloads/libpayload/include/libpayload.h
+++ b/payloads/libpayload/include/libpayload.h
@@ -440,11 +440,6 @@
 /* Defined in arch/${ARCH}/selfboot.c */
 void selfboot(void *entry);
 
-/* Enter remote GDB mode. Will initialize connection if not already up. */
-void gdb_enter(void);
-/* Disconnect existing GDB connection if one exists. */
-void gdb_exit(s8 exit_status);
-
 /* look for area "name" in "fmap", setting offset and size to describe it.
    Returns 0 on success, < 0 on error. */
 int fmap_region_by_name(const uint32_t fmap_offset, const char * const name,
diff --git a/payloads/libpayload/include/stdlib.h b/payloads/libpayload/include/stdlib.h
index 658fe61..a2e612d 100644
--- a/payloads/libpayload/include/stdlib.h
+++ b/payloads/libpayload/include/stdlib.h
@@ -211,6 +211,11 @@
 void srand(unsigned int seed);
 /** @} */
 
+/* Enter remote GDB mode. Will initialize connection if not already up. */
+void gdb_enter(void);
+/* Disconnect existing GDB connection if one exists. */
+void gdb_exit(s8 exit_status);
+
 /**
  * Stop execution and halt the processor (this function does not return).
  */

-- 
To view, visit https://review.coreboot.org/25730
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7b23b8ac9cd302aa6ef96f24565130490ac40071
Gerrit-Change-Number: 25730
Gerrit-PatchSet: 1
Gerrit-Owner: Julius Werner <jwerner at chromium.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180418/d8c1d1fa/attachment.html>


More information about the coreboot-gerrit mailing list