PatchworkOS  19e446b
A non-POSIX operating system.
Loading...
Searching...
No Matches
fb.c File Reference
#include <kernel/drivers/abstract/fb.h>
#include <kernel/fs/devfs.h>
#include <kernel/fs/file.h>
#include <kernel/fs/vfs.h>
#include <kernel/log/log.h>
#include <kernel/sched/thread.h>
#include <assert.h>
#include <stdatomic.h>
#include <stdio.h>
#include <stdlib.h>
Include dependency graph for fb.c:

Go to the source code of this file.

Functions

static size_t fb_name_read (file_t *file, void *buffer, size_t count, size_t *offset)
 
static size_t fb_data_read (file_t *file, void *buffer, size_t count, size_t *offset)
 
static size_t fb_data_write (file_t *file, const void *buffer, size_t count, size_t *offset)
 
static void * fb_data_mmap (file_t *file, void *addr, size_t length, size_t *offset, pml_flags_t flags)
 
static size_t fb_info_read (file_t *file, void *buffer, size_t count, size_t *offset)
 
static void fb_dir_cleanup (vnode_t *vnode)
 
fb_tfb_new (const char *name, const fb_ops_t *ops, void *data)
 Allocate and initialize a new framebuffer.
 
void fb_free (fb_t *fb)
 Frees a framebuffer.
 

Variables

static atomic_uint64_t newId = ATOMIC_VAR_INIT(0)
 
static dentry_tdir = NULL
 
static file_ops_t nameOps
 
static file_ops_t dataOps
 
static file_ops_t infoOps
 
static vnode_ops_t dirVnodeOps
 

Function Documentation

◆ fb_name_read()

static size_t fb_name_read ( file_t file,
void *  buffer,
size_t  count,
size_t offset 
)
static

Definition at line 18 of file fb.c.

Here is the call graph for this function:

◆ fb_data_read()

static size_t fb_data_read ( file_t file,
void *  buffer,
size_t  count,
size_t offset 
)
static

Definition at line 31 of file fb.c.

◆ fb_data_write()

static size_t fb_data_write ( file_t file,
const void *  buffer,
size_t  count,
size_t offset 
)
static

Definition at line 45 of file fb.c.

◆ fb_data_mmap()

static void * fb_data_mmap ( file_t file,
void *  addr,
size_t  length,
size_t offset,
pml_flags_t  flags 
)
static

Definition at line 59 of file fb.c.

◆ fb_info_read()

static size_t fb_info_read ( file_t file,
void *  buffer,
size_t  count,
size_t offset 
)
static

Definition at line 79 of file fb.c.

Here is the call graph for this function:

◆ fb_dir_cleanup()

static void fb_dir_cleanup ( vnode_t vnode)
static

Definition at line 118 of file fb.c.

Here is the call graph for this function:

Variable Documentation

◆ newId

atomic_uint64_t newId = ATOMIC_VAR_INIT(0)
static

Definition at line 14 of file fb.c.

◆ dir

dentry_t* dir = NULL
static

Definition at line 16 of file fb.c.

◆ nameOps

file_ops_t nameOps
static
Initial value:
= {
.read = fb_name_read,
}
static size_t fb_name_read(file_t *file, void *buffer, size_t count, size_t *offset)
Definition fb.c:18

Definition at line 27 of file fb.c.

◆ dataOps

file_ops_t dataOps
static
Initial value:
= {
.read = fb_data_read,
.write = fb_data_write,
.mmap = fb_data_mmap,
}
static void * fb_data_mmap(file_t *file, void *addr, size_t length, size_t *offset, pml_flags_t flags)
Definition fb.c:59
static size_t fb_data_read(file_t *file, void *buffer, size_t count, size_t *offset)
Definition fb.c:31
static size_t fb_data_write(file_t *file, const void *buffer, size_t count, size_t *offset)
Definition fb.c:45

Definition at line 73 of file fb.c.

◆ infoOps

file_ops_t infoOps
static
Initial value:
= {
.read = fb_info_read,
}
static size_t fb_info_read(file_t *file, void *buffer, size_t count, size_t *offset)
Definition fb.c:79

Definition at line 114 of file fb.c.

◆ dirVnodeOps

vnode_ops_t dirVnodeOps
static
Initial value:
= {
.cleanup = fb_dir_cleanup,
}
static void fb_dir_cleanup(vnode_t *vnode)
Definition fb.c:118

Definition at line 130 of file fb.c.