Ciro Santilli has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/36896 )

Change subject: misc: create C declarations for the _addr and _semi m5ops
......................................................................

misc: create C declarations for the _addr and _semi m5ops

Symbols such as m5_exit_addr are already present in the libm5.a, but were
not previously exposed in a header. This commit allows external C programs
to use those versions of the functions as well.

Change-Id: I925e3af7bd6cb23e06fb744d453153323afb9310
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/36896
Reviewed-by: Gabe Black <gabe.bl...@gmail.com>
Maintainer: Gabe Black <gabe.bl...@gmail.com>
Tested-by: kokoro <noreply+kok...@google.com>
---
M include/gem5/m5ops.h
1 file changed, 16 insertions(+), 0 deletions(-)

Approvals:
  Gabe Black: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass



diff --git a/include/gem5/m5ops.h b/include/gem5/m5ops.h
index 315b1dc..7e12c70 100644
--- a/include/gem5/m5ops.h
+++ b/include/gem5/m5ops.h
@@ -35,6 +35,8 @@

 #include <stdint.h>

+#include <gem5/asm/generic/m5ops.h>
+
 void m5_arm(uint64_t address);
 void m5_quiesce(void);
 void m5_quiesce_ns(uint64_t ns);
@@ -73,6 +75,20 @@
  */
 void m5_workload();

+/*
+ * Create _addr and _semi versions all declarations, e.g. m5_exit_addr and
+ * m5_exit_semi. These expose the the memory and semihosting variants of the
+ * ops.
+ *
+ * Some of those declarations are not defined for certain ISAs, e.g. X86
+ * does not have _semi, but we felt that ifdefing them out could cause more
+ * trouble tham leaving them in.
+ */
+#define M5OP(name, func) __typeof__(name) M5OP_MERGE_TOKENS(name, _addr); \
+                         __typeof__(name) M5OP_MERGE_TOKENS(name, _semi);
+M5OP_FOREACH
+#undef M5OP
+
 #ifdef __cplusplus
 }
 #endif

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/36896
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I925e3af7bd6cb23e06fb744d453153323afb9310
Gerrit-Change-Number: 36896
Gerrit-PatchSet: 5
Gerrit-Owner: Ciro Santilli <ciro.santi...@arm.com>
Gerrit-Reviewer: Ciro Santilli <ciro.santi...@arm.com>
Gerrit-Reviewer: Gabe Black <gabe.bl...@gmail.com>
Gerrit-Reviewer: Gabe Black <gabebl...@google.com>
Gerrit-Reviewer: Giacomo Travaglini <giacomo.travagl...@arm.com>
Gerrit-Reviewer: Jason Lowe-Power <power...@gmail.com>
Gerrit-Reviewer: kokoro <noreply+kok...@google.com>
Gerrit-CC: Jason Lowe-Power <ja...@lowepower.com>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to