diff --git a/fs_defs.h b/fs_defs.h new file mode 100644 index 0000000..1b1bc41 --- /dev/null +++ b/fs_defs.h @@ -0,0 +1,61 @@ +#ifndef FS_DEFS_H +#define FS_DEFS_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + + +/* FS defines and types */ +#define FS_MAX_LOCALPATH_SIZE 511 +#define FS_MAX_MOUNTPATH_SIZE 128 +#define FS_MAX_FULLPATH_SIZE (FS_MAX_LOCALPATH_SIZE + FS_MAX_MOUNTPATH_SIZE) +#define FS_MAX_ARGPATH_SIZE FS_MAX_FULLPATH_SIZE + +#define FS_STATUS_OK 0 +#define FS_RET_UNSUPPORTED_CMD 0x0400 +#define FS_RET_NO_ERROR 0x0000 +#define FS_RET_ALL_ERROR (unsigned int)(-1) + +#define FS_STAT_FLAG_IS_DIRECTORY 0x80000000 + +/* max length of file/dir name */ +#define FS_MAX_ENTNAME_SIZE 256 + +#define FS_SOURCETYPE_EXTERNAL 0 +#define FS_SOURCETYPE_HFIO 1 + +#define FS_MOUNT_SOURCE_SIZE 0x300 +#define FS_CLIENT_SIZE 0x1700 +#define FS_CMD_BLOCK_SIZE 0xA80 + +typedef struct +{ + uint32_t flag; + uint32_t permission; + uint32_t owner_id; + uint32_t group_id; + uint32_t size; + uint32_t alloc_size; + uint64_t quota_size; + uint32_t ent_id; + uint64_t ctime; + uint64_t mtime; + uint8_t attributes[48]; +} __attribute__((packed)) FSStat; + +typedef struct +{ + FSStat stat; + char name[FS_MAX_ENTNAME_SIZE]; +} FSDirEntry; + + +#ifdef __cplusplus +} +#endif + +#endif /* FS_DEFS_H */ + diff --git a/fs_functions.c b/fs_functions.c index 29d7fb1..08a4fb6 100644 --- a/fs_functions.c +++ b/fs_functions.c @@ -23,7 +23,6 @@ ***************************************************************************/ #include "fs_functions.h" #include "os_functions.h" -#include "utils/utils.h" EXPORT_DECL(int, FSInit, void); EXPORT_DECL(int, FSShutdown, void); diff --git a/fs_functions.h b/fs_functions.h index eeec621..d024655 100644 --- a/fs_functions.h +++ b/fs_functions.h @@ -29,56 +29,7 @@ extern "C" { #endif #include - -/* FS defines and types */ -#define FS_MAX_LOCALPATH_SIZE 511 -#define FS_MAX_MOUNTPATH_SIZE 128 -#define FS_MAX_FULLPATH_SIZE (FS_MAX_LOCALPATH_SIZE + FS_MAX_MOUNTPATH_SIZE) -#define FS_MAX_ARGPATH_SIZE FS_MAX_FULLPATH_SIZE - -#define FS_STATUS_OK 0 -#define FS_RET_UNSUPPORTED_CMD 0x0400 -#define FS_RET_NO_ERROR 0x0000 -#define FS_RET_ALL_ERROR (unsigned int)(-1) - -#define FS_STAT_FLAG_IS_DIRECTORY 0x80000000 - -/* max length of file/dir name */ -#define FS_MAX_ENTNAME_SIZE 256 - -#define FS_SOURCETYPE_EXTERNAL 0 -#define FS_SOURCETYPE_HFIO 1 -#define FS_SOURCETYPE_HFIO 1 - -#define FS_STATUS_OK 0 -#define FS_STATUS_EXISTS -5 -#define FS_STATUS_STORAGE_FULL -12 -#define FS_STATUS_JOURNAL_FULL -13 - -#define FS_MOUNT_SOURCE_SIZE 0x300 -#define FS_CLIENT_SIZE 0x1700 -#define FS_CMD_BLOCK_SIZE 0xA80 - -typedef struct -{ - uint32_t flag; - uint32_t permission; - uint32_t owner_id; - uint32_t group_id; - uint32_t size; - uint32_t alloc_size; - uint64_t quota_size; - uint32_t ent_id; - uint64_t ctime; - uint64_t mtime; - uint8_t attributes[48]; -} __attribute__((packed)) FSStat; - -typedef struct -{ - FSStat stat; - char name[FS_MAX_ENTNAME_SIZE]; -} FSDirEntry; +#include "fs_defs.h" void InitFSFunctionPointers(void); diff --git a/gx2_functions.c b/gx2_functions.c index c96cf22..a34807e 100644 --- a/gx2_functions.c +++ b/gx2_functions.c @@ -23,7 +23,6 @@ ***************************************************************************/ #include "os_functions.h" #include "gx2_types.h" -#include "utils/utils.h" unsigned int gx2_handle __attribute__((section(".data"))) = 0;