From 631603cab372ac36c948416bff333007739416b5 Mon Sep 17 00:00:00 2001 From: Ali Mashtizadeh Date: Sun, 10 Sep 2023 16:12:25 -0400 Subject: [PATCH] Fix up documentation --- sys/kern/bufcache.c | 69 +++++++++++++++++++++++---------------------- sys/kern/copy.c | 65 +++++++++++++++++++++++------------------- sys/kern/cv.c | 6 ++-- sys/kern/disk.c | 4 +++ sys/kern/loader.c | 34 ++++++++++++---------- sys/kern/mutex.c | 8 +++--- sys/kern/nic.c | 4 +++ sys/kern/palloc.c | 26 ++++++++--------- sys/kern/process.c | 46 +++++++++++++++--------------- sys/kern/sched.c | 38 ++++++++++++------------- sys/kern/sga.c | 4 +++ sys/kern/spinlock.c | 6 ++-- sys/kern/thread.c | 15 +++++----- sys/kern/vfs.c | 64 +++++++++++++++++++++-------------------- 14 files changed, 210 insertions(+), 179 deletions(-) diff --git a/sys/kern/bufcache.c b/sys/kern/bufcache.c index e2c63a2..af1c14b 100644 --- a/sys/kern/bufcache.c +++ b/sys/kern/bufcache.c @@ -34,7 +34,7 @@ DEFINE_SLAB(BufCacheEntry, &cacheEntrySlab); /** * BufCache_Init -- * - * Initialize the system buffer cache. + * Initialize the system buffer cache. */ void BufCache_Init() @@ -83,14 +83,15 @@ BufCache_Init() /** * BufCacheLookup -- * - * Looks up a buffer cache entry that can be used by BufCache_Alloc or - * BufCache_Read to allocate the underlying buffer. + * Looks up a buffer cache entry that can be used by BufCache_Alloc or + * BufCache_Read to allocate the underlying buffer. * - * @param [in] disk Disk object - * @param [in] diskOffset Block offset within the disk - * @param [out] entry If successful, this contains the buffer cache entry. - * @retval 0 if successful - * @return ENOENT if not present. + * @param [in] disk Disk object + * @param [in] diskOffset Block offset within the disk + * @param [out] entry If successful, this contains the buffer cache entry. + * + * @retval 0 if successful + * @return ENOENT if not present. */ static int BufCacheLookup(Disk *disk, uint64_t diskOffset, BufCacheEntry **entry) @@ -118,14 +119,15 @@ BufCacheLookup(Disk *disk, uint64_t diskOffset, BufCacheEntry **entry) /** * BufCacheAlloc -- * - * Allocates a buffer cache entry that can be used by BufCache_Alloc or - * BufCache_Read to allocate the underlying buffer.. + * Allocates a buffer cache entry that can be used by BufCache_Alloc or + * BufCache_Read to allocate the underlying buffer.. * - * @param [in] disk Disk object - * @param [in] diskOffset Block offset within the disk - * @param [out] entry If successful, this contains the buffer cache entry. - * @retval 0 if successful. - * @return ENOMEM if there's no buffer cache entries free. + * @param [in] disk Disk object + * @param [in] diskOffset Block offset within the disk + * @param [out] entry If successful, this contains the buffer cache entry. + * + * @retval 0 if successful. + * @return ENOMEM if there's no buffer cache entries free. */ static int BufCacheAlloc(Disk *disk, uint64_t diskOffset, BufCacheEntry **entry) @@ -163,13 +165,14 @@ BufCacheAlloc(Disk *disk, uint64_t diskOffset, BufCacheEntry **entry) /** * BufCache_Alloc -- * - * Allocate a buffer cache entry to allow writing new data to disk. + * Allocate a buffer cache entry to allow writing new data to disk. * - * @param [in] disk Disk object - * @param [in] diskOffset Block offset within the disk - * @param [out] entry If successful, this contains the buffer cache entry. - * @retval 0 if successful - * @return Otherwise returns an error code. + * @param [in] disk Disk object + * @param [in] diskOffset Block offset within the disk + * @param [out] entry If successful, this contains the buffer cache entry. + * + * @retval 0 if successful + * @return Otherwise returns an error code. */ int BufCache_Alloc(Disk *disk, uint64_t diskOffset, BufCacheEntry **entry) @@ -193,10 +196,10 @@ BufCache_Alloc(Disk *disk, uint64_t diskOffset, BufCacheEntry **entry) /** * BufCache_Release -- * - * Release a buffer cache entry. If no other references are held the - * buffer cache entry is placed on the LRU list. + * Release a buffer cache entry. If no other references are held the + * buffer cache entry is placed on the LRU list. * - * @param [in] entry Buffer cache entry. + * @param [in] entry Buffer cache entry. */ void BufCache_Release(BufCacheEntry *entry) @@ -214,13 +217,13 @@ BufCache_Release(BufCacheEntry *entry) /** * BufCache_Read -- * - * Read block from disk into the buffer cache. + * Read block from disk into the buffer cache. * - * @param [in] disk Disk object - * @param [in] diskOffset Block offset within the disk - * @param [out] entry If successful, this contains the buffer cache entry. - * @retval 0 if successful - * @return Otherwise returns an error code. + * @param [in] disk Disk object + * @param [in] diskOffset Block offset within the disk + * @param [out] entry If successful, this contains the buffer cache entry. + * @retval 0 if successful + * @return Otherwise returns an error code. */ int BufCache_Read(Disk *disk, uint64_t diskOffset, BufCacheEntry **entry) @@ -261,10 +264,10 @@ BufCache_Read(Disk *disk, uint64_t diskOffset, BufCacheEntry **entry) /** * BufCache_Write -- * - * Write a buffer cache entry to disk. + * Write a buffer cache entry to disk. * - * @retval 0 if successful - * @return Otherwise an error code is returned. + * @retval 0 if successful + * @return Otherwise an error code is returned. */ int BufCache_Write(BufCacheEntry *entry) diff --git a/sys/kern/copy.c b/sys/kern/copy.c index 85e6891..73db893 100644 --- a/sys/kern/copy.c +++ b/sys/kern/copy.c @@ -17,16 +17,18 @@ extern int copystr_unsafe(void *to_addr, void *from_addr, uintptr_t len); /** * Copy_In -- - * Safely copy memory from userspace. Prevents userspace pointers from - * reading kernel memory. * - * @param [in] fromuser User address to copy from. - * @param [in] tokernel Kernel address to copy to. - * @param [in] len Length of the data to copy. - * @retval EFAULT if the address is invalid or causes a fault. + * Safely copy memory from userspace. Prevents userspace pointers from + * reading kernel memory. * * Side effects: - * Kernel page fault may have occurred. + * Kernel page fault may have occurred. + * + * @param [in] fromuser User address to copy from. + * @param [in] tokernel Kernel address to copy to. + * @param [in] len Length of the data to copy. + * + * @retval EFAULT if the address is invalid or causes a fault. */ int Copy_In(uintptr_t fromuser, void *tokernel, uintptr_t len) @@ -51,16 +53,18 @@ Copy_In(uintptr_t fromuser, void *tokernel, uintptr_t len) /** * Copy_Out -- - * Safely copy memory to userspace. Prevents userspace pointers from - * writing kernel memory. * - * @param [in] fromkernel Kernel address to copy from. - * @param [in] touser User address to copy to. - * @param [in] len Length of the data to copy. - * @retval EFAULT if the address is invalid or causes a fault. + * Safely copy memory to userspace. Prevents userspace pointers from + * writing kernel memory. * * Side effects: - * Kernel page fault may have occurred. + * Kernel page fault may have occurred. + * + * @param [in] fromkernel Kernel address to copy from. + * @param [in] touser User address to copy to. + * @param [in] len Length of the data to copy. + * + * @retval EFAULT if the address is invalid or causes a fault. */ int Copy_Out(void *fromkernel, uintptr_t touser, uintptr_t len) @@ -86,16 +90,17 @@ Copy_Out(void *fromkernel, uintptr_t touser, uintptr_t len) /** * Copy_StrIn -- * - * Safely copy a string from userspace. Prevents userspace pointers from - * reading kernel memory. - * - * @param [in] fromuser User address to copy from. - * @param [in] tokernel Kernel address to copy to. - * @param [in] len Maximum string length. - * @retval EFAULT if the address is invalid or causes a fault. + * Safely copy a string from userspace. Prevents userspace pointers from + * reading kernel memory. * * Side effects: - * Kernel page fault may have occurred. + * Kernel page fault may have occurred. + * + * @param [in] fromuser User address to copy from. + * @param [in] tokernel Kernel address to copy to. + * @param [in] len Maximum string length. + * + * @retval EFAULT if the address is invalid or causes a fault. */ int Copy_StrIn(uintptr_t fromuser, void *tokernel, uintptr_t len) @@ -120,16 +125,18 @@ Copy_StrIn(uintptr_t fromuser, void *tokernel, uintptr_t len) /** * Copy_StrOut -- - * Safely copy a string to userspace. Prevents userspace pointers from - * writing kernel memory. * - * @param [in] fromkernel Kernel address to copy from. - * @param [in] touser User address to copy to. - * @param [in] len Maximum string length. - * @retval EFAULT if the address is invalid or causes a fault. + * Safely copy a string to userspace. Prevents userspace pointers from + * writing kernel memory. * * Side effects: - * Kernel page fault may have occurred. + * Kernel page fault may have occurred. + * + * @param [in] fromkernel Kernel address to copy from. + * @param [in] touser User address to copy to. + * @param [in] len Maximum string length. + * + * @retval EFAULT if the address is invalid or causes a fault. */ int Copy_StrOut(void *fromkernel, uintptr_t touser, uintptr_t len) diff --git a/sys/kern/cv.c b/sys/kern/cv.c index bef6217..4a98753 100644 --- a/sys/kern/cv.c +++ b/sys/kern/cv.c @@ -40,7 +40,7 @@ CV_Destroy(CV *cv) /** * CV_Wait -- * - * Wait to be woken up on a condition. + * Wait to be woken up on a condition. */ void CV_Wait(CV *cv, Mutex *mtx) @@ -59,7 +59,7 @@ CV_Wait(CV *cv, Mutex *mtx) /** * CV_Signal -- * - * Wake a single thread waiting on the condition. + * Wake a single thread waiting on the condition. */ void CV_Signal(CV *cv) @@ -72,7 +72,7 @@ CV_Signal(CV *cv) /** * CV_WakeAll -- * - * Wake all threads waiting on the condition. + * Wake all threads waiting on the condition. */ void CV_WakeAll(CV *cv) diff --git a/sys/kern/disk.c b/sys/kern/disk.c index ff2a62c..e594c64 100644 --- a/sys/kern/disk.c +++ b/sys/kern/disk.c @@ -1,3 +1,7 @@ +/* + * Copyright (c) 2013-2023 Ali Mashtizadeh + * All rights reserved. + */ #include #include diff --git a/sys/kern/loader.c b/sys/kern/loader.c index 11e8919..d0b9777 100644 --- a/sys/kern/loader.c +++ b/sys/kern/loader.c @@ -1,3 +1,7 @@ +/* + * Copyright (c) 2006-2023 Ali Mashtizadeh + * All rights reserved. + */ #include #include @@ -21,10 +25,10 @@ extern Handle *Console_OpenHandle(); -/* +/** * Loader_CheckHeader -- * - * Check that the program has a valid ELF header. + * Check that the program has a valid ELF header. */ bool Loader_CheckHeader(const Elf64_Ehdr *ehdr) @@ -46,12 +50,12 @@ Loader_CheckHeader(const Elf64_Ehdr *ehdr) return true; } -/* +/** * LoaderLoadSegment -- * - * Loads a single segment into the target address space. This function - * loads a single page at a time because it has to lookup the address - * mappings through the page tables. + * Loads a single segment into the target address space. This function loads a + * single page at a time because it has to lookup the address mappings through + * the page tables. */ static void LoaderLoadSegment(AS *as, VNode *vn, uintptr_t vaddr, @@ -84,11 +88,11 @@ LoaderLoadSegment(AS *as, VNode *vn, uintptr_t vaddr, } } -/* +/** * LoaderZeroSegment -- * - * Zeroes a segment of memory in the target address space. This is done - * one page a time while translating the virtual address to physical. + * Zeroes a segment of memory in the target address space. This is done one + * page a time while translating the virtual address to physical. */ static void LoaderZeroSegment(AS *as, uintptr_t vaddr, uintptr_t len) @@ -118,10 +122,10 @@ LoaderZeroSegment(AS *as, uintptr_t vaddr, uintptr_t len) } } -/* +/** * Loader_Load -- * - * Load the ELF binary into the process belonging to the thread. + * Load the ELF binary into the process belonging to the thread. */ bool Loader_Load(Thread *thr, VNode *vn, void *buf, uint64_t len) @@ -184,12 +188,12 @@ Loader_Load(Thread *thr, VNode *vn, void *buf, uint64_t len) return true; } -/* +/** * Loader_LoadInit -- * - * The init process is created from the execution kernel thread that - * initializes the system. This function initializes the thread and - * process state then loads the init binary. + * The init process is created from the execution kernel thread that + * initializes the system. This function initializes the thread and process + * state then loads the init binary. */ void Loader_LoadInit() diff --git a/sys/kern/mutex.c b/sys/kern/mutex.c index f487087..0ab7b93 100644 --- a/sys/kern/mutex.c +++ b/sys/kern/mutex.c @@ -46,7 +46,7 @@ Mutex_Destroy(Mutex *mtx) /** * Mutex_Lock -- * - * Acquires the mutex. + * Acquires the mutex. */ void Mutex_Lock(Mutex *mtx) @@ -74,8 +74,8 @@ Mutex_Lock(Mutex *mtx) /** * Mutex_TryLock -- * - * Attempts to acquire the user mutex. Returns EBUSY if the lock is - * already taken, otherwise 0 on success. + * Attempts to acquire the user mutex. Returns EBUSY if the lock is already + * taken, otherwise 0 on success. */ int Mutex_TryLock(Mutex *mtx) @@ -95,7 +95,7 @@ Mutex_TryLock(Mutex *mtx) /** * Mutex_Unlock -- * - * Releases the user mutex. + * Releases the user mutex. */ void Mutex_Unlock(Mutex *mtx) diff --git a/sys/kern/nic.c b/sys/kern/nic.c index a4b6cc9..721ebe5 100644 --- a/sys/kern/nic.c +++ b/sys/kern/nic.c @@ -1,3 +1,7 @@ +/* + * Copyright (c) 2013-2023 Ali Mashtizadeh + * All rights reserved. + */ #include #include diff --git a/sys/kern/palloc.c b/sys/kern/palloc.c index 37152d3..375542d 100644 --- a/sys/kern/palloc.c +++ b/sys/kern/palloc.c @@ -63,9 +63,9 @@ PAlloc_Init() /** * PAlloc_LateInit -- * - * The late init call is made after the page tables are initialized using - * a small boot memory region (2nd 16MBs). This is where initialize the - * XMem region that represents the PageInfo array, and map memory into it. + * The late init call is made after the page tables are initialized using a + * small boot memory region (2nd 16MBs). This is where initialize the XMem + * region that represents the PageInfo array, and map memory into it. */ void PAlloc_LateInit() @@ -86,7 +86,7 @@ PAlloc_LateInit() /** * PAlloc_AddRegion -- * - * Add a physical memory region to the page allocator. + * Add a physical memory region to the page allocator. */ void PAlloc_AddRegion(uintptr_t start, uintptr_t len) @@ -166,7 +166,7 @@ PAlloc_AddRegion(uintptr_t start, uintptr_t len) /** * PAllocGetInfo -- * - * Lookup the PageInfo structure for a given physical address. + * Lookup the PageInfo structure for a given physical address. */ static inline PageInfo * PAllocGetInfo(void *pg) @@ -178,11 +178,11 @@ PAllocGetInfo(void *pg) /** * PAlloc_AllocPage -- * - * Allocate a physical page and return the page's address in the Kernel's - * ident mapped memory region. + * Allocate a physical page and return the page's address in the Kernel's ident + * mapped memory region. * - * @retval NULL if no memory is available. - * @return Newly allocated physical page. + * @retval NULL if no memory is available. + * @return Newly allocated physical page. */ void * PAlloc_AllocPage() @@ -215,7 +215,7 @@ PAlloc_AllocPage() /** * PAllocFreePage -- * - * Free a page. + * Free a page. */ static void PAllocFreePage(void *region) @@ -242,7 +242,7 @@ PAllocFreePage(void *region) /** * PAlloc_Retain -- * - * Increment the reference count for a physical page. + * Increment the reference count for a physical page. */ void PAlloc_Retain(void *pg) @@ -258,8 +258,8 @@ PAlloc_Retain(void *pg) /** * PAlloc_Release -- * - * Deccrement the reference count for a physical page. If the reference - * count is zero the page will be freed. + * Deccrement the reference count for a physical page. If the reference count + * is zero the page will be freed. */ void PAlloc_Release(void *pg) diff --git a/sys/kern/process.c b/sys/kern/process.c index 70e9fe6..30ac57b 100644 --- a/sys/kern/process.c +++ b/sys/kern/process.c @@ -39,11 +39,12 @@ Slab processSlab; /** * Process_Create -- * - * Create a process. + * Create a process. * - * @param [in] parent Parent process. - * @param [in] title Process title. - * @return The newly created process. + * @param [in] parent Parent process. + * @param [in] title Process title. + * + * @return The newly created process. */ Process * Process_Create(Process *parent, const char *title) @@ -103,10 +104,10 @@ Process_Create(Process *parent, const char *title) /** * Process_Destroy -- * - * Destroy a process. This should not be called direct, but rather by - * Process_Release. + * Destroy a process. This should not be called direct, but rather by + * Process_Release. * - * @param [in] proc Process to destroy. + * @param [in] proc Process to destroy. */ static void Process_Destroy(Process *proc) @@ -133,11 +134,12 @@ Process_Destroy(Process *proc) /** * Process_Lookup -- * - * Lookup a process by PID and increment its reference count. - * @param [in] pid Process ID to search for. + * Lookup a process by PID and increment its reference count. * - * @retval NULL No such process. - * @return Process that corresponds to the pid. + * @param [in] pid Process ID to search for. + * + * @retval NULL No such process. + * @return Process that corresponds to the pid. */ Process * Process_Lookup(uint64_t pid) @@ -161,9 +163,9 @@ Process_Lookup(uint64_t pid) /** * Process_Retain -- * - * Increment the reference count for a given process. + * Increment the reference count for a given process. * - * @param proc Process to retain a reference to. + * @param proc Process to retain a reference to. */ void Process_Retain(Process *proc) @@ -175,9 +177,9 @@ Process_Retain(Process *proc) /** * Process_Release -- * - * Decrement the reference count for a given process. + * Decrement the reference count for a given process. * - * @param proc Process to release a reference of. + * @param proc Process to release a reference of. */ void Process_Release(Process *proc) @@ -191,14 +193,14 @@ Process_Release(Process *proc) /** * Process_Wait -- * - * Wait for a process to exit and then cleanup it's references. If the - * pid == 0, we wait for any process, otherwise we wait for a specific - * process. + * Wait for a process to exit and then cleanup it's references. If the pid == + * 0, we wait for any process, otherwise we wait for a specific process. * - * @param [in] proc Parent process. - * @param [in] pid Optionally specify the pid of the process to wait on. - * @retval ENOENT Process ID doesn't exist. - * @return Exit status of the process that exited or crashed. + * @param [in] proc Parent process. + * @param [in] pid Optionally specify the pid of the process to wait on. + * + * @retval ENOENT Process ID doesn't exist. + * @return Exit status of the process that exited or crashed. */ uint64_t Process_Wait(Process *proc, uint64_t pid) diff --git a/sys/kern/sched.c b/sys/kern/sched.c index 8499e60..269fd47 100644 --- a/sys/kern/sched.c +++ b/sys/kern/sched.c @@ -47,10 +47,10 @@ Thread *curProc[MAX_CPUS]; /** * Sched_Current() -- * - * Get the currently executing thread. This function retains a reference - * count and you must release the reference by calling Thread_Release. + * Get the currently executing thread. This function retains a reference count + * and you must release the reference by calling Thread_Release. * - * @return Returns the current thread. + * @return Returns the current thread. */ Thread * Sched_Current() @@ -68,10 +68,10 @@ Sched_Current() /** * Sched_SetRunnable -- * - * Set the thread to the runnable state and move it from the wait queue if - * necessary to the runnable queue. + * Set the thread to the runnable state and move it from the wait queue if + * necessary to the runnable queue. * - * @param [in] thr Thread to be set as runnable. + * @param [in] thr Thread to be set as runnable. */ void Sched_SetRunnable(Thread *thr) @@ -95,10 +95,10 @@ Sched_SetRunnable(Thread *thr) /** * Sched_SetWaiting -- * - * Set the thread to the waiting state and move it to the wait queue. The - * thread should be currently running. + * Set the thread to the waiting state and move it to the wait queue. The + * thread should be currently running. * - * @param [in] thr Thread to be set as waiting. + * @param [in] thr Thread to be set as waiting. */ void Sched_SetWaiting(Thread *thr) @@ -117,11 +117,10 @@ Sched_SetWaiting(Thread *thr) /** * Sched_SetZombie -- * - * Set the thread to the zombie state and move it to the parent - * processes's zombie process queue. The thread should be currently - * running. + * Set the thread to the zombie state and move it to the parent processes's + * zombie process queue. The thread should be currently running. * - * @param [in] thr Thread to be set as zombie. + * @param [in] thr Thread to be set as zombie. */ void Sched_SetZombie(Thread *thr) @@ -165,13 +164,12 @@ Sched_SetZombie(Thread *thr) /** * Sched_Switch -- * - * Switch between threads. During the creation of kernel threads (and by - * proxy user threads) we may not return through this code path and thus - * the kernel thread initialization function must release the scheduler - * lock. + * Switch between threads. During the creation of kernel threads (and by proxy + * user threads) we may not return through this code path and thus the kernel + * thread initialization function must release the scheduler lock. * - * @param [in] oldthr Current thread we are switching from. - * @param [in] newthr Thread to switch to. + * @param [in] oldthr Current thread we are switching from. + * @param [in] newthr Thread to switch to. */ static void Sched_Switch(Thread *oldthr, Thread *newthr) @@ -185,7 +183,7 @@ Sched_Switch(Thread *oldthr, Thread *newthr) /** * Sched_Scheduler -- * - * Run our round robin scheduler to find the process and switch to it. + * Run our round robin scheduler to find the process and switch to it. */ void Sched_Scheduler() diff --git a/sys/kern/sga.c b/sys/kern/sga.c index 72b1070..24a06a4 100644 --- a/sys/kern/sga.c +++ b/sys/kern/sga.c @@ -1,3 +1,7 @@ +/* + * Copyright (c) 2013-2023 Ali Mashtizadeh + * All rights reserved. + */ #include diff --git a/sys/kern/spinlock.c b/sys/kern/spinlock.c index a3a58dc..061ce50 100644 --- a/sys/kern/spinlock.c +++ b/sys/kern/spinlock.c @@ -68,8 +68,8 @@ Spinlock_Destroy(Spinlock *lock) /** * Spinlock_Lock -- * - * Spin until we acquire the spinlock. This will also disable interrupts - * to prevent deadlocking with interrupt handlers. + * Spin until we acquire the spinlock. This will also disable interrupts to + * prevent deadlocking with interrupt handlers. */ void Spinlock_Lock(Spinlock *lock) __NO_LOCK_ANALYSIS @@ -103,7 +103,7 @@ Spinlock_Lock(Spinlock *lock) __NO_LOCK_ANALYSIS /** * Spinlock_Unlock -- * - * Release the spinlock. This will re-enable interrupts. + * Release the spinlock. This will re-enable interrupts. */ void Spinlock_Unlock(Spinlock *lock) __NO_LOCK_ANALYSIS diff --git a/sys/kern/thread.c b/sys/kern/thread.c index 9a55b15..2d54bcc 100644 --- a/sys/kern/thread.c +++ b/sys/kern/thread.c @@ -218,11 +218,12 @@ Thread_Destroy(Thread *thr) /** * Thread_Lookup -- * - * Lookup a thread by TID and increment its reference count. + * Lookup a thread by TID and increment its reference count. * - * @param [in] proc Process within which to find a specific thread. - * @param [in] tid Thread ID of the thread to find. - * @retval NULL if the thread isn't found. + * @param [in] proc Process within which to find a specific thread. + * @param [in] tid Thread ID of the thread to find. + * + * @retval NULL if the thread isn't found. */ Thread * Thread_Lookup(Process *proc, uint64_t tid) @@ -246,7 +247,7 @@ Thread_Lookup(Process *proc, uint64_t tid) /** * Thread_Retain -- * - * Increment the reference count for a given thread. + * Increment the reference count for a given thread. */ void Thread_Retain(Thread *thr) @@ -258,7 +259,7 @@ Thread_Retain(Thread *thr) /** * Thread_Release -- * - * Decrement the reference count for a given thread. + * Decrement the reference count for a given thread. */ void Thread_Release(Thread *thr) @@ -272,7 +273,7 @@ Thread_Release(Thread *thr) /** * Thread_Wait -- * - * Wait for any thread (tid == TID_ANY) or a specific thread. + * Wait for any thread (tid == TID_ANY) or a specific thread. */ uint64_t Thread_Wait(Thread *thr, uint64_t tid) diff --git a/sys/kern/vfs.c b/sys/kern/vfs.c index 38c136f..5699f73 100644 --- a/sys/kern/vfs.c +++ b/sys/kern/vfs.c @@ -30,7 +30,7 @@ DEFINE_SLAB(VNode, &vnodeSlab); /** * VFS_MountRoot -- * - * Mount the root file system from a specific disk. + * Mount the root file system from a specific disk. */ int VFS_MountRoot(Disk *rootDisk) @@ -56,9 +56,8 @@ VFS_MountRoot(Disk *rootDisk) /** * VFS_Lookup -- * - * Lookup a VNode by a path. This function recursively searches the - * directory heirarchy until the given path is found otherwise returns - * NULL if not found. + * Lookup a VNode by a path. This function recursively searches the directory + * heirarchy until the given path is found otherwise returns NULL if not found. */ VNode * VFS_Lookup(const char *path) @@ -118,8 +117,8 @@ VFS_Lookup(const char *path) /** * VFS_Stat -- * - * Return the struct stat that contains the file and directory information - * for a given VNode. + * Return the struct stat that contains the file and directory information for + * a given VNode. */ int VFS_Stat(const char *path, struct stat *sb) @@ -138,10 +137,11 @@ VFS_Stat(const char *path, struct stat *sb) /** * VFS_Open -- * - * Open a vnode for reading and writing. + * Open a vnode for reading and writing. * - * @param [in] fn VNode to open. - * @return Return status + * @param [in] fn VNode to open. + * + * @return Return status */ int VFS_Open(VNode *fn) @@ -152,10 +152,11 @@ VFS_Open(VNode *fn) /** * VFS_Close -- * - * Close a vnode. + * Close a vnode. * - * @param [in] fn VNode to close. - * @return Return status + * @param [in] fn VNode to close. + * + * @return Return status */ int VFS_Close(VNode *fn) @@ -166,13 +167,14 @@ VFS_Close(VNode *fn) /** * VFS_Read -- * - * Read from a vnode. + * Read from a vnode. * - * @param [in] fn VNode to read from. - * @param [in] buf Buffer to write the data to. - * @param [in] off File offset in bytes. - * @param [in] len Length to read in bytes. - * @return Return status + * @param [in] fn VNode to read from. + * @param [in] buf Buffer to write the data to. + * @param [in] off File offset in bytes. + * @param [in] len Length to read in bytes. + * + * @return Return status */ int VFS_Read(VNode *fn, void *buf, uint64_t off, uint64_t len) @@ -183,13 +185,14 @@ VFS_Read(VNode *fn, void *buf, uint64_t off, uint64_t len) /** * VFS_Write -- * - * Write from a vnode. + * Write from a vnode. * - * @param [in] fn VNode to write to. - * @param [in] buf Buffer to read the data from. - * @param [in] off File offset in bytes. - * @param [in] len Length to read in bytes. - * @return Return status + * @param [in] fn VNode to write to. + * @param [in] buf Buffer to read the data from. + * @param [in] off File offset in bytes. + * @param [in] len Length to read in bytes. + * + * @return Return status */ int VFS_Write(VNode *fn, void *buf, uint64_t off, uint64_t len) @@ -200,13 +203,14 @@ VFS_Write(VNode *fn, void *buf, uint64_t off, uint64_t len) /** * VFS_ReadDir -- * - * Read a directory entry from a vnode. + * Read a directory entry from a vnode. * - * @param [in] fn VNode to read from. - * @param [in] buf Buffer to write the data to. - * @param [in] off Directory offset in bytes. - * @param [in] len Length to read in bytes. - * @return Return status + * @param [in] fn VNode to read from. + * @param [in] buf Buffer to write the data to. + * @param [in] off Directory offset in bytes. + * @param [in] len Length to read in bytes. + * + * @return Return status */ int VFS_ReadDir(VNode *fn, void *buf, uint64_t len, uint64_t *off)