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.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Ciro Santilli
2020-10-28 10:38:41 +00:00
parent b6a35f3c99
commit bdd4044e97

View File

@@ -35,6 +35,8 @@ extern "C" {
#include <stdint.h> #include <stdint.h>
#include <gem5/asm/generic/m5ops.h>
void m5_arm(uint64_t address); void m5_arm(uint64_t address);
void m5_quiesce(void); void m5_quiesce(void);
void m5_quiesce_ns(uint64_t ns); void m5_quiesce_ns(uint64_t ns);
@@ -73,6 +75,20 @@ void m5_work_end(uint64_t workid, uint64_t threadid);
*/ */
void m5_workload(); 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 #ifdef __cplusplus
} }
#endif #endif