Changeset fcfac420 in mainline for arch/ia32/src


Ignore:
Timestamp:
2005-12-10T01:02:31Z (20 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6095342
Parents:
973be64e
Message:

Changed ia32 & amd64 to use exc_register instead of trap_register.

Fixed dependency list building. I hope you all have 'makedepend' installed,
if you don't it's time to install it, as CC -M builds the dependency
list without directory names..and it just does not work.

Location:
arch/ia32/src
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • arch/ia32/src/asm.S

    r973be64e rfcfac420  
    7676#
    7777# The handlers setup data segment registers
    78 # and call trap_dispatcher().
     78# and call exc_dispatch().
    7979#
    8080.macro handler i n
     
    9595        addl $4,(%esp)
    9696        pushl %edi
    97         call trap_dispatcher
     97        call exc_dispatch
    9898        addl $8,%esp
    9999
  • arch/ia32/src/drivers/i8042.c

    r973be64e rfcfac420  
    3939#include <console/console.h>
    4040#include <macros.h>
     41#include <interrupt.h>
    4142
    4243/**
     
    236237};
    237238
     239static void i8042_interrupt(int n, void *stack);
     240
    238241/** Initialize i8042. */
    239242void i8042_init(void)
    240243{
    241         trap_register(VECTOR_KBD, i8042_interrupt);
     244        exc_register(VECTOR_KBD, "i8042_interrupt", i8042_interrupt);
    242245        trap_virtual_enable_irqs(1<<IRQ_KBD);
    243246        spinlock_initialize(&keylock, "i8042_lock");
     
    251254 * @param stack Interrupted stack.
    252255 */
    253 void i8042_interrupt(__u8 n, __native stack[])
     256void i8042_interrupt(int n, void *stack)
    254257{
    255258        __u8 x;
  • arch/ia32/src/drivers/i8254.c

    r973be64e rfcfac420  
    4040#include <arch.h>
    4141#include <time/delay.h>
     42#include <interrupt.h>
    4243
    4344/*
     
    5354#define MAGIC_NUMBER    1194
    5455
     56static void i8254_interrupt(int n, void *stack);
     57
    5558void i8254_init(void)
    5659{
     
    6568        outb(CLK_PORT1, (CLK_CONST/HZ) >> 8);
    6669        pic_enable_irqs(1<<IRQ_CLK);
    67         trap_register(VECTOR_CLK, i8254_interrupt);
     70        exc_register(VECTOR_CLK, "i8254_clock", i8254_interrupt);
    6871}
    6972
     
    123126}
    124127
    125 void i8254_interrupt(__u8 n, __native stack[])
     128void i8254_interrupt(int n, void *stack)
    126129{
    127130        trap_virtual_eoi();
  • arch/ia32/src/drivers/i8259.c

    r973be64e rfcfac420  
    3333#include <arch.h>
    3434#include <print.h>
     35#include <interrupt.h>
    3536
    3637/*
     
    3839 * Programmable Interrupt Controller for UP systems.
    3940 */
     41
     42static void pic_spurious(int n, void *stack);
    4043
    4144void i8259_init(void)
     
    6871         * Register interrupt handler for the PIC spurious interrupt.
    6972         */
    70         trap_register(VECTOR_PIC_SPUR, pic_spurious);   
     73        exc_register(VECTOR_PIC_SPUR, "pic_spurious", pic_spurious);   
    7174
    7275        /*
     
    116119}
    117120
    118 void pic_spurious(__u8 n, __native stack[])
     121void pic_spurious(int n, void *stack)
    119122{
    120123        printf("cpu%d: PIC spurious interrupt\n", CPU->id);
  • arch/ia32/src/ia32.c

    r973be64e rfcfac420  
    5050
    5151#include <arch/mm/memory_init.h>
     52#include <interrupt.h>
    5253
    5354void arch_pre_mm_init(void)
     
    6061                i8254_init();   /* hard clock */
    6162               
    62                 trap_register(VECTOR_SYSCALL, syscall);
     63                exc_register(VECTOR_SYSCALL, "syscall", syscall);
    6364               
    6465                #ifdef CONFIG_SMP
    65                 trap_register(VECTOR_TLB_SHOOTDOWN_IPI, tlb_shootdown_ipi);
    66                 trap_register(VECTOR_WAKEUP_IPI, wakeup_ipi);
     66                exc_register(VECTOR_TLB_SHOOTDOWN_IPI, "tlb_shootdown",
     67                             tlb_shootdown_ipi);
     68                exc_register(VECTOR_WAKEUP_IPI, "wakeup_ipi", wakeup_ipi);
    6769                #endif /* CONFIG_SMP */
    6870        }
  • arch/ia32/src/interrupt.c

    r973be64e rfcfac420  
    4444 */
    4545
    46 static iroutine ivt[IVT_ITEMS];
    47 
    4846void (* disable_irqs_function)(__u16 irqmask) = NULL;
    4947void (* enable_irqs_function)(__u16 irqmask) = NULL;
    5048void (* eoi_function)(void) = NULL;
    5149
    52 #define PRINT_INFO_ERRCODE(x) { \
    53         char *symbol = get_symtab_entry(stack[1]); \
     50#define PRINT_INFO_ERRCODE(st) { \
     51        __native *x = (__native *) st; \
     52        char *symbol = get_symtab_entry(x[1]); \
    5453        if (!symbol) \
    5554                symbol = ""; \
     
    6665        }
    6766
    68 iroutine trap_register(__u8 n, iroutine f)
     67void null_interrupt(int n, void *st)
    6968{
    70         ASSERT(n < IVT_ITEMS);
    71        
    72         iroutine old;
    73        
    74         old = ivt[n];
    75         ivt[n] = f;
    76        
    77         return old;
    78 }
     69        __native *stack = (__native *) st;
    7970
    80 /*
    81  * Called directly from the assembler code.
    82  * CPU is interrupts_disable()'d.
    83  */
    84 void trap_dispatcher(__u8 n, __native stack[])
    85 {
    86         ASSERT(n < IVT_ITEMS);
    87        
    88         ivt[n](n, stack);
    89 }
    90 
    91 void null_interrupt(__u8 n, __native stack[])
    92 {
    9371        printf("int %d: null_interrupt\n", n);
    9472        printf("stack: %L, %L, %L, %L\n", stack[0], stack[1], stack[2], stack[3]);
     
    9674}
    9775
    98 void gp_fault(__u8 n, __native stack[])
     76void gp_fault(int n, void *stack)
    9977{
    10078        PRINT_INFO_ERRCODE(stack);
     
    10280}
    10381
    104 void ss_fault(__u8 n, __native stack[])
     82void ss_fault(int n, void *stack)
    10583{
    10684        PRINT_INFO_ERRCODE(stack);
     
    10987
    11088
    111 void nm_fault(__u8 n, __native stack[])
     89void nm_fault(int n, void *stack)
    11290{
    11391#ifdef CONFIG_FPU_LAZY     
     
    12098
    12199
    122 void page_fault(__u8 n, __native stack[])
     100void page_fault(int n, void *stack)
    123101{
    124102        PRINT_INFO_ERRCODE(stack);
     
    127105}
    128106
    129 void syscall(__u8 n, __native stack[])
     107void syscall(int n, void *stack)
    130108{
    131109        printf("cpu%d: syscall\n", CPU->id);
     
    133111}
    134112
    135 void tlb_shootdown_ipi(__u8 n, __native stack[])
     113void tlb_shootdown_ipi(int n, void *stack)
    136114{
    137115        trap_virtual_eoi();
     
    139117}
    140118
    141 void wakeup_ipi(__u8 n, __native stack[])
     119void wakeup_ipi(int n, void *stack)
    142120{
    143121        trap_virtual_eoi();
  • arch/ia32/src/mm/page.c

    r973be64e rfcfac420  
    4040#include <memstr.h>
    4141#include <print.h>
     42#include <interrupt.h>
    4243
    4344static __address bootstrap_dba;
     
    6061                        page_mapping_insert(PA2KA(cur), cur, PAGE_CACHEABLE, KA2PA(dba));
    6162
    62                 trap_register(14, page_fault);
     63                exc_register(14, "page_fault", page_fault);
    6364                write_cr3(KA2PA(dba));
    6465        }
  • arch/ia32/src/pm.c

    r973be64e rfcfac420  
    3939#include <memstr.h>
    4040#include <arch/boot/boot.h>
     41#include <interrupt.h>
    4142
    4243/*
     
    125126               
    126127                idt_setoffset(d, ((__address) interrupt_handlers) + i*interrupt_handler_size);
    127                 trap_register(i, null_interrupt);
     128                exc_register(i, "undef", null_interrupt);
    128129        }
    129         trap_register(13, gp_fault);
    130         trap_register( 7, nm_fault);
    131         trap_register(12, ss_fault);
     130        exc_register(13, "gp_fault", gp_fault);
     131        exc_register( 7, "nm_fault", nm_fault);
     132        exc_register(12, "ss_fault", ss_fault);
    132133}
    133134
  • arch/ia32/src/smp/apic.c

    r973be64e rfcfac420  
    3333#include <mm/page.h>
    3434#include <time/delay.h>
     35#include <interrupt.h>
    3536#include <arch/interrupt.h>
    3637#include <print.h>
     
    109110#endif /* LAPIC_VERBOSE */
    110111
     112
     113static void apic_spurious(int n, void *stack);
     114static void l_apic_timer_interrupt(int n, void *stack);
     115
    111116/** Initialize APIC on BSP. */
    112117void apic_init(void)
     
    115120        int i;
    116121
    117         trap_register(VECTOR_APIC_SPUR, apic_spurious);
     122        exc_register(VECTOR_APIC_SPUR, "apic_spurious", apic_spurious);
    118123
    119124        enable_irqs_function = io_apic_enable_irqs;
     
    127132         */
    128133        io_apic_disable_irqs(0xffff);
    129         trap_register(VECTOR_CLK, l_apic_timer_interrupt);
     134        exc_register(VECTOR_CLK, "l_apic_timer", l_apic_timer_interrupt);
    130135        for (i = 0; i < IRQ_COUNT; i++) {
    131136                int pin;
     
    163168 * @param stack Interrupted stack.
    164169 */
    165 void apic_spurious(__u8 n, __native stack[])
     170void apic_spurious(int n, void *stack)
    166171{
    167172        printf("cpu%d: APIC spurious interrupt\n", CPU->id);
     
    402407 * @param stack Interrupted stack.
    403408 */
    404 void l_apic_timer_interrupt(__u8 n, __native stack[])
     409void l_apic_timer_interrupt(int n, void *stack)
    405410{
    406411        l_apic_eoi();
Note: See TracChangeset for help on using the changeset viewer.