Rev 525 | Rev 527 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 525 | Rev 526 | ||
---|---|---|---|
Line 33... | Line 33... | ||
33 | 33 | ||
34 | .global context_save_arch |
34 | .global context_save_arch |
35 | .global context_restore_arch |
35 | .global context_restore_arch |
36 | 36 | ||
37 | .macro CONTEXT_STORE r |
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 | stx %i1, [\r + OFFSET_I1] |
38 | stx %i1, [\r + OFFSET_I1] |
47 | stx %i2, [\r + OFFSET_I2] |
39 | stx %i2, [\r + OFFSET_I2] |
48 | stx %i3, [\r + OFFSET_I3] |
40 | stx %i3, [\r + OFFSET_I3] |
49 | stx %i4, [\r + OFFSET_I4] |
41 | stx %i4, [\r + OFFSET_I4] |
50 | stx %i5, [\r + OFFSET_I5] |
42 | stx %i5, [\r + OFFSET_I5] |
51 | stx %i6, [\r + OFFSET_SP] |
43 | stx %fp, [\r + OFFSET_FP] |
52 | stx %i7, [\r + OFFSET_PC] |
44 | stx %i7, [\r + OFFSET_PC] |
- | 45 | stx %sp, [\r + OFFSET_SP] |
|
53 | .endm |
46 | .endm |
54 | 47 | ||
55 | .macro CONTEXT_LOAD r |
48 | .macro CONTEXT_LOAD r |
56 | ldx [\r + OFFSET_L0], %l0 |
- | |
57 | ldx [\r + OFFSET_L1], %l1 |
- | |
58 | ldx [\r + OFFSET_L2], %l2 |
- | |
59 | ldx [\r + OFFSET_L3], %l3 |
- | |
60 | ldx [\r + OFFSET_L4], %l4 |
- | |
61 | ldx [\r + OFFSET_L5], %l5 |
- | |
62 | ldx [\r + OFFSET_L6], %l6 |
- | |
63 | ldx [\r + OFFSET_L7], %l7 |
- | |
64 | ldx [\r + OFFSET_I1], %i1 |
49 | ldx [\r + OFFSET_I1], %i1 |
65 | ldx [\r + OFFSET_I2], %i2 |
50 | ldx [\r + OFFSET_I2], %i2 |
66 | ldx [\r + OFFSET_I3], %i3 |
51 | ldx [\r + OFFSET_I3], %i3 |
67 | ldx [\r + OFFSET_I4], %i4 |
52 | ldx [\r + OFFSET_I4], %i4 |
68 | ldx [\r + OFFSET_I5], %i5 |
53 | ldx [\r + OFFSET_I5], %i5 |
69 | ldx [\r + OFFSET_SP], %i6 |
54 | ldx [\r + OFFSET_FP], %fp |
70 | ldx [\r + OFFSET_PC], %i7 |
55 | ldx [\r + OFFSET_PC], %i7 |
71 | ldx [\r + OFFSET_SP], %sp |
56 | ldx [\r + OFFSET_SP], %sp |
72 | .endm |
57 | .endm |
73 | 58 | ||
74 | 59 | ||
75 | context_save_arch: |
60 | context_save_arch: |
76 | save %sp, -STACK_WINDOW_SAVE_AREA_SIZE, %sp |
61 | save %sp, -STACK_WINDOW_SAVE_AREA_SIZE, %sp |
77 | CONTEXT_STORE %i0 |
62 | CONTEXT_STORE %i0 |
78 | 63 | ||
79 | # context_save returns 1 |
64 | # context_save returns 1 |
80 | mov 1, %i0 |
65 | mov 1, %i0 |
81 | ret |
66 | ret |
82 | restore %sp, 128, %sp |
67 | restore %sp, STACK_WINDOW_SAVE_AREA_SIZE, %sp |
83 | 68 | ||
84 | context_restore_arch: |
69 | context_restore_arch: |
85 | save %sp, -STACK_WINDOW_SAVE_AREA_SIZE, %sp |
70 | save %sp, -STACK_WINDOW_SAVE_AREA_SIZE, %sp |
86 | CONTEXT_LOAD %i0 |
71 | CONTEXT_LOAD %i0 |
87 | 72 | ||
88 | # context_restore returns 0 |
73 | # context_restore returns 0 |
89 | xor %i0, %i0, %i0 |
74 | xor %i0, %i0, %i0 |
90 | ret |
75 | ret |
91 | restore %sp, STACK_WINDOW_SAVE_AREA_SIZE, %sp |
76 | restore %sp, STACK_WINDOW_SAVE_AREA_SIZE, %sp |