| 1 | /* |
| 2 | * ========== Copyright Header Begin ========================================== |
| 3 | * |
| 4 | * OpenSPARC T2 Processor File: ctraps.s |
| 5 | * Copyright (C) 1995-2007 Sun Microsystems, Inc. All Rights Reserved |
| 6 | * 4150 Network Circle, Santa Clara, California 95054, U.S.A. |
| 7 | * |
| 8 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
| 9 | * |
| 10 | * This program is free software; you can redistribute it and/or modify |
| 11 | * it under the terms of the GNU General Public License as published by |
| 12 | * the Free Software Foundation; version 2 of the License. |
| 13 | * |
| 14 | * This program is distributed in the hope that it will be useful, |
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 | * GNU General Public License for more details. |
| 18 | * |
| 19 | * You should have received a copy of the GNU General Public License |
| 20 | * along with this program; if not, write to the Free Software |
| 21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 22 | * |
| 23 | * For the avoidance of doubt, and except that if any non-GPL license |
| 24 | * choice is available it will apply instead, Sun elects to use only |
| 25 | * the General Public License version 2 (GPLv2) at this time for any |
| 26 | * software where a choice of GPL license versions is made |
| 27 | * available with the language indicating that GPLv2 or any later version |
| 28 | * may be used, or where a choice of which version of the GPL is applied is |
| 29 | * otherwise unspecified. |
| 30 | * |
| 31 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
| 32 | * CA 95054 USA or visit www.sun.com if you need additional information or |
| 33 | * have any questions. |
| 34 | * |
| 35 | * |
| 36 | * ========== Copyright Header End ============================================ |
| 37 | */ |
| 38 | .text |
| 39 | |
| 40 | #define ASI_AS_IF_USER_BLK_INIT_ST_QUAD_LDD_S 0x22 |
| 41 | |
| 42 | #ifdef SPILL_RMO |
| 43 | .align 4 |
| 44 | .global spill_trap |
| 45 | spill_trap: |
| 46 | wr %g0, ASI_AS_IF_USER_BLK_INIT_ST_QUAD_LDD_S, %asi |
| 47 | stxa %l0, [%sp + STACK_BIAS + 0x00] %asi |
| 48 | stxa %l1, [%sp + STACK_BIAS + 0x08] %asi |
| 49 | stxa %l2, [%sp + STACK_BIAS + 0x10] %asi |
| 50 | stxa %l3, [%sp + STACK_BIAS + 0x18] %asi |
| 51 | stxa %l4, [%sp + STACK_BIAS + 0x20] %asi |
| 52 | stxa %l5, [%sp + STACK_BIAS + 0x28] %asi |
| 53 | stxa %l6, [%sp + STACK_BIAS + 0x30] %asi |
| 54 | stxa %l7, [%sp + STACK_BIAS + 0x38] %asi |
| 55 | stxa %i0, [%sp + STACK_BIAS + 0x40] %asi |
| 56 | wr %g0, ASI_AS_IF_USER_PRIMARY, %asi |
| 57 | stxa %i1, [%sp + STACK_BIAS + 0x48] %asi |
| 58 | stxa %i2, [%sp + STACK_BIAS + 0x50] %asi |
| 59 | stxa %i3, [%sp + STACK_BIAS + 0x58] %asi |
| 60 | stxa %i4, [%sp + STACK_BIAS + 0x60] %asi |
| 61 | stxa %i5, [%sp + STACK_BIAS + 0x68] %asi |
| 62 | stxa %i6, [%sp + STACK_BIAS + 0x70] %asi |
| 63 | stxa %i7, [%sp + STACK_BIAS + 0x78] %asi |
| 64 | saved |
| 65 | membar #Sync |
| 66 | retry |
| 67 | nop |
| 68 | |
| 69 | |
| 70 | #else |
| 71 | .align 4 |
| 72 | .global spill_trap |
| 73 | spill_trap: |
| 74 | wr %g0, ASI_AS_IF_USER_PRIMARY, %asi |
| 75 | stxa %l0, [%sp + STACK_BIAS + 0x00] %asi |
| 76 | stxa %l1, [%sp + STACK_BIAS + 0x08] %asi |
| 77 | stxa %l2, [%sp + STACK_BIAS + 0x10] %asi |
| 78 | stxa %l3, [%sp + STACK_BIAS + 0x18] %asi |
| 79 | stxa %l4, [%sp + STACK_BIAS + 0x20] %asi |
| 80 | stxa %l5, [%sp + STACK_BIAS + 0x28] %asi |
| 81 | stxa %l6, [%sp + STACK_BIAS + 0x30] %asi |
| 82 | stxa %l7, [%sp + STACK_BIAS + 0x38] %asi |
| 83 | stxa %i0, [%sp + STACK_BIAS + 0x40] %asi |
| 84 | stxa %i1, [%sp + STACK_BIAS + 0x48] %asi |
| 85 | stxa %i2, [%sp + STACK_BIAS + 0x50] %asi |
| 86 | stxa %i3, [%sp + STACK_BIAS + 0x58] %asi |
| 87 | stxa %i4, [%sp + STACK_BIAS + 0x60] %asi |
| 88 | stxa %i5, [%sp + STACK_BIAS + 0x68] %asi |
| 89 | stxa %i6, [%sp + STACK_BIAS + 0x70] %asi |
| 90 | stxa %i7, [%sp + STACK_BIAS + 0x78] %asi |
| 91 | saved |
| 92 | retry |
| 93 | nop |
| 94 | #endif |
| 95 | |
| 96 | .align 4 |
| 97 | .global fill_trap |
| 98 | |
| 99 | fill_trap: |
| 100 | wr %g0, ASI_AS_IF_USER_PRIMARY, %asi |
| 101 | ldxa [%sp + STACK_BIAS + 0x00] %asi, %l0 |
| 102 | ldxa [%sp + STACK_BIAS + 0x08] %asi, %l1 |
| 103 | ldxa [%sp + STACK_BIAS + 0x10] %asi, %l2 |
| 104 | ldxa [%sp + STACK_BIAS + 0x18] %asi, %l3 |
| 105 | ldxa [%sp + STACK_BIAS + 0x20] %asi, %l4 |
| 106 | ldxa [%sp + STACK_BIAS + 0x28] %asi, %l5 |
| 107 | ldxa [%sp + STACK_BIAS + 0x30] %asi, %l6 |
| 108 | ldxa [%sp + STACK_BIAS + 0x38] %asi, %l7 |
| 109 | ldxa [%sp + STACK_BIAS + 0x40] %asi, %i0 |
| 110 | ldxa [%sp + STACK_BIAS + 0x48] %asi, %i1 |
| 111 | ldxa [%sp + STACK_BIAS + 0x50] %asi, %i2 |
| 112 | ldxa [%sp + STACK_BIAS + 0x58] %asi, %i3 |
| 113 | ldxa [%sp + STACK_BIAS + 0x60] %asi, %i4 |
| 114 | ldxa [%sp + STACK_BIAS + 0x68] %asi, %i5 |
| 115 | ldxa [%sp + STACK_BIAS + 0x70] %asi, %i6 |
| 116 | ldxa [%sp + STACK_BIAS + 0x78] %asi, %i7 |
| 117 | restored |
| 118 | retry |
| 119 | nop |
| 120 | |
| 121 | .data |
| 122 | .word 0 |