Skip to content

Commit 17dd38e

Browse files
authored
Rename handlers (#88)
* Rename `dispatch_syscall()` to `handle_syscall()`. * Rename `dispatch_interrupt()` to `handle_interrupt()`. * Rename interrupt.c/.h to interrupts.c/.h. * Cleanup `#include`s
1 parent 87a6c65 commit 17dd38e

File tree

7 files changed

+22
-23
lines changed

7 files changed

+22
-23
lines changed

include/kernel/interface/i686/interrupt.h include/kernel/interface/i686/interrupts.h

+1-4
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,12 @@
3333
#define JINUE_KERNEL_INTERFACE_I686_INTERRUPT_H
3434

3535
#include <kernel/infrastructure/i686/types.h>
36-
#include <kernel/interface/i686/asm/irq.h>
3736
#include <kernel/interface/i686/types.h>
38-
#include <stdint.h>
3937

4038

4139
/* defined in trap.asm */
4240
extern seg_descriptor_t idt[];
4341

44-
void dispatch_interrupt(trapframe_t *trapframe);
42+
void handle_interrupt(trapframe_t *trapframe);
4543

4644
#endif
47-

include/kernel/interface/syscalls.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@
3434

3535
#include <jinue/shared/types.h>
3636

37-
void dispatch_syscall(jinue_syscall_args_t *args);
37+
void handle_syscall(jinue_syscall_args_t *args);
3838

3939
#endif

kernel/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ sources.kernel.c = \
116116
infrastructure/elf.c \
117117
interface/i686/auxv.c \
118118
interface/i686/bootinfo.c \
119-
interface/i686/interrupt.c \
119+
interface/i686/interrupts.c \
120120
interface/syscalls.c
121121

122122
sources.kernel.nasm = \

kernel/infrastructure/i686/init.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@
4949
#include <kernel/infrastructure/i686/memory.h>
5050
#include <kernel/infrastructure/i686/percpu.h>
5151
#include <kernel/infrastructure/elf.h>
52+
#include <kernel/interface/i686/asm/irq.h>
5253
#include <kernel/interface/i686/boot.h>
53-
#include <kernel/interface/i686/interrupt.h>
54+
#include <kernel/interface/i686/interrupts.h>
5455
#include <kernel/interface/i686/trap.h>
5556
#include <kernel/interface/syscalls.h>
5657
#include <kernel/machine/asm/machine.h>

kernel/interface/i686/interrupt.c kernel/interface/i686/interrupts.c

+4-3
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,14 @@
3434
#include <kernel/infrastructure/i686/drivers/pic8259.h>
3535
#include <kernel/infrastructure/i686/isa/io.h>
3636
#include <kernel/infrastructure/i686/isa/regs.h>
37-
#include <kernel/interface/i686/interrupt.h>
37+
#include <kernel/interface/i686/asm/irq.h>
38+
#include <kernel/interface/i686/interrupts.h>
3839
#include <kernel/interface/syscalls.h>
3940
#include <kernel/machine/asm/machine.h>
4041
#include <inttypes.h>
4142

4243

43-
void dispatch_interrupt(trapframe_t *trapframe) {
44+
void handle_interrupt(trapframe_t *trapframe) {
4445
unsigned int ivt = trapframe->ivt;
4546
uintptr_t eip = trapframe->eip;
4647
uint32_t errcode = trapframe->errcode;
@@ -60,7 +61,7 @@ void dispatch_interrupt(trapframe_t *trapframe) {
6061

6162
if(ivt == JINUE_I686_SYSCALL_IRQ) {
6263
/* interrupt-based system call implementation */
63-
dispatch_syscall((jinue_syscall_args_t *)&trapframe->msg_arg0);
64+
handle_syscall((jinue_syscall_args_t *)&trapframe->msg_arg0);
6465
}
6566
else if(ivt >= IDT_PIC8259_BASE && ivt < IDT_PIC8259_BASE + PIC8259_IRQ_COUNT) {
6667
int irq = ivt - IDT_PIC8259_BASE;

kernel/interface/i686/trap.asm

+12-12
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333

3434
bits 32
3535

36-
extern dispatch_interrupt
37-
extern dispatch_syscall
36+
extern handle_interrupt
37+
extern handle_syscall
3838

3939
; ------------------------------------------------------------------------------
4040
; FUNCTION: interrupt_entry
@@ -128,11 +128,11 @@ interrupt_entry:
128128
mov eax, SEG_SELECTOR(GDT_PER_CPU_DATA, RPL_KERNEL)
129129
mov gs, ax
130130
131-
; set dispatch_interrupt() function argument
131+
; set handle_interrupt() function argument
132132
push esp ; First argument: trapframe
133133
134134
; call interrupt dispatching function
135-
call dispatch_interrupt
135+
call handle_interrupt
136136
137137
; remove argument(s) from stack
138138
add esp, 4
@@ -208,16 +208,16 @@ fast_intel_entry:
208208
mov eax, SEG_SELECTOR(GDT_PER_CPU_DATA, RPL_KERNEL)
209209
mov gs, ax
210210
211-
; set dispatch_syscall() function argument
211+
; set handle_syscall() function argument
212212
;
213-
; The message arguments, a ponter to which dispatch_syscall() takes
213+
; The message arguments, a ponter to which handle_syscall() takes
214214
; as argument are at the beginning of the trap frame, so we can just
215215
; pass the address of the trap frame.
216216
push esp ; First argument: message arguments
217217
218-
call dispatch_syscall
218+
call handle_syscall
219219
220-
; cleanup dispatch_syscall() argument
220+
; cleanup handle_syscall() argument
221221
add esp, 4
222222
223223
pop eax ; 0
@@ -299,16 +299,16 @@ fast_amd_entry:
299299
mov ds, cx
300300
mov es, cx
301301
302-
; set dispatch_syscall() function argument
302+
; set handle_syscall() function argument
303303
;
304-
; The message arguments, a ponter to which dispatch_syscall() takes
304+
; The message arguments, a ponter to which handle_syscall() takes
305305
; as argument are at the beginning of the trap frame, so we can just
306306
; pass the address of the trap frame.
307307
push esp ; First argument: message arguments
308308
309-
call dispatch_syscall
309+
call handle_syscall
310310
311-
; cleanup dispatch_syscall() argument
311+
; cleanup handle_syscall() argument
312312
add esp, 4
313313
314314
pop eax ; 0

kernel/interface/syscalls.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ static void sys_reply_error(jinue_syscall_args_t *args) {
562562
*
563563
* @param trapframe trap frame for current system call
564564
*/
565-
void dispatch_syscall(jinue_syscall_args_t *args) {
565+
void handle_syscall(jinue_syscall_args_t *args) {
566566
intptr_t function = args->arg0;
567567

568568
if(function < 0) {

0 commit comments

Comments
 (0)