1 /* Copyright (c) 2007-2010, 2012-2014. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
7 #ifndef _SIMIX_SMURF_PRIVATE_H
8 #define _SIMIX_SMURF_PRIVATE_H
12 /********************************* Simcalls *********************************/
14 /* we want to build the e_smx_simcall_t enumeration, the table of the
15 * corresponding simcalls string names, and the simcall handlers table
16 * automatically, using macros.
17 * To add a new simcall follow the following syntax:
22 * \brief All possible simcalls.
26 #include "simcalls_generated_enum.h"
31 typedef int (*simix_match_func_t)(void *, void *, smx_action_t);
32 typedef void (*simix_clean_func_t)(void *);
33 typedef void (*FPtr)(void); // Hide the ugliness
35 /* Pack all possible scalar types in an union */
56 * \brief Represents a simcall to the kernel.
58 typedef struct s_smx_simcall {
62 union u_smx_scalar args[10];
63 union u_smx_scalar result;
64 //FIXME: union u_smx_scalar retval;
73 } s_smx_simcall_t, *smx_simcall_t;
75 #include "simcalls_generated_res_getter_setter.h"
76 #include "simcalls_generated_args_getter_setter.h"
78 /******************************** General *************************************/
80 void SIMIX_simcall_push(smx_process_t self);
81 void SIMIX_simcall_answer(smx_simcall_t);
82 void SIMIX_simcall_pre(smx_simcall_t, int);
83 void SIMIX_simcall_post(smx_action_t);
84 smx_simcall_t SIMIX_simcall_mine(void);
85 const char *SIMIX_simcall_name(e_smx_simcall_t kind);
86 //TOFIX put it in a better place
87 xbt_dict_t SIMIX_pre_asr_get_properties(smx_simcall_t simcall, const char *name);
89 /*************************** New simcall interface ****************************/
91 typedef smx_action_t (*simcall_handler_t)(u_smx_scalar_t *);
93 extern const char *simcall_types[];
94 extern simcall_handler_t simcall_table[];