Rev 2787 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2787 | Rev 2925 | ||
---|---|---|---|
Line 34... | Line 34... | ||
34 | * is very important and prevents any implicit window |
34 | * is very important and prevents any implicit window |
35 | * spill/fill/clean traps in these very core kernel |
35 | * spill/fill/clean traps in these very core kernel |
36 | * functions. |
36 | * functions. |
37 | */ |
37 | */ |
38 | 38 | ||
- | 39 | #include <arch/context_offset.h> |
|
- | 40 | ||
39 | .text |
41 | .text |
40 | 42 | ||
41 | .global context_save_arch |
43 | .global context_save_arch |
42 | .global context_restore_arch |
44 | .global context_restore_arch |
43 | 45 | ||
44 | .macro CONTEXT_STORE r |
- | |
45 | stx %sp, [\r + OFFSET_SP] |
- | |
46 | stx %o7, [\r + OFFSET_PC] |
- | |
47 | stx %i0, [\r + OFFSET_I0] |
- | |
48 | stx %i1, [\r + OFFSET_I1] |
- | |
49 | stx %i2, [\r + OFFSET_I2] |
- | |
50 | stx %i3, [\r + OFFSET_I3] |
- | |
51 | stx %i4, [\r + OFFSET_I4] |
- | |
52 | stx %i5, [\r + OFFSET_I5] |
- | |
53 | stx %fp, [\r + OFFSET_FP] |
- | |
54 | stx %i7, [\r + OFFSET_I7] |
- | |
55 | stx %l0, [\r + OFFSET_L0] |
- | |
56 | stx %l1, [\r + OFFSET_L1] |
- | |
57 | stx %l2, [\r + OFFSET_L2] |
- | |
58 | stx %l3, [\r + OFFSET_L3] |
- | |
59 | stx %l4, [\r + OFFSET_L4] |
- | |
60 | stx %l5, [\r + OFFSET_L5] |
- | |
61 | stx %l6, [\r + OFFSET_L6] |
- | |
62 | stx %l7, [\r + OFFSET_L7] |
- | |
63 | .endm |
- | |
64 | - | ||
65 | .macro CONTEXT_LOAD r |
- | |
66 | ldx [\r + OFFSET_SP], %sp |
- | |
67 | ldx [\r + OFFSET_PC], %o7 |
- | |
68 | ldx [\r + OFFSET_I0], %i0 |
- | |
69 | ldx [\r + OFFSET_I1], %i1 |
- | |
70 | ldx [\r + OFFSET_I2], %i2 |
- | |
71 | ldx [\r + OFFSET_I3], %i3 |
- | |
72 | ldx [\r + OFFSET_I4], %i4 |
- | |
73 | ldx [\r + OFFSET_I5], %i5 |
- | |
74 | ldx [\r + OFFSET_FP], %fp |
- | |
75 | ldx [\r + OFFSET_I7], %i7 |
- | |
76 | ldx [\r + OFFSET_L0], %l0 |
- | |
77 | ldx [\r + OFFSET_L1], %l1 |
- | |
78 | ldx [\r + OFFSET_L2], %l2 |
- | |
79 | ldx [\r + OFFSET_L3], %l3 |
- | |
80 | ldx [\r + OFFSET_L4], %l4 |
- | |
81 | ldx [\r + OFFSET_L5], %l5 |
- | |
82 | ldx [\r + OFFSET_L6], %l6 |
- | |
83 | ldx [\r + OFFSET_L7], %l7 |
- | |
84 | .endm |
- | |
85 | - | ||
86 | context_save_arch: |
46 | context_save_arch: |
87 | CONTEXT_STORE %o0 |
47 | CONTEXT_SAVE_ARCH_CORE %o0 |
88 | retl |
48 | retl |
89 | mov 1, %o0 ! context_save_arch returns 1 |
49 | mov 1, %o0 ! context_save_arch returns 1 |
90 | 50 | ||
91 | context_restore_arch: |
51 | context_restore_arch: |
92 | # |
52 | # |
Line 96... | Line 56... | ||
96 | # Flushing all active windows mitigates this problem |
56 | # Flushing all active windows mitigates this problem |
97 | # as CWP - 1 becomes the overlap window. |
57 | # as CWP - 1 becomes the overlap window. |
98 | # |
58 | # |
99 | flushw |
59 | flushw |
100 | 60 | ||
101 | CONTEXT_LOAD %o0 |
61 | CONTEXT_RESTORE_ARCH_CORE %o0 |
102 | retl |
62 | retl |
103 | xor %o0, %o0, %o0 ! context_restore_arch returns 0 |
63 | xor %o0, %o0, %o0 ! context_restore_arch returns 0 |