Changeset ecc83bd in mainline


Ignore:
Timestamp:
2008-04-15T20:05:13Z (16 years ago)
Author:
Josef Cejka <malyzelenyhnus@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9765182
Parents:
9a5f0cb
Message:

Context handling unified for sparc64.

Files:
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/sparc64/include/context_offset.h

    r9a5f0cb recc83bd  
    4949#define OFFSET_L7       0x88
    5050
     51#ifndef KERNEL         
     52# define OFFSET_TP      0x90
    5153#endif
     54
     55#ifdef __ASM__
     56
     57.macro CONTEXT_SAVE_ARCH_CORE ctx:req
     58        stx %sp, [\ctx + OFFSET_SP]
     59        stx %o7, [\ctx + OFFSET_PC]
     60        stx %i0, [\ctx + OFFSET_I0]
     61        stx %i1, [\ctx + OFFSET_I1]
     62        stx %i2, [\ctx + OFFSET_I2]
     63        stx %i3, [\ctx + OFFSET_I3]
     64        stx %i4, [\ctx + OFFSET_I4]
     65        stx %i5, [\ctx + OFFSET_I5]
     66        stx %fp, [\ctx + OFFSET_FP]
     67        stx %i7, [\ctx + OFFSET_I7]
     68        stx %l0, [\ctx + OFFSET_L0]
     69        stx %l1, [\ctx + OFFSET_L1]
     70        stx %l2, [\ctx + OFFSET_L2]
     71        stx %l3, [\ctx + OFFSET_L3]
     72        stx %l4, [\ctx + OFFSET_L4]
     73        stx %l5, [\ctx + OFFSET_L5]
     74        stx %l6, [\ctx + OFFSET_L6]
     75        stx %l7, [\ctx + OFFSET_L7]
     76#ifndef KERNEL         
     77        stx %g7, [\ctx + OFFSET_TP]
     78#endif
     79.endm
     80
     81.macro CONTEXT_RESTORE_ARCH_CORE ctx:req
     82        ldx [\ctx + OFFSET_SP], %sp
     83        ldx [\ctx + OFFSET_PC], %o7
     84        ldx [\ctx + OFFSET_I0], %i0
     85        ldx [\ctx + OFFSET_I1], %i1
     86        ldx [\ctx + OFFSET_I2], %i2
     87        ldx [\ctx + OFFSET_I3], %i3
     88        ldx [\ctx + OFFSET_I4], %i4
     89        ldx [\ctx + OFFSET_I5], %i5
     90        ldx [\ctx + OFFSET_FP], %fp
     91        ldx [\ctx + OFFSET_I7], %i7
     92        ldx [\ctx + OFFSET_L0], %l0
     93        ldx [\ctx + OFFSET_L1], %l1
     94        ldx [\ctx + OFFSET_L2], %l2
     95        ldx [\ctx + OFFSET_L3], %l3
     96        ldx [\ctx + OFFSET_L4], %l4
     97        ldx [\ctx + OFFSET_L5], %l5
     98        ldx [\ctx + OFFSET_L6], %l6
     99        ldx [\ctx + OFFSET_L7], %l7
     100#ifndef KERNEL         
     101        ldx [\ctx + OFFSET_TP], %g7
     102#endif
     103.endm
     104
     105#endif /* __ASM__ */
     106
     107#endif
  • kernel/arch/sparc64/src/context.S

    r9a5f0cb recc83bd  
    3737 */
    3838       
     39#include <arch/context_offset.h>
     40
    3941.text   
    4042
     
    4244.global context_restore_arch
    4345
    44 .macro CONTEXT_STORE r
    45         stx %sp, [\r + OFFSET_SP]
    46         stx %o7, [\r + OFFSET_PC]
    47         stx %i0, [\r + OFFSET_I0]
    48         stx %i1, [\r + OFFSET_I1]
    49         stx %i2, [\r + OFFSET_I2]
    50         stx %i3, [\r + OFFSET_I3]
    51         stx %i4, [\r + OFFSET_I4]
    52         stx %i5, [\r + OFFSET_I5]
    53         stx %fp, [\r + OFFSET_FP]
    54         stx %i7, [\r + OFFSET_I7]
    55         stx %l0, [\r + OFFSET_L0]
    56         stx %l1, [\r + OFFSET_L1]
    57         stx %l2, [\r + OFFSET_L2]
    58         stx %l3, [\r + OFFSET_L3]
    59         stx %l4, [\r + OFFSET_L4]
    60         stx %l5, [\r + OFFSET_L5]
    61         stx %l6, [\r + OFFSET_L6]
    62         stx %l7, [\r + OFFSET_L7]
    63 .endm
    64 
    65 .macro CONTEXT_LOAD r
    66         ldx [\r + OFFSET_SP], %sp
    67         ldx [\r + OFFSET_PC], %o7
    68         ldx [\r + OFFSET_I0], %i0
    69         ldx [\r + OFFSET_I1], %i1
    70         ldx [\r + OFFSET_I2], %i2
    71         ldx [\r + OFFSET_I3], %i3
    72         ldx [\r + OFFSET_I4], %i4
    73         ldx [\r + OFFSET_I5], %i5
    74         ldx [\r + OFFSET_FP], %fp
    75         ldx [\r + OFFSET_I7], %i7
    76         ldx [\r + OFFSET_L0], %l0
    77         ldx [\r + OFFSET_L1], %l1
    78         ldx [\r + OFFSET_L2], %l2
    79         ldx [\r + OFFSET_L3], %l3
    80         ldx [\r + OFFSET_L4], %l4
    81         ldx [\r + OFFSET_L5], %l5
    82         ldx [\r + OFFSET_L6], %l6
    83         ldx [\r + OFFSET_L7], %l7
    84 .endm
    85 
    8646context_save_arch:
    87         CONTEXT_STORE %o0
     47        CONTEXT_SAVE_ARCH_CORE %o0
    8848        retl
    8949        mov 1, %o0              ! context_save_arch returns 1
     
    9959        flushw
    10060       
    101         CONTEXT_LOAD %o0
     61        CONTEXT_RESTORE_ARCH_CORE %o0
    10262        retl
    10363        xor %o0, %o0, %o0       ! context_restore_arch returns 0
  • uspace/lib/libc/arch/sparc64/src/fibril.S

    r9a5f0cb recc83bd  
    2727#
    2828
    29 #include <libarch/context_offset.h>
     29#include <kernel/arch/context_offset.h>
    3030
    3131.text   
     
    3434.global context_restore
    3535
    36 .macro CONTEXT_STORE r
    37         stx %sp, [\r + OFFSET_SP]
    38         stx %o7, [\r + OFFSET_PC]
    39         stx %i0, [\r + OFFSET_I0]
    40         stx %i1, [\r + OFFSET_I1]
    41         stx %i2, [\r + OFFSET_I2]
    42         stx %i3, [\r + OFFSET_I3]
    43         stx %i4, [\r + OFFSET_I4]
    44         stx %i5, [\r + OFFSET_I5]
    45         stx %fp, [\r + OFFSET_FP]
    46         stx %i7, [\r + OFFSET_I7]
    47         stx %l0, [\r + OFFSET_L0]
    48         stx %l1, [\r + OFFSET_L1]
    49         stx %l2, [\r + OFFSET_L2]
    50         stx %l3, [\r + OFFSET_L3]
    51         stx %l4, [\r + OFFSET_L4]
    52         stx %l5, [\r + OFFSET_L5]
    53         stx %l6, [\r + OFFSET_L6]
    54         stx %l7, [\r + OFFSET_L7]
    55         stx %g7, [\r + OFFSET_TP]
    56 .endm
    57 
    58 .macro CONTEXT_LOAD r
    59         ldx [\r + OFFSET_SP], %sp
    60         ldx [\r + OFFSET_PC], %o7
    61         ldx [\r + OFFSET_I0], %i0
    62         ldx [\r + OFFSET_I1], %i1
    63         ldx [\r + OFFSET_I2], %i2
    64         ldx [\r + OFFSET_I3], %i3
    65         ldx [\r + OFFSET_I4], %i4
    66         ldx [\r + OFFSET_I5], %i5
    67         ldx [\r + OFFSET_FP], %fp
    68         ldx [\r + OFFSET_I7], %i7
    69         ldx [\r + OFFSET_L0], %l0
    70         ldx [\r + OFFSET_L1], %l1
    71         ldx [\r + OFFSET_L2], %l2
    72         ldx [\r + OFFSET_L3], %l3
    73         ldx [\r + OFFSET_L4], %l4
    74         ldx [\r + OFFSET_L5], %l5
    75         ldx [\r + OFFSET_L6], %l6
    76         ldx [\r + OFFSET_L7], %l7
    77         ldx [\r + OFFSET_TP], %g7
    78 .endm
    79 
    8036context_save:
    81         CONTEXT_STORE %o0
     37        CONTEXT_SAVE_ARCH_CORE %o0
    8238        retl
    8339        mov 1, %o0              ! context_save_arch returns 1
     
    9349        flushw
    9450       
    95         CONTEXT_LOAD %o0
     51        CONTEXT_RESTORE_ARCH_CORE %o0
    9652        retl
    9753        xor %o0, %o0, %o0       ! context_restore_arch returns 0
Note: See TracChangeset for help on using the changeset viewer.