Changeset 74813216 in mainline
- Timestamp:
- 2005-12-01T13:36:01Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 22e10ab
- Parents:
- ee69c49
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified arch/sparc64/include/context.h ¶
ree69c49 r74813216 30 30 #define __sparc64_CONTEXT_H__ 31 31 32 #ifndef __sparc64_STACK_H__ 32 33 #include <arch/stack.h> 34 #endif 33 35 34 36 #ifndef __sparc64_TYPES_H__ … … 48 50 #define context_set(c, _pc, stack, size) \ 49 51 (c)->pc = ((__address) _pc) - 8; \ 52 (c)->fp = NULL; \ 50 53 (c)->sp = ((__address) stack) + ALIGN((size), STACK_ALIGNMENT) - (STACK_BIAS + SP_DELTA) 51 54 52 55 /* 53 56 * Only save registers that must be preserved across 54 * function calls. 57 * function calls and that are not saved in caller's 58 * register window. 55 59 */ 56 60 struct context { 57 __u64 l0;58 __u64 l1;59 __u64 l2;60 __u64 l3;61 __u64 l4;62 __u64 l5;63 __u64 l6;64 __u64 l7;65 61 __u64 i1; 66 62 __u64 i2; … … 68 64 __u64 i4; 69 65 __u64 i5; 70 __address sp; /* %i6 */66 __address fp; /* %i6 */ 71 67 __address pc; /* %i7 */ 68 __address sp; 72 69 ipl_t ipl; 73 70 }; -
TabularUnified arch/sparc64/include/context_offset.h ¶
ree69c49 r74813216 1 1 /* This file is automatically generated by gencontext.c. */ 2 2 /* struct context */ 3 #define OFFSET_SP 0x68 4 #define OFFSET_PC 0x70 5 #define OFFSET_L0 0x0 6 #define OFFSET_L1 0x8 7 #define OFFSET_L2 0x10 8 #define OFFSET_L3 0x18 9 #define OFFSET_L4 0x20 10 #define OFFSET_L5 0x28 11 #define OFFSET_L6 0x30 12 #define OFFSET_L7 0x38 13 #define OFFSET_I1 0x40 14 #define OFFSET_I2 0x48 15 #define OFFSET_I3 0x50 16 #define OFFSET_I4 0x58 17 #define OFFSET_I5 0x60 3 #define OFFSET_SP 0x38 4 #define OFFSET_FP 0x28 5 #define OFFSET_PC 0x30 6 #define OFFSET_I1 0x0 7 #define OFFSET_I2 0x8 8 #define OFFSET_I3 0x10 9 #define OFFSET_I4 0x18 10 #define OFFSET_I5 0x20 -
TabularUnified arch/sparc64/src/context.S ¶
ree69c49 r74813216 36 36 37 37 .macro CONTEXT_STORE r 38 stx %l0, [\r + OFFSET_L0]39 stx %l1, [\r + OFFSET_L1]40 stx %l2, [\r + OFFSET_L2]41 stx %l3, [\r + OFFSET_L3]42 stx %l4, [\r + OFFSET_L4]43 stx %l5, [\r + OFFSET_L5]44 stx %l6, [\r + OFFSET_L6]45 stx %l7, [\r + OFFSET_L7]46 38 stx %i1, [\r + OFFSET_I1] 47 39 stx %i2, [\r + OFFSET_I2] … … 49 41 stx %i4, [\r + OFFSET_I4] 50 42 stx %i5, [\r + OFFSET_I5] 51 stx % i6, [\r + OFFSET_SP]43 stx %fp, [\r + OFFSET_FP] 52 44 stx %i7, [\r + OFFSET_PC] 45 stx %sp, [\r + OFFSET_SP] 53 46 .endm 54 47 55 48 .macro CONTEXT_LOAD r 56 ldx [\r + OFFSET_L0], %l057 ldx [\r + OFFSET_L1], %l158 ldx [\r + OFFSET_L2], %l259 ldx [\r + OFFSET_L3], %l360 ldx [\r + OFFSET_L4], %l461 ldx [\r + OFFSET_L5], %l562 ldx [\r + OFFSET_L6], %l663 ldx [\r + OFFSET_L7], %l764 49 ldx [\r + OFFSET_I1], %i1 65 50 ldx [\r + OFFSET_I2], %i2 … … 67 52 ldx [\r + OFFSET_I4], %i4 68 53 ldx [\r + OFFSET_I5], %i5 69 ldx [\r + OFFSET_ SP], %i654 ldx [\r + OFFSET_FP], %fp 70 55 ldx [\r + OFFSET_PC], %i7 71 56 ldx [\r + OFFSET_SP], %sp … … 78 63 79 64 # context_save returns 1 80 mov 1, %i0 65 mov 1, %i0 81 66 ret 82 restore %sp, 128, %sp83 67 restore %sp, STACK_WINDOW_SAVE_AREA_SIZE, %sp 68 84 69 context_restore_arch: 85 70 save %sp, -STACK_WINDOW_SAVE_AREA_SIZE, %sp … … 87 72 88 73 # context_restore returns 0 89 xor %i0, %i0, %i0 74 xor %i0, %i0, %i0 90 75 ret 91 restore %sp, STACK_WINDOW_SAVE_AREA_SIZE, %sp 76 restore %sp, STACK_WINDOW_SAVE_AREA_SIZE, %sp -
TabularUnified tools/sparc64/gencontext.c ¶
ree69c49 r74813216 8 8 #define __ALIGN_H__ 9 9 10 #include "../../arch/sparc64/include/stack.h" 10 11 #include "../../arch/sparc64/include/context.h" 11 12 … … 29 30 30 31 fprintf(f,"#define OFFSET_SP 0x%x\n",((int)&pctx->sp) - (int )pctx); 32 fprintf(f,"#define OFFSET_FP 0x%x\n",((int)&pctx->fp) - (int )pctx); 31 33 fprintf(f,"#define OFFSET_PC 0x%x\n",((int)&pctx->pc) - (int )pctx); 32 fprintf(f,"#define OFFSET_L0 0x%x\n",((int)&pctx->l0) - (int )pctx);33 fprintf(f,"#define OFFSET_L1 0x%x\n",((int)&pctx->l1) - (int )pctx);34 fprintf(f,"#define OFFSET_L2 0x%x\n",((int)&pctx->l2) - (int )pctx);35 fprintf(f,"#define OFFSET_L3 0x%x\n",((int)&pctx->l3) - (int )pctx);36 fprintf(f,"#define OFFSET_L4 0x%x\n",((int)&pctx->l4) - (int )pctx);37 fprintf(f,"#define OFFSET_L5 0x%x\n",((int)&pctx->l5) - (int )pctx);38 fprintf(f,"#define OFFSET_L6 0x%x\n",((int)&pctx->l6) - (int )pctx);39 fprintf(f,"#define OFFSET_L7 0x%x\n",((int)&pctx->l7) - (int )pctx);40 34 fprintf(f,"#define OFFSET_I1 0x%x\n",((int)&pctx->i1) - (int )pctx); 41 35 fprintf(f,"#define OFFSET_I2 0x%x\n",((int)&pctx->i2) - (int )pctx);
Note:
See TracChangeset
for help on using the changeset viewer.