Changeset 25d7709 in mainline


Ignore:
Timestamp:
2006-03-13T20:08:16Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
631ca4d
Parents:
45d6add
Message:

Nicer ia32 interrupt handlers and structures holding interrupted context data.
Unify the name holding interrupted context data on all architectures to be istate.

Files:
36 edited

Legend:

Unmodified
Added
Removed
  • arch/amd64/include/context.h

    r45d6add r25d7709  
    5959} __attribute__ ((packed));
    6060
    61 /** This is passed to interrupt handlers */
    62 struct interrupt_context {
    63         __u64 rax;
    64         __u64 rbx;
    65         __u64 rcx;
    66         __u64 rdx;
    67         __u64 rsi;
    68         __u64 rdi;
    69         __u64 r8;
    70         __u64 r9;
    71         __u64 r10;
    72         __u64 r11;
    73         __u64 r12;
    74         __u64 r13;
    75         __u64 r14;
    76         __u64 r15;
    77         /* These 2 items MUST be last parts of the structure */
    78         __u64 rbp;
    79         __u64 stack[0]; /* Additional data on stack */
    80 } __attribute__ ((packed));
    81 
    8261#endif
  • arch/amd64/include/interrupt.h

    r45d6add r25d7709  
    6161#define VECTOR_WAKEUP_IPI               (IVT_FREEBASE+1)
    6262
     63/** This is passed to interrupt handlers */
     64struct istate {
     65        __u64 rax;
     66        __u64 rbx;
     67        __u64 rcx;
     68        __u64 rdx;
     69        __u64 rsi;
     70        __u64 rdi;
     71        __u64 r8;
     72        __u64 r9;
     73        __u64 r10;
     74        __u64 r11;
     75        __u64 r12;
     76        __u64 r13;
     77        __u64 r14;
     78        __u64 r15;
     79        /* These 2 items MUST be last parts of the structure */
     80        __u64 rbp;
     81        __u64 stack[0]; /* Additional data on stack */
     82} __attribute__ ((packed));
     83
    6384extern void (* disable_irqs_function)(__u16 irqmask);
    6485extern void (* enable_irqs_function)(__u16 irqmask);
    6586extern void (* eoi_function)(void);
    6687
    67 extern void null_interrupt(int n, struct interrupt_context *ctx);
    68 extern void gp_fault(int n, void *stack);
    69 extern void nm_fault(int n, void *stack);
    70 extern void ss_fault(int n, void *stack);
    71 extern void page_fault(int n, struct interrupt_context *ctx);
    72 extern void syscall(int n, void *stack);
    73 extern void tlb_shootdown_ipi(int n, void *stack);
     88extern void null_interrupt(int n, istate_t *istate);
     89extern void gp_fault(int n, istate_t *istate);
     90extern void nm_fault(int n, istate_t *istate);
     91extern void ss_fault(int n, istate_t *istate);
     92extern void page_fault(int n, istate_t *istate);
     93extern void syscall(int n, istate_t *istate);
     94extern void tlb_shootdown_ipi(int n, istate_t *istate);
    7495
    7596extern void trap_virtual_enable_irqs(__u16 irqmask);
  • arch/amd64/src/interrupt.c

    r45d6add r25d7709  
    4343#include <proc/thread.h>
    4444
    45 /*
    46 static void messy_stack_trace(__native *stack)
    47 {
    48         __native *upper_limit = (__native *)(((__native)get_stack_base()) + STACK_SIZE);
    49         char *symbol;
    50 
    51         printf("Stack contents: ");
    52         while (stack < upper_limit) {
    53                 symbol = get_symtab_entry((__address)*stack);
    54                 if (symbol)
    55                         printf("%s, ", symbol);
    56                 stack++;
    57         }
    58         printf("\n");
    59 }
    60 */
    61 
    62 static void print_info_errcode(int n, struct interrupt_context *ctx)
     45static void print_info_errcode(int n, istate_t *istate)
    6346{
    6447        char *symbol;
    65         __u64 *x = &ctx->stack[0];
     48        __u64 *x = &istate->stack[0];
    6649
    6750        if (!(symbol=get_symtab_entry(x[1])))
     
    6952
    7053        printf("-----EXCEPTION(%d) OCCURED----- ( %s )\n",n,__FUNCTION__);
    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);
     54        printf("%%rip: %Q (%s)\n",istate->stack[1],symbol);
     55        printf("ERROR_WORD=%Q\n", istate->stack[0]);
     56        printf("%%rcs=%Q,flags=%Q, %%cr0=%Q\n", istate->stack[2],
     57               istate->stack[3],read_cr0());
     58        printf("%%rax=%Q, %%rbx=%Q, %%rcx=%Q\n",istate->rax,istate->rbx,istate->rcx);
     59        printf("%%rdx=%Q, %%rsi=%Q, %%rdi=%Q\n",istate->rdx,istate->rsi,istate->rdi);
     60        printf("%%r8 =%Q, %%r9 =%Q, %%r10=%Q\n",istate->r8,istate->r9,istate->r10);
     61        printf("%%r11=%Q, %%r12=%Q, %%r13=%Q\n",istate->r11,istate->r12,istate->r13);
     62        printf("%%r14=%Q, %%r15=%Q, %%rsp=%Q\n",istate->r14,istate->r15,&istate->stack[0]);
     63        printf("%%rbp=%Q\n",istate->rbp);
    8164        printf("stack: %Q, %Q, %Q\n", x[5], x[6], x[7]);
    8265        printf("       %Q, %Q, %Q\n", x[8], x[9], x[10]);
    8366        printf("       %Q, %Q, %Q\n", x[11], x[12], x[13]);
    8467        printf("       %Q, %Q, %Q\n", x[14], x[15], x[16]);
    85 //      messy_stack_trace(&x[5]);
    8668}
    8769
     
    9476void (* eoi_function)(void) = NULL;
    9577
    96 void null_interrupt(int n, struct interrupt_context *ctx)
     78void null_interrupt(int n, istate_t *istate)
    9779{
    9880        printf("-----EXCEPTION(%d) OCCURED----- ( %s )\n",n,__FUNCTION__); \
    99         printf("stack: %X, %X, %X, %X\n", ctx->stack[0], ctx->stack[1],
    100                ctx->stack[2], ctx->stack[3]);
     81        printf("stack: %X, %X, %X, %X\n", istate->stack[0], istate->stack[1],
     82               istate->stack[2], istate->stack[3]);
    10183        panic("unserviced interrupt\n");
    10284}
    10385
    104 void gp_fault(int n, void *stack)
     86void gp_fault(int n, istate_t *istate)
    10587{
    106         print_info_errcode(n,stack);
     88        print_info_errcode(n, istate);
    10789        panic("general protection fault\n");
    10890}
    10991
    110 void ss_fault(int n, void *stack)
     92void ss_fault(int n, istate_t *istate)
    11193{
    112         print_info_errcode(n,stack);
     94        print_info_errcode(n, istate);
    11395        panic("stack fault\n");
    11496}
    11597
    11698
    117 void nm_fault(int n, void *stack)
     99void nm_fault(int n, istate_t *istate)
    118100{
    119101#ifdef CONFIG_FPU_LAZY     
     
    124106}
    125107
    126 void page_fault(int n, struct interrupt_context *ctx)
     108void page_fault(int n, istate_t *istate)
    127109{
    128110        __address page;
     
    130112        page = read_cr2();
    131113        if (!as_page_fault(page)) {
    132                 print_info_errcode(n,ctx);
     114                print_info_errcode(n, istate);
    133115                printf("Page fault address: %Q\n", page);
    134116                panic("page fault\n");
     
    136118}
    137119
    138 void tlb_shootdown_ipi(int n, void *stack)
     120void tlb_shootdown_ipi(int n, istate_t *istate)
    139121{
    140122        trap_virtual_eoi();
  • arch/ia32/include/interrupt.h

    r45d6add r25d7709  
    6161#define VECTOR_TLB_SHOOTDOWN_IPI        (IVT_FREEBASE+1)
    6262
     63struct istate {
     64        __u32 edi;
     65        __u32 esi;
     66        __u32 ebp;
     67        __u32 esp;
     68        __u32 ebx;
     69        __u32 edx;
     70        __u32 ecx;
     71        __u32 eax;
     72        __u32 error_word;
     73        __u32 eip;
     74        __u32 cs;
     75        __u32 eflags;
     76        __u32 stack[];
     77};
     78
    6379extern void (* disable_irqs_function)(__u16 irqmask);
    6480extern void (* enable_irqs_function)(__u16 irqmask);
    6581extern void (* eoi_function)(void);
    6682
    67 extern void null_interrupt(int n, void *stack);
    68 extern void gp_fault(int n, void *stack);
    69 extern void nm_fault(int n, void *stack);
    70 extern void ss_fault(int n, void *stack);
    71 extern void page_fault(int n, void *stack);
    72 extern void syscall(int n, void *stack);
    73 extern void tlb_shootdown_ipi(int n, void *stack);
     83extern void null_interrupt(int n, istate_t *istate);
     84extern void gp_fault(int n, istate_t *istate);
     85extern void nm_fault(int n, istate_t *istate);
     86extern void ss_fault(int n, istate_t *istate);
     87extern void page_fault(int n, istate_t *istate);
     88extern void syscall(int n, istate_t *istate);
     89extern void tlb_shootdown_ipi(int n, istate_t *istate);
    7490
    7591extern void trap_virtual_enable_irqs(__u16 irqmask);
  • arch/ia32/include/types.h

    r45d6add r25d7709  
    4848
    4949typedef __u32 __native;
    50 typedef __s32 __native;
     50typedef __s32 __snative;
    5151
    5252typedef struct page_specifier pte_t;
  • arch/ia32/src/asm.S

    r45d6add r25d7709  
    7979#
    8080.macro handler i n
    81         push %ebp
    82         movl %esp,%ebp
     81        push %eax
     82
     83        # Test if this is interrupt with error word or not
     84        movl $(1<<\i), %eax
     85        andl $ERROR_WORD_INTERRUPT_LIST,%eax
     86
     87        /*
     88         * If this interrupt/exception  stores error word,
     89         * we need to pop EAX.
     90         * If this interrupt doesn't store error word, we emulate it
     91         * for the sake of consistent pstate structure. In that case
     92         * we merely leave the EAX on the stack.
     93         */
     94        jz 0f
     95
     96        /*
     97         * This exception stores error word.
     98         */
     99        pop %eax
     100        jmp 1f
     101
     1020:
     103        /*
     104         * This interrupt doesn't store error word.
     105         * Just restore EAX without doing POP.
     106         */
     107        movl (%esp), %eax
     108
     1091:
    83110        pusha
    84 
     111        movl %esp, %ebp
    85112        push %ds
    86113        push %es
     
    93120        movl $(\i),%edi
    94121        pushl %ebp
    95         addl $4,(%esp)
    96122        pushl %edi
    97123        call exc_dispatch
     
    101127        pop %ds
    102128
    103 
    104 # CLNT
     129# Clear Nested Task flag.
    105130        pushfl
    106131        pop %eax
     
    109134        popfl
    110135       
    111 
    112 
    113 # Test if this is interrupt with error word or not
    114         mov $\i,%cl
    115         movl $1,%eax
    116         test $0xe0,%cl
    117         jnz 0f
    118         and $0x1f,%cl
    119         shl %cl,%eax
    120         and $ERROR_WORD_INTERRUPT_LIST,%eax
    121         jz 0f
    122 
    123 
    124 # Return with error word
    125136        popa
    126         pop %ebp
    127         add $4,%esp     # Skip error word
    128         iret
    129 
    130 0:
    131 # Return with no error word
    132         popa
    133         pop %ebp
     137        add $4,%esp     # Skip error word, whether real or fake.
    134138        iret
    135139
  • arch/ia32/src/drivers/i8254.c

    r45d6add r25d7709  
    5454#define MAGIC_NUMBER    1194
    5555
    56 static void i8254_interrupt(int n, void *stack);
     56static void i8254_interrupt(int n, istate_t *istate);
    5757
    5858void i8254_init(void)
     
    6868        outb(CLK_PORT1, (CLK_CONST/HZ) >> 8);
    6969        pic_enable_irqs(1<<IRQ_CLK);
    70         exc_register(VECTOR_CLK, "i8254_clock", i8254_interrupt);
     70        exc_register(VECTOR_CLK, "i8254_clock", (iroutine) i8254_interrupt);
    7171}
    7272
     
    126126}
    127127
    128 void i8254_interrupt(int n, void *stack)
     128void i8254_interrupt(int n, istate_t *istate)
    129129{
    130130        trap_virtual_eoi();
  • arch/ia32/src/drivers/i8259.c

    r45d6add r25d7709  
    4040 */
    4141
    42 static void pic_spurious(int n, void *stack);
     42static void pic_spurious(int n, istate_t *istate);
    4343
    4444void i8259_init(void)
     
    7171         * Register interrupt handler for the PIC spurious interrupt.
    7272         */
    73         exc_register(VECTOR_PIC_SPUR, "pic_spurious", pic_spurious);   
     73        exc_register(VECTOR_PIC_SPUR, "pic_spurious", (iroutine) pic_spurious);
    7474
    7575        /*
     
    119119}
    120120
    121 void pic_spurious(int n, void *stack)
     121void pic_spurious(int n, istate_t *istate)
    122122{
    123123        printf("cpu%d: PIC spurious interrupt\n", CPU->id);
  • arch/ia32/src/ia32.c

    r45d6add r25d7709  
    6161                i8254_init();   /* hard clock */
    6262               
    63                 exc_register(VECTOR_SYSCALL, "syscall", syscall);
     63                exc_register(VECTOR_SYSCALL, "syscall", (iroutine) syscall);
    6464               
    6565                #ifdef CONFIG_SMP
    6666                exc_register(VECTOR_TLB_SHOOTDOWN_IPI, "tlb_shootdown",
    67                              tlb_shootdown_ipi);
     67                             (iroutine) tlb_shootdown_ipi);
    6868                #endif /* CONFIG_SMP */
    6969        }
  • arch/ia32/src/interrupt.c

    r45d6add r25d7709  
    5050void (* eoi_function)(void) = NULL;
    5151
    52 #define PRINT_INFO_ERRCODE(st) { \
    53         __native *x = (__native *) st; \
    54         char *symbol = get_symtab_entry(x[1]); \
     52#define PRINT_INFO_ERRCODE(istate) do { \
     53        char *symbol = get_symtab_entry(istate->eip); \
    5554        if (!symbol) \
    5655                symbol = ""; \
    5756        printf("----------------EXCEPTION OCCURED----------------\n"); \
    58         printf("%%eip: %X (%s)\n",x[1],symbol); \
    59         printf("ERROR_WORD=%X\n", x[0]); \
    60         printf("%%cs=%X,flags=%X\n", x[2], x[3]); \
     57        printf("%%eip: %X (%s)\n",istate->eip,symbol); \
     58        printf("ERROR_WORD=%X\n", istate->error_word); \
     59        printf("%%cs=%X,flags=%X\n", istate->cs, istate->eflags); \
    6160        printf("%%eax=%X, %%ebx=%X, %%ecx=%X, %%edx=%X\n",\
    62                x[-2],x[-5],x[-3],x[-4]); \
     61               istate->eax,istate->ebx,istate->ecx,istate->edx); \
    6362        printf("%%esi=%X, %%edi=%X, %%ebp=%X, %%esp=%X\n",\
    64                x[-8],x[-9],x[-1],x); \
    65         printf("stack: %X, %X, %X, %X\n", x[4], x[5], x[6], x[7]); \
    66         printf("       %X, %X, %X, %X\n", x[8], x[9], x[10], x[11]); \
    67         }
     63               istate->esi,istate->edi,istate->ebp,istate->esp); \
     64        printf("stack: %X, %X, %X, %X\n", istate->stack[0], istate->stack[1], istate->stack[2], istate->stack[3]); \
     65        printf("       %X, %X, %X, %X\n", istate->stack[4], istate->stack[5], istate->stack[6], istate->stack[7]); \
     66} while(0)
    6867
    69 void null_interrupt(int n, void *st)
     68void null_interrupt(int n, istate_t *istate)
    7069{
    71         __native *stack = (__native *) st;
    72 
    73         printf("int %d: null_interrupt\n", n);
    74         printf("stack: %L, %L, %L, %L\n", stack[0], stack[1], stack[2], stack[3]);
    75         panic("unserviced interrupt\n");
     70        PRINT_INFO_ERRCODE(istate);
     71        panic("unserviced interrupt: %d\n", n);
    7672}
    7773
    78 void gp_fault(int n, void *stack)
     74void gp_fault(int n, istate_t *istate)
    7975{
    80         PRINT_INFO_ERRCODE(stack);
     76        PRINT_INFO_ERRCODE(istate);
    8177        panic("general protection fault\n");
    8278}
    8379
    84 void ss_fault(int n, void *stack)
     80void ss_fault(int n, istate_t *istate)
    8581{
    86         PRINT_INFO_ERRCODE(stack);
     82        PRINT_INFO_ERRCODE(istate);
    8783        panic("stack fault\n");
    8884}
    8985
    90 
    91 void nm_fault(int n, void *stack)
     86void nm_fault(int n, istate_t *istate)
    9287{
    9388#ifdef CONFIG_FPU_LAZY     
     
    9893}
    9994
    100 
    101 
    102 void page_fault(int n, void *stack)
     95void page_fault(int n, istate_t *istate)
    10396{
    10497        __address page;
     
    10699        page = read_cr2();
    107100        if (!as_page_fault(page)) {
    108                 PRINT_INFO_ERRCODE(stack);
     101                PRINT_INFO_ERRCODE(istate);
    109102                printf("page fault address: %X\n", page);
    110103                panic("page fault\n");
     
    112105}
    113106
    114 void syscall(int n, void *st)
     107void syscall(int n, istate_t *istate)
    115108{
    116         __native *stack = (__native *) st;
    117 
    118109        interrupts_enable();
    119         if (stack[-2] < SYSCALL_END)
    120                 stack[-2] = syscall_table[stack[-2]](stack[-5], stack[-3], stack[-4]);
     110        if (istate->edx < SYSCALL_END)
     111                istate->eax = syscall_table[istate->edx](istate->eax, istate->ebx, istate->ecx);
    121112        else
    122                 panic("Undefined syscall %d", stack[-2]);
     113                panic("Undefined syscall %d", istate->edx);
    123114        interrupts_disable();
    124115}
    125116
    126 void tlb_shootdown_ipi(int n, void *stack)
     117void tlb_shootdown_ipi(int n, istate_t *istate)
    127118{
    128119        trap_virtual_eoi();
  • arch/ia32/src/mm/page.c

    r45d6add r25d7709  
    6161                }
    6262
    63                 exc_register(14, "page_fault", page_fault);
     63                exc_register(14, "page_fault", (iroutine) page_fault);
    6464                write_cr3((__address) AS_KERNEL->page_table);
    6565        }
  • arch/ia32/src/pm.c

    r45d6add r25d7709  
    126126               
    127127                idt_setoffset(d, ((__address) interrupt_handlers) + i*interrupt_handler_size);
    128                 exc_register(i, "undef", null_interrupt);
     128                exc_register(i, "undef", (iroutine) null_interrupt);
    129129        }
    130         exc_register(13, "gp_fault", gp_fault);
    131         exc_register( 7, "nm_fault", nm_fault);
    132         exc_register(12, "ss_fault", ss_fault);
     130        exc_register(13, "gp_fault", (iroutine) gp_fault);
     131        exc_register( 7, "nm_fault", (iroutine) nm_fault);
     132        exc_register(12, "ss_fault", (iroutine) ss_fault);
    133133}
    134134
  • arch/ia32/src/smp/apic.c

    r45d6add r25d7709  
    113113
    114114
    115 static void apic_spurious(int n, void *stack);
    116 static void l_apic_timer_interrupt(int n, void *stack);
     115static void apic_spurious(int n, istate_t *istate);
     116static void l_apic_timer_interrupt(int n, istate_t *istate);
    117117
    118118/** Initialize APIC on BSP. */
     
    122122        int i;
    123123
    124         exc_register(VECTOR_APIC_SPUR, "apic_spurious", apic_spurious);
     124        exc_register(VECTOR_APIC_SPUR, "apic_spurious", (iroutine) apic_spurious);
    125125
    126126        enable_irqs_function = io_apic_enable_irqs;
     
    134134         */
    135135        io_apic_disable_irqs(0xffff);
    136         exc_register(VECTOR_CLK, "l_apic_timer", l_apic_timer_interrupt);
     136        exc_register(VECTOR_CLK, "l_apic_timer", (iroutine) l_apic_timer_interrupt);
    137137        for (i = 0; i < IRQ_COUNT; i++) {
    138138                int pin;
     
    170170 * @param stack Interrupted stack.
    171171 */
    172 void apic_spurious(int n, void *stack)
     172void apic_spurious(int n, istate_t *istate)
    173173{
    174174        printf("cpu%d: APIC spurious interrupt\n", CPU->id);
     
    428428 * @param stack Interrupted stack.
    429429 */
    430 void l_apic_timer_interrupt(int n, void *stack)
     430void l_apic_timer_interrupt(int n, istate_t *istate)
    431431{
    432432        l_apic_eoi();
  • arch/ia64/include/interrupt.h

    r45d6add r25d7709  
    3030#define __ia64_INTERRUPT_H__
    3131
     32#include <typedefs.h>
    3233#include <arch/types.h>
    3334#include <arch/register.h>
     
    4748#define EOI     0               /**< The actual value doesn't matter. */
    4849
    49 struct exception_regdump {
     50struct istate {
    5051        __address ar_bsp;
    5152        __address ar_bspstore;
     
    7475extern void *ivt;
    7576
    76 extern void general_exception(__u64 vector, struct exception_regdump *pstate);
    77 extern int break_instruction(__u64 vector, struct exception_regdump *pstate);
    78 extern void universal_handler(__u64 vector, struct exception_regdump *pstate);
    79 extern void external_interrupt(__u64 vector, struct exception_regdump *pstate);
     77extern void general_exception(__u64 vector, istate_t *istate);
     78extern int break_instruction(__u64 vector, istate_t *istate);
     79extern void universal_handler(__u64 vector, istate_t *istate);
     80extern void external_interrupt(__u64 vector, istate_t *istate);
    8081
    8182#endif
  • arch/ia64/include/mm/tlb.h

    r45d6add r25d7709  
    8383extern void itc_pte_copy(pte_t *t);
    8484
    85 extern void alternate_instruction_tlb_fault(__u64 vector, struct exception_regdump *pstate);
    86 extern void alternate_data_tlb_fault(__u64 vector, struct exception_regdump *pstate);
    87 extern void data_nested_tlb_fault(__u64 vector, struct exception_regdump *pstate);
    88 extern void data_dirty_bit_fault(__u64 vector, struct exception_regdump *pstate);
    89 extern void instruction_access_bit_fault(__u64 vector, struct exception_regdump *pstate);
    90 extern void data_access_bit_fault(__u64 vector, struct exception_regdump *pstate);
    91 extern void page_not_present(__u64 vector, struct exception_regdump *pstate);
     85extern void alternate_instruction_tlb_fault(__u64 vector, istate_t *istate);
     86extern void alternate_data_tlb_fault(__u64 vector, istate_t *istate);
     87extern void data_nested_tlb_fault(__u64 vector, istate_t *istate);
     88extern void data_dirty_bit_fault(__u64 vector, istate_t *istate);
     89extern void instruction_access_bit_fault(__u64 vector, istate_t *istate);
     90extern void data_access_bit_fault(__u64 vector, istate_t *istate);
     91extern void page_not_present(__u64 vector, istate_t *istate);
    9292
    9393#endif
  • arch/ia64/include/types.h

    r45d6add r25d7709  
    1 
     1/*
    22 * Copyright (C) 2005 Jakub Jermar
    33 * All rights reserved.
     
    4848
    4949typedef __u64 __native;
    50 typedef __s64 __native;
     50typedef __s64 __snative;
    5151
    5252typedef struct pte pte_t;
  • arch/ia64/src/interrupt.c

    r45d6add r25d7709  
    109109
    110110static char *vector_to_string(__u16 vector);
    111 static void dump_interrupted_context(struct exception_regdump *pstate);
     111static void dump_interrupted_context(istate_t *istate);
    112112
    113113char *vector_to_string(__u16 vector)
     
    121121}
    122122
    123 void dump_interrupted_context(struct exception_regdump *pstate)
     123void dump_interrupted_context(istate_t *istate)
    124124{
    125125        char *ifa, *iipa, *iip;
    126126
    127         ifa = get_symtab_entry(pstate->cr_ifa);
    128         iipa = get_symtab_entry(pstate->cr_iipa);
    129         iip = get_symtab_entry(pstate->cr_iip);
     127        ifa = get_symtab_entry(istate->cr_ifa);
     128        iipa = get_symtab_entry(istate->cr_iipa);
     129        iip = get_symtab_entry(istate->cr_iip);
    130130
    131131        putchar('\n');
    132132        printf("Interrupted context dump:\n");
    133         printf("ar.bsp=%P\tar.bspstore=%P\n", pstate->ar_bsp, pstate->ar_bspstore);
    134         printf("ar.rnat=%Q\tar.rsc=%Q\n", pstate->ar_rnat, pstate->ar_rsc);
    135         printf("ar.ifs=%Q\tar.pfs=%Q\n", pstate->ar_ifs, pstate->ar_pfs);
    136         printf("cr.isr=%Q\tcr.ipsr=%Q\t\n", pstate->cr_isr.value, pstate->cr_ipsr);
     133        printf("ar.bsp=%P\tar.bspstore=%P\n", istate->ar_bsp, istate->ar_bspstore);
     134        printf("ar.rnat=%Q\tar.rsc=%Q\n", istate->ar_rnat, istate->ar_rsc);
     135        printf("ar.ifs=%Q\tar.pfs=%Q\n", istate->ar_ifs, istate->ar_pfs);
     136        printf("cr.isr=%Q\tcr.ipsr=%Q\t\n", istate->cr_isr.value, istate->cr_ipsr);
    137137       
    138         printf("cr.iip=%Q, #%d\t(%s)\n", pstate->cr_iip, pstate->cr_isr.ei ,iip ? iip : "?");
    139         printf("cr.iipa=%Q\t(%s)\n", pstate->cr_iipa, iipa ? iipa : "?");
    140         printf("cr.ifa=%Q\t(%s)\n", pstate->cr_ifa, ifa ? ifa : "?");
    141 }
    142 
    143 void general_exception(__u64 vector, struct exception_regdump *pstate)
     138        printf("cr.iip=%Q, #%d\t(%s)\n", istate->cr_iip, istate->cr_isr.ei ,iip ? iip : "?");
     139        printf("cr.iipa=%Q\t(%s)\n", istate->cr_iipa, iipa ? iipa : "?");
     140        printf("cr.ifa=%Q\t(%s)\n", istate->cr_ifa, ifa ? ifa : "?");
     141}
     142
     143void general_exception(__u64 vector, istate_t *istate)
    144144{
    145145        char *desc = "";
    146146
    147         dump_interrupted_context(pstate);
    148 
    149         switch (pstate->cr_isr.ge_code) {
     147        dump_interrupted_context(istate);
     148
     149        switch (istate->cr_isr.ge_code) {
    150150            case GE_ILLEGALOP:
    151151                desc = "Illegal Operation fault";
     
    175175
    176176/** Handle syscall. */
    177 int break_instruction(__u64 vector, struct exception_regdump *pstate)
     177int break_instruction(__u64 vector, istate_t *istate)
    178178{
    179179        /*
    180180         * Move to next instruction after BREAK.
    181181         */
    182         if (pstate->cr_ipsr.ri == 2) {
    183                 pstate->cr_ipsr.ri = 0;
    184                 pstate->cr_iip += 16;
     182        if (istate->cr_ipsr.ri == 2) {
     183                istate->cr_ipsr.ri = 0;
     184                istate->cr_iip += 16;
    185185        } else {
    186                 pstate->cr_ipsr.ri++;
     186                istate->cr_ipsr.ri++;
    187187        }
    188188
    189         if (pstate->in0 < SYSCALL_END)
    190                 return syscall_table[pstate->in0](pstate->in1, pstate->in2, pstate->in3);
     189        if (istate->in3 < SYSCALL_END)
     190                return syscall_table[istate->in3](istate->in0, istate->in1, istate->in2);
    191191        else
    192                 panic("Undefined syscall %d", pstate->in0);
     192                panic("Undefined syscall %d", istate->in3);
    193193               
    194194        return -1;
    195195}
    196196
    197 void universal_handler(__u64 vector, struct exception_regdump *pstate)
    198 {
    199         dump_interrupted_context(pstate);
     197void universal_handler(__u64 vector, istate_t *istate)
     198{
     199        dump_interrupted_context(istate);
    200200        panic("Interruption: %W (%s)\n", (__u16) vector, vector_to_string(vector));
    201201}
    202202
    203 void external_interrupt(__u64 vector, struct exception_regdump *pstate)
     203void external_interrupt(__u64 vector, istate_t *istate)
    204204{
    205205        cr_ivr_t ivr;
  • arch/ia64/src/mm/tlb.c

    r45d6add r25d7709  
    443443 *
    444444 * @param vector Interruption vector.
    445  * @param pstate Structure with saved interruption state.
    446  */
    447 void alternate_instruction_tlb_fault(__u64 vector, struct exception_regdump *pstate)
     445 * @param istate Structure with saved interruption state.
     446 */
     447void alternate_instruction_tlb_fault(__u64 vector, istate_t *istate)
    448448{
    449449        region_register rr;
     
    451451        pte_t *t;
    452452       
    453         va = pstate->cr_ifa;    /* faulting address */
     453        va = istate->cr_ifa;    /* faulting address */
    454454        t = page_mapping_find(AS, va);
    455455        if (t) {
     
    464464                 */
    465465                if (!as_page_fault(va)) {
    466                         panic("%s: va=%P, rid=%d\n", __FUNCTION__, pstate->cr_ifa, rr.map.rid);
     466                        panic("%s: va=%P, rid=%d\n", __FUNCTION__, istate->cr_ifa, rr.map.rid);
    467467                }
    468468        }
     
    472472 *
    473473 * @param vector Interruption vector.
    474  * @param pstate Structure with saved interruption state.
    475  */
    476 void alternate_data_tlb_fault(__u64 vector, struct exception_regdump *pstate)
     474 * @param istate Structure with saved interruption state.
     475 */
     476void alternate_data_tlb_fault(__u64 vector, istate_t *istate)
    477477{
    478478        region_register rr;
     
    481481        pte_t *t;
    482482       
    483         va = pstate->cr_ifa;    /* faulting address */
     483        va = istate->cr_ifa;    /* faulting address */
    484484        rr.word = rr_read(VA2VRN(va));
    485485        rid = rr.map.rid;
     
    507507                 */
    508508                if (!as_page_fault(va)) {
    509                         panic("%s: va=%P, rid=%d\n", __FUNCTION__, pstate->cr_ifa, rr.map.rid);
     509                        panic("%s: va=%P, rid=%d\n", __FUNCTION__, istate->cr_ifa, rr.map.rid);
    510510                }
    511511        }
     
    517517 *
    518518 * @param vector Interruption vector.
    519  * @param pstate Structure with saved interruption state.
    520  */
    521 void data_nested_tlb_fault(__u64 vector, struct exception_regdump *pstate)
     519 * @param istate Structure with saved interruption state.
     520 */
     521void data_nested_tlb_fault(__u64 vector, istate_t *istate)
    522522{
    523523        panic("%s\n", __FUNCTION__);
     
    527527 *
    528528 * @param vector Interruption vector.
    529  * @param pstate Structure with saved interruption state.
    530  */
    531 void data_dirty_bit_fault(__u64 vector, struct exception_regdump *pstate)
     529 * @param istate Structure with saved interruption state.
     530 */
     531void data_dirty_bit_fault(__u64 vector, istate_t *istate)
    532532{
    533533        pte_t *t;
    534534
    535         t = page_mapping_find(AS, pstate->cr_ifa);
     535        t = page_mapping_find(AS, istate->cr_ifa);
    536536        ASSERT(t && t->p);
    537537        if (t && t->p) {
     
    548548 *
    549549 * @param vector Interruption vector.
    550  * @param pstate Structure with saved interruption state.
    551  */
    552 void instruction_access_bit_fault(__u64 vector, struct exception_regdump *pstate)
     550 * @param istate Structure with saved interruption state.
     551 */
     552void instruction_access_bit_fault(__u64 vector, istate_t *istate)
    553553{
    554554        pte_t *t;
    555555
    556         t = page_mapping_find(AS, pstate->cr_ifa);
     556        t = page_mapping_find(AS, istate->cr_ifa);
    557557        ASSERT(t && t->p);
    558558        if (t && t->p) {
     
    569569 *
    570570 * @param vector Interruption vector.
    571  * @param pstate Structure with saved interruption state.
    572  */
    573 void data_access_bit_fault(__u64 vector, struct exception_regdump *pstate)
     571 * @param istate Structure with saved interruption state.
     572 */
     573void data_access_bit_fault(__u64 vector, istate_t *istate)
    574574{
    575575        pte_t *t;
    576576
    577         t = page_mapping_find(AS, pstate->cr_ifa);
     577        t = page_mapping_find(AS, istate->cr_ifa);
    578578        ASSERT(t && t->p);
    579579        if (t && t->p) {
     
    590590 *
    591591 * @param vector Interruption vector.
    592  * @param pstate Structure with saved interruption state.
    593  */
    594 void page_not_present(__u64 vector, struct exception_regdump *pstate)
     592 * @param istate Structure with saved interruption state.
     593 */
     594void page_not_present(__u64 vector, istate_t *istate)
    595595{
    596596        region_register rr;
     
    598598        pte_t *t;
    599599       
    600         va = pstate->cr_ifa;    /* faulting address */
     600        va = istate->cr_ifa;    /* faulting address */
    601601        t = page_mapping_find(AS, va);
    602602        ASSERT(t);
     
    613613        } else {
    614614                if (!as_page_fault(va)) {
    615                         panic("%s: va=%P, rid=%d\n", __FUNCTION__, pstate->cr_ifa, rr.map.rid);
    616                 }
    617         }
    618 }
     615                        panic("%s: va=%P, rid=%d\n", __FUNCTION__, istate->cr_ifa, rr.map.rid);
     616                }
     617        }
     618}
  • arch/mips32/include/debugger.h

    r45d6add r25d7709  
    5050        int flags;        /**< Flags regarding breakpoint */
    5151        count_t counter;
    52         void (*bkfunc)(void *b, struct exception_regdump *pstate);
     52        void (*bkfunc)(void *b, istate_t *istate);
    5353} bpinfo_t;
    5454
    5555extern void debugger_init(void);
    56 void debugger_bpoint(struct exception_regdump *pstate);
     56void debugger_bpoint(istate_t *istate);
    5757
    5858extern bpinfo_t breakpoints[BKPOINTS_MAX];
  • arch/mips32/include/exception.h

    r45d6add r25d7709  
    3434#endif
    3535
     36#include <typedefs.h>
     37
    3638#define EXC_Int         0
    3739#define EXC_Mod         1
     
    5355#define EXC_VCED        31
    5456
    55 struct exception_regdump {
     57struct istate {
    5658        __u32 at;
    5759        __u32 v0;
     
    9193};
    9294
    93 extern void exception(struct exception_regdump *pstate);
     95extern void exception(istate_t *istate);
    9496extern void tlb_refill_entry(void);
    9597extern void exception_entry(void);
  • arch/mips32/include/mm/tlb.h

    r45d6add r25d7709  
    170170#define tlb_invalidate(asid)    tlb_invalidate_asid(asid)
    171171
    172 extern void tlb_invalid(struct exception_regdump *pstate);
    173 extern void tlb_refill(struct exception_regdump *pstate);
    174 extern void tlb_modified(struct exception_regdump *pstate);
     172extern void tlb_invalid(istate_t *istate);
     173extern void tlb_refill(istate_t *istate);
     174extern void tlb_modified(istate_t *istate);
    175175
    176176#endif
  • arch/mips32/include/thread.h

    r45d6add r25d7709  
    3232#include <arch/exception.h>
    3333
    34 #define ARCH_THREAD_DATA   struct exception_regdump *pstate
     34#define ARCH_THREAD_DATA   istate_t *istate
    3535
    3636#endif
  • arch/mips32/src/debugger.c

    r45d6add r25d7709  
    180180        } else { /* We are add extended */
    181181                cur->flags = BKPOINT_FUNCCALL;
    182                 cur->bkfunc =   (void (*)(void *, struct exception_regdump *)) argv[1].intval;
     182                cur->bkfunc =   (void (*)(void *, istate_t *)) argv[1].intval;
    183183        }
    184184        if (is_jump(cur->instruction))
     
    290290 * next instruction.
    291291 */
    292 void debugger_bpoint(struct exception_regdump *pstate)
     292void debugger_bpoint(istate_t *istate)
    293293{
    294294        bpinfo_t *cur = NULL;
    295         __address fireaddr = pstate->epc;
     295        __address fireaddr = istate->epc;
    296296        int i;
    297297
     
    330330                if (!(cur->flags & BKPOINT_FUNCCALL))
    331331                        printf("***Breakpoint %d: 0x%p in %s.\n", i,
    332                                fireaddr, get_symtab_entry(pstate->epc));
     332                               fireaddr, get_symtab_entry(istate->epc));
    333333
    334334                /* Return first instruction back */
     
    345345                       get_symtab_entry(fireaddr));
    346346                /* Move on to next instruction */
    347                 pstate->epc += 4;
     347                istate->epc += 4;
    348348        }
    349349        if (cur)
     
    352352                /* Allow zero bkfunc, just for counting */
    353353                if (cur->bkfunc)
    354                         cur->bkfunc(cur, pstate);
     354                        cur->bkfunc(cur, istate);
    355355        } else {
    356356                printf("***Type 'exit' to exit kconsole.\n");
  • arch/mips32/src/drivers/arc.c

    r45d6add r25d7709  
    350350iroutine old_timer;
    351351/** Do polling on timer interrupt */
    352 static void timer_replace(int n, void *stack)
     352static void timer_replace(int n, istate_t *istate)
    353353{
    354354        arc_keyboard_poll();
    355         old_timer(n, stack);
     355        old_timer(n, istate);
    356356        arc_keyboard_poll();
    357357}
  • arch/mips32/src/drivers/msim.c

    r45d6add r25d7709  
    8484
    8585/** Process keyboard interrupt. */
    86 static void msim_interrupt(int n, void *stack)
     86static void msim_interrupt(int n, istate_t *istate)
    8787{
    8888        char ch = 0;
  • arch/mips32/src/drivers/serial.c

    r45d6add r25d7709  
    113113iroutine old_timer;
    114114/** Do polling on timer interrupt */
    115 static void timer_replace(int n, void *stack)
     115static void timer_replace(int n, istate_t *istate)
    116116{
    117         old_timer(n, stack);
    118         serial_interrupt(n, stack);
     117        old_timer(n, istate);
     118        serial_interrupt(n, istate);
    119119}
    120120
  • arch/mips32/src/exception.c

    r45d6add r25d7709  
    6363};
    6464
    65 static void print_regdump(struct exception_regdump *pstate)
     65static void print_regdump(istate_t *istate)
    6666{
    6767        char *pcsymbol = "";
    6868        char *rasymbol = "";
    6969
    70         char *s = get_symtab_entry(pstate->epc);
     70        char *s = get_symtab_entry(istate->epc);
    7171        if (s)
    7272                pcsymbol = s;
    73         s = get_symtab_entry(pstate->ra);
     73        s = get_symtab_entry(istate->ra);
    7474        if (s)
    7575                rasymbol = s;
    7676       
    77         printf("PC: %X(%s) RA: %X(%s), SP(%P)\n",pstate->epc,pcsymbol,
    78                pstate->ra,rasymbol, pstate->sp);
    79 }
    80 
    81 static void unhandled_exception(int n, struct exception_regdump *pstate)
    82 {
    83         print_regdump(pstate);
     77        printf("PC: %X(%s) RA: %X(%s), SP(%P)\n",istate->epc,pcsymbol,
     78               istate->ra,rasymbol, istate->sp);
     79}
     80
     81static void unhandled_exception(int n, istate_t *istate)
     82{
     83        print_regdump(istate);
    8484        panic("unhandled exception %s\n", exctable[n]);
    8585}
    8686
    87 static void breakpoint_exception(int n, struct exception_regdump *pstate)
     87static void breakpoint_exception(int n, istate_t *istate)
    8888{
    8989#ifdef CONFIG_DEBUG
    90         debugger_bpoint(pstate);
     90        debugger_bpoint(istate);
    9191#else
    9292        /* it is necessary to not re-execute BREAK instruction after
    9393           returning from Exception handler
    9494           (see page 138 in R4000 Manual for more information) */
    95         pstate->epc += 4;
     95        istate->epc += 4;
    9696#endif
    9797}
    9898
    99 static void tlbmod_exception(int n, struct exception_regdump *pstate)
    100 {
    101         tlb_modified(pstate);
    102 }
    103 
    104 static void tlbinv_exception(int n, struct exception_regdump *pstate)
    105 {
    106         tlb_invalid(pstate);
     99static void tlbmod_exception(int n, istate_t *istate)
     100{
     101        tlb_modified(istate);
     102}
     103
     104static void tlbinv_exception(int n, istate_t *istate)
     105{
     106        tlb_invalid(istate);
    107107}
    108108
    109109#ifdef CONFIG_FPU_LAZY
    110 static void cpuns_exception(int n, struct exception_regdump *pstate)
     110static void cpuns_exception(int n, istate_t *istate)
    111111{
    112112        if (cp0_cause_coperr(cp0_cause_read()) == fpu_cop_id)
     
    117117#endif
    118118
    119 static void interrupt_exception(int n, struct exception_regdump *pstate)
     119static void interrupt_exception(int n, istate_t *istate)
    120120{
    121121        __u32 cause;
     
    127127        for (i = 0; i < 8; i++)
    128128                if (cause & (1 << i))
    129                         exc_dispatch(i+INT_OFFSET, pstate);
     129                        exc_dispatch(i+INT_OFFSET, istate);
    130130}
    131131
    132132#include <debug.h>
    133133/** Handle syscall userspace call */
    134 static void syscall_exception(int n, struct exception_regdump *pstate)
     134static void syscall_exception(int n, istate_t *istate)
    135135{
    136136        interrupts_enable();
    137         if (pstate->a3 < SYSCALL_END)
    138                 pstate->v0 = syscall_table[pstate->a3](pstate->a0,
    139                                                        pstate->a1,
    140                                                        pstate->a2);
     137        if (istate->a3 < SYSCALL_END)
     138                istate->v0 = syscall_table[istate->a3](istate->a0,
     139                                                       istate->a1,
     140                                                       istate->a2);
    141141        else
    142                 panic("Undefined syscall %d", pstate->a3);
     142                panic("Undefined syscall %d", istate->a3);
     143        istate->epc += 4;
    143144        interrupts_disable();
    144         pstate->epc += 4;
    145 }
    146 
    147 
    148 void exception(struct exception_regdump *pstate)
     145}
     146
     147void exception(istate_t *istate)
    149148{
    150149        int cause;
     
    164163                                                cp0_status_um_bit));
    165164
    166         /* Save pstate so that the threads can access it */
    167         /* If THREAD->pstate is set, this is nested exception,
     165        /* Save istate so that the threads can access it */
     166        /* If THREAD->istate is set, this is nested exception,
    168167         * do not rewrite it
    169168         */
    170         if (THREAD && !THREAD->pstate)
    171                 THREAD->pstate = pstate;
     169        if (THREAD && !THREAD->istate)
     170                THREAD->istate = istate;
    172171
    173172        cause = cp0_cause_read();
    174173        excno = cp0_cause_excno(cause);
    175174        /* Dispatch exception */
    176         exc_dispatch(excno, pstate);
     175        exc_dispatch(excno, istate);
    177176
    178177        /* Set to NULL, so that we can still support nested
     
    180179         * TODO: We should probably set EXL bit before this command,
    181180         * nesting. On the other hand, if some exception occurs between
    182          * here and ERET, it won't set anything on the pstate anyway.
     181         * here and ERET, it won't set anything on the istate anyway.
    183182         */
    184183        if (THREAD)
    185                 THREAD->pstate = NULL;
     184                THREAD->istate = NULL;
    186185}
    187186
  • arch/mips32/src/fpu_context.c

    r45d6add r25d7709  
    3737#ifdef ARCH_HAS_FPU
    3838        cp0_status_write(cp0_status_read() & ~cp0_status_fpu_bit);
    39         if (THREAD && THREAD->pstate)
    40                 THREAD->pstate->status &= ~cp0_status_fpu_bit;
     39        if (THREAD && THREAD->istate)
     40                THREAD->istate->status &= ~cp0_status_fpu_bit;
    4141#endif
    4242}
     
    4646#ifdef ARCH_HAS_FPU
    4747        cp0_status_write(cp0_status_read() | cp0_status_fpu_bit);
    48         if (THREAD && THREAD->pstate)
    49                 THREAD->pstate->status |= cp0_status_fpu_bit;
     48        if (THREAD && THREAD->istate)
     49                THREAD->istate->status |= cp0_status_fpu_bit;
    5050#endif
    5151}
  • arch/mips32/src/interrupt.c

    r45d6add r25d7709  
    7575}
    7676
    77 static void timer_exception(int n, void *stack)
     77static void timer_exception(int n, istate_t *istate)
    7878{
    7979        cp0_compare_write(cp0_count_read() + cp0_compare_value);
     
    8181}
    8282
    83 static void swint0(int n, void *stack)
     83static void swint0(int n, istate_t *istate)
    8484{
    8585        cp0_cause_write(cp0_cause_read() & ~(1 << 8)); /* clear SW0 interrupt */
    8686}
    8787
    88 static void swint1(int n, void *stack)
     88static void swint1(int n, istate_t *istate)
    8989{
    9090        cp0_cause_write(cp0_cause_read() & ~(1 << 9)); /* clear SW1 interrupt */
  • arch/mips32/src/mm/tlb.c

    r45d6add r25d7709  
    4040#include <debug.h>
    4141
    42 static void tlb_refill_fail(struct exception_regdump *pstate);
    43 static void tlb_invalid_fail(struct exception_regdump *pstate);
    44 static void tlb_modified_fail(struct exception_regdump *pstate);
     42static void tlb_refill_fail(istate_t *istate);
     43static void tlb_invalid_fail(istate_t *istate);
     44static void tlb_modified_fail(istate_t *istate);
    4545
    4646static pte_t *find_mapping_and_check(__address badvaddr);
     
    8282 * Process TLB Refill Exception.
    8383 *
    84  * @param pstate Interrupted register context.
    85  */
    86 void tlb_refill(struct exception_regdump *pstate)
     84 * @param istate Interrupted register context.
     85 */
     86void tlb_refill(istate_t *istate)
    8787{
    8888        entry_lo_t lo;
     
    127127fail:
    128128        spinlock_unlock(&AS->lock);
    129         tlb_refill_fail(pstate);
     129        tlb_refill_fail(istate);
    130130}
    131131
     
    134134 * Process TLB Invalid Exception.
    135135 *
    136  * @param pstate Interrupted register context.
    137  */
    138 void tlb_invalid(struct exception_regdump *pstate)
     136 * @param istate Interrupted register context.
     137 */
     138void tlb_invalid(istate_t *istate)
    139139{
    140140        tlb_index_t index;
     
    196196fail:
    197197        spinlock_unlock(&AS->lock);
    198         tlb_invalid_fail(pstate);
     198        tlb_invalid_fail(istate);
    199199}
    200200
     
    203203 * Process TLB Modified Exception.
    204204 *
    205  * @param pstate Interrupted register context.
    206  */
    207 void tlb_modified(struct exception_regdump *pstate)
     205 * @param istate Interrupted register context.
     206 */
     207void tlb_modified(istate_t *istate)
    208208{
    209209        tlb_index_t index;
     
    272272fail:
    273273        spinlock_unlock(&AS->lock);
    274         tlb_modified_fail(pstate);
    275 }
    276 
    277 void tlb_refill_fail(struct exception_regdump *pstate)
     274        tlb_modified_fail(istate);
     275}
     276
     277void tlb_refill_fail(istate_t *istate)
    278278{
    279279        char *symbol = "";
    280280        char *sym2 = "";
    281281
    282         char *s = get_symtab_entry(pstate->epc);
     282        char *s = get_symtab_entry(istate->epc);
    283283        if (s)
    284284                symbol = s;
    285         s = get_symtab_entry(pstate->ra);
     285        s = get_symtab_entry(istate->ra);
    286286        if (s)
    287287                sym2 = s;
    288         panic("%X: TLB Refill Exception at %X(%s<-%s)\n", cp0_badvaddr_read(), pstate->epc, symbol, sym2);
    289 }
    290 
    291 
    292 void tlb_invalid_fail(struct exception_regdump *pstate)
     288        panic("%X: TLB Refill Exception at %X(%s<-%s)\n", cp0_badvaddr_read(), istate->epc, symbol, sym2);
     289}
     290
     291
     292void tlb_invalid_fail(istate_t *istate)
    293293{
    294294        char *symbol = "";
    295295
    296         char *s = get_symtab_entry(pstate->epc);
     296        char *s = get_symtab_entry(istate->epc);
    297297        if (s)
    298298                symbol = s;
    299         panic("%X: TLB Invalid Exception at %X(%s)\n", cp0_badvaddr_read(), pstate->epc, symbol);
    300 }
    301 
    302 void tlb_modified_fail(struct exception_regdump *pstate)
     299        panic("%X: TLB Invalid Exception at %X(%s)\n", cp0_badvaddr_read(), istate->epc, symbol);
     300}
     301
     302void tlb_modified_fail(istate_t *istate)
    303303{
    304304        char *symbol = "";
    305305
    306         char *s = get_symtab_entry(pstate->epc);
     306        char *s = get_symtab_entry(istate->epc);
    307307        if (s)
    308308                symbol = s;
    309         panic("%X: TLB Modified Exception at %X(%s)\n", cp0_badvaddr_read(), pstate->epc, symbol);
     309        panic("%X: TLB Modified Exception at %X(%s)\n", cp0_badvaddr_read(), istate->epc, symbol);
    310310}
    311311
  • arch/sparc64/include/drivers/tick.h

    r45d6add r25d7709  
    3030#define __sparc64_TICK_H__
    3131
     32#include <typedefs.h>
     33
    3234#define TICK_DELTA        500000
    3335
    3436extern void tick_init(void);
    35 extern void tick_interrupt(int n, void *stack);
     37extern void tick_interrupt(int n, istate_t *istate);
    3638
    3739#endif
  • arch/sparc64/src/drivers/tick.c

    r45d6add r25d7709  
    3333#include <debug.h>
    3434#include <time/clock.h>
     35#include <typedefs.h>
    3536
    3637/** Initialize tick interrupt. */
     
    4950 *
    5051 * @param n Interrupt Level, 14,  (can be ignored)
    51  * @param stack Stack pointer of the interrupted context.
     52 * @param istate Interrupted state.
    5253 */
    53 void tick_interrupt(int n, void *stack)
     54void tick_interrupt(int n, istate_t *istate)
    5455{
    5556        softint_reg_t softint, clear;
  • genarch/src/i8042/i8042.c

    r45d6add r25d7709  
    266266};
    267267
    268 static void i8042_interrupt(int n, void *stack);
     268static void i8042_interrupt(int n, istate_t *istate);
    269269static void i8042_wait(void);
    270270
     
    272272void i8042_init(void)
    273273{
    274         exc_register(VECTOR_KBD, "i8042_interrupt", i8042_interrupt);
     274        exc_register(VECTOR_KBD, "i8042_interrupt", (iroutine) i8042_interrupt);
    275275        i8042_wait();
    276276        i8042_command_write(i8042_SET_COMMAND);
     
    289289 * @param stack Interrupted stack.
    290290 */
    291 void i8042_interrupt(int n, void *stack)
     291void i8042_interrupt(int n, istate_t *istate)
    292292{
    293293        __u8 x;
  • generic/include/interrupt.h

    r45d6add r25d7709  
    4242
    4343extern iroutine exc_register(int n, const char *name, iroutine f);
    44 extern void exc_dispatch(int n, void *stack);
     44extern void exc_dispatch(int n, istate_t *t);
    4545void exc_init(void);
    4646
  • generic/include/typedefs.h

    r45d6add r25d7709  
    8383typedef struct cmd_info cmd_info_t;
    8484
    85 typedef void (* iroutine)(int n, void *stack);
     85typedef struct istate istate_t;
     86typedef void (* iroutine)(int n, istate_t *istate);
    8687
    8788typedef struct hash_table hash_table_t;
  • generic/src/interrupt/interrupt.c

    r45d6add r25d7709  
    7272 * CPU is interrupts_disable()'d.
    7373 */
    74 void exc_dispatch(int n, void *stack)
     74void exc_dispatch(int n, istate_t *istate)
    7575{
    7676        ASSERT(n < IVT_ITEMS);
    7777       
    78         exc_table[n].f(n + IVT_FIRST, stack);
     78        exc_table[n].f(n + IVT_FIRST, istate);
    7979}
    8080
    8181/** Default 'null' exception handler */
    82 static void exc_undef(int n, void *stack)
     82static void exc_undef(int n, istate_t *istate)
    8383{
    8484        panic("Unhandled exception %d.", n);
     
    127127
    128128        for (i=0;i < IVT_ITEMS; i++)
    129                 exc_register(i, "undef", exc_undef);
     129                exc_register(i, "undef", (iroutine) exc_undef);
    130130
    131131        cmd_initialize(&exc_info);
Note: See TracChangeset for help on using the changeset viewer.