XBT_PUBLIC(int) simcall_file_seek(smx_file_t fd, sg_offset_t offset, int origin);
XBT_PUBLIC(int) simcall_file_move(smx_file_t fd, const char* fullpath);
/***************************** Storage **********************************/
-XBT_PUBLIC(sg_size_t) simcall_storage_get_free_size (smx_storage_t storage);
-XBT_PUBLIC(sg_size_t) simcall_storage_get_used_size (smx_storage_t storage);
XBT_PUBLIC(xbt_dict_t) simcall_storage_get_properties(smx_storage_t storage);
-XBT_PUBLIC(void*) SIMIX_storage_get_data(smx_storage_t storage);
-XBT_PUBLIC(void) SIMIX_storage_set_data(smx_storage_t storage, void *data);
XBT_PUBLIC(const char*) SIMIX_storage_get_name(smx_storage_t storage);
/************************** MC simcalls **********************************/
* \return the free space size of the storage element (as a #sg_size_t)
*/
sg_size_t MSG_storage_get_free_size(msg_storage_t storage){
- return simcall_storage_get_free_size(storage);
+ return simgrid::simix::kernelImmediate([storage] { return surf_storage_resource_priv(storage)->getFreeSize(); });
}
/** \ingroup msg_storage_management
* \return the used space size of the storage element (as a #sg_size_t)
*/
sg_size_t MSG_storage_get_used_size(msg_storage_t storage){
- return simcall_storage_get_used_size(storage);
+ return simgrid::simix::kernelImmediate([storage] { return surf_storage_resource_priv(storage)->getUsedSize(); });
}
/** \ingroup msg_storage_management
*/
xbt_dict_t MSG_storage_get_content(msg_storage_t storage)
{
- std::map<std::string, sg_size_t*>* content = surf_storage_resource_priv(storage)->getContent();
+ std::map<std::string, sg_size_t*>* content =
+ simgrid::simix::kernelImmediate([storage] { return surf_storage_resource_priv(storage)->getContent(); });
xbt_dict_t content_dict = xbt_dict_new_homogeneous(nullptr);
for (auto entry : *content) {
sg_size_t Storage::sizeFree()
{
- return simcall_storage_get_free_size(pimpl_);
+ return simgrid::simix::kernelImmediate([this] { return surf_storage_resource_priv(pimpl_)->getFreeSize(); });
}
sg_size_t Storage::sizeUsed()
{
- return simcall_storage_get_used_size(pimpl_);
+ return simgrid::simix::kernelImmediate([this] { return surf_storage_resource_priv(pimpl_)->getUsedSize(); });
}
sg_size_t Storage::size() {
return simcall_BODY_file_move(fd, fullpath);
}
-/**
- * \ingroup simix_storage_management
- * \brief Returns the free space size on a given storage element.
- * \param storage a storage
- * \return Return the free space size on a given storage element (as sg_size_t)
- */
-sg_size_t simcall_storage_get_free_size (smx_storage_t storage){
- return simcall_BODY_storage_get_free_size(storage);
-}
-
-/**
- * \ingroup simix_storage_management
- * \brief Returns the used space size on a given storage element.
- * \param storage a storage
- * \return Return the used space size on a given storage element (as sg_size_t)
- */
-sg_size_t simcall_storage_get_used_size (smx_storage_t storage){
- return simcall_BODY_storage_get_used_size(storage);
-}
-
/**
* \ingroup simix_storage_management
* \brief Returns a dict of the properties assigned to a storage element.
simgrid::simix::marshal<int>(simcall->result, result);
}
-static inline smx_storage_t simcall_storage_get_free_size__get__storage(smx_simcall_t simcall) {
- return simgrid::simix::unmarshal<smx_storage_t>(simcall->args[0]);
-}
-static inline void simcall_storage_get_free_size__set__storage(smx_simcall_t simcall, smx_storage_t arg) {
- simgrid::simix::marshal<smx_storage_t>(simcall->args[0], arg);
-}
-static inline sg_size_t simcall_storage_get_free_size__get__result(smx_simcall_t simcall){
- return simgrid::simix::unmarshal<sg_size_t>(simcall->result);
-}
-static inline void simcall_storage_get_free_size__set__result(smx_simcall_t simcall, sg_size_t result){
- simgrid::simix::marshal<sg_size_t>(simcall->result, result);
-}
-
-static inline smx_storage_t simcall_storage_get_used_size__get__name(smx_simcall_t simcall) {
- return simgrid::simix::unmarshal<smx_storage_t>(simcall->args[0]);
-}
-static inline void simcall_storage_get_used_size__set__name(smx_simcall_t simcall, smx_storage_t arg) {
- simgrid::simix::marshal<smx_storage_t>(simcall->args[0], arg);
-}
-static inline sg_size_t simcall_storage_get_used_size__get__result(smx_simcall_t simcall){
- return simgrid::simix::unmarshal<sg_size_t>(simcall->result);
-}
-static inline void simcall_storage_get_used_size__set__result(smx_simcall_t simcall, sg_size_t result){
- simgrid::simix::marshal<sg_size_t>(simcall->result, result);
-}
-
static inline smx_storage_t simcall_storage_get_properties__get__storage(smx_simcall_t simcall) {
return simgrid::simix::unmarshal<smx_storage_t>(simcall->args[0]);
}
XBT_PRIVATE int simcall_HANDLER_file_seek(smx_simcall_t simcall, smx_file_t fd, sg_offset_t offset, int origin);
XBT_PRIVATE xbt_dynar_t simcall_HANDLER_file_get_info(smx_simcall_t simcall, smx_file_t fd);
XBT_PRIVATE int simcall_HANDLER_file_move(smx_simcall_t simcall, smx_file_t fd, const char* fullpath);
-XBT_PRIVATE sg_size_t simcall_HANDLER_storage_get_free_size(smx_simcall_t simcall, smx_storage_t storage);
-XBT_PRIVATE sg_size_t simcall_HANDLER_storage_get_used_size(smx_simcall_t simcall, smx_storage_t name);
XBT_PRIVATE int simcall_HANDLER_mc_random(smx_simcall_t simcall, int min, int max);
\ No newline at end of file
return simcall<int, smx_file_t, const char*>(SIMCALL_FILE_MOVE, fd, fullpath);
}
-inline static sg_size_t simcall_BODY_storage_get_free_size(smx_storage_t storage) {
- /* Go to that function to follow the code flow through the simcall barrier */
- if (0) simcall_HANDLER_storage_get_free_size(&SIMIX_process_self()->simcall, storage);
- return simcall<sg_size_t, smx_storage_t>(SIMCALL_STORAGE_GET_FREE_SIZE, storage);
- }
-
-inline static sg_size_t simcall_BODY_storage_get_used_size(smx_storage_t name) {
- /* Go to that function to follow the code flow through the simcall barrier */
- if (0) simcall_HANDLER_storage_get_used_size(&SIMIX_process_self()->simcall, name);
- return simcall<sg_size_t, smx_storage_t>(SIMCALL_STORAGE_GET_USED_SIZE, name);
- }
-
inline static xbt_dict_t simcall_BODY_storage_get_properties(smx_storage_t storage) {
/* Go to that function to follow the code flow through the simcall barrier */
if (0) SIMIX_storage_get_properties(storage);
SIMCALL_FILE_SEEK,
SIMCALL_FILE_GET_INFO,
SIMCALL_FILE_MOVE,
- SIMCALL_STORAGE_GET_FREE_SIZE,
- SIMCALL_STORAGE_GET_USED_SIZE,
SIMCALL_STORAGE_GET_PROPERTIES,
SIMCALL_MC_RANDOM,
SIMCALL_SET_CATEGORY,
"SIMCALL_FILE_SEEK",
"SIMCALL_FILE_GET_INFO",
"SIMCALL_FILE_MOVE",
- "SIMCALL_STORAGE_GET_FREE_SIZE",
- "SIMCALL_STORAGE_GET_USED_SIZE",
"SIMCALL_STORAGE_GET_PROPERTIES",
"SIMCALL_MC_RANDOM",
"SIMCALL_SET_CATEGORY",
SIMIX_simcall_answer(simcall);
break;
-case SIMCALL_STORAGE_GET_FREE_SIZE:
- simgrid::simix::marshal<sg_size_t>(simcall->result, simcall_HANDLER_storage_get_free_size(simcall, simgrid::simix::unmarshal<smx_storage_t>(simcall->args[0])));
- SIMIX_simcall_answer(simcall);
- break;
-
-case SIMCALL_STORAGE_GET_USED_SIZE:
- simgrid::simix::marshal<sg_size_t>(simcall->result, simcall_HANDLER_storage_get_used_size(simcall, simgrid::simix::unmarshal<smx_storage_t>(simcall->args[0])));
- SIMIX_simcall_answer(simcall);
- break;
-
case SIMCALL_STORAGE_GET_PROPERTIES:
simgrid::simix::marshal<xbt_dict_t>(simcall->result, SIMIX_storage_get_properties(simgrid::simix::unmarshal<smx_storage_t>(simcall->args[0])));
SIMIX_simcall_answer(simcall);
xbt_dynar_t file_get_info(smx_file_t fd);
int file_move(smx_file_t fd, const char* fullpath);
-sg_size_t storage_get_free_size(smx_storage_t storage);
-sg_size_t storage_get_used_size(smx_storage_t name);
xbt_dict_t storage_get_properties(smx_storage_t storage) [[nohandler]];
int mc_random(int min, int max);