Changeset 6b96ab44 in mainline


Ignore:
Timestamp:
2005-05-17T22:43:57Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1eee8383
Parents:
7f1bfce
Message:

IA-64 work.
Add the rest of branch registers to context_t.
Add predicate registers to context_t.
Modify context_save()/context_restore() to save/restore branch registers and predicate registers.
Change SP_DELTA to 0 since both context_save() and context_restore() are leaf procedures and as such don't use the scratch area.
Change pri_t to be u64 instead of u32.

Location:
arch
Files:
4 edited

Legend:

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

    r7f1bfce r6b96ab44  
    3232#include <arch/types.h>
    3333
     34/*
     35 * Both context_save() and context_restore() eat two doublewords from the stack.
     36 * First for pop of the saved register, second during ret instruction.
     37 */
    3438#define SP_DELTA        8
    3539
  • arch/ia64/include/context.h

    r7f1bfce r6b96ab44  
    3232#include <arch/types.h>
    3333
    34 #define SP_DELTA        16
     34/*
     35 * context_save() and context_restore() are both leaf procedures.
     36 * No need to allocate scratch area.
     37 */
     38#define SP_DELTA        0
    3539
    3640struct context {
     41        /*
     42         * General registers
     43         */
    3744        __u64 r1;
    3845        __u64 r2;
     
    6673        __u64 r30;
    6774        __u64 r31;
     75       
     76        /*
     77         * Branch registers
     78         */
    6879        __u64 pc;               /* b0 */
     80        __u64 b1;
     81        __u64 b2;
     82        __u64 b3;
     83        __u64 b4;
     84        __u64 b5;
     85        __u64 b6;
     86        __u64 b7;
     87
     88        /*
     89         * Predicate registers
     90         */
     91        __u64 pr;
     92       
    6993        pri_t pri;
    7094} __attribute__ ((packed));
  • arch/ia64/include/types.h

    r7f1bfce r6b96ab44  
    4141typedef __u64 __address;
    4242
    43 typedef __u32 pri_t;
     43typedef __u64 pri_t;
    4444
    4545typedef __u64 __native;
  • arch/ia64/src/context.S

    r7f1bfce r6b96ab44  
    3333
    3434context_save:
    35         alloc loc0 = ar.pfs, 1, 2, 0, 0
     35        alloc loc0 = ar.pfs, 1, 9, 0, 0
    3636       
    3737        /*
     
    3939         */
    4040
     41        /*
     42         * Save general registers
     43         */
    4144        st8 [in0] = r1, 8       ;;
    4245        st8 [in0] = r2, 8       ;;
     
    7174        st8 [in0] = r31, 8      ;;
    7275
    73         /* save pc */
     76        /*
     77         * Save branch registers
     78         */
    7479        mov loc1 = b0           ;;
     80        st8 [in0] = loc1, 8             /* save pc */
     81        mov loc2 = b1           ;;
     82        st8 [in0] = loc2, 8
     83        mov loc3 = b2           ;;
     84        st8 [in0] = loc3, 8
     85        mov loc4 = b3           ;;
     86        st8 [in0] = loc4, 8
     87        mov loc5 = b4           ;;
     88        st8 [in0] = loc5, 8
     89        mov loc6 = b5           ;;
     90        st8 [in0] = loc6, 8
     91        mov loc7 = b6           ;;
     92        st8 [in0] = loc7, 8
     93        mov loc8 = b7           ;;
     94        st8 [in0] = loc8, 8
     95
     96        /*
     97         * Save predicate registers
     98         */
     99        mov loc1 = pr           ;;
    75100        st8 [in0] = loc1, 8
    76101       
     
    81106
    82107context_restore:
    83         alloc loc0 = ar.pfs, 1, 2, 0, 0
     108        alloc loc0 = ar.pfs, 1, 9, 0, 0
    84109
    85110        /*
     
    87112         */
    88113       
     114        /*
     115         * Restore general registers
     116         */
    89117        ld8 r1 = [in0], 8       ;;
    90118        ld8 r2 = [in0], 8       ;;
     
    119147        ld8 r31 = [in0], 8      ;;
    120148
    121         /* restore pc */
     149        /*
     150         * Restore branch registers
     151         */
     152        ld8 loc1 = [in0], 8     ;;      /* restore pc */
     153        mov b0 = loc1
     154        ld8 loc2 = [in0], 8     ;;
     155        mov b1 = loc2
     156        ld8 loc3 = [in0], 8     ;;
     157        mov b2 = loc3
     158        ld8 loc4 = [in0], 8     ;;
     159        mov b3 = loc4
     160        ld8 loc5 = [in0], 8     ;;
     161        mov b4 = loc5
     162        ld8 loc6 = [in0], 8     ;;
     163        mov b5 = loc6
     164        ld8 loc7 = [in0], 8     ;;
     165        mov b6 = loc7
     166        ld8 loc8 = [in0], 8     ;;
     167        mov b7 = loc8
     168
    122169        ld8 loc1 = [in0], 8     ;;
    123         mov b0 = loc1
     170        mov pr = loc1, ~0
    124171       
    125172        mov ar.pfs = loc0
Note: See TracChangeset for help on using the changeset viewer.