Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 50805c9 in mainline


Ignore:
Timestamp:
2014-09-06T09:31:39Z (7 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master
Children:
b482287
Parents:
089901e
Message:

Autogenerate sparc64 fibril context_t and its offsets.

Location:
uspace/lib/c/arch/sparc64
Files:
1 added
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/arch/sparc64/Makefile.inc

    r089901e r50805c9  
    3737
    3838ARCH_AUTOGENS_AG = \
    39         arch/$(UARCH)/include/libarch/istate_struct.ag
     39        arch/$(UARCH)/include/libarch/istate_struct.ag \
     40        arch/$(UARCH)/include/libarch/fibril_context.ag
    4041
    4142.PRECIOUS: arch/$(UARCH)/src/entry.o
  • uspace/lib/c/arch/sparc64/include/libarch/fibril.h

    r089901e r50805c9  
    3737
    3838#include <libarch/stack.h>
     39#include <libarch/fibril_context.h>
    3940#include <sys/types.h>
    4041#include <align.h>
     
    5152        } while (0)
    5253
    53 /*
    54  * Save only registers that must be preserved across
    55  * function calls.
    56  */
    57 typedef struct {
    58         uintptr_t sp;           /* %o6 */
    59         uintptr_t pc;           /* %o7 */
    60         uint64_t i0;
    61         uint64_t i1;
    62         uint64_t i2;
    63         uint64_t i3;
    64         uint64_t i4;
    65         uint64_t i5;
    66         uintptr_t fp;           /* %i6 */
    67         uintptr_t i7;
    68         uint64_t l0;
    69         uint64_t l1;
    70         uint64_t l2;
    71         uint64_t l3;
    72         uint64_t l4;
    73         uint64_t l5;
    74         uint64_t l6;
    75         uint64_t l7;
    76         uint64_t tp;            /* %g7 */
    77 } context_t;
    78 
    7954static inline uintptr_t context_get_fp(context_t *ctx)
    8055{
  • uspace/lib/c/arch/sparc64/src/fibril.S

    r089901e r50805c9  
    2727#
    2828
    29 #include <libarch/context_offset.h>
     29#include <libarch/fibril_context.h>
    3030
    3131.text
     
    3939        # should a thread switch occur.
    4040        #
    41         CONTEXT_SAVE_ARCH_CORE %o0
     41        stx %sp, [%o0 + CONTEXT_OFFSET_SP]
     42        stx %o7, [%o0 + CONTEXT_OFFSET_PC]
     43        stx %i0, [%o0 + CONTEXT_OFFSET_I0]
     44        stx %i1, [%o0 + CONTEXT_OFFSET_I1]
     45        stx %i2, [%o0 + CONTEXT_OFFSET_I2]
     46        stx %i3, [%o0 + CONTEXT_OFFSET_I3]
     47        stx %i4, [%o0 + CONTEXT_OFFSET_I4]
     48        stx %i5, [%o0 + CONTEXT_OFFSET_I5]
     49        stx %fp, [%o0 + CONTEXT_OFFSET_FP]
     50        stx %i7, [%o0 + CONTEXT_OFFSET_I7]
     51        stx %l0, [%o0 + CONTEXT_OFFSET_L0]
     52        stx %l1, [%o0 + CONTEXT_OFFSET_L1]
     53        stx %l2, [%o0 + CONTEXT_OFFSET_L2]
     54        stx %l3, [%o0 + CONTEXT_OFFSET_L3]
     55        stx %l4, [%o0 + CONTEXT_OFFSET_L4]
     56        stx %l5, [%o0 + CONTEXT_OFFSET_L5]
     57        stx %l6, [%o0 + CONTEXT_OFFSET_L6]
     58        stx %l7, [%o0 + CONTEXT_OFFSET_L7]
     59        stx %g7, [%o0 + CONTEXT_OFFSET_TP]
    4260        retl
    4361        mov 1, %o0              ! context_save_arch returns 1
     
    5270        flushw
    5371       
    54         CONTEXT_RESTORE_ARCH_CORE %o0
     72        ldx [%o0 + CONTEXT_OFFSET_SP], %sp
     73        ldx [%o0 + CONTEXT_OFFSET_PC], %o7
     74        ldx [%o0 + CONTEXT_OFFSET_I0], %i0
     75        ldx [%o0 + CONTEXT_OFFSET_I1], %i1
     76        ldx [%o0 + CONTEXT_OFFSET_I2], %i2
     77        ldx [%o0 + CONTEXT_OFFSET_I3], %i3
     78        ldx [%o0 + CONTEXT_OFFSET_I4], %i4
     79        ldx [%o0 + CONTEXT_OFFSET_I5], %i5
     80        ldx [%o0 + CONTEXT_OFFSET_FP], %fp
     81        ldx [%o0 + CONTEXT_OFFSET_I7], %i7
     82        ldx [%o0 + CONTEXT_OFFSET_L0], %l0
     83        ldx [%o0 + CONTEXT_OFFSET_L1], %l1
     84        ldx [%o0 + CONTEXT_OFFSET_L2], %l2
     85        ldx [%o0 + CONTEXT_OFFSET_L3], %l3
     86        ldx [%o0 + CONTEXT_OFFSET_L4], %l4
     87        ldx [%o0 + CONTEXT_OFFSET_L5], %l5
     88        ldx [%o0 + CONTEXT_OFFSET_L6], %l6
     89        ldx [%o0 + CONTEXT_OFFSET_L7], %l7
     90        ldx [%o0 + CONTEXT_OFFSET_TP], %g7
    5591        retl
    5692        xor %o0, %o0, %o0       ! context_restore_arch returns 0
Note: See TracChangeset for help on using the changeset viewer.