Subversion Repositories HelenOS

Compare Revisions

Regard whitespace Rev 81 → Rev 82

/SPARTAN/trunk/arch/ia64/include/context.h
31,9 → 31,16
 
#include <arch/types.h>
 
#define SP_DELTA 16
/*
* context_save() and context_restore() are both leaf procedures.
* No need to allocate scratch area.
*/
#define SP_DELTA 0
 
struct context {
/*
* General registers
*/
__u64 r1;
__u64 r2;
__u64 r3;
65,7 → 72,24
__u64 r29;
__u64 r30;
__u64 r31;
/*
* Branch registers
*/
__u64 pc; /* b0 */
__u64 b1;
__u64 b2;
__u64 b3;
__u64 b4;
__u64 b5;
__u64 b6;
__u64 b7;
 
/*
* Predicate registers
*/
__u64 pr;
pri_t pri;
} __attribute__ ((packed));
 
/SPARTAN/trunk/arch/ia64/include/types.h
40,7 → 40,7
 
typedef __u64 __address;
 
typedef __u32 pri_t;
typedef __u64 pri_t;
 
typedef __u64 __native;
 
/SPARTAN/trunk/arch/ia64/src/context.S
32,12 → 32,15
.global context_restore
 
context_save:
alloc loc0 = ar.pfs, 1, 2, 0, 0
alloc loc0 = ar.pfs, 1, 9, 0, 0
/*
* TODO: save the rest of the context registers.
*/
 
/*
* Save general registers
*/
st8 [in0] = r1, 8 ;;
st8 [in0] = r2, 8 ;;
st8 [in0] = r3, 8 ;;
70,8 → 73,30
st8 [in0] = r30, 8 ;;
st8 [in0] = r31, 8 ;;
 
/* save pc */
/*
* Save branch registers
*/
mov loc1 = b0 ;;
st8 [in0] = loc1, 8 /* save pc */
mov loc2 = b1 ;;
st8 [in0] = loc2, 8
mov loc3 = b2 ;;
st8 [in0] = loc3, 8
mov loc4 = b3 ;;
st8 [in0] = loc4, 8
mov loc5 = b4 ;;
st8 [in0] = loc5, 8
mov loc6 = b5 ;;
st8 [in0] = loc6, 8
mov loc7 = b6 ;;
st8 [in0] = loc7, 8
mov loc8 = b7 ;;
st8 [in0] = loc8, 8
 
/*
* Save predicate registers
*/
mov loc1 = pr ;;
st8 [in0] = loc1, 8
mov ar.pfs = loc0
80,12 → 105,15
br.ret.sptk.many b0
 
context_restore:
alloc loc0 = ar.pfs, 1, 2, 0, 0
alloc loc0 = ar.pfs, 1, 9, 0, 0
 
/*
* TODO: restore the rest of the context registers.
*/
/*
* Restore general registers
*/
ld8 r1 = [in0], 8 ;;
ld8 r2 = [in0], 8 ;;
ld8 r3 = [in0], 8 ;;
118,10 → 146,29
ld8 r30 = [in0], 8 ;;
ld8 r31 = [in0], 8 ;;
 
/* restore pc */
ld8 loc1 = [in0], 8 ;;
/*
* Restore branch registers
*/
ld8 loc1 = [in0], 8 ;; /* restore pc */
mov b0 = loc1
ld8 loc2 = [in0], 8 ;;
mov b1 = loc2
ld8 loc3 = [in0], 8 ;;
mov b2 = loc3
ld8 loc4 = [in0], 8 ;;
mov b3 = loc4
ld8 loc5 = [in0], 8 ;;
mov b4 = loc5
ld8 loc6 = [in0], 8 ;;
mov b5 = loc6
ld8 loc7 = [in0], 8 ;;
mov b6 = loc7
ld8 loc8 = [in0], 8 ;;
mov b7 = loc8
ld8 loc1 = [in0], 8 ;;
mov pr = loc1, ~0
mov ar.pfs = loc0
mov r8 = r0 /* context_restore returns 0 */