Changeset 8005218 in mainline


Ignore:
Timestamp:
2005-10-19T12:58:02Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
37e9dbd
Parents:
4b2c872d
Message:

Make context_set() reset ar.pfs.pfm (especially ar.pfs.pfm.sol) so that register stack does not underflow.

File:
1 edited

Legend:

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

    r4b2c872d r8005218  
    3434#include <align.h>
    3535
    36 #define STACK_ITEM_SIZE 16
    37 #define STACK_ALIGNMENT 16
     36#define STACK_ITEM_SIZE                 16
     37#define STACK_ALIGNMENT                 16
     38#define REGISTER_STACK_ALIGNMENT        8
    3839
    3940/*
     
    4546#define SP_DELTA        (0+STACK_ITEM_SIZE)
    4647
     48#define PFM_MASK        (~0x3fffffffff)
     49
    4750#ifdef context_set
    4851#undef context_set
    4952#endif
    5053
    51 #define context_set(c, _pc, stack, size)                                                \
    52         (c)->pc = (__address) _pc;                                                      \
    53         (c)->bsp = ((__address) stack) + ALIGN(sizeof(the_t), STACK_ALIGNMENT);         \
     54#define context_set(c, _pc, stack, size)                                                                \
     55        (c)->pc = (__address) _pc;                                                                      \
     56        (c)->bsp = ((__address) stack) + ALIGN(sizeof(the_t), REGISTER_STACK_ALIGNMENT);                \
     57        (c)->ar_pfs &= PFM_MASK;                                                                        \
    5458        (c)->sp = ((__address) stack) + ALIGN((size), STACK_ALIGNMENT) - SP_DELTA;
    5559
Note: See TracChangeset for help on using the changeset viewer.