RIOT integration of xipfs.
More...
RIOT integration of xipfs.
|
| #define | XIPFS_PARTITION_CORE(id, path, data, data_bytesize) |
| | Define an XiPFS mountpoint along with its associated metadata.
|
| |
| #define | XIPFS_NEW_PARTITION(id, path, num) |
| | Allocate a new contiguous space aligned to a page in the non-volatile addressable memory of the MCU to serve as a partition for an xipfs file system.
|
| |
| #define | XIPFS_START_PARTITION_INCLUSION(id) |
| | Define the beginning of an included XiPFS mount point.
|
| |
| #define | XIPFS_END_PARTITION_INCLUSION(id, path, data, data_bytesize) |
| | Define the end of an included XiPFS mount point.
|
| |
◆ XIPFS_END_PARTITION_INCLUSION
| #define XIPFS_END_PARTITION_INCLUSION |
( |
| id, |
|
|
| path, |
|
|
| data, |
|
|
| data_bytesize ) |
Value:
#define XIPFS_PARTITION_CORE(id, path, data, data_bytesize)
Define an XiPFS mountpoint along with its associated metadata.
Define the end of an included XiPFS mount point.
- Parameters
-
| [in] | id | Identifier name for the mount point used by functions that manipulate xipfs file systems. |
| [in] | path | The mount point of the file system in the VFS tree. |
| [in] | data | Pointer to the start of the mount point in Flash memory. |
| [in] | data_bytesize | Size of the mount point in Flash memory. |
Definition at line 105 of file xipfs_fs.h.
◆ XIPFS_NEW_PARTITION
| #define XIPFS_NEW_PARTITION |
( |
| id, |
|
|
| path, |
|
|
| num ) |
Value:
XIPFS_PARTITION_CORE(id, path, xipfs_part_##id, num * XIPFS_NVM_PAGE_SIZE)
#define FLASH_WRITABLE_INIT(name, size)
Define an array in flash memory.
Allocate a new contiguous space aligned to a page in the non-volatile addressable memory of the MCU to serve as a partition for an xipfs file system.
- Parameters
-
| [in] | id | Identifier name for the mount point used by functions that manipulate xipfs file systems. |
| [in] | path | The mount point of the file system in the VFS tree. |
| [in] | num | The total number of pages allocated for the partition. |
Definition at line 73 of file xipfs_fs.h.
◆ XIPFS_PARTITION_CORE
| #define XIPFS_PARTITION_CORE |
( |
| id, |
|
|
| path, |
|
|
| data, |
|
|
| data_bytesize ) |
Value:
.vfs_mp = { \
.mount_point = path, \
}, \
.magic = XIPFS_MAGIC, \
.mount_path = path, \
.page_num = data_bytesize / XIPFS_NVM_PAGE_SIZE, \
.page_addr = (void *)data, \
.execution_mutex = &execution_mutex_##id, \
.mutex = &mutex_##id \
}
#define MUTEX_INIT
Static initializer for mutex_t.
const vfs_file_system_t xipfs_file_system
The xipfs vfs driver.
struct vfs_xipfs_mount_s vfs_xipfs_mount_t
xipfs descriptor for vfs integration.
Define an XiPFS mountpoint along with its associated metadata.
- Parameters
-
| [in] | id | Identifier name for the mount point used by functions that manipulate xipfs file systems |
| [in] | path | The mount point of the file system in the VFS tree |
| [in] | data | Pointer to the start of the mount point in Flash memory. |
| [in] | data_bytesize | Size of the mount point in Flash memory. |
- Warning
- data_bytesize must be an integral multiple of XIPFS_NVM_PAGE_SIZE.
- See also
- XIPFS_NEW_PARTITION
-
XIPFS_START_PARTITION_INCLUSION / XIPFS_END_PARTITION_INCLUSION
Definition at line 47 of file xipfs_fs.h.
◆ XIPFS_START_PARTITION_INCLUSION
| #define XIPFS_START_PARTITION_INCLUSION |
( |
| id | ) |
|
Value: __attribute__((aligned(XIPFS_NVM_PAGE_SIZE))) \
__attribute__((section(".rodata.xipfs." #id)))
Define the beginning of an included XiPFS mount point.
- Parameters
-
| [in] | id | Identifier name for the mount point used by functions that manipulate xipfs file systems |
- Warning
- Contrary to most other macros, please take care NOT to end this one with a semicolon character ';'.
Definition at line 89 of file xipfs_fs.h.
◆ vfs_xipfs_mount_t
xipfs descriptor for vfs integration.
execution_mutex is taken by:
- xipfs_extended_driver_execv,
- xipfs_extended_driver_safe_execv,
- deletion operations.
mutex is taken by all operations except from:
- xipfs_extended_driver_execv
- xipfs_extended_driver_safe_execv.
This two mutexes scheme:
- allows to call xipfs operation from within a code run by xipfs_extended_driver_execv,
- prevents from deleting files or directories when operations are performed on them.
◆ xipfs_construct_from_flashpage()
vfs_xipfs_mount_t constructor from a mtd_flashpage_t.
This function constructs an xipfs mount point from a mtd_flashpage_t such as mtd_flash_aux_slot. It allows to use XIPFS with the RIOT AUX slot mechanism.
- Parameters
-
| [in] | flashpage | A valid mtd_flashpage_t pointer such as &mtd_flash_aux_slot. |
| [in] | path | A valid mounting point path. |
| [in] | execution_mutex | A valid mutex pointer used for execution and deletions operations. |
| [in] | mutex | A valid mutex pointer used by all operations except from execution. |
| [in,out] | vfs_xipfs_mount | A valid vfs xipfs mount point pointer. |
- Return values
-
| -EINVAL | when one of the parameters is NULL or when path is an empty string. |
| 0 | on success. |
- Note
- Both mutexes will be initialized by this function.
◆ xipfs_extended_driver_execv()
| int xipfs_extended_driver_execv |
( |
const char * | full_path, |
|
|
char *const | argv[] ) |
Executes an executable file with arguments.
- Parameters
-
| [in] | full_path | A full path such as /nvme0p0/my_executable_file. |
| [in] | argv | Executable arguments. Cannot be NULL, argv[0] contains the executable filename. |
- Return values
-
| <0 | on errors. |
| >=0 | on success. |
◆ xipfs_extended_driver_new_file()
| int xipfs_extended_driver_new_file |
( |
const char * | full_path, |
|
|
uint32_t | size, |
|
|
uint32_t | exec ) |
Executable or regular new file.
Allows to create a regular or executable new file within XiPFS.
- Parameters
-
| [in] | full_path | A full path such as /nvme0p0/my_new_file |
| [in] | size | The file size in bytes. |
| [in] | exec | 0 for regular files, 1 for executable files. |
- Return values
-
| <0 | on errors. |
| 0 | on success. |