Changeset 220 for trunk/hal


Ignore:
Timestamp:
Jul 17, 2017, 2:14:21 PM (7 years ago)
Author:
max@…
Message:

use the asm entry point to save the context

Location:
trunk/hal/x86_64
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/hal/x86_64/core/hal_kentry.S

    r203 r220  
    3636        .globl  hal_exception_entry
    3737        .globl  hal_timer_intr
     38        .globl  ioc_ata_isr
    3839        .globl  hal_com1_intr
    3940        .globl  hal_keyboard_intr
    4041        .type   hal_exception_entry, @function
    4142        .type   hal_timer_intr, @function
     43        .type   ioc_ata_isr, @function
    4244        .type   hal_com1_intr, @function
    4345        .type   hal_keyboard_intr, @function
     
    135137        movq    %rsp,%rdi
    136138        call    hal_timer_intr
     139
     140        movq    lapic_va(%rip),%rax
     141        movl    $0,LAPIC_EOI(%rax)
     142
     143        INTR_RESTORE_REGS
     144        addq    $16,%rsp
     145        iretq
     146
     147ASM_ENTRY(x86_ioapic_ata0)
     148        pushq   $0
     149        pushq   $T_ASTFLT
     150        INTR_SAVE_REGS
     151
     152        movq    %rsp,%rdi
     153        call    ioc_ata_isr
    137154
    138155        movq    lapic_va(%rip),%rax
  • trunk/hal/x86_64/drivers/ioc_ata.c

    r215 r220  
    2323#include <dev_ioc.h>
    2424#include <hal_drivers.h>
     25#include <hal_kentry.h>
    2526#include <thread.h>
    2627#include <spinlock.h>
     
    175176
    176177static void ioc_ata_cmd(xptr_t th_xp);
    177 static void ioc_ata_isr(chdev_t *chdev);
     178extern void x86_ioapic_ata0();
    178179
    179180void ioc_ata_init(chdev_t *chdev)
    180181{
    181182        chdev->cmd = &ioc_ata_cmd;
    182         chdev->isr = &ioc_ata_isr;
     183        chdev->isr = &x86_ioapic_ata0;
    183184        ata_init();
    184185}
     
    217218}
    218219
    219 static void ioc_ata_isr(chdev_t *chdev)
    220 {
     220void ioc_ata_isr(hal_cpu_context_t *ctx)
     221{
     222        x86_printf("rip = %Z\n", ctx->tf_rip);
     223
    221224        x86_panic((char *)__func__);
    222225}
Note: See TracChangeset for help on using the changeset viewer.