Changeset 22e10ab in mainline


Ignore:
Timestamp:
2005-12-01T13:52:13Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
414f59c
Parents:
74813216
Message:

saprc64 work.
Perform leaf-procedure optimization for context_save and context_restore.

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • arch/sparc64/include/context.h

    r74813216 r22e10ab  
    5050#define context_set(c, _pc, stack, size)                                                                \
    5151        (c)->pc = ((__address) _pc) - 8;                                                                \
    52         (c)->fp = NULL;                                                                                 \
    5352        (c)->sp = ((__address) stack) + ALIGN((size), STACK_ALIGNMENT) - (STACK_BIAS + SP_DELTA)
    5453
     
    5958 */
    6059struct context {
    61         __u64 i1;
    62         __u64 i2;
    63         __u64 i3;
    64         __u64 i4;
    65         __u64 i5;
    66         __address fp;           /* %i6 */
    67         __address pc;           /* %i7 */
    68         __address sp;
     60        __u64 o1;
     61        __u64 o2;
     62        __u64 o3;
     63        __u64 o4;
     64        __u64 o5;
     65        __address sp;           /* %o6 */
     66        __address pc;           /* %o7 */
    6967        ipl_t ipl;
    7068};
  • arch/sparc64/include/context_offset.h

    r74813216 r22e10ab  
    11/* This file is automatically generated by gencontext.c. */
    22/* struct context */
    3 #define OFFSET_SP  0x38
    4 #define OFFSET_FP  0x28
     3#define OFFSET_O1  0x0
     4#define OFFSET_O2  0x8
     5#define OFFSET_O3  0x10
     6#define OFFSET_O4  0x18
     7#define OFFSET_O5  0x20
     8#define OFFSET_SP  0x28
    59#define OFFSET_PC  0x30
    6 #define OFFSET_I1  0x0
    7 #define OFFSET_I2  0x8
    8 #define OFFSET_I3  0x10
    9 #define OFFSET_I4  0x18
    10 #define OFFSET_I5  0x20
  • arch/sparc64/src/context.S

    r74813216 r22e10ab  
    3636
    3737.macro CONTEXT_STORE r
    38         stx %i1, [\r + OFFSET_I1]
    39         stx %i2, [\r + OFFSET_I2]
    40         stx %i3, [\r + OFFSET_I3]
    41         stx %i4, [\r + OFFSET_I4]
    42         stx %i5, [\r + OFFSET_I5]
    43         stx %fp, [\r + OFFSET_FP]
    44         stx %i7, [\r + OFFSET_PC]
     38        stx %o1, [\r + OFFSET_I1]
     39        stx %o2, [\r + OFFSET_I2]
     40        stx %o3, [\r + OFFSET_I3]
     41        stx %o4, [\r + OFFSET_I4]
     42        stx %o5, [\r + OFFSET_I5]
     43        stx %o7, [\r + OFFSET_PC]
    4544        stx %sp, [\r + OFFSET_SP]
    4645.endm
    4746
    4847.macro CONTEXT_LOAD r
    49         ldx [\r + OFFSET_I1], %i1
    50         ldx [\r + OFFSET_I2], %i2
    51         ldx [\r + OFFSET_I3], %i3
    52         ldx [\r + OFFSET_I4], %i4
    53         ldx [\r + OFFSET_I5], %i5
    54         ldx [\r + OFFSET_FP], %fp
    55         ldx [\r + OFFSET_PC], %i7
     48        ldx [\r + OFFSET_I1], %o1
     49        ldx [\r + OFFSET_I2], %o2
     50        ldx [\r + OFFSET_I3], %o3
     51        ldx [\r + OFFSET_I4], %o4
     52        ldx [\r + OFFSET_I5], %o5
     53        ldx [\r + OFFSET_PC], %o7
    5654        ldx [\r + OFFSET_SP], %sp
    5755.endm
     
    5957       
    6058context_save_arch:
    61         save %sp, -STACK_WINDOW_SAVE_AREA_SIZE, %sp
    62         CONTEXT_STORE %i0
     59        CONTEXT_STORE %o0
    6360
    6461        # context_save returns 1
    65         mov 1, %i0
    66         ret
    67         restore %sp, STACK_WINDOW_SAVE_AREA_SIZE, %sp
     62        retl
     63        mov 1, %o0
    6864
    6965context_restore_arch:
    70         save %sp, -STACK_WINDOW_SAVE_AREA_SIZE, %sp
    71         CONTEXT_LOAD %i0
     66        CONTEXT_LOAD %o0
    7267
    7368        # context_restore returns 0
    74         xor %i0, %i0, %i0
    75         ret
    76         restore %sp, STACK_WINDOW_SAVE_AREA_SIZE, %sp
     69        retl
     70        xor %o0, %o0, %o0
  • tools/sparc64/gencontext.c

    r74813216 r22e10ab  
    2828
    2929        fprintf(f,"/* struct context */\n");
    30 
     30        fprintf(f,"#define OFFSET_O1  0x%x\n",((int)&pctx->o1) - (int )pctx);
     31        fprintf(f,"#define OFFSET_O2  0x%x\n",((int)&pctx->o2) - (int )pctx);
     32        fprintf(f,"#define OFFSET_O3  0x%x\n",((int)&pctx->o3) - (int )pctx);
     33        fprintf(f,"#define OFFSET_O4  0x%x\n",((int)&pctx->o4) - (int )pctx);
     34        fprintf(f,"#define OFFSET_O5  0x%x\n",((int)&pctx->o5) - (int )pctx);
    3135        fprintf(f,"#define OFFSET_SP  0x%x\n",((int)&pctx->sp) - (int )pctx);
    32         fprintf(f,"#define OFFSET_FP  0x%x\n",((int)&pctx->fp) - (int )pctx);   
    3336        fprintf(f,"#define OFFSET_PC  0x%x\n",((int)&pctx->pc) - (int )pctx);
    34         fprintf(f,"#define OFFSET_I1  0x%x\n",((int)&pctx->i1) - (int )pctx);
    35         fprintf(f,"#define OFFSET_I2  0x%x\n",((int)&pctx->i2) - (int )pctx);
    36         fprintf(f,"#define OFFSET_I3  0x%x\n",((int)&pctx->i3) - (int )pctx);
    37         fprintf(f,"#define OFFSET_I4  0x%x\n",((int)&pctx->i4) - (int )pctx);
    38         fprintf(f,"#define OFFSET_I5  0x%x\n",((int)&pctx->i5) - (int )pctx);
    3937
    4038        fclose(f);
Note: See TracChangeset for help on using the changeset viewer.