Changeset ee69c49 in mainline


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

sparc64 work.
Add stack.h.

Location:
arch/sparc64
Files:
1 added
2 edited

Legend:

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

    r5ff4f6b ree69c49  
    3030#define __sparc64_CONTEXT_H__
    3131
     32#include <arch/stack.h>
     33
    3234#ifndef __sparc64_TYPES_H__
    3335# include <arch/types.h>
     
    3840#endif
    3941
    40 /** According to SPARC Compliance Definition, every stack frame is 16-byte aligned. */
    41 #define STACK_ALIGNMENT                 16
    42 
    43 #define STACK_ITEM_SIZE                 sizeof(__u64)
    44 
    45 /**
    46  * 16-extended-word save area for %i[0-7] and %l[0-7] registers.
    47  */
    48 #define SAVE_AREA       (16*STACK_ITEM_SIZE)
    49 #define SP_DELTA        SAVE_AREA
    50 
    51 /**
    52  * By convention, the actual top of the stack is %sp + BIAS.
    53  */
    54 #define BIAS            2047
     42#define SP_DELTA        STACK_WINDOW_SAVE_AREA_SIZE
    5543
    5644#ifdef context_set
     
    6048#define context_set(c, _pc, stack, size)                                                                \
    6149        (c)->pc = ((__address) _pc) - 8;                                                                \
    62         (c)->sp = ((__address) stack) + ALIGN((size), STACK_ALIGNMENT) - (BIAS + SP_DELTA)
     50        (c)->sp = ((__address) stack) + ALIGN((size), STACK_ALIGNMENT) - (STACK_BIAS + SP_DELTA)
    6351
    6452/*
  • arch/sparc64/src/context.S

    r5ff4f6b ree69c49  
    2828
    2929#include <arch/context_offset.h>
     30#include <arch/stack.h>
    3031       
    3132.text   
     
    7374       
    7475context_save_arch:
    75         save %sp, -128, %sp
     76        save %sp, -STACK_WINDOW_SAVE_AREA_SIZE, %sp
    7677        CONTEXT_STORE %i0
    7778
     
    8283       
    8384context_restore_arch:
    84         save %sp, -128, %sp
     85        save %sp, -STACK_WINDOW_SAVE_AREA_SIZE, %sp
    8586        CONTEXT_LOAD %i0
    8687
     
    8889        xor %i0, %i0, %i0                       
    8990        ret
    90         restore %sp, 128, %sp   
     91        restore %sp, STACK_WINDOW_SAVE_AREA_SIZE, %sp   
Note: See TracChangeset for help on using the changeset viewer.