Skip to content

Commit

Permalink
修复gcc编译错误
Browse files Browse the repository at this point in the history
  • Loading branch information
copi143 committed Dec 18, 2024
1 parent 3c039d1 commit 72de878
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 16 deletions.
16 changes: 8 additions & 8 deletions src/kernel/cpu/cpu_error.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#include <kernel.h>

inthandler_f error_inthandler;
inthandler_f ERROR7;
inthandler_f ERROR13;
inthandler_f irq13;
static inthandler_f error_inthandler;
static inthandler_f ERROR7;
static inthandler_f ERROR13;
static inthandler_f irq13;

void fpu_disable() {
asm_set_ts, asm_set_em;
Expand Down Expand Up @@ -69,7 +69,7 @@ static const struct {
[31] = {"--", "Reserved" },
};

void error_inthandler(i32 id, regs32 *regs) {
__attr(fastcall) void error_inthandler(i32 id, regs32 *regs) {
kassert(id >= 0);
kassert(id < 32);
kassert(regs != null);
Expand All @@ -78,11 +78,11 @@ void error_inthandler(i32 id, regs32 *regs) {
abort();
}

void ERROR7(i32 id, regs32 *reg) {
__attr(fastcall) void ERROR7(i32 id, regs32 *reg) {
fpu_enable(current_task);
}

void irq13(i32 id, regs32 *reg) {
__attr(fastcall) void irq13(i32 id, regs32 *reg) {
kloge("IRQ 13 should not be triggered");
fpu_enable(current_task);
}
Expand All @@ -105,7 +105,7 @@ extern byte *IVT;

extern task_t v86_using_task;

void ERROR13(i32 id, regs32 *regs) {
__attr(fastcall) void ERROR13(i32 id, regs32 *regs) {
const var frame = regs;
const var task = current_task;
if (current_task->v86_mode != 1) {
Expand Down
2 changes: 1 addition & 1 deletion src/kernel/drivers/general/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ void sleep(uint64_t time_s) {
// } while (now_time.sec < end_time.sec || now_time.nsec < end_time.nsec);
}

static void inthandler20(i32 id, regs32 *regs) {
__attr(fastcall) void inthandler20(i32 id, regs32 *regs) {
// gettime_ns(NULL); // 更新时间

system_tick++;
Expand Down
2 changes: 1 addition & 1 deletion src/kernel/drivers/input/keyboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ static int sc2a(int sc) {
int disable_flag = 0;
task_t keyboard_use_task = NULL;

static void inthandler21(i32 id, regs32 *regs) {
__attr(fastcall) void inthandler21(i32 id, regs32 *regs) {
// 键盘中断处理函数
u8 data, s[4];
asm_out8(PIC0_OCW2, 0x61);
Expand Down
2 changes: 1 addition & 1 deletion src/kernel/drivers/input/mouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ u32 m_cr3 = 0;
u32 m_eip = 0;
u32 times = 0;

static void inthandler2c(i32 id, regs32 *regs) {
__attr(fastcall) void inthandler2c(i32 id, regs32 *regs) {
byte data = asm_in8(PORT_KEYDAT);

klogd("mouse data=%02x\n", data);
Expand Down
2 changes: 1 addition & 1 deletion src/kernel/drivers/sound/hda.c
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ static int hda_open(vsound_t vsound) {
return 0;
}

static void hda_interrupt_handler(i32 id, regs32 *regs) {
__attr(fastcall) void hda_interrupt_handler(i32 id, regs32 *regs) {
// printf("hda interrupt has been called");
if (hda_stopping) {
hda_stop();
Expand Down
2 changes: 1 addition & 1 deletion src/kernel/drivers/sound/sb16.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ static vsound_t snd;

static inthandler_f sb16_handler;

static void sb16_handler(i32 id, regs32 *regs) {
__attr(fastcall) void sb16_handler(i32 id, regs32 *regs) {
asm_in8(sb.depth == 16 ? SB_INTR16 : SB_STATE);

#if VSOUND_RWAPI
Expand Down
2 changes: 1 addition & 1 deletion src/kernel/drivers/storage/fdc.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ static void Write(int drive, byte *buffer, uint number, uint lba) {

static inthandler_f flint;

static void flint(i32 id, regs32 *regs) {
__attr(fastcall) void flint(i32 id, regs32 *regs) {
floppy_int_count = 1; // 设置中断计数器为1,代表中断已经发生(或者是系统已经收到了中断)
asm_out8(0x20, 0x20); // 发送EOI信号,告诉PIC,我们已经处理完了这个中断
// task_run(waiter);
Expand Down
2 changes: 1 addition & 1 deletion src/kernel/drivers/storage/ide.c
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ void ide_wait_irq() {
ide_irq_invoked = 0;
}

static void ide_irq(i32 id, regs32 *regs) {
__attr(fastcall) void ide_irq(i32 id, regs32 *regs) {
klog("ide irq.");
ide_irq_invoked = 1;
}
Expand Down
2 changes: 1 addition & 1 deletion src/kernel/mm/vpage.c
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ void page_set_physics_attr_pde(u32 vaddr, void *paddr, u32 attr, u32 pde_backup)

extern TSS32 tss;

static void page_fault(i32 id, regs32 *regs) {
__attr(fastcall) void page_fault(i32 id, regs32 *regs) {
asm_cli;
u32 pde = current_task->pde;
asm_set_cr3(PDE_ADDRESS); // 设置一个安全的页表
Expand Down

0 comments on commit 72de878

Please sign in to comment.