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 *********************************/
13 XBT_PUBLIC(const char*) simcall_names[]; /* Name of each simcall */
15 #include "simcalls_generated_enum.h" /* All possible simcalls (generated) */
17 typedef int (*simix_match_func_t)(void *, void *, smx_action_t);
18 typedef void (*simix_copy_data_func_t)(smx_action_t, void*, size_t);
19 typedef void (*simix_clean_func_t)(void *);
20 typedef void (*FPtr)(void); // Hide the ugliness
22 /* Pack all possible scalar types in an union */
44 * \brief Represents a simcall to the kernel.
46 typedef struct s_smx_simcall {
52 union u_smx_scalar args[11];
53 union u_smx_scalar result;
62 } s_smx_simcall_t, *smx_simcall_t;
65 #define SIMCALL_SET_MC_VALUE(simcall, value) ((simcall)->mc_value = (value))
66 #define SIMCALL_GET_MC_VALUE(simcall) ((simcall)->mc_value)
68 #define SIMCALL_SET_MC_VALUE(simcall, value) ((void)0)
69 #define SIMCALL_GET_MC_VALUE(simcall) 0
72 #include "simcalls_generated_res_getter_setter.h"
73 #include "simcalls_generated_args_getter_setter.h"
75 /******************************** General *************************************/
77 void SIMIX_simcall_push(smx_process_t self);
78 void SIMIX_simcall_answer(smx_simcall_t);
79 void SIMIX_simcall_enter(smx_simcall_t, int);
80 void SIMIX_simcall_exit(smx_action_t);
81 smx_simcall_t SIMIX_simcall_mine(void);
82 const char *SIMIX_simcall_name(e_smx_simcall_t kind);
83 //FIXME put it in a better place
84 xbt_dict_t SIMIX_pre_asr_get_properties(smx_simcall_t simcall, const char *name);
86 /*************************** New simcall interface ****************************/
88 typedef smx_action_t (*simcall_handler_t)(u_smx_scalar_t *);
90 extern const char *simcall_types[];
91 extern simcall_handler_t simcall_table[];