Changeset fcfac420 in mainline for arch/amd64/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/amd64/src
Files:
5 edited

Legend:

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

    r973be64e rfcfac420  
    4545#include <genarch/acpi/acpi.h>
    4646#include <panic.h>
     47#include <interrupt.h>
    4748
    4849void arch_pre_mm_init(void)
     
    7374                i8254_init();   /* hard clock */
    7475
    75                 trap_register(VECTOR_SYSCALL, syscall);
     76                exc_register(VECTOR_SYSCALL, "syscall", syscall);
    7677               
    7778                #ifdef CONFIG_SMP
    78                 trap_register(VECTOR_TLB_SHOOTDOWN_IPI, tlb_shootdown_ipi);
    79                 trap_register(VECTOR_WAKEUP_IPI, wakeup_ipi);
     79                exc_register(VECTOR_TLB_SHOOTDOWN_IPI, "tlb_shootdown",
     80                             tlb_shootdown_ipi);
     81                exc_register(VECTOR_WAKEUP_IPI, "wakeup_ipi", wakeup_ipi);
    8082                #endif /* CONFIG_SMP */
    8183        }
  • arch/amd64/src/asm_utils.S

    r973be64e rfcfac420  
    160160#
    161161# The handlers setup data segment registers
    162 # and call trap_dispatcher().
     162# and call exc_dispatch().
    163163#
    164164.macro handler i n
     
    171171        movq %rbp, %rsi
    172172        addq $8, %rsi     # %rsi - second parameter - original stack
    173         call trap_dispatcher    # trap_dispatcher(i, stack)
     173        call exc_dispatch       # exc_dispatch(i, stack)
    174174
    175175# Test if this is interrupt with error word or not
  • arch/amd64/src/interrupt.c

    r973be64e rfcfac420  
    5858}
    5959
    60 static void print_info_errcode(__u8 n, __native x[])
     60static void print_info_errcode(int n, void *st)
    6161{
    6262        char *symbol;
     63        __native *x = (__native *) st;
    6364
    6465        if (!(symbol=get_symtab_entry(x[1])))
     
    8990 */
    9091
    91 static iroutine ivt[IVT_ITEMS];
    92 
    9392void (* disable_irqs_function)(__u16 irqmask) = NULL;
    9493void (* enable_irqs_function)(__u16 irqmask) = NULL;
    9594void (* eoi_function)(void) = NULL;
    9695
    97 iroutine trap_register(__u8 n, iroutine f)
     96void null_interrupt(int n, void *st)
    9897{
    99         ASSERT(n < IVT_ITEMS);
    100        
    101         iroutine old;
    102        
    103         old = ivt[n];
    104         ivt[n] = f;
    105        
    106         return old;
    107 }
     98        __native *stack = (__native *) st;
    10899
    109 /*
    110  * Called directly from the assembler code.
    111  * CPU is interrupts_disable()'d.
    112  */
    113 void trap_dispatcher(__u8 n, __native stack[])
    114 {
    115         ASSERT(n < IVT_ITEMS);
    116        
    117         ivt[n](n, stack);
    118 }
    119 
    120 void null_interrupt(__u8 n, __native stack[])
    121 {
    122100        printf("-----EXCEPTION(%d) OCCURED----- ( %s )\n",n,__FUNCTION__); \
    123101        printf("stack: %L, %L, %L, %L\n", stack[0], stack[1], stack[2], stack[3]);
     
    125103}
    126104
    127 void gp_fault(__u8 n, __native stack[])
     105void gp_fault(int n, void *stack)
    128106{
    129107        print_info_errcode(n,stack);
     
    131109}
    132110
    133 void ss_fault(__u8 n, __native stack[])
     111void ss_fault(int n, void *stack)
    134112{
    135113        print_info_errcode(n,stack);
     
    138116
    139117
    140 void nm_fault(__u8 n, __native stack[])
     118void nm_fault(int n, void *stack)
    141119{
    142120#ifdef CONFIG_FPU_LAZY     
     
    149127
    150128
    151 void page_fault(__u8 n, __native stack[])
     129void page_fault(int n, void *stack)
    152130{
    153131        print_info_errcode(n,stack);
     
    156134}
    157135
    158 void syscall(__u8 n, __native stack[])
     136void syscall(int n, void *stack)
    159137{
    160138        printf("cpu%d: syscall\n", CPU->id);
     
    162140}
    163141
    164 void tlb_shootdown_ipi(__u8 n, __native stack[])
     142void tlb_shootdown_ipi(int n, void *stack)
    165143{
    166144        trap_virtual_eoi();
     
    168146}
    169147
    170 void wakeup_ipi(__u8 n, __native stack[])
     148void wakeup_ipi(int n, void *stack)
    171149{
    172150        trap_virtual_eoi();
  • arch/amd64/src/mm/page.c

    r973be64e rfcfac420  
    3535#include <config.h>
    3636#include <memstr.h>
     37#include <interrupt.h>
    3738
    3839static __address bootstrap_dba;
     
    5657                }
    5758
    58                 trap_register(14, page_fault);
     59                exc_register(14, "page_fault", page_fault);
    5960                write_cr3(KA2PA(dba));
    6061        }
  • arch/amd64/src/pm.c

    r973be64e rfcfac420  
    3232#include <arch/interrupt.h>
    3333#include <arch/asm.h>
     34#include <interrupt.h>
    3435
    3536#include <config.h>
     
    175176               
    176177                idt_setoffset(d, ((__address) interrupt_handlers) + i*interrupt_handler_size);
    177                 trap_register(i, null_interrupt);
     178                exc_register(i, "undef", null_interrupt);
    178179        }
    179         trap_register(13, gp_fault);
    180         trap_register( 7, nm_fault);
    181         trap_register(12, ss_fault);   
     180        exc_register(13, "gp_fault", gp_fault);
     181        exc_register( 7, "nm_fault", nm_fault);
     182        exc_register(12, "ss_fault", ss_fault);
    182183}
    183184
Note: See TracChangeset for help on using the changeset viewer.