Voxia OS v0.0.1
Hobby Project Operating System Targeting x86-64
Loading...
Searching...
No Matches
ioforge_usb.c File Reference
#include "ioforge/ioforge_usb.h"
#include "ioforge/ioforge.h"
#include "libk/serial.h"
#include "memory/kalloc.h"
#include "memory/memory_utils.h"
#include <type.h>

Go to the source code of this file.

Macros

#define MAX_USB_NODES   64
 

Functions

static bool ioforge_can_contain_usb_device (IoForgeType type)
 
void __attribute__ ((used, visibility("default"), section(".export")))
 This function handles memory allocation for a new dentry using the slab allocator.
 

Macro Definition Documentation

◆ MAX_USB_NODES

#define MAX_USB_NODES   64

Referenced by __attribute__().

Function Documentation

◆ __attribute__()

void __attribute__ ( (used, visibility("default"), section(".export")) )

This function handles memory allocation for a new dentry using the slab allocator.

It also links the dentry to its corresponding VNode (if provided).

Note
This function performs lazy initialization of the dentry slab cache if it does not exist yet.
Parameters
nameThe name of the file or directory.
vnodePointer to the associated VNode (inode data). Pass NULL if the VNode is not yet available.
Returns
dentry_ptr A pointer to the newly allocated and initialized dentry.

Definition at line 19 of file ioforge_usb.c.

References ioforge_usb_device::class_code, ioforge_device::first_child, ioforge_can_contain_usb_device(), IOFORGE_USB_DEVICE, kalloc(), KERNEL_API, kfree(), MAX_USB_NODES, ioforge_device::next_sibling, root, serial_printf(), stack, and ioforge_device::type.

◆ ioforge_can_contain_usb_device()

static bool ioforge_can_contain_usb_device ( IoForgeType type)
static

Definition at line 9 of file ioforge_usb.c.

References IOFORGE_ROOT, IOFORGE_USB_DEVICE, and type.

Referenced by __attribute__().