#if defined(CONFIG_SMP) && CONFIG_SMP_CPUS > 1
-int cpu_get_id(void) {
+int cpu_get_id(void)
+{
/* FIXME: implement this properly */
return(0);
}
#endif /* CONFIG_SMP */
-void _segment_descriptor_set(segment_descriptor_t *sd, u32_t type, u32_t base, u32_t limit, u32_t dpl) {
+void _segment_descriptor_set(segment_descriptor_t *sd, u32_t type, u32_t base, u32_t limit, u32_t dpl)
+{
sd->sd_high = type;
switch(type) {
case SD_TYPE_CODE:
return;
}
-void cpu_debug(void) {
+void cpu_debug(void)
+{
u32_t i;
for(i = 0; i < 256; i++) {
#define VGA_SET_FONT(c) vga_attrs = (vga_attrs & 0xf0ff) | VGA_FONT(c)
#define VGA_SET_BACKGROUND(c) vga_attrs = (vga_attrs & 0x0fff) | VGA_BACKGROUND(c)
-i64_t _i64div(i64_t dividend, i64_t divisor) {
+i64_t _i64div(i64_t dividend, i64_t divisor)
+{
i64_t quotient;
int sign;
return(sign > 0 ? quotient : -quotient);
}
-i64_t _i64mod(i64_t dividend, i64_t divisor) {
+i64_t _i64mod(i64_t dividend, i64_t divisor)
+{
if(divisor == 0) {
PANIC("Can't divide by zero");
}
return(dividend);
}
-u64_t _u64div(u64_t dividend, u64_t divisor) {
+u64_t _u64div(u64_t dividend, u64_t divisor)
+{
u64_t quotient = 0;
if(divisor == 0) {
return(quotient);
}
-u64_t _u64mod(u64_t dividend, u64_t divisor) {
+u64_t _u64mod(u64_t dividend, u64_t divisor)
+{
if(divisor == 0) {
PANIC("Can't divide by zero");
}
return(dividend);
}
-void* memset(void *dst, int val, u32_t n) {
+void* memset(void *dst, int val, u32_t n)
+{
char *ptr;
ptr = dst;
return(dst);
}
-void* memcpy(void *dst, const void *src, u32_t n) {
+void* memcpy(void *dst, const void *src, u32_t n)
+{
char *d;
const char *s;
return(dst);
}
-static void _putchar(int c) {
+static void _putchar(int c)
+{
if(c == '\n') {
vga_offset += VGA_BUFFER_COLS - (vga_offset % VGA_BUFFER_COLS);
} else {
return;
}
-int dbg_printf(const char *format, ...) {
+int dbg_printf(const char *format, ...)
+{
int n;
char c;
char size;
return(n);
}
-void dbg_panic(const char *func, const char *file, i32_t line, const char *msg) {
+void dbg_panic(const char *func, const char *file, i32_t line, const char *msg)
+{
/* vga_attrs = 0x0400; *//* VGA_FONT(VGA_RED) | VGA_BACKGROUND(VGA_BLACK); */
VGA_SET_FONT(VGA_RED);
"Intel64 mode"
};
-void* pg_dir_create(void) {
+void* pg_dir_create(void)
+{
void *dir;
dir = NULL;
return(dir);
}
-static void* _phys_alloc(u32_t size, u32_t align) {
+static void* _phys_alloc(u32_t size, u32_t align)
+{
extern u32_t _mem_start;
void *addr;
return(addr);
}
-void* pg_init(struct multiboot_info *info) {
+void* pg_init(struct multiboot_info *info)
+{
struct memory_map *mmap;
u64_t mem_size;
u64_t map_end;
return;
}
-int corax(void *mb_info, u32_t magic) {
+int corax(void *mb_info, u32_t magic)
+{
dbg_printf("Corax 0.1 - As the Crow flies\n");
dbg_printf("(C) 2019 Matthias Kruk <matt@corax.cc>\n");
dbg_printf("Compiled on %s at %s\n", __DATE__, __TIME__);