diff options
author | Marvin Borner | 2020-11-05 17:30:39 +0100 |
---|---|---|
committer | Marvin Borner | 2020-11-05 17:32:53 +0100 |
commit | 63e86f792167e6cc2e9600d00b184a3c83fe7498 (patch) | |
tree | 31e2d583be3ebf34782f6ec37f6c524657c40686 /kernel/inc | |
parent | 916fca2161e76de67a5106b90baf00a57f2a0512 (diff) |
Added warning flags and fixed them :)
Diffstat (limited to 'kernel/inc')
-rw-r--r-- | kernel/inc/acpi.h | 6 | ||||
-rw-r--r-- | kernel/inc/fpu.h | 2 | ||||
-rw-r--r-- | kernel/inc/fs.h | 6 | ||||
-rw-r--r-- | kernel/inc/interrupts.h | 2 | ||||
-rw-r--r-- | kernel/inc/keyboard.h | 2 | ||||
-rw-r--r-- | kernel/inc/mouse.h | 2 | ||||
-rw-r--r-- | kernel/inc/net.h | 2 | ||||
-rw-r--r-- | kernel/inc/pci.h | 13 | ||||
-rw-r--r-- | kernel/inc/proc.h | 12 | ||||
-rw-r--r-- | kernel/inc/rtl8139.h | 4 | ||||
-rw-r--r-- | kernel/inc/syscall.h | 2 | ||||
-rw-r--r-- | kernel/inc/test.h | 24 | ||||
-rw-r--r-- | kernel/inc/timer.h | 6 |
13 files changed, 30 insertions, 53 deletions
diff --git a/kernel/inc/acpi.h b/kernel/inc/acpi.h index 4e04037..f2fd030 100644 --- a/kernel/inc/acpi.h +++ b/kernel/inc/acpi.h @@ -183,8 +183,8 @@ struct madt *madt; struct fadt *fadt; struct hpet *hpet; -void acpi_install(); -void hpet_install(int frequency); -void madt_install(); +void acpi_install(void); +void hpet_install(u32 period); +void madt_install(void); #endif diff --git a/kernel/inc/fpu.h b/kernel/inc/fpu.h index d747708..d3ec8d9 100644 --- a/kernel/inc/fpu.h +++ b/kernel/inc/fpu.h @@ -3,6 +3,6 @@ #ifndef FPU_H #define FPU_H -void fpu_install(); +void fpu_install(void); #endif diff --git a/kernel/inc/fs.h b/kernel/inc/fs.h index 775a1ce..d7e3544 100644 --- a/kernel/inc/fs.h +++ b/kernel/inc/fs.h @@ -93,10 +93,10 @@ struct file { u32 curr_block_pos; }; -int find_inode(const char *name, int dir_inode); -struct inode *get_inode(int i); +u32 find_inode(const char *name, u32 dir_inode); +struct inode *get_inode(u32 i); void *read_inode(struct inode *in); void *read_file(char *path); -void ls_root(); // DEMO ;) +void ls_root(void); // DEMO ;) #endif diff --git a/kernel/inc/interrupts.h b/kernel/inc/interrupts.h index e943e5a..61d31fc 100644 --- a/kernel/inc/interrupts.h +++ b/kernel/inc/interrupts.h @@ -36,7 +36,7 @@ void irq_uninstall_handler(int irq); void isr_install_handler(int isr, void (*handler)(struct regs *r)); void isr_uninstall_handler(int isr); -void interrupts_install(); +void interrupts_install(void); // External handlers (ASM) diff --git a/kernel/inc/keyboard.h b/kernel/inc/keyboard.h index f0effc7..32168f4 100644 --- a/kernel/inc/keyboard.h +++ b/kernel/inc/keyboard.h @@ -3,6 +3,6 @@ #ifndef KEYBOARD_H #define KEYBOARD_H -void keyboard_install(); +void keyboard_install(void); #endif diff --git a/kernel/inc/mouse.h b/kernel/inc/mouse.h index ccea383..e8072aa 100644 --- a/kernel/inc/mouse.h +++ b/kernel/inc/mouse.h @@ -3,6 +3,6 @@ #ifndef MOUSE_H #define MOUSE_H -void mouse_install(); +void mouse_install(void); #endif diff --git a/kernel/inc/net.h b/kernel/inc/net.h index 81754d8..26ee1ef 100644 --- a/kernel/inc/net.h +++ b/kernel/inc/net.h @@ -138,6 +138,6 @@ struct arp_table_entry { }; void ethernet_handle_packet(struct ethernet_packet *packet, int len); -void net_install(); +void net_install(void); #endif diff --git a/kernel/inc/pci.h b/kernel/inc/pci.h index 10aea56..11fad6f 100644 --- a/kernel/inc/pci.h +++ b/kernel/inc/pci.h @@ -61,25 +61,26 @@ struct pci_device_descriptor { u8 revision; }; -static inline int pci_extract_bus(u32 device) +static inline u8 pci_extract_bus(u32 device) { return (u8)((device >> 16)); } -static inline int pci_extract_slot(u32 device) +static inline u8 pci_extract_slot(u32 device) { return (u8)((device >> 8)); } -static inline int pci_extract_func(u32 device) +static inline u8 pci_extract_func(u32 device) { return (u8)(device); } static inline u32 pci_get_addr(u32 device, int field) { - return 0x80000000 | (pci_extract_bus(device) << 16) | (pci_extract_slot(device) << 11) | - (pci_extract_func(device) << 8) | ((field)&0xFC); + return 0x80000000 | (u32)(pci_extract_bus(device) << 16) | + (u32)(pci_extract_slot(device) << 11) | (u32)(pci_extract_func(device) << 8) | + ((field)&0xFC); } static inline u32 pci_box_device(int bus, int slot, int func) @@ -96,6 +97,6 @@ void pci_scan_slot(pci_func_t f, int type, int bus, int slot, void *extra); void pci_scan_bus(pci_func_t f, int type, int bus, void *extra); void pci_scan(pci_func_t f, int type, void *extra); int pci_get_interrupt(u32 device); -void pci_install(); +void pci_install(void); #endif diff --git a/kernel/inc/proc.h b/kernel/inc/proc.h index 97ee69a..ad95104 100644 --- a/kernel/inc/proc.h +++ b/kernel/inc/proc.h @@ -36,16 +36,16 @@ struct proc_message { struct proc *kernel_proc; -void scheduler_enable(); -void scheduler_disable(); -void proc_init(); -void proc_print(); -struct proc *proc_current(); +void scheduler_enable(void); +void scheduler_disable(void); +void proc_init(void); +void proc_print(void); +struct proc *proc_current(void); void proc_send(struct proc *src, struct proc *dest, u32 type, void *data); struct proc_message *proc_receive(struct proc *proc); struct proc *proc_from_pid(u32 pid); void proc_exit(struct proc *proc, int status); void proc_yield(struct regs *r); -struct proc *proc_make(); +struct proc *proc_make(void); #endif diff --git a/kernel/inc/rtl8139.h b/kernel/inc/rtl8139.h index d84d115..faeb3f6 100644 --- a/kernel/inc/rtl8139.h +++ b/kernel/inc/rtl8139.h @@ -28,8 +28,8 @@ #define RTL_PORT_RXMISS 0x4C #define RTL_PORT_CONFIG 0x52 -int rtl8139_install(); +int rtl8139_install(void); void rtl8139_send_packet(void *data, u32 len); -u8 *rtl8139_get_mac(); +u8 *rtl8139_get_mac(void); #endif diff --git a/kernel/inc/syscall.h b/kernel/inc/syscall.h index 3f89365..ff13d39 100644 --- a/kernel/inc/syscall.h +++ b/kernel/inc/syscall.h @@ -3,6 +3,6 @@ #ifndef SYSCALL_H #define SYSCALL_H -void syscall_init(); +void syscall_init(void); #endif diff --git a/kernel/inc/test.h b/kernel/inc/test.h deleted file mode 100644 index 8bd0d41..0000000 --- a/kernel/inc/test.h +++ /dev/null @@ -1,24 +0,0 @@ -// MIT License, Copyright (c) 2020 Marvin Borner - -#ifndef TEST_H -#define TEST_H - -#include <boot.h> -#include <print.h> -#include <str.h> - -#define a_mag 0x55 -#define b_mag 0x42 - -void pass_or_fail(const char *file_name, int line_num, const char *func, const char *first, - const char *second, int success); - -#define check(exp) pass_or_fail(__FILE__, __LINE__, __func__, #exp, "1", exp); -#define equals(first, second) \ - pass_or_fail(__FILE__, __LINE__, __func__, #first, #second, (first) == (second)); -#define equals_str(first, second) \ - pass_or_fail(__FILE__, __LINE__, __func__, #first, #second, strcmp((first), (second)) == 0); - -void test_all(struct vid_info *vid_info); - -#endif diff --git a/kernel/inc/timer.h b/kernel/inc/timer.h index fbd1500..21dd437 100644 --- a/kernel/inc/timer.h +++ b/kernel/inc/timer.h @@ -5,9 +5,9 @@ #include <def.h> -u32 timer_get(); +u32 timer_get(void); void timer_wait(u32 ticks); -void timer_install(); -void timer_handler(); // For scheduler +void timer_install(void); +void timer_handler(void); // For scheduler #endif |