add void to functions with no arguments

This commit is contained in:
hippoz 2022-02-24 21:57:59 +02:00
parent ca93f5077b
commit 581c2d7d64
No known key found for this signature in database
GPG key ID: 7C52899193467641
8 changed files with 11 additions and 8 deletions

View file

@ -173,7 +173,7 @@ static void isr31(struct interrupt_descriptor_32 *frame) {
} }
void exception_handlers_init() { void exception_handlers_init(void) {
idt_register_handler(0, (size_t)isr0); idt_register_handler(0, (size_t)isr0);
idt_register_handler(1, (size_t)isr1); idt_register_handler(1, (size_t)isr1);
idt_register_handler(2, (size_t)isr2); idt_register_handler(2, (size_t)isr2);

View file

@ -1,6 +1,6 @@
#ifndef _EXCEPTION_H #ifndef _EXCEPTION_H
#define _EXCEPTION_H #define _EXCEPTION_H
void exception_handlers_init(); void exception_handlers_init(void);
#endif #endif

View file

@ -6,7 +6,7 @@
struct interrupt_descriptor_32 idt[256]; struct interrupt_descriptor_32 idt[256];
static size_t idt_ptr[2]; static size_t idt_ptr[2];
void idt_init() { void idt_init(void) {
size_t idt_address = (size_t)idt; size_t idt_address = (size_t)idt;
idt_ptr[0] = (sizeof (struct interrupt_descriptor_32) * 256) + ((idt_address & 0xffff) << 16); idt_ptr[0] = (sizeof (struct interrupt_descriptor_32) * 256) + ((idt_address & 0xffff) << 16);
idt_ptr[1] = idt_address >> 16; idt_ptr[1] = idt_address >> 16;

View file

@ -16,7 +16,7 @@ struct interrupt_descriptor_32 {
uint16_t offset_2; // offset bits 16..31 uint16_t offset_2; // offset bits 16..31
} __attribute__((__packed__)); } __attribute__((__packed__));
void idt_init(); void idt_init(void);
void idt_register_handler(uint8_t interrupt, size_t address); void idt_register_handler(uint8_t interrupt, size_t address);
#endif #endif

View file

@ -58,7 +58,7 @@ end:
pic_send_eoi(1); pic_send_eoi(1);
} }
void keyboard_init() { void keyboard_init(void) {
pic_irq_clear_mask(1); pic_irq_clear_mask(1);
idt_register_handler(33, (size_t)irq); idt_register_handler(33, (size_t)irq);
inb(0x60); inb(0x60);

View file

@ -1,6 +1,6 @@
#ifndef _KEYBOARD_H #ifndef _KEYBOARD_H
#define _KEYBOARD_H #define _KEYBOARD_H
void keyboard_init(); void keyboard_init(void);
#endif #endif

View file

@ -118,7 +118,8 @@ void kputs(const char* data) {
kprintf("%s\n", data); kprintf("%s\n", data);
} }
void kabort() { __attribute__((__noreturn__))
void kabort(void) {
kprintf("kabort(): halting kernel...\n"); kprintf("kabort(): halting kernel...\n");
asm volatile("cli"); asm volatile("cli");
asm volatile("hlt"); asm volatile("hlt");

View file

@ -6,6 +6,8 @@
int kputchar(int ic); int kputchar(int ic);
int kprintf(const char* restrict format, ...); int kprintf(const char* restrict format, ...);
void kputs(const char* data); void kputs(const char* data);
void kabort();
__attribute__((__noreturn__))
void kabort(void);
#endif #endif