58    if (*offset >= nameLen)
 
 
#define MAX_NAME
Maximum length of names.
mouse_t * mouse_new(const char *name)
Allocate and initialize a mouse structure.
void mouse_free(mouse_t *mouse)
Free and deinitialize a mouse structure.
void mouse_push(mouse_t *mouse, mouse_buttons_t buttons, int64_t deltaX, int64_t deltaY)
Push a new mouse event to the mouse event queue.
#define MOUSE_MAX_EVENT
Maximum number of queued mouse events.
#define BUFFER_READ(buffer, count, offset, src, size)
Helper macros for implementing file operations dealing with simple buffers.
uint64_t wait_unblock(wait_queue_t *waitQueue, uint64_t amount, errno_t err)
Unblock threads waiting on a wait queue.
void wait_queue_init(wait_queue_t *waitQueue)
Initialize wait queue.
#define WAIT_ALL
Wait for all.
#define WAIT_BLOCK_LOCK(waitQueue, lock, condition)
Block with a spinlock.
void wait_queue_deinit(wait_queue_t *waitQueue)
Deinitialize wait queue.
static void lock_init(lock_t *lock)
Initializes a lock.
#define LOCK_SCOPE(lock)
Acquires a lock for the reminder of the current scope.
clock_t timer_uptime(void)
Time since boot.
#define DEREF(ptr)
Decrement reference count.
#define EINVAL
Invalid argument.
#define errno
Error number variable.
poll_events_t
Poll events type.
@ POLLIN
File descriptor is ready to read.
#define ROUND_DOWN(number, multiple)
mouse_buttons_t
Mouse buttons enum.
#define NULL
Pointer error value.
#define ERR
Integer error value.
EFI_PHYSICAL_ADDRESS buffer
static atomic_uint64_t newId
static uint64_t mouse_events_read(file_t *file, void *buffer, uint64_t count, uint64_t *offset)
static void mouse_dir_cleanup(inode_t *inode)
static file_ops_t nameOps
static wait_queue_t * mouse_events_poll(file_t *file, poll_events_t *revents)
static inode_ops_t dirInodeOps
static file_ops_t eventsOps
static dentry_t * mouseDir
static uint64_t mouse_name_read(file_t *file, void *buffer, uint64_t count, uint64_t *offset)
#define ATOMIC_VAR_INIT(value)
#define atomic_fetch_add(object, operand)
_PUBLIC int snprintf(char *_RESTRICT s, size_t n, const char *_RESTRICT format,...)
_PUBLIC void * calloc(size_t nmemb, size_t size)
_PUBLIC void free(void *ptr)
_PUBLIC char * strncpy(char *_RESTRICT s1, const char *_RESTRICT s2, size_t n)
size_t strnlen_s(const char *s, size_t maxsize)
Directory entry structure.
File operations structure.
uint64_t(* read)(file_t *file, void *buffer, uint64_t count, uint64_t *offset)
void(* cleanup)(inode_t *inode)
clock_t time
Clock ticks since boot when the event happened.
mouse_event_t events[MOUSE_MAX_EVENT]
dentry_t * sysfs_dir_new(dentry_t *parent, const char *name, const inode_ops_t *inodeOps, void *private)
Create a new directory inside a mounted SysFS instance.
dentry_t * sysfs_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 SysFS instance.