Changeset 74813216 in mainline


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

sparc64 work.
No need to save/restore local registers.

Files:
4 edited

Legend:

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

    ree69c49 r74813216  
    3030#define __sparc64_CONTEXT_H__
    3131
     32#ifndef __sparc64_STACK_H__
    3233#include <arch/stack.h>
     34#endif
    3335
    3436#ifndef __sparc64_TYPES_H__
     
    4850#define context_set(c, _pc, stack, size)                                                                \
    4951        (c)->pc = ((__address) _pc) - 8;                                                                \
     52        (c)->fp = NULL;                                                                                 \
    5053        (c)->sp = ((__address) stack) + ALIGN((size), STACK_ALIGNMENT) - (STACK_BIAS + SP_DELTA)
    5154
    5255/*
    5356 * Only save registers that must be preserved across
    54  * function calls.
     57 * function calls and that are not saved in caller's
     58 * register window.
    5559 */
    5660struct context {
    57         __u64 l0;
    58         __u64 l1;
    59         __u64 l2;
    60         __u64 l3;
    61         __u64 l4;
    62         __u64 l5;
    63         __u64 l6;
    64         __u64 l7;
    6561        __u64 i1;
    6662        __u64 i2;
     
    6864        __u64 i4;
    6965        __u64 i5;
    70         __address sp;           /* %i6 */
     66        __address fp;           /* %i6 */
    7167        __address pc;           /* %i7 */
     68        __address sp;
    7269        ipl_t ipl;
    7370};
  • arch/sparc64/include/context_offset.h

    ree69c49 r74813216  
    11/* This file is automatically generated by gencontext.c. */
    22/* struct context */
    3 #define OFFSET_SP  0x68
    4 #define OFFSET_PC  0x70
    5 #define OFFSET_L0  0x0
    6 #define OFFSET_L1  0x8
    7 #define OFFSET_L2  0x10
    8 #define OFFSET_L3  0x18
    9 #define OFFSET_L4  0x20
    10 #define OFFSET_L5  0x28
    11 #define OFFSET_L6  0x30
    12 #define OFFSET_L7  0x38
    13 #define OFFSET_I1  0x40
    14 #define OFFSET_I2  0x48
    15 #define OFFSET_I3  0x50
    16 #define OFFSET_I4  0x58
    17 #define OFFSET_I5  0x60
     3#define OFFSET_SP  0x38
     4#define OFFSET_FP  0x28
     5#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

    ree69c49 r74813216  
    3636
    3737.macro CONTEXT_STORE r
    38         stx %l0, [\r + OFFSET_L0]
    39         stx %l1, [\r + OFFSET_L1]
    40         stx %l2, [\r + OFFSET_L2]
    41         stx %l3, [\r + OFFSET_L3]
    42         stx %l4, [\r + OFFSET_L4]
    43         stx %l5, [\r + OFFSET_L5]
    44         stx %l6, [\r + OFFSET_L6]
    45         stx %l7, [\r + OFFSET_L7]
    4638        stx %i1, [\r + OFFSET_I1]
    4739        stx %i2, [\r + OFFSET_I2]
     
    4941        stx %i4, [\r + OFFSET_I4]
    5042        stx %i5, [\r + OFFSET_I5]
    51         stx %i6, [\r + OFFSET_SP]
     43        stx %fp, [\r + OFFSET_FP]
    5244        stx %i7, [\r + OFFSET_PC]
     45        stx %sp, [\r + OFFSET_SP]
    5346.endm
    5447
    5548.macro CONTEXT_LOAD r
    56         ldx [\r + OFFSET_L0], %l0
    57         ldx [\r + OFFSET_L1], %l1
    58         ldx [\r + OFFSET_L2], %l2
    59         ldx [\r + OFFSET_L3], %l3
    60         ldx [\r + OFFSET_L4], %l4
    61         ldx [\r + OFFSET_L5], %l5
    62         ldx [\r + OFFSET_L6], %l6
    63         ldx [\r + OFFSET_L7], %l7
    6449        ldx [\r + OFFSET_I1], %i1
    6550        ldx [\r + OFFSET_I2], %i2
     
    6752        ldx [\r + OFFSET_I4], %i4
    6853        ldx [\r + OFFSET_I5], %i5
    69         ldx [\r + OFFSET_SP], %i6
     54        ldx [\r + OFFSET_FP], %fp
    7055        ldx [\r + OFFSET_PC], %i7
    7156        ldx [\r + OFFSET_SP], %sp
     
    7863
    7964        # context_save returns 1
    80         mov 1, %i0     
     65        mov 1, %i0
    8166        ret
    82         restore %sp, 128, %sp
    83        
     67        restore %sp, STACK_WINDOW_SAVE_AREA_SIZE, %sp
     68
    8469context_restore_arch:
    8570        save %sp, -STACK_WINDOW_SAVE_AREA_SIZE, %sp
     
    8772
    8873        # context_restore returns 0
    89         xor %i0, %i0, %i0                       
     74        xor %i0, %i0, %i0
    9075        ret
    91         restore %sp, STACK_WINDOW_SAVE_AREA_SIZE, %sp   
     76        restore %sp, STACK_WINDOW_SAVE_AREA_SIZE, %sp
  • tools/sparc64/gencontext.c

    ree69c49 r74813216  
    88#define __ALIGN_H__
    99
     10#include "../../arch/sparc64/include/stack.h"
    1011#include "../../arch/sparc64/include/context.h"
    1112
     
    2930
    3031        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);   
    3133        fprintf(f,"#define OFFSET_PC  0x%x\n",((int)&pctx->pc) - (int )pctx);
    32         fprintf(f,"#define OFFSET_L0  0x%x\n",((int)&pctx->l0) - (int )pctx);
    33         fprintf(f,"#define OFFSET_L1  0x%x\n",((int)&pctx->l1) - (int )pctx);
    34         fprintf(f,"#define OFFSET_L2  0x%x\n",((int)&pctx->l2) - (int )pctx);
    35         fprintf(f,"#define OFFSET_L3  0x%x\n",((int)&pctx->l3) - (int )pctx);
    36         fprintf(f,"#define OFFSET_L4  0x%x\n",((int)&pctx->l4) - (int )pctx);
    37         fprintf(f,"#define OFFSET_L5  0x%x\n",((int)&pctx->l5) - (int )pctx);
    38         fprintf(f,"#define OFFSET_L6  0x%x\n",((int)&pctx->l6) - (int )pctx);
    39         fprintf(f,"#define OFFSET_L7  0x%x\n",((int)&pctx->l7) - (int )pctx);
    4034        fprintf(f,"#define OFFSET_I1  0x%x\n",((int)&pctx->i1) - (int )pctx);
    4135        fprintf(f,"#define OFFSET_I2  0x%x\n",((int)&pctx->i2) - (int )pctx);
Note: See TracChangeset for help on using the changeset viewer.