Changeset 8ac5fe7 in mainline


Ignore:
Timestamp:
2005-12-02T16:18:23Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
060ce90
Parents:
414f59c
Message:

sparc64 work.
Add dummy trap tables.

Location:
arch/sparc64
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • arch/sparc64/Makefile.inc

    r414f59c r8ac5fe7  
    5555        arch/$(ARCH)/src/mm/page.c \
    5656        arch/$(ARCH)/src/sparc64.c \
    57         arch/$(ARCH)/src/start.S
     57        arch/$(ARCH)/src/start.S \
     58        arch/$(ARCH)/src/trap_table.S
  • arch/sparc64/include/asm.h

    r414f59c r8ac5fe7  
    8686}
    8787
     88/** Read Trap Base Address register.
     89 *
     90 * @return Current value in TBA.
     91 */
     92static inline __u64 tba_read(void)
     93{
     94        __u64 v;
     95       
     96        __asm__ volatile ("rdpr %%tba, %0\n" : "=r" (v));
     97       
     98        return v;
     99}
     100
     101/** Write Trap Base Address register.
     102 *
     103 * @param New value of TBA.
     104 */
     105static inline void tba_write(__u64 v)
     106{
     107        __asm__ volatile ("wrpr %0, %1, %%tba\n" : : "r" (v), "i" (0));
     108}
     109
     110
    88111void cpu_halt(void);
    89112void cpu_sleep(void);
  • arch/sparc64/src/context.S

    r414f59c r8ac5fe7  
    3232/**
    3333 * Both context_save_arch() and context_restore_arch() are
    34  * leaf-optimized procedures. Both of them touch %sp and
    35  * %fp and thus break SCD 2.4 compliance. However, these
    36  * functions are special enough to be allowed this
    37  * kind of behavior. Moreover, this kind of optimization
    38  * is very important and prevents any window spill/
    39  * fill/clean traps in these very core kernel functions.
     34 * leaf-optimized procedures. This kind of optimization
     35 * is very important and prevents any implicit window
     36 * spill/fill/clean traps in these very core kernel
     37 * functions.
    4038 */
    4139       
  • arch/sparc64/src/sparc64.c

    r414f59c r8ac5fe7  
    2828
    2929#include <arch.h>
     30#include <print.h>
     31#include <arch/asm.h>
     32#include <memstr.h>
     33#include <arch/trap_table.h>
    3034
    3135void arch_pre_mm_init(void)
     
    3943void arch_pre_smp_init(void)
    4044{
     45        /*
     46         * Copy OFW's trap table into kernel and point TBA there.
     47         */
     48        memcpy((void *) trap_table, (void *) tba_read(), TRAP_TABLE_SIZE);
     49/*
     50 *      TBA cannot be changed until there are means of getting it into TLB.
     51 *      tba_write((__u64) trap_table);
     52 */
    4153}
    4254
  • arch/sparc64/src/start.S

    r414f59c r8ac5fe7  
    52521:
    5353        set ofw, %l0
    54         stx %o4, [%l0]
    5554
    5655        call ofw_init
    57         nop
     56        stx %o4, [%l0]
    5857
    5958        call main_bsp
Note: See TracChangeset for help on using the changeset viewer.