X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/53b6a451a45d9d6465c9dbad3f29d3f1a55ca238..cd69f8c66886ae218c6a9b38125b27fe157e6bb2:/src/simix/smx_smurf_private.h diff --git a/src/simix/smx_smurf_private.h b/src/simix/smx_smurf_private.h index 58b8bc4899..7847b5f986 100644 --- a/src/simix/smx_smurf_private.h +++ b/src/simix/smx_smurf_private.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2007-2010, 2012-2013. The SimGrid Team. +/* Copyright (c) 2007-2010, 2012-2014. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -10,25 +10,12 @@ SG_BEGIN_DECL() /********************************* Simcalls *********************************/ +XBT_PUBLIC(const char*) simcall_names[]; /* Name of each simcall */ -/* we want to build the e_smx_simcall_t enumeration, the table of the - * corresponding simcalls string names, and the simcall handlers table - * automatically, using macros. - * To add a new simcall follow the following syntax: - * - * */ - -/** - * \brief All possible simcalls. - */ -typedef enum { -SIMCALL_NONE, -#include "simcalls_generated_enum.h" -SIMCALL_NEW_API_INIT, -NUM_SIMCALLS -} e_smx_simcall_t; +#include "smx_popping_generated.h" /* All generated code about simcalls */ typedef int (*simix_match_func_t)(void *, void *, smx_action_t); +typedef void (*simix_copy_data_func_t)(smx_action_t, void*, size_t); typedef void (*simix_clean_func_t)(void *); typedef void (*FPtr)(void); // Hide the ugliness @@ -47,6 +34,7 @@ union u_smx_scalar { double d; size_t sz; sg_size_t sgsz; + sg_offset_t sgoff; void* dp; FPtr fp; const void* cp; @@ -58,20 +46,21 @@ union u_smx_scalar { typedef struct s_smx_simcall { e_smx_simcall_t call; smx_process_t issuer; +#ifdef HAVE_MC int mc_value; - union u_smx_scalar args[10]; +#endif + union u_smx_scalar args[11]; union u_smx_scalar result; - //FIXME: union u_smx_scalar retval; - union { - struct { - const char* param1; - double param2; - int result; - } new_api; - - }; } s_smx_simcall_t, *smx_simcall_t; +#if HAVE_MC +#define SIMCALL_SET_MC_VALUE(simcall, value) ((simcall)->mc_value = (value)) +#define SIMCALL_GET_MC_VALUE(simcall) ((simcall)->mc_value) +#else +#define SIMCALL_SET_MC_VALUE(simcall, value) ((void)0) +#define SIMCALL_GET_MC_VALUE(simcall) 0 +#endif + #include "simcalls_generated_res_getter_setter.h" #include "simcalls_generated_args_getter_setter.h" @@ -79,11 +68,11 @@ typedef struct s_smx_simcall { void SIMIX_simcall_push(smx_process_t self); void SIMIX_simcall_answer(smx_simcall_t); -void SIMIX_simcall_pre(smx_simcall_t, int); -void SIMIX_simcall_post(smx_action_t); +void SIMIX_simcall_enter(smx_simcall_t, int); +void SIMIX_simcall_exit(smx_action_t); smx_simcall_t SIMIX_simcall_mine(void); const char *SIMIX_simcall_name(e_smx_simcall_t kind); -//TOFIX put it in a better place +//FIXME put it in a better place xbt_dict_t SIMIX_pre_asr_get_properties(smx_simcall_t simcall, const char *name); /*************************** New simcall interface ****************************/