Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Try to make a symbol easier to find for MC on exotic platforms
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Mon, 21 Jan 2019 08:42:37 +0000 (09:42 +0100)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Mon, 21 Jan 2019 08:42:37 +0000 (09:42 +0100)
src/kernel/context/ContextUnix.cpp

index e9dafbf..09711d0 100644 (file)
@@ -23,9 +23,10 @@ constexpr int CTX_ADDR_LEN = 2;
 static_assert(sizeof(simgrid::kernel::context::UContext*) <= CTX_ADDR_LEN * sizeof(int),
               "Ucontexts are not supported on this arch yet. Please increase CTX_ADDR_LEN.");
 
-namespace simgrid {
-namespace kernel {
-namespace context {
+/* Make sure that this symbol is easy to recognize by name, even on exotic platforms */
+extern "C" {
+static void smx_ctx_wrapper(int i1, int i2);
+}
 
 // The name of this function is currently hardcoded in MC (as string).
 // Do not change it without fixing those references as well.
@@ -50,6 +51,10 @@ static void smx_ctx_wrapper(int i1, int i2)
   context->suspend();
 }
 
+namespace simgrid {
+namespace kernel {
+namespace context {
+
 // UContextFactory
 Context* UContextFactory::create_context(std::function<void()> code, void_pfn_smxprocess_t cleanup, smx_actor_t actor)
 {