Changeset b482287 in mainline


Ignore:
Timestamp:
2014-09-06T09:50:00Z (10 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f3831af
Parents:
50805c9
Message:

Autogenerate sparc64 kernel context_t and its offsets.

Location:
kernel/arch/sparc64
Files:
1 added
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/sparc64/Makefile.inc

    r50805c9 rb482287  
    109109
    110110ARCH_AUTOGENS_AG = \
    111         arch/$(KARCH)/include/arch/istate_struct.ag
     111        arch/$(KARCH)/include/arch/istate_struct.ag \
     112        arch/$(KARCH)/include/arch/context_struct.ag
    112113
  • kernel/arch/sparc64/include/arch/context.h

    r50805c9 rb482287  
    3737
    3838#include <arch/stack.h>
     39#include <arch/context_struct.h>
    3940#include <typedefs.h>
    4041#include <align.h>
     
    5051        } while (0)
    5152
    52 /*
    53  * Save only registers that must be preserved across
    54  * function calls.
    55  */
    56 typedef struct {
    57         uintptr_t sp;           /* %o6 */
    58         uintptr_t pc;           /* %o7 */
    59         uint64_t i0;
    60         uint64_t i1;
    61         uint64_t i2;
    62         uint64_t i3;
    63         uint64_t i4;
    64         uint64_t i5;
    65         uintptr_t fp;           /* %i6 */
    66         uintptr_t i7;
    67         uint64_t l0;
    68         uint64_t l1;
    69         uint64_t l2;
    70         uint64_t l3;
    71         uint64_t l4;
    72         uint64_t l5;
    73         uint64_t l6;
    74         uint64_t l7;
    75         ipl_t ipl;
    76 } context_t;
    77 
    7853#endif
    7954
  • kernel/arch/sparc64/src/context.S

    r50805c9 rb482287  
    2727#
    2828
    29 #include <arch/context_offset.h>
     29#include <arch/context_struct.h>
    3030#include <arch/arch.h>
    3131#include <arch/regdef.h>
     
    4747        flushw
    4848
    49         CONTEXT_SAVE_ARCH_CORE %o0
     49        stx %sp, [%o0 + CONTEXT_OFFSET_SP]
     50        stx %o7, [%o0 + CONTEXT_OFFSET_PC]
     51        stx %i0, [%o0 + CONTEXT_OFFSET_I0]
     52        stx %i1, [%o0 + CONTEXT_OFFSET_I1]
     53        stx %i2, [%o0 + CONTEXT_OFFSET_I2]
     54        stx %i3, [%o0 + CONTEXT_OFFSET_I3]
     55        stx %i4, [%o0 + CONTEXT_OFFSET_I4]
     56        stx %i5, [%o0 + CONTEXT_OFFSET_I5]
     57        stx %fp, [%o0 + CONTEXT_OFFSET_FP]
     58        stx %i7, [%o0 + CONTEXT_OFFSET_I7]
     59        stx %l0, [%o0 + CONTEXT_OFFSET_L0]
     60        stx %l1, [%o0 + CONTEXT_OFFSET_L1]
     61        stx %l2, [%o0 + CONTEXT_OFFSET_L2]
     62        stx %l3, [%o0 + CONTEXT_OFFSET_L3]
     63        stx %l4, [%o0 + CONTEXT_OFFSET_L4]
     64        stx %l5, [%o0 + CONTEXT_OFFSET_L5]
     65        stx %l6, [%o0 + CONTEXT_OFFSET_L6]
     66        stx %l7, [%o0 + CONTEXT_OFFSET_L7]
    5067        retl
    5168        mov 1, %o0              ! context_save_arch returns 1
     
    6986        wrpr %l0, %pstate
    7087
    71         CONTEXT_RESTORE_ARCH_CORE %o0
     88        ldx [%o0 + CONTEXT_OFFSET_SP], %sp
     89        ldx [%o0 + CONTEXT_OFFSET_PC], %o7
     90        ldx [%o0 + CONTEXT_OFFSET_I0], %i0
     91        ldx [%o0 + CONTEXT_OFFSET_I1], %i1
     92        ldx [%o0 + CONTEXT_OFFSET_I2], %i2
     93        ldx [%o0 + CONTEXT_OFFSET_I3], %i3
     94        ldx [%o0 + CONTEXT_OFFSET_I4], %i4
     95        ldx [%o0 + CONTEXT_OFFSET_I5], %i5
     96        ldx [%o0 + CONTEXT_OFFSET_FP], %fp
     97        ldx [%o0 + CONTEXT_OFFSET_I7], %i7
     98        ldx [%o0 + CONTEXT_OFFSET_L0], %l0
     99        ldx [%o0 + CONTEXT_OFFSET_L1], %l1
     100        ldx [%o0 + CONTEXT_OFFSET_L2], %l2
     101        ldx [%o0 + CONTEXT_OFFSET_L3], %l3
     102        ldx [%o0 + CONTEXT_OFFSET_L4], %l4
     103        ldx [%o0 + CONTEXT_OFFSET_L5], %l5
     104        ldx [%o0 + CONTEXT_OFFSET_L6], %l6
     105        ldx [%o0 + CONTEXT_OFFSET_L7], %l7
    72106        retl
    73107        xor %o0, %o0, %o0       ! context_restore_arch returns 0
  • kernel/arch/sparc64/src/sun4u/start.S

    r50805c9 rb482287  
    3939
    4040#ifdef CONFIG_SMP
    41 #include <arch/context_offset.h>
     41#include <arch/context_struct.h>
    4242#endif
    4343
     
    356356         */
    357357        set ctx, %g1
    358         add %g1, OFFSET_SP, %g1
     358        add %g1, CONTEXT_OFFSET_SP, %g1
    359359        ldx [%g1], %o6
    360360
  • kernel/arch/sparc64/src/sun4v/start.S

    r50805c9 rb482287  
    3131#include <arch/stack.h>
    3232#include <arch/regdef.h>
    33 #include <arch/context_offset.h>
     33#include <arch/context_struct.h>
    3434#include <arch/sun4v/regdef.h>
    3535#include <arch/sun4v/hypercall.h>
     
    291291         */
    292292        set ctx, %g1
    293         add %g1, OFFSET_SP, %g1
     293        add %g1, CONTEXT_OFFSET_SP, %g1
    294294        ldx [%g1], %o6
    295295
Note: See TracChangeset for help on using the changeset viewer.