lib: move lib headers into lib directory
This commit is contained in:
parent
2f20777a47
commit
a10509f1e5
20 changed files with 13 additions and 24 deletions
|
|
@ -4,7 +4,6 @@
|
||||||
#include <dev/apic.h>
|
#include <dev/apic.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
static uintptr_t ioapic_addr = 0xFEC00000;
|
static uintptr_t ioapic_addr = 0xFEC00000;
|
||||||
static uintptr_t lapic_addr = 0;
|
static uintptr_t lapic_addr = 0;
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,6 @@
|
||||||
#include <dev/apic.h>
|
#include <dev/apic.h>
|
||||||
#include <dev/console.h>
|
#include <dev/console.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
int serial_init()
|
int serial_init()
|
||||||
{
|
{
|
||||||
outb(COM1 | 1, 0x00);
|
outb(COM1 | 1, 0x00);
|
||||||
|
|
|
||||||
2
fs/vfs.c
2
fs/vfs.c
|
|
@ -107,7 +107,7 @@ struct file *vfs_open(const char *pathname, int *err)
|
||||||
file->vnode = cur_vnode;
|
file->vnode = cur_vnode;
|
||||||
file->type = cur_vnode->flags & VFS_VTYPE_MASK;
|
file->type = cur_vnode->flags & VFS_VTYPE_MASK;
|
||||||
file->size = vnode->size;
|
file->size = vnode->size;
|
||||||
file->inode_num = vnode->ino_num;
|
file->ino_num = vnode->ino_num;
|
||||||
|
|
||||||
return file;
|
return file;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@ typedef struct _DIR {
|
||||||
struct file {
|
struct file {
|
||||||
struct vnode *vnode;
|
struct vnode *vnode;
|
||||||
|
|
||||||
ino_t inode_num; /* inode number */
|
ino_t ino_num; /* inode number */
|
||||||
uint32_t type; /* type of the file */
|
uint32_t type; /* type of the file */
|
||||||
uint64_t size; /* size of the file */
|
uint64_t size; /* size of the file */
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,11 @@
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdio.h>
|
#include <lib/stdio.h>
|
||||||
#include <string.h>
|
#include <lib/string.h>
|
||||||
#include <errno.h>
|
#include <lib/errno.h>
|
||||||
#include <math.h>
|
#include <lib/math.h>
|
||||||
#include <assert.h>
|
#include <lib/assert.h>
|
||||||
|
|
||||||
#include <kernel/bitwise.h>
|
#include <kernel/bitwise.h>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,6 @@
|
||||||
|
|
||||||
#include <limine/limine.h>
|
#include <limine/limine.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
struct limine_rsdp_request rsdp_req = { .id = LIMINE_RSDP_REQUEST, .revision = 0 };
|
struct limine_rsdp_request rsdp_req = { .id = LIMINE_RSDP_REQUEST, .revision = 0 };
|
||||||
|
|
||||||
static struct rsdp *rsdp = NULL;
|
static struct rsdp *rsdp = NULL;
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,6 @@
|
||||||
|
|
||||||
#include <fs/vfs.h>
|
#include <fs/vfs.h>
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
int kcmd_help(int argc, char **argv);
|
int kcmd_help(int argc, char **argv);
|
||||||
int kcmd_ls(int argc, char **argv);
|
int kcmd_ls(int argc, char **argv);
|
||||||
int kcmd_clear(int argc, char **argv);
|
int kcmd_clear(int argc, char **argv);
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,6 @@
|
||||||
#include <kernel/common.h>
|
#include <kernel/common.h>
|
||||||
#include <kernel/slab.h>
|
#include <kernel/slab.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
void gdt_load();
|
void gdt_load();
|
||||||
|
|
||||||
static int gdt_index = 0;
|
static int gdt_index = 0;
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@
|
||||||
#include <kernel/irq.h>
|
#include <kernel/irq.h>
|
||||||
#include <dev/pic.h>
|
#include <dev/pic.h>
|
||||||
#include <dev/serial.h>
|
#include <dev/serial.h>
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
#define exception(_i) _exception_##_i
|
#define exception(_i) _exception_##_i
|
||||||
#define exception_decl(_j) void exception(_j)()
|
#define exception_decl(_j) void exception(_j)()
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,6 @@
|
||||||
|
|
||||||
#include <fs/vfs.h>
|
#include <fs/vfs.h>
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#define LIMINE_INTERNAL_MODULE_REQUIRED (1 << 0)
|
#define LIMINE_INTERNAL_MODULE_REQUIRED (1 << 0)
|
||||||
#include <limine/limine.h>
|
#include <limine/limine.h>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
#include <errno.h>
|
|
||||||
#include <kernel/common.h>
|
#include <kernel/common.h>
|
||||||
|
#include <lib/errno.h>
|
||||||
|
|
||||||
static const char *errno_str[] = {
|
static const char *errno_str[] = {
|
||||||
[0] = "Success",
|
[0] = "Success",
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
#include <kernel/common.h>
|
#include <kernel/common.h>
|
||||||
#include <math.h>
|
#include <lib/math.h>
|
||||||
|
|
||||||
size_t npow2(size_t n)
|
size_t npow2(size_t n)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
3
lib/stack.c
Normal file
3
lib/stack.c
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
|
#include <kernel/slab.h>
|
||||||
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
#include <kernel/slab.h>
|
#include <kernel/slab.h>
|
||||||
#include <kernel/lock.h>
|
#include <kernel/lock.h>
|
||||||
|
|
||||||
#include <string.h>
|
#include <lib/string.h>
|
||||||
|
|
||||||
void *memcpy(void *dest, const void *src, size_t num)
|
void *memcpy(void *dest, const void *src, size_t num)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@
|
||||||
#include <kernel/gdt.h>
|
#include <kernel/gdt.h>
|
||||||
|
|
||||||
#include <fs/vfs.h>
|
#include <fs/vfs.h>
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
static const char elf_magic[] = { 0x7F, 'E', 'L', 'F' };
|
static const char elf_magic[] = { 0x7F, 'E', 'L', 'F' };
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue