Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Mark some internal symbols as hidden on ELF in simix
[simgrid.git] / src / simix / popping_private.h
1 /* Copyright (c) 2007-2010, 2012-2015. The SimGrid Team.
2  * All rights reserved.                                                     */
3
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. */
6
7 #ifndef _POPPING_PRIVATE_H
8 #define _POPPING_PRIVATE_H
9
10 #include <xbt/base.h>
11
12 SG_BEGIN_DECL()
13
14 /********************************* Simcalls *********************************/
15 XBT_PUBLIC_DATA(const char*) simcall_names[]; /* Name of each simcall */
16
17 #include "popping_enum.h" /* Definition of e_smx_simcall_t, with one value per simcall */
18 #include "mc/mc_forward.h" /* Definition of mc_snapshot_t, used by one simcall */
19
20 typedef int (*simix_match_func_t)(void *, void *, smx_synchro_t);
21 typedef void (*simix_copy_data_func_t)(smx_synchro_t, void*, size_t);
22 typedef void (*simix_clean_func_t)(void *);
23 typedef void (*FPtr)(void); // Hide the ugliness
24
25 /* Pack all possible scalar types in an union */
26 union u_smx_scalar {
27   char            c;
28   const char*     cc;
29   short           s;
30   int             i;
31   long            l;
32   unsigned char   uc;
33   unsigned short  us;
34   unsigned int    ui;
35   unsigned long   ul;
36   float           f;
37   double          d;
38   size_t          sz;
39   sg_size_t       sgsz;
40   sg_offset_t     sgoff;
41   void*           dp;
42   FPtr            fp;
43   const void*     cp;
44 };
45
46 /**
47  * \brief Represents a simcall to the kernel.
48  */
49 typedef struct s_smx_simcall {
50   e_smx_simcall_t call;
51   smx_process_t issuer;
52   int mc_value;
53   union u_smx_scalar args[11];
54   union u_smx_scalar result;
55 } s_smx_simcall_t, *smx_simcall_t;
56
57 #define SIMCALL_SET_MC_VALUE(simcall, value) ((simcall)->mc_value = (value))
58 #define SIMCALL_GET_MC_VALUE(simcall) ((simcall)->mc_value)
59
60 #include "popping_accessors.h"
61
62 /******************************** General *************************************/
63
64 XBT_PRIVATE void SIMIX_simcall_answer(smx_simcall_t);
65 XBT_PRIVATE void SIMIX_simcall_handle(smx_simcall_t, int);
66 XBT_PRIVATE void SIMIX_simcall_exit(smx_synchro_t);
67 XBT_PRIVATE const char *SIMIX_simcall_name(e_smx_simcall_t kind);
68
69 SG_END_DECL()
70
71 #endif