Rev 3993 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3993 | Rev 4369 | ||
---|---|---|---|
1 | /* |
1 | /* |
2 | * Copyright (c) 2005 Jakub Jermar |
2 | * Copyright (c) 2005 Jakub Jermar |
3 | * Copyright (c) 2009 Pavel Rimsky |
3 | * Copyright (c) 2009 Pavel Rimsky |
4 | * All rights reserved. |
4 | * All rights reserved. |
5 | * |
5 | * |
6 | * Redistribution and use in source and binary forms, with or without |
6 | * Redistribution and use in source and binary forms, with or without |
7 | * modification, are permitted provided that the following conditions |
7 | * modification, are permitted provided that the following conditions |
8 | * are met: |
8 | * are met: |
9 | * |
9 | * |
10 | * - Redistributions of source code must retain the above copyright |
10 | * - Redistributions of source code must retain the above copyright |
11 | * notice, this list of conditions and the following disclaimer. |
11 | * notice, this list of conditions and the following disclaimer. |
12 | * - Redistributions in binary form must reproduce the above copyright |
12 | * - Redistributions in binary form must reproduce the above copyright |
13 | * notice, this list of conditions and the following disclaimer in the |
13 | * notice, this list of conditions and the following disclaimer in the |
14 | * documentation and/or other materials provided with the distribution. |
14 | * documentation and/or other materials provided with the distribution. |
15 | * - The name of the author may not be used to endorse or promote products |
15 | * - The name of the author may not be used to endorse or promote products |
16 | * derived from this software without specific prior written permission. |
16 | * derived from this software without specific prior written permission. |
17 | * |
17 | * |
18 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
18 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
19 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
19 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
20 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
20 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
21 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
21 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
22 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
22 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
23 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
23 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
24 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
25 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
26 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
26 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
27 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 | */ |
28 | */ |
29 | 29 | ||
30 | /** @addtogroup sparc64interrupt |
30 | /** @addtogroup sparc64interrupt |
31 | * @{ |
31 | * @{ |
32 | */ |
32 | */ |
33 | #ifndef KERN_sparc64_sun4v_REGWIN_H_ |
33 | #ifndef KERN_sparc64_sun4v_REGWIN_H_ |
34 | #define KERN_sparc64_sun4v_REGWIN_H_ |
34 | #define KERN_sparc64_sun4v_REGWIN_H_ |
35 | 35 | ||
36 | #ifdef __ASM__ |
36 | #ifdef __ASM__ |
37 | 37 | ||
38 | /* |
38 | /* |
39 | * Saves the contents of the current window to the userspace window buffer. |
39 | * Saves the contents of the current window to the userspace window buffer. |
40 | * Does not modify any register window registers, but updates pointer to the |
40 | * Does not modify any register window registers, but updates pointer to the |
41 | * top of the userspace window buffer. |
41 | * top of the userspace window buffer. |
42 | * |
42 | * |
43 | * Parameters: |
43 | * Parameters: |
44 | * \tmpreg1 global register to be used for scratching purposes |
44 | * \tmpreg1 global register to be used for scratching purposes |
45 | * \tmpreg2 global register to be used for scratching purposes |
45 | * \tmpreg2 global register to be used for scratching purposes |
46 | */ |
46 | */ |
47 | .macro SAVE_TO_USPACE_WBUF tmpreg1, tmpreg2 |
47 | .macro SAVE_TO_USPACE_WBUF tmpreg1, tmpreg2 |
48 | get_kstack_wbuf_ptr \tmpreg1, \tmpreg2 |
48 | set SCRATCHPAD_WBUF, \tmpreg2 |
49 | ldx [\tmpreg2 + 8], \tmpreg1 |
49 | ldxa [\tmpreg2] ASI_SCRATCHPAD, \tmpreg1 |
50 | stx %l0, [\tmpreg1 + L0_OFFSET] |
50 | stx %l0, [\tmpreg1 + L0_OFFSET] |
51 | stx %l1, [\tmpreg1 + L1_OFFSET] |
51 | stx %l1, [\tmpreg1 + L1_OFFSET] |
52 | stx %l2, [\tmpreg1 + L2_OFFSET] |
52 | stx %l2, [\tmpreg1 + L2_OFFSET] |
53 | stx %l3, [\tmpreg1 + L3_OFFSET] |
53 | stx %l3, [\tmpreg1 + L3_OFFSET] |
54 | stx %l4, [\tmpreg1 + L4_OFFSET] |
54 | stx %l4, [\tmpreg1 + L4_OFFSET] |
55 | stx %l5, [\tmpreg1 + L5_OFFSET] |
55 | stx %l5, [\tmpreg1 + L5_OFFSET] |
56 | stx %l6, [\tmpreg1 + L6_OFFSET] |
56 | stx %l6, [\tmpreg1 + L6_OFFSET] |
57 | stx %l7, [\tmpreg1 + L7_OFFSET] |
57 | stx %l7, [\tmpreg1 + L7_OFFSET] |
58 | stx %i0, [\tmpreg1 + I0_OFFSET] |
58 | stx %i0, [\tmpreg1 + I0_OFFSET] |
59 | stx %i1, [\tmpreg1 + I1_OFFSET] |
59 | stx %i1, [\tmpreg1 + I1_OFFSET] |
60 | stx %i2, [\tmpreg1 + I2_OFFSET] |
60 | stx %i2, [\tmpreg1 + I2_OFFSET] |
61 | stx %i3, [\tmpreg1 + I3_OFFSET] |
61 | stx %i3, [\tmpreg1 + I3_OFFSET] |
62 | stx %i4, [\tmpreg1 + I4_OFFSET] |
62 | stx %i4, [\tmpreg1 + I4_OFFSET] |
63 | stx %i5, [\tmpreg1 + I5_OFFSET] |
63 | stx %i5, [\tmpreg1 + I5_OFFSET] |
64 | stx %i6, [\tmpreg1 + I6_OFFSET] |
64 | stx %i6, [\tmpreg1 + I6_OFFSET] |
65 | stx %i7, [\tmpreg1 + I7_OFFSET] |
65 | stx %i7, [\tmpreg1 + I7_OFFSET] |
66 | add \tmpreg1, STACK_WINDOW_SAVE_AREA_SIZE, \tmpreg1 |
66 | add \tmpreg1, STACK_WINDOW_SAVE_AREA_SIZE, \tmpreg1 |
67 | stx \tmpreg1, [\tmpreg2 + 8] |
67 | stxa \tmpreg1, [\tmpreg2] ASI_SCRATCHPAD |
68 | .endm |
68 | .endm |
69 | 69 | ||
70 | /* |
70 | /* |
71 | * Macro used to spill userspace window to userspace window buffer. |
71 | * Macro used to spill userspace window to userspace window buffer. |
72 | * It is triggered from normal kernel code doing SAVE when |
72 | * It is triggered from normal kernel code doing SAVE when |
73 | * OTHERWIN>0 at (TL=0). |
73 | * OTHERWIN>0 at (TL=0). |
74 | */ |
74 | */ |
75 | .macro SPILL_TO_USPACE_WINDOW_BUFFER |
75 | .macro SPILL_TO_USPACE_WINDOW_BUFFER |
76 | SAVE_TO_USPACE_WBUF %g7, %g4 |
76 | SAVE_TO_USPACE_WBUF %g7, %g4 |
77 | saved |
77 | saved |
78 | retry |
78 | retry |
79 | .endm |
79 | .endm |
80 | 80 | ||
81 | #endif |
81 | #endif |
82 | 82 | ||
83 | #endif |
83 | #endif |
84 | 84 | ||
85 | /** @} |
85 | /** @} |
86 | */ |
86 | */ |
87 | 87 |