Constant devices.
More...
Constant devices.
This module provides the constant devices which provide user space with its primary means of allocating memory and obtaining constant data.
The constant devices are exposed under the /dev/const/ directory:
/dev/const/one: A readable and mappable file that returns bytes with all bits set to 1.
/dev/const/zero: A readable and mappable file that returns bytes with all bits set to 0.
/dev/const/null: A readable and writable file that discards all written data and returns EOF on read.
|
| static uint64_t | const_one_read (file_t *file, void *buffer, size_t count, size_t *offset) |
| |
| static void * | const_one_mmap (file_t *file, void *addr, size_t length, size_t *offset, pml_flags_t flags) |
| |
| static uint64_t | const_zero_read (file_t *file, void *buffer, size_t count, size_t *offset) |
| |
| static void * | const_zero_mmap (file_t *file, void *addr, size_t length, size_t *offset, pml_flags_t flags) |
| |
| static uint64_t | const_null_read (file_t *file, void *buffer, size_t count, size_t *offset) |
| |
| static uint64_t | const_null_write (file_t *file, const void *buffer, size_t count, size_t *offset) |
| |
| static uint64_t | const_init (void) |
| |
| static void | const_deinit (void) |
| |
◆ const_one_read()
◆ const_one_mmap()
◆ const_zero_read()
◆ const_zero_mmap()
◆ const_null_read()
◆ const_null_write()
◆ const_init()
◆ const_deinit()
◆ constDir
◆ oneFile
◆ zeroFile
◆ nullFile
◆ oneOps
Initial value:= {
}
static uint64_t const_one_read(file_t *file, void *buffer, size_t count, size_t *offset)
static void * const_one_mmap(file_t *file, void *addr, size_t length, size_t *offset, pml_flags_t flags)
Definition at line 58 of file const.c.
◆ zeroOps
Initial value:= {
}
static void * const_zero_mmap(file_t *file, void *addr, size_t length, size_t *offset, pml_flags_t flags)
static uint64_t const_zero_read(file_t *file, void *buffer, size_t count, size_t *offset)
Definition at line 87 of file const.c.
◆ nullOps
Initial value:= {
}
static uint64_t const_null_write(file_t *file, const void *buffer, size_t count, size_t *offset)
static uint64_t const_null_read(file_t *file, void *buffer, size_t count, size_t *offset)
Definition at line 110 of file const.c.