Changeset c43fa55 in mainline


Ignore:
Timestamp:
2005-12-16T10:44:02Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
07bd114e
Parents:
5753fbb
Message:

sparc64 work.
Better way of trap table organization.
Kernel trap handlers now "stay" on addresses on wich they were linked.

Location:
arch/sparc64
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • arch/sparc64/include/trap/trap_table.h

    r5753fbb rc43fa55  
    4646
    4747extern trap_table_entry_t trap_table[TRAP_TABLE_ENTRY_COUNT];
    48 extern trap_table_entry_t trap_table_kernel[TRAP_TABLE_ENTRY_COUNT];
     48extern trap_table_entry_t trap_table_save[TRAP_TABLE_ENTRY_COUNT];
    4949#endif /* !__ASM__ */
    5050
  • arch/sparc64/src/trap/trap.c

    r5753fbb rc43fa55  
    4040{
    4141        /*
     42         * Save kernel provided trap handlers.
     43         */
     44        memcpy((void *) trap_table_save, (void *) trap_table, TRAP_TABLE_SIZE);
     45
     46        /*
    4247         * Copy OFW's trap table into kernel.
    4348         */
     
    7479       
    7580        for (i = tt; i < tt + cnt; i++) {
    76                 trap_table[i] = trap_table_kernel[i];
     81                trap_table[i] = trap_table_save[i];
    7782        }       
    7883}
  • arch/sparc64/src/trap/trap_table.S

    r5753fbb rc43fa55  
    2828
    2929/**
    30  * This file contains two trap tables. First, trap_table, is the one
    31  * to wich kernel copies OFW's own trap table and patches it with
    32  * kernel-provided handlers from the second trap table, trap_table_kernel.
     30 * This file contains two trap tables.
     31 * First, trap_table, is the one wich contains handlers implemented by
     32 * kernel. During initialization, these handlers are copied out to
     33 * the second trap table, trap_table_save, and the first table is
     34 * overwritten with copy of OFW's own trap table. The copy is then patched
     35 * from the trap_table_save.
     36 *
     37 * This arrangement is beneficial because kernel handlers stay on their
     38 * link-time addresses which is good for debugging.
    3339 */
    3440 
     
    4147#define ENTRY_SIZE      TRAP_TABLE_ENTRY_SIZE
    4248
    43 
    4449/*
    45  * Trap table for copy of OFW's own trap table.
     50 * Kernel trap table.
    4651 */
    4752.align TABLE_SIZE
    4853.global trap_table
    4954trap_table:
    50         .space TABLE_SIZE, 0
    51 
    52 
    53 /*
    54  * Kernel-provided trap handlers.
    55  */
    56 .global trap_table_kernel
    57 trap_table_kernel:
    5855
    5956/* TT = 0x24, TL = 0 *, clean_window handler */
    60 .org trap_table_kernel + TT_CLEAN_WINDOW*ENTRY_SIZE
     57.org trap_table + TT_CLEAN_WINDOW*ENTRY_SIZE
    6158.global clean_window_handler
    6259clean_window_handler:
     
    6461
    6562/* TT = 0x80, TL = 0 *, spill_0_normal handler */
    66 .org trap_table_kernel + TT_SPILL_0_NORMAL*ENTRY_SIZE
     63.org trap_table + TT_SPILL_0_NORMAL*ENTRY_SIZE
    6764.global spill_0_normal
    6865spill_0_normal:
     
    7067
    7168/* TT = 0xc0, TL = 0 *, fill_0_normal handler */
    72 .org trap_table_kernel + TT_FILL_0_NORMAL*ENTRY_SIZE
     69.org trap_table + TT_FILL_0_NORMAL*ENTRY_SIZE
    7370fill_0_normal:
    7471        FILL_NORMAL_HANDLER
     
    7774 * Software traps for TL=0.
    7875 */
    79 .org trap_table_kernel + 256*ENTRY_SIZE
     76.org trap_table + 256*ENTRY_SIZE
    8077tl_0_software_traps:
    8178
    8279/* Reserved area. */
    83 .org trap_table_kernel + 384*ENTRY_SIZE
     80.org trap_table + 384*ENTRY_SIZE
    8481.space 128*ENTRY_SIZE, 0
    8582
     
    8784 * Hardware interrupts for TL>0.
    8885 */
    89 .org trap_table_kernel + 512*ENTRY_SIZE
     86.org trap_table + 512*ENTRY_SIZE
    9087tl_non_0_hardware_traps:
    9188
     
    9390 * Register window spill/fill traps for TL>0.
    9491 */
    95 .org trap_table_kernel + 640*ENTRY_SIZE
     92.org trap_table + 640*ENTRY_SIZE
    9693tl_non_0_regwin_traps:
    9794
     
    9996 * Software traps for TL>0.
    10097 */
    101 .org trap_table_kernel + 768*ENTRY_SIZE
     98.org trap_table + 768*ENTRY_SIZE
    10299tl_non_0_software_traps:
    103100
    104101/* Reserved area. */
    105 .org trap_table_kernel + 896*ENTRY_SIZE
     102.org trap_table + 896*ENTRY_SIZE
    106103.space 128*ENTRY_SIZE, 0
     104
     105
     106/*
     107 * Save trap table.
     108 */
     109.global trap_table_save
     110trap_table_save:
     111        .space TABLE_SIZE, 0
Note: See TracChangeset for help on using the changeset viewer.