Changeset 437ee6a4 in mainline for arch/sparc64/include/context.h


Ignore:
Timestamp:
2005-10-30T13:49:39Z (20 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
df91be5
Parents:
2cd0485d
Message:

sparc64 work.
Add context_save(), context_set() and context_restore().
Remove putchar() definition from ofw.c.
Add sparc64 putchar().
Add ppc32 putchar() (i.e. the original ofw.c putchar()).
Make arg.h use the builtin va_* constructs.

File:
1 edited

Legend:

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

    r2cd0485d r437ee6a4  
    3030#define __sparc64_CONTEXT_H__
    3131
    32 #include <arch/types.h>
    33 #include <typedefs.h>
    34 #include <align.h>
     32#ifndef __sparc64_TYPES_H__
     33# include <arch/types.h>
     34#endif
    3535
     36#ifndef __ALIGN_H__
     37# include <align.h>
     38#endif
     39
     40#define STACK_ALIGNMENT                 8
    3641#define STACK_ITEM_SIZE                 8
    3742
     
    4146#define SP_DELTA        (0+STACK_ITEM_SIZE)
    4247
     48#ifdef context_set
     49#undef context_set
     50#endif
     51
     52#define context_set(c, _pc, stack, size)                                                                \
     53        (c)->pc = ((__address) _pc) - 8;                                                                \
     54        (c)->sp = ((__address) stack) + (ALIGN((size), STACK_ALIGNMENT) + 1) - SP_DELTA;                       
     55
    4356/*
    4457 * Only save registers that must be preserved across
     
    4659 */
    4760struct context {
    48 
    49         __address bsp;
    50         __address sp;
    51         __address pc;
     61        __u64 l0;
     62        __u64 l1;
     63        __u64 l2;
     64        __u64 l3;
     65        __u64 l4;
     66        __u64 l5;
     67        __u64 l6;
     68        __u64 l7;
     69        __u64 i1;
     70        __u64 i2;
     71        __u64 i3;
     72        __u64 i4;
     73        __u64 i5;
     74        __address sp;           /* %i6 */
     75        __address pc;           /* %i7 */
    5276        ipl_t ipl;
    53 } __attribute__ ((packed));
     77};
    5478
    5579#endif
Note: See TracChangeset for help on using the changeset viewer.