Generic nodes are an alternative to standard drivers in RTEMS.
More...
|
#define | IMFS_GENERIC_INITIALIZER(handlers, init, destroy) IMFS_NODE_CONTROL_INITIALIZER( handlers, init, destroy ) |
|
#define | IMFS_GENERIC_CONTROL_INITIALIZER(handlers, init, destroy) IMFS_NODE_CONTROL_INITIALIZER( handlers, init, destroy ) |
| Initializer for a generic node control. More...
|
|
#define | IMFS_GENERIC_NODE_INITIALIZER(node_control, name, namelen, mode) { IMFS_NODE_INITIALIZER( node_control, name, namelen, mode ), NULL } |
| Initializer for a generic node. More...
|
|
Generic nodes are an alternative to standard drivers in RTEMS.
The handlers of a generic node are called with less overhead compared to the standard driver operations. The usage of file system node handlers enable more features like support for fsync() and fdatasync(). The generic nodes use the reference counting of the IMFS. This provides automatic node destruction when the last reference vanishes.
◆ IMFS_GENERIC_CONTROL_INITIALIZER
Initializer for a generic node control.
- Parameters
-
handlers | The file system node handlers. |
init | The node initialization method. |
destroy | The node destruction method. |
◆ IMFS_GENERIC_NODE_INITIALIZER
#define IMFS_GENERIC_NODE_INITIALIZER |
( |
|
node_control, |
|
|
|
name, |
|
|
|
namelen, |
|
|
|
mode |
|
) |
| { IMFS_NODE_INITIALIZER( node_control, name, namelen, mode ), NULL } |
Initializer for a generic node.
Initialize the node control with IMFS_GENERIC_CONTROL_INITIALIZER().
- Parameters
-
node_control | The node control of the IMFS generic node. |
name | The name of the IMFS generic node. |
namelen | The length of the name of the IMFS generic node. |
mode | The mode of the IMFS generic node. |
◆ IMFS_node_control_destroy
typedef void(* IMFS_node_control_destroy) (IMFS_jnode_t *node) |
◆ IMFS_node_control_initialize
◆ IMFS_node_control_remove
Prepares the removal of an IMFS node from its parent directory.
- Parameters
-
- Return values
-
node | Successful operation. |
NULL | An error occurred. The errno indicates the error. This will abort the removal operation. |
- See also
- IMFS_node_control and IMFS_node_remove_default().
◆ IMFS_do_nothing_destroy()
◆ IMFS_make_generic_node()
int IMFS_make_generic_node |
( |
const char * |
path, |
|
|
mode_t |
mode, |
|
|
const IMFS_node_control * |
node_control, |
|
|
void * |
context |
|
) |
| |
Makes a generic IMFS node.
- Parameters
-
[in] | path | The path to the new generic IMFS node. |
[in] | mode | The node mode. |
[in] | node_control | The node control. |
[in] | context | The node control handler context. |
- Return values
-
0 | Successful operation. |
-1 | An error occurred. The errno indicates the error. |
#include <sys/stat.h>
#include <fcntl.h>
...
};
{
context = IMFS_generic_get_context_by_node(node);
return node;
}
{
void *
context = IMFS_generic_get_context_by_node(node);
}
&some_node_handlers,
some_node_init,
some_node_destroy
);
void example(void *some_node_context)
{
int rv;
"/path/to/some/generic/node",
S_IFCHR | S_IRWXU | S_IRWXG | S_IRWXO,
&some_node_control,
some_node_context
);
assert(rv == 0);
}
This header file provides the interfaces of the Assert Handler.
#define IMFS_GENERIC_CONTROL_INITIALIZER(handlers, init, destroy)
Initializer for a generic node control.
Definition: imfs.h:740
IMFS_jnode_t * IMFS_node_initialize_generic(IMFS_jnode_t *node, void *arg)
Returns the node and sets the generic node context.
Definition: imfs_make_generic_node.c:44
int IMFS_make_generic_node(const char *path, mode_t mode, const IMFS_node_control *node_control, void *context)
Makes a generic IMFS node.
Definition: imfs_make_generic_node.c:56
void IMFS_node_destroy_default(IMFS_jnode_t *node)
Frees the node.
Definition: imfs_node_destroy_default.c:44
This header file defines the API of the In-Memory File System.
rtems_termios_device_context * context
Definition: console-config.c:62
IMFS node control.
Definition: imfs.h:237
File system node operations table.
Definition: libio.h:1020
◆ IMFS_node_destroy_default()
◆ IMFS_node_initialize_default()
Returns the node and does nothing else.
- Parameters
-
[in] | node | The IMFS node. |
[in] | arg | The user provided argument pointer. It is not used. |
- Return values
-
node | Returns always the node passed as parameter. |
- See also
- IMFS_node_control.
◆ IMFS_node_initialize_generic()
Returns the node and sets the generic node context.
- Parameters
-
[in] | node | The IMFS node. |
[in] | arg | The user provided argument pointer. It must contain the generic context. |
- Return values
-
node | Returns always the node passed as parameter. |
- See also
- IMFS_node_control.
◆ IMFS_node_remove_default()
Returns the node and does nothing else.
- Parameters
-
- Return values
-
node | Returns always the node passed as parameter. |
- See also
- IMFS_node_control.