Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Extend definition of simcalls to include a pointer to the simcall handler functions.
authorCristian Rosa <cristian@rtfm.org.ar>
Fri, 7 Sep 2012 15:33:18 +0000 (12:33 -0300)
committershenshei <paul.bedaride@gmail.com>
Wed, 28 Nov 2012 08:17:53 +0000 (09:17 +0100)
Use these pointers to initialize a simcall dispatch table.

src/simix/smx_smurf.c

index 0f1bdfb..5a573ff 100644 (file)
@@ -658,7 +658,13 @@ void __SIMIX_simcall(e_smx_simcall_t simcall_id, u_smx_scalar_t *args)
 /* FIXME: add types for every simcall */
 const char *simcall_types[NUM_SIMCALLS] = { [SIMCALL_HOST_EXECUTE] = "%s%p%f%f%p" };
 
-simcall_handler_t simcall_table[NUM_SIMCALLS] = {[SIMCALL_HOST_EXECUTE] = &SIMIX_host_execute};
+simcall_handler_t simcall_table[NUM_SIMCALLS] = {
+#undef SIMCALL_ENUM_ELEMENT
+#define SIMCALL_ENUM_ELEMENT(x,y) &y /* generate strings from the enumeration values */
+SIMCALL_LIST
+#undef SIMCALL_ENUM_ELEMENT
+};
+
 
 void SIMIX_simcall_typecheck(const char *fmt, ...)
 {