Changeset 233


Ignore:
Timestamp:
Jul 18, 2017, 3:28:20 PM (4 years ago)
Author:
max@…
Message:

Push the context entirely for an exception.

Location:
trunk/hal/x86_64/core
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/hal/x86_64/core/hal_exception.c

    r143 r233  
    5858 * Hexception handler.
    5959 */
    60 void hal_exception_entry(struct small_trapframe *tf)
     60void hal_exception_entry(hal_cpu_context_t *ctx)
    6161{
    62         uint64_t excno = tf->tf_trapno;
     62        uint64_t excno = ctx->tf_trapno;
    6363        const char *buf;
    6464
     
    7171        x86_printf("\n****** EXCEPTION OCCURRED ******\n");
    7272        x86_printf("%s\n", (char *)buf);
    73         x86_printf("-> rip = %Z\n", tf->tf_rip);
    74         x86_printf("-> rsp = %Z\n", tf->tf_rsp);
    75         x86_printf("-> err = %Z\n", tf->tf_err);
     73        x86_printf("-> rip = %Z\n", ctx->tf_rip);
     74        x86_printf("-> rsp = %Z\n", ctx->tf_rsp);
     75        x86_printf("-> err = %Z\n", ctx->tf_err);
    7676        if (excno == T_PAGEFLT)
    7777                x86_printf("-> va  = %Z\n", rcr2());
  • trunk/hal/x86_64/core/hal_kentry.S

    r220 r233  
    191191
    192192/*
    193  * Arguments pushed on the stack:
    194  *  tf_trapno
    195  *  tf_err: Dummy inserted if not defined
    196  *  tf_rip
    197  *  tf_cs
    198  *  tf_rflags
    199  *  tf_rsp
    200  *  tf_ss
     193 * Common entry point for exceptions.
    201194 */
    202195alltraps:
     196        INTR_SAVE_REGS
     197
    203198        movq    %rsp,%rdi
    204199        call    hal_exception_entry
  • trunk/hal/x86_64/core/hal_kentry.h

    r193 r233  
    129129        uint64_t tf_trapno;
    130130
    131         /* Pushed by the hardware if trap */
    132         uint64_t tf_err;
     131        /* Pushed by the hardware if exception */
     132        uint64_t tf_err;        /* in fact, this one may not... */
    133133        uint64_t tf_rip;
    134134        uint64_t tf_cs;
     
    139139        uint64_t tf_ss;
    140140} hal_cpu_context_t;
    141 
    142 /*
    143  * Our small trap frame.
    144  */
    145 struct small_trapframe {
    146         uint64_t tf_trapno;
    147 
    148         /* These are pushed for a trap */
    149         uint64_t tf_err;        /* in fact, this one may not... */
    150         uint64_t tf_rip;
    151         uint64_t tf_cs;
    152         uint64_t tf_rflags;
    153 
    154         /* These are always pushed */
    155         uint64_t tf_rsp;
    156         uint64_t tf_ss;
    157 };
    158141
    159142#else
Note: See TracChangeset for help on using the changeset viewer.