use freestanding headers
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
#include <zinnia/percpu.h>
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
#include <zinnia/string.h>
|
||||
#include <x86_64/asm.h>
|
||||
#include <x86_64/defs.h>
|
||||
#include <x86_64/gdt.h>
|
||||
|
||||
@@ -3,4 +3,3 @@
|
||||
#include <stdint.h>
|
||||
|
||||
typedef uint64_t phys_t;
|
||||
typedef uint64_t virt_t;
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
#include <zinnia/cmdline.h>
|
||||
#include <zinnia/init.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <zinnia/stdlib.h>
|
||||
#include <zinnia/string.h>
|
||||
|
||||
// Defined in linker script.
|
||||
extern const struct cmdline_option* __ld_cmdline_start[];
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
#include <zinnia/init.h>
|
||||
#include <zinnia/print.h>
|
||||
#include <zinnia/utils.h>
|
||||
#include <string.h>
|
||||
#include <zinnia/string.h>
|
||||
#include "limine.h"
|
||||
|
||||
[[__initdata_sorted("limine.0")]]
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
#include <zinnia/cmdline.h>
|
||||
#include <zinnia/console.h>
|
||||
#include <zinnia/print.h>
|
||||
#include <string.h>
|
||||
#include <zinnia/string.h>
|
||||
|
||||
extern struct console* const __ld_console_start[];
|
||||
extern struct console* const __ld_console_end[];
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@
|
||||
#include <zinnia/vma.h>
|
||||
#include <zinnia/vmo.h>
|
||||
#include <bits/elf.h>
|
||||
#include <string.h>
|
||||
#include <zinnia/string.h>
|
||||
|
||||
struct exec_info {
|
||||
struct vma* space;
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <zinnia/stdlib.h>
|
||||
#include <zinnia/string.h>
|
||||
|
||||
static void reverse(char* s) {
|
||||
int i, j;
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
#include <zinnia/utils.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <zinnia/string.h>
|
||||
|
||||
[[__hot]]
|
||||
size_t strlen(const char* str) {
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
#include <zinnia/print.h>
|
||||
#include <zinnia/utils.h>
|
||||
#include <zinnia/vma.h>
|
||||
#include <string.h>
|
||||
#include <zinnia/string.h>
|
||||
|
||||
extern uint8_t __ld_text_start[];
|
||||
extern uint8_t __ld_text_end[];
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
#include <zinnia/spin.h>
|
||||
#include <zinnia/vma.h>
|
||||
#include <config.h>
|
||||
#include <string.h>
|
||||
#include <zinnia/string.h>
|
||||
|
||||
// TODO: For now, we assume that we can do generic PTE lookups on every arch that has a MMU.
|
||||
static_assert(CONFIG_HAVE_MMU_GENERIC);
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
#include <zinnia/spin.h>
|
||||
#include <zinnia/virt.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <zinnia/string.h>
|
||||
|
||||
uintptr_t mem_hhdm_base = 0;
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
#include <zinnia/compiler.h>
|
||||
#include <zinnia/errno.h>
|
||||
#include <zinnia/spin.h>
|
||||
#include <string.h>
|
||||
#include <zinnia/string.h>
|
||||
|
||||
typedef struct {
|
||||
size_t num_pages; // Amount of pages connected to this slab.
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
#include <zinnia/list.h>
|
||||
#include <zinnia/utils.h>
|
||||
#include <zinnia/vmo.h>
|
||||
#include <string.h>
|
||||
#include <zinnia/string.h>
|
||||
|
||||
errno_t vmo_read(struct vmo* obj, uintptr_t offset, void* buf, size_t len, size_t* actual_read) {
|
||||
const size_t page_size = arch_mem_page_size();
|
||||
|
||||
+2
-2
@@ -5,8 +5,8 @@
|
||||
#include <stdarg.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <zinnia/stdlib.h>
|
||||
#include <zinnia/string.h>
|
||||
|
||||
typedef void (*log_fn_t)(void* ctx, const char* buf, size_t len);
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include <zinnia/vma.h>
|
||||
#include <arch/sched.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <zinnia/string.h>
|
||||
|
||||
static void idle_func(uintptr_t) {
|
||||
while (1) {
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
typedef __builtin_va_list va_list;
|
||||
#define va_start(v, l) __builtin_va_start(v, l)
|
||||
#define va_end(v) __builtin_va_end(v)
|
||||
#define va_arg(v, T) __builtin_va_arg(v, T)
|
||||
#define va_copy(d, s) __builtin_va_copy(d, s)
|
||||
@@ -1,7 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
typedef unsigned long size_t;
|
||||
typedef signed long ssize_t;
|
||||
|
||||
#define offsetof(type, member) __builtin_offsetof(type, member)
|
||||
#define unreachable() __builtin_unreachable()
|
||||
@@ -1,26 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
typedef __INT8_TYPE__ int8_t;
|
||||
typedef __UINT8_TYPE__ uint8_t;
|
||||
#define INT8_MAX __INT8_MAX__
|
||||
#define UINT8_MAX __UINT8_MAX__
|
||||
|
||||
typedef __INT16_TYPE__ int16_t;
|
||||
typedef __UINT16_TYPE__ uint16_t;
|
||||
#define INT16_MAX __INT16_MAX__
|
||||
#define UINT16_MAX __UINT16_MAX__
|
||||
|
||||
typedef __INT32_TYPE__ int32_t;
|
||||
typedef __UINT32_TYPE__ uint32_t;
|
||||
#define INT32_MAX __INT32_MAX__
|
||||
#define UINT32_MAX __UINT32_MAX__
|
||||
|
||||
typedef __INT64_TYPE__ int64_t;
|
||||
typedef __UINT64_TYPE__ uint64_t;
|
||||
#define INT64_MAX __INT64_MAX__
|
||||
#define UINT64_MAX __UINT64_MAX__
|
||||
|
||||
typedef __INTPTR_TYPE__ intptr_t;
|
||||
typedef __UINTPTR_TYPE__ uintptr_t;
|
||||
#define INTPTR_MAX __INTPTR_MAX__
|
||||
#define UINTPTR_MAX __UINTPTR_MAX__
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
typedef intptr_t __ssize_t;
|
||||
typedef int64_t __off_t;
|
||||
typedef __off_t __off64_t;
|
||||
typedef uintptr_t __blksize_t;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <zinnia/errno.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <zinnia/string.h>
|
||||
|
||||
#define hashmap(K, V) \
|
||||
struct { \
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
#include <uapi/types.h>
|
||||
|
||||
ASSERT_TYPE(phys_t);
|
||||
ASSERT_TYPE(virt_t);
|
||||
|
||||
typedef __ssize_t ssize_t;
|
||||
typedef __off_t off_t;
|
||||
typedef __off64_t off64_t;
|
||||
typedef __blksize_t blksize_t;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include <zinnia/alloc.h>
|
||||
#include <zinnia/errno.h>
|
||||
#include <stddef.h> // IWYU pragma: keep
|
||||
#include <string.h> // IWYU pragma: keep
|
||||
#include <zinnia/string.h> // IWYU pragma: keep
|
||||
|
||||
#define vec(T) \
|
||||
struct { \
|
||||
|
||||
@@ -30,9 +30,9 @@ uintptr_t vm_page_addr(struct page* page);
|
||||
|
||||
// Allocator for virtual memory.
|
||||
struct vm_alloc {
|
||||
virt_t start_page;
|
||||
virt_t end_page;
|
||||
virt_t next_fit;
|
||||
uintptr_t start_page;
|
||||
uintptr_t end_page;
|
||||
uintptr_t next_fit;
|
||||
hashmap(int, void);
|
||||
};
|
||||
|
||||
|
||||
@@ -39,7 +39,6 @@ add_project_arguments(
|
||||
'-ffunction-sections',
|
||||
'-fdata-sections',
|
||||
'-ffreestanding',
|
||||
'-nostdinc', # We provide our own headers.
|
||||
'-fno-stack-protector',
|
||||
language: 'c',
|
||||
)
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
#include <zinnia/syscall.h>
|
||||
#include <zinnia/usercopy.h>
|
||||
#include <config.h>
|
||||
#include <string.h>
|
||||
#include <zinnia/string.h>
|
||||
#include <uapi/utsname.h>
|
||||
|
||||
static struct spinlock uname_lock = {};
|
||||
|
||||
Reference in New Issue
Block a user