129 if (virtAddr ==
NULL)
234 LOG_ERR(
"failed to create /dev/shmem directory");
242 LOG_ERR(
"failed to create /dev/shmem/new file");
280 "MIT",
"BOOT_ALWAYS");
#define assert(expression)
dentry_t * devfs_dir_new(dentry_t *parent, const char *name, const inode_ops_t *inodeOps, void *private)
Create a new directory inside a mounted devfs instance.
dentry_t * devfs_file_new(dentry_t *parent, const char *name, const inode_ops_t *inodeOps, const file_ops_t *fileOps, void *private)
Create a new file inside a mounted devfs instance.
#define LOG_ERR(format,...)
void pmm_free(void *address)
Frees a single physical page.
void * pmm_alloc(void)
Allocates a single physical page.
void * vmm_map_pages(space_t *space, void *virtAddr, void **pages, size_t pageAmount, pml_flags_t flags, space_callback_func_t func, void *private)
Maps an array of physical pages to virtual memory in a given address space.
#define MODULE_INFO(_name, _author, _description, _version, _licence, _deviceTypes)
Macro to define module information.
process_t * sched_process_unsafe(void)
Retrieves the process of the currently running thread without disabling interrupts.
static void lock_init(lock_t *lock)
Initializes a lock.
#define LOCK_SCOPE(lock)
Acquires a lock for the reminder of the current scope.
#define REF(ptr)
Increment reference count.
static void ref_init(ref_t *ref, void *callback)
Initialize a reference counter.
#define UNREF(ptr)
Decrement reference count.
#define EINVAL
Invalid argument.
#define errno
Error number variable.
#define PAGE_SIZE
The size of a memory page in bytes.
#define BYTES_TO_PAGES(amount)
Convert a size in bytes to pages.
#define NULL
Pointer error value.
#define ERR
Integer error value.
static uintptr_t address
Mapped virtual address of the HPET registers.
static dentry_t * shmemDir
static void shmem_deinit(void)
static void shmem_object_free(shmem_object_t *shmem)
static void * shmem_mmap(file_t *file, void *address, size_t length, size_t *offset, pml_flags_t flags)
static shmem_object_t * shmem_object_new(void)
static void shmem_close(file_t *file)
static uint64_t shmem_open(file_t *file)
static dentry_t * newFile
static void * shmem_object_allocate_pages(shmem_object_t *shmem, uint64_t pageAmount, space_t *space, void *address, pml_flags_t flags)
static file_ops_t fileOps
static void shmem_vmm_callback(void *private)
static uint64_t shmem_init(void)
static const path_flag_t flags[]
static uint64_t pageAmount
uint64_t _module_procedure(const module_event_t *event)
_PUBLIC void * malloc(size_t size)
_PUBLIC void free(void *ptr)
Directory entry structure.
File operations structure.
uint64_t(* open)(file_t *file)
A simple ticket lock implementation.
A entry in a page table without a specified address or callback ID.
Reference counting structure.
Represents a shared memory object.
Virtual address space structure.