| 1 | /* |
| 2 | * ========== Copyright Header Begin ========================================== |
| 3 | * |
| 4 | * OpenSPARC T2 Processor File: tso_n1_self_mod106.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 | #define MAIN_BASE_DATA_ADDR 0x160000 |
| 39 | #define MAIN_BASE_TEXT_ADDR 0x150000 |
| 40 | #define MAIN_BASE_DATA_ADDR_RA 0x100160000 |
| 41 | #define MAIN_BASE_TEXT_ADDR_RA 0x100150000 |
| 42 | |
| 43 | #define USER_PAGE_CUSTOM_MAP |
| 44 | #include "hboot.s" |
| 45 | |
| 46 | SECTION .MAIN TEXT_VA=0x150000, DATA_VA=0x160000 |
| 47 | |
| 48 | attr_text { |
| 49 | Name = .MAIN, |
| 50 | VA=MAIN_BASE_TEXT_ADDR, |
| 51 | RA=MAIN_BASE_TEXT_ADDR_RA, |
| 52 | PA=ra2pa(MAIN_BASE_TEXT_ADDR_RA,0), |
| 53 | part_0_ctx_nonzero_tsb_config_0, |
| 54 | TTE_G=0, TTE_Context=PCONTEXT, TTE_V=1, TTE_Size=0, TTE_NFO=0, |
| 55 | TTE_IE=0, TTE_Soft2=0, TTE_Diag=0, TTE_Soft=0, |
| 56 | TTE_L=0, TTE_CP=1, TTE_CV=1, TTE_E=0, TTE_EP=1, TTE_P=0, TTE_W=1 |
| 57 | } |
| 58 | attr_data { |
| 59 | Name = .MAIN, |
| 60 | VA=MAIN_BASE_DATA_ADDR, |
| 61 | RA=MAIN_BASE_DATA_ADDR_RA, |
| 62 | PA=ra2pa(MAIN_BASE_DATA_ADDR_RA,0), |
| 63 | part_0_ctx_nonzero_tsb_config_0, |
| 64 | TTE_G=0, TTE_Context=PCONTEXT, TTE_V=1, TTE_Size=0, TTE_NFO=0, |
| 65 | TTE_IE=0, TTE_Soft2=0, TTE_Diag=0, TTE_Soft=0, |
| 66 | TTE_L=0, TTE_CP=1, TTE_CV=1, TTE_E=0, TTE_P=0, TTE_W=1 |
| 67 | } |
| 68 | |
| 69 | .text |
| 70 | .global main |
| 71 | main: |
| 72 | |
| 73 | setx label0, %l0,%o0 |
| 74 | setx label1, %l0,%o1 |
| 75 | setx label2, %l0,%o2 |
| 76 | setx label3, %l0,%o3 |
| 77 | setx label4, %l0,%o4 |
| 78 | setx label5, %l0,%o5 |
| 79 | setx label6, %l0,%o6 |
| 80 | setx label7, %l0,%o7 |
| 81 | |
| 82 | setx 0x01000000, %l0, %i0 ! nop |
| 83 | setx 0xdeadbeef, %l0, %i1 ! well, you know this one. |
| 84 | |
| 85 | setx 0x20, %l0, %l2 ! loop counter |
| 86 | |
| 87 | label0a: |
| 88 | ld [%o0], %i2 ! |
| 89 | st %i0, [%o0] ! store a nop to label0 |
| 90 | flush %o0 |
| 91 | nop |
| 92 | nop |
| 93 | nop |
| 94 | nop |
| 95 | nop |
| 96 | nop |
| 97 | nop |
| 98 | nop |
| 99 | nop |
| 100 | nop |
| 101 | nop |
| 102 | nop |
| 103 | nop |
| 104 | label0: |
| 105 | ta T_BAD_TRAP ! |
| 106 | ld [%o1], %i2 ! |
| 107 | st %i0, [%o1] ! store a nop to label1 |
| 108 | flush %o0 ! |
| 109 | label1: |
| 110 | ta T_BAD_TRAP ! |
| 111 | ld [%o2], %i2 ! |
| 112 | st %i0, [%o2] ! etc. |
| 113 | flush %o0 ! |
| 114 | label2: |
| 115 | ta T_BAD_TRAP ! |
| 116 | ld [%o3], %i2 ! |
| 117 | st %i0, [%o3] |
| 118 | flush %o0 ! |
| 119 | label3: |
| 120 | ta T_BAD_TRAP ! |
| 121 | ld [%o4], %i2 ! |
| 122 | st %i0, [%o4] ! |
| 123 | flush %o0 ! |
| 124 | label4: |
| 125 | ta T_BAD_TRAP ! |
| 126 | ld [%o5], %i2 ! |
| 127 | st %i0, [%o5] ! |
| 128 | flush %o0 ! |
| 129 | label5: |
| 130 | ta T_BAD_TRAP ! |
| 131 | ld [%o6], %i2 ! |
| 132 | st %i0, [%o6] ! |
| 133 | flush %o0 ! |
| 134 | |
| 135 | label6: |
| 136 | ta T_BAD_TRAP ! |
| 137 | ld [%o7], %i2 ! |
| 138 | st %i0, [%o7] ! |
| 139 | flush %o0 ! |
| 140 | |
| 141 | label7: |
| 142 | ta T_BAD_TRAP ! |
| 143 | ld [%o0], %i2 ! |
| 144 | st %i0, [%o0] |
| 145 | flush %o0 ! |
| 146 | |
| 147 | ld [%o0], %i2 ! |
| 148 | ld [%o1], %i2 ! |
| 149 | ld [%o2], %i2 ! |
| 150 | ld [%o3], %i2 ! |
| 151 | ld [%o4], %i2 ! |
| 152 | ld [%o5], %i2 ! |
| 153 | ld [%o6], %i2 ! |
| 154 | ld [%o7], %i2 ! |
| 155 | st %i1, [%o0] ! store deadbeef to all labels |
| 156 | st %i1, [%o1] ! |
| 157 | st %i1, [%o2] ! |
| 158 | st %i1, [%o3] ! |
| 159 | st %i1, [%o4] ! |
| 160 | st %i1, [%o5] ! |
| 161 | st %i1, [%o6] ! |
| 162 | st %i1, [%o7] ! |
| 163 | |
| 164 | dec %l2 |
| 165 | brnz,pt %l2, label0a ! no loop |
| 166 | nop |
| 167 | |
| 168 | normal_end: |
| 169 | ta T_GOOD_TRAP |
| 170 | bad_end: |
| 171 | ta T_BAD_TRAP |
| 172 | |
| 173 | user_text_end: |
| 174 | |
| 175 | /*********************************************************************** |
| 176 | Test case data start |
| 177 | ***********************************************************************/ |
| 178 | .data |
| 179 | user_data_start: |
| 180 | .word 0x0 |
| 181 | user_data_end: |