Changeset 49a39c2 in mainline for arch/amd64/src/interrupt.c


Ignore:
Timestamp:
2006-02-06T21:14:29Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8a1da55
Parents:
7febdde5
Message:

Preliminary work on AMD userspace.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • arch/amd64/src/interrupt.c

    r7febdde5 r49a39c2  
    5959}
    6060*/
    61 static void print_info_errcode(int n, void *st)
     61
     62static void print_info_errcode(int n, struct interrupt_context *ctx)
    6263{
    6364        char *symbol;
    64         __native *x = (__native *) st;
     65        __u64 *x = &ctx->stack[0];
    6566
    6667        if (!(symbol=get_symtab_entry(x[1])))
     
    6869
    6970        printf("-----EXCEPTION(%d) OCCURED----- ( %s )\n",n,__FUNCTION__);
    70         printf("%%rip: %Q (%s)\n",x[1],symbol);
    71         printf("ERROR_WORD=%Q\n", x[0]);
    72         printf("%%rcs=%Q,flags=%Q, %%cr0=%Q\n", x[2], x[3],read_cr0());
    73         printf("%%rax=%Q, %%rbx=%Q, %%rcx=%Q\n",x[-2],x[-3],x[-4]);
    74         printf("%%rdx=%Q, %%rsi=%Q, %%rdi=%Q\n",x[-5],x[-6],x[-7]);
    75         printf("%%r8 =%Q, %%r9 =%Q, %%r10=%Q\n",x[-8],x[-9],x[-10]);
    76         printf("%%r11=%Q, %%r12=%Q, %%r13=%Q\n",x[-11],x[-12],x[-13]);
    77         printf("%%r14=%Q, %%r15=%Q, %%rsp=%Q\n",x[-14],x[-15],x);
    78         printf("%%rbp=%Q\n",x[-1]);
     71        printf("%%rip: %Q (%s)\n",ctx->stack[1],symbol);
     72        printf("ERROR_WORD=%Q\n", ctx->stack[0]);
     73        printf("%%rcs=%Q,flags=%Q, %%cr0=%Q\n", ctx->stack[2],
     74               ctx->stack[3],read_cr0());
     75        printf("%%rax=%Q, %%rbx=%Q, %%rcx=%Q\n",ctx->rax,ctx->rbx,ctx->rcx);
     76        printf("%%rdx=%Q, %%rsi=%Q, %%rdi=%Q\n",ctx->rdx,ctx->rsi,ctx->rdi);
     77        printf("%%r8 =%Q, %%r9 =%Q, %%r10=%Q\n",ctx->r8,ctx->r9,ctx->r10);
     78        printf("%%r11=%Q, %%r12=%Q, %%r13=%Q\n",ctx->r11,ctx->r12,ctx->r13);
     79        printf("%%r14=%Q, %%r15=%Q, %%rsp=%Q\n",ctx->r14,ctx->r15,&ctx->stack[0]);
     80        printf("%%rbp=%Q\n",ctx->rbp);
    7981        printf("stack: %Q, %Q, %Q\n", x[5], x[6], x[7]);
    8082        printf("       %Q, %Q, %Q\n", x[8], x[9], x[10]);
    8183        printf("       %Q, %Q, %Q\n", x[11], x[12], x[13]);
    8284        printf("       %Q, %Q, %Q\n", x[14], x[15], x[16]);
    83         printf("       %Q, %Q, %Q\n", x[17], x[18], x[19]);
    84         printf("       %Q, %Q, %Q\n", x[20], x[21], x[22]);
    85         printf("       %Q, %Q, %Q\n", x[23], x[24], x[25]);
    8685//      messy_stack_trace(&x[5]);
    8786}
     
    9594void (* eoi_function)(void) = NULL;
    9695
    97 void null_interrupt(int n, void *st)
     96void null_interrupt(int n, struct interrupt_context *ctx)
    9897{
    99         __native *stack = (__native *) st;
    100 
    10198        printf("-----EXCEPTION(%d) OCCURED----- ( %s )\n",n,__FUNCTION__); \
    102         printf("stack: %L, %L, %L, %L\n", stack[0], stack[1], stack[2], stack[3]);
     99        printf("stack: %X, %X, %X, %X\n", ctx->stack[0], ctx->stack[1],
     100               ctx->stack[2], ctx->stack[3]);
    103101        panic("unserviced interrupt\n");
    104102}
     
    126124}
    127125
    128 void page_fault(int n, void *stack)
     126void page_fault(int n, struct interrupt_context *ctx)
    129127{
    130128        __address page;
     
    132130        page = read_cr2();
    133131        if (!as_page_fault(page)) {
    134                 print_info_errcode(n,stack);
     132                print_info_errcode(n,ctx);
    135133                printf("Page fault address: %Q\n", page);
    136134                panic("page fault\n");
    137135        }
    138 }
    139 
    140 void syscall(int n, void *stack)
    141 {
    142         printf("cpu%d: syscall\n", CPU->id);
    143         thread_usleep(1000);
    144136}
    145137
Note: See TracChangeset for help on using the changeset viewer.