7 #include <linux/kernel.h>
8 #include <linux/sched.h>
9 #include <linux/string.h>
13 #include <asm/uaccess.h>
18 register int ctr
asm(
"g5");
23 "ld [%%g6 + %2], %%g4\n\t"
24 "orcc %%g0, %%g4, %%g0\n\t"
27 " save %%sp, -64, %%sp\n"
31 " restore %%g0, %%g0, %%g0\n"
34 "i" ((
const unsigned long)TI_UWINMASK)
38 static inline void shift_window_buffer(
int first_win,
int last_win,
struct thread_info *tp)
42 for(i = first_win; i < last_win; i++) {
43 tp->rwbuf_stkptrs[
i] = tp->rwbuf_stkptrs[i+1];
67 for(window = tp->w_saved - 1; window >= 0; window--) {
68 unsigned long sp = tp->rwbuf_stkptrs[
window];
75 shift_window_buffer(window, tp->w_saved - 1, tp);
82 static inline void copy_aligned_window(
void *
dest,
const void *
src)
84 __asm__ __volatile__(
"ldd [%1], %%g2\n\t"
85 "ldd [%1 + 0x8], %%g4\n\t"
87 "std %%g4, [%0 + 0x8]\n\t"
88 "ldd [%1 + 0x10], %%g2\n\t"
89 "ldd [%1 + 0x18], %%g4\n\t"
90 "std %%g2, [%0 + 0x10]\n\t"
91 "std %%g4, [%0 + 0x18]\n\t"
92 "ldd [%1 + 0x20], %%g2\n\t"
93 "ldd [%1 + 0x28], %%g4\n\t"
94 "std %%g2, [%0 + 0x20]\n\t"
95 "std %%g4, [%0 + 0x28]\n\t"
96 "ldd [%1 + 0x30], %%g2\n\t"
97 "ldd [%1 + 0x38], %%g4\n\t"
98 "std %%g2, [%0 + 0x30]\n\t"
99 "std %%g4, [%0 + 0x38]\n\t" : :
100 "r" (dest),
"r" (src) :
101 "g2",
"g3",
"g4",
"g5");
115 for(window = 0; window < tp->w_saved; window++) {
116 unsigned long sp = tp->rwbuf_stkptrs[
window];