lib: move lib headers into lib directory

This commit is contained in:
Michael Shaw 2024-01-30 22:00:20 -05:00
commit a10509f1e5
20 changed files with 13 additions and 24 deletions

View file

@ -4,7 +4,6 @@
#include <dev/apic.h>
#include <stdint.h>
#include <stdio.h>
static uintptr_t ioapic_addr = 0xFEC00000;
static uintptr_t lapic_addr = 0;

View file

@ -6,8 +6,6 @@
#include <dev/apic.h>
#include <dev/console.h>
#include <stdio.h>
int serial_init()
{
outb(COM1 | 1, 0x00);

View file

@ -107,7 +107,7 @@ struct file *vfs_open(const char *pathname, int *err)
file->vnode = cur_vnode;
file->type = cur_vnode->flags & VFS_VTYPE_MASK;
file->size = vnode->size;
file->inode_num = vnode->ino_num;
file->ino_num = vnode->ino_num;
return file;

View file

@ -96,7 +96,7 @@ typedef struct _DIR {
struct file {
struct vnode *vnode;
ino_t inode_num; /* inode number */
ino_t ino_num; /* inode number */
uint32_t type; /* type of the file */
uint64_t size; /* size of the file */
};

View file

@ -7,11 +7,11 @@
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <math.h>
#include <assert.h>
#include <lib/stdio.h>
#include <lib/string.h>
#include <lib/errno.h>
#include <lib/math.h>
#include <lib/assert.h>
#include <kernel/bitwise.h>

View file

@ -5,9 +5,6 @@
#include <limine/limine.h>
#include <stdio.h>
#include <string.h>
struct limine_rsdp_request rsdp_req = { .id = LIMINE_RSDP_REQUEST, .revision = 0 };
static struct rsdp *rsdp = NULL;

View file

@ -7,8 +7,6 @@
#include <fs/vfs.h>
#include <string.h>
int kcmd_help(int argc, char **argv);
int kcmd_ls(int argc, char **argv);
int kcmd_clear(int argc, char **argv);

View file

@ -3,8 +3,6 @@
#include <kernel/common.h>
#include <kernel/slab.h>
#include <stdio.h>
void gdt_load();
static int gdt_index = 0;

View file

@ -5,7 +5,6 @@
#include <kernel/irq.h>
#include <dev/pic.h>
#include <dev/serial.h>
#include <stdio.h>
#define exception(_i) _exception_##_i
#define exception_decl(_j) void exception(_j)()

View file

@ -18,8 +18,6 @@
#include <fs/vfs.h>
#include <string.h>
#define LIMINE_INTERNAL_MODULE_REQUIRED (1 << 0)
#include <limine/limine.h>

View file

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <errno.h>
#include <kernel/common.h>
#include <lib/errno.h>
static const char *errno_str[] = {
[0] = "Success",

View file

@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <kernel/common.h>
#include <math.h>
#include <lib/math.h>
size_t npow2(size_t n)
{

3
lib/stack.c Normal file
View file

@ -0,0 +1,3 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <kernel/slab.h>

View file

@ -2,7 +2,7 @@
#include <kernel/slab.h>
#include <kernel/lock.h>
#include <string.h>
#include <lib/string.h>
void *memcpy(void *dest, const void *src, size_t num)
{

View file

@ -6,7 +6,6 @@
#include <kernel/gdt.h>
#include <fs/vfs.h>
#include <string.h>
static const char elf_magic[] = { 0x7F, 'E', 'L', 'F' };