MOS Source Code
Loading...
Searching...
No Matches
io.hpp File Reference
#include "mos/platform/platform.hpp"
#include <mos/io/io_types.h>
#include <mos/mm/mm_types.h>
#include <mos/types.hpp>
+ Include dependency graph for io.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  io_op_t
 
struct  io_t
 

Typedefs

typedef struct _io io_t
 

Enumerations

enum  io_type_t {
  IO_NULL , IO_FILE , IO_DIR , IO_IPC ,
  IO_PIPE , IO_CONSOLE
}
 
enum  io_flags_t {
  IO_NONE = MEM_PERM_NONE , IO_READABLE = MEM_PERM_READ , IO_WRITABLE = MEM_PERM_WRITE , IO_EXECUTABLE = MEM_PERM_EXEC ,
  IO_SEEKABLE = 1 << 3 , IO_MMAPABLE = 1 << 4
}
 

Functions

 MOS_ENUM_OPERATORS (io_flags_t)
 
void io_init (io_t *io, io_type_t type, io_flags_t flags, const io_op_t *ops)
 
io_tio_ref (io_t *io)
 
io_tio_unref (io_t *io)
 
__nodiscard bool io_valid (const io_t *io)
 
size_t io_read (io_t *io, void *buf, size_t count)
 
size_t io_pread (io_t *io, void *buf, size_t count, off_t offset)
 
size_t io_write (io_t *io, const void *buf, size_t count)
 
off_t io_seek (io_t *io, off_t offset, io_seek_whence_t whence)
 
off_t io_tell (io_t *io)
 
bool io_mmap_perm_check (io_t *io, vm_flags flags, bool is_private)
 
bool io_mmap (io_t *io, vmap_t *vmap, off_t offset)
 
bool io_munmap (io_t *io, vmap_t *vmap, bool *unmapped)
 
void io_get_name (const io_t *io, char *buf, size_t size)
 

Variables

io_t *const io_null
 

Typedef Documentation

◆ io_t

typedef struct _io io_t

Definition at line 11 of file io.hpp.

Enumeration Type Documentation

◆ io_type_t

enum io_type_t
Enumerator
IO_NULL 
IO_FILE 
IO_DIR 
IO_IPC 
IO_PIPE 
IO_CONSOLE 

Definition at line 14 of file io.hpp.

◆ io_flags_t

enum io_flags_t
Enumerator
IO_NONE 
IO_READABLE 
IO_WRITABLE 
IO_EXECUTABLE 
IO_SEEKABLE 
IO_MMAPABLE 

Definition at line 24 of file io.hpp.

Function Documentation

◆ MOS_ENUM_OPERATORS()

MOS_ENUM_OPERATORS ( io_flags_t )

◆ io_init()

void io_init ( io_t * io,
io_type_t type,
io_flags_t flags,
const io_op_t * ops )

◆ io_ref()

◆ io_unref()

◆ io_valid()

__nodiscard bool io_valid ( const io_t * io)

◆ io_read()

size_t io_read ( io_t * io,
void * buf,
size_t count )

Definition at line 133 of file io.cpp.

Referenced by io_pread(), and io_read().

◆ io_pread()

size_t io_pread ( io_t * io,
void * buf,
size_t count,
off_t offset )

Definition at line 152 of file io.cpp.

Referenced by elf_read_file(), and io_pread().

+ Here is the call graph for this function:

◆ io_write()

size_t io_write ( io_t * io,
const void * buf,
size_t count )

Definition at line 181 of file io.cpp.

Referenced by io_write().

◆ io_seek()

off_t io_seek ( io_t * io,
off_t offset,
io_seek_whence_t whence )

Definition at line 200 of file io.cpp.

Referenced by io_pread(), io_seek(), and io_tell().

◆ io_tell()

off_t io_tell ( io_t * io)

Definition at line 219 of file io.cpp.

Referenced by io_pread(), and io_tell().

+ Here is the call graph for this function:

◆ io_mmap_perm_check()

bool io_mmap_perm_check ( io_t * io,
vm_flags flags,
bool is_private )

Definition at line 225 of file io.cpp.

Referenced by io_mmap(), and vm_protect().

◆ io_mmap()

bool io_mmap ( io_t * io,
vmap_t * vmap,
off_t offset )

Definition at line 255 of file io.cpp.

Referenced by mmap_file().

+ Here is the call graph for this function:

◆ io_munmap()

bool io_munmap ( io_t * io,
vmap_t * vmap,
bool * unmapped )

Definition at line 274 of file io.cpp.

Referenced by vmap_destroy().

+ Here is the call graph for this function:

◆ io_get_name()

void io_get_name ( const io_t * io,
char * buf,
size_t size )

Definition at line 308 of file io.cpp.

Referenced by process_sysfs_vmap_stat(), vsnprintf_do_pointer_kernel(), and x86_dump_stack_at().

+ Here is the call graph for this function:

Variable Documentation

◆ io_null

io_t* const io_null
extern

Definition at line 43 of file io.cpp.

Referenced by process_new().