Changeset cefb126 in mainline for kernel/arch/sparc64
- Timestamp:
- 2010-07-02T14:19:30Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 89c57b6
- Parents:
- fe7abd0 (diff), e3ee9b9 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - Location:
- kernel/arch/sparc64
- Files:
-
- 1 deleted
- 11 edited
-
Makefile.inc (modified) (1 diff)
-
include/drivers/tick.h (modified) (2 diffs)
-
include/types.h (modified) (1 diff)
-
src/asm.S (modified) (7 diffs)
-
src/drivers/tick.c (modified) (2 diffs)
-
src/mm/sun4u/frame.c (modified) (2 diffs)
-
src/mm/sun4u/tlb.c (modified) (7 diffs)
-
src/mm/sun4v/frame.c (modified) (1 diff)
-
src/mm/sun4v/tlb.c (modified) (6 diffs)
-
src/panic.S (deleted)
-
src/trap/exception.c (modified) (20 diffs)
-
src/trap/sun4v/interrupt.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/sparc64/Makefile.inc
rfe7abd0 rcefb126 64 64 arch/$(KARCH)/src/asm.S \ 65 65 arch/$(KARCH)/src/$(USARCH)/asm.S \ 66 arch/$(KARCH)/src/panic.S \67 66 arch/$(KARCH)/src/console.c \ 68 67 arch/$(KARCH)/src/context.S \ -
kernel/arch/sparc64/include/drivers/tick.h
rfe7abd0 rcefb126 27 27 */ 28 28 29 /** @addtogroup sparc64 29 /** @addtogroup sparc64 30 30 * @{ 31 31 */ … … 40 40 41 41 /* mask of the "counter" field of the Tick register */ 42 #define TICK_COUNTER_MASK (~(1l << 63))42 #define TICK_COUNTER_MASK (~(1l << 63)) 43 43 44 44 extern void tick_init(void); 45 extern void tick_interrupt( int n, istate_t *istate);45 extern void tick_interrupt(unsigned int, istate_t *); 46 46 47 47 /** -
kernel/arch/sparc64/include/types.h
rfe7abd0 rcefb126 52 52 typedef uint8_t asi_t; 53 53 54 /** <Formats for uintptr_t, size_t */54 /** Formats for uintptr_t, size_t */ 55 55 #define PRIp "llx" 56 56 #define PRIs "llu" 57 57 58 /** <Formats for (u)int8_t, (u)int16_t, (u)int32_t, (u)int64_t and (u)native_t */58 /** Formats for (u)int8_t, (u)int16_t, (u)int32_t, (u)int64_t and (u)native_t */ 59 59 #define PRId8 "d" 60 60 #define PRId16 "d" -
kernel/arch/sparc64/src/asm.S
rfe7abd0 rcefb126 1 # 2 #Copyright (c) 2005 Jakub Jermar3 #All rights reserved.4 # 5 #Redistribution and use in source and binary forms, with or without6 #modification, are permitted provided that the following conditions7 #are met:8 # 9 #- Redistributions of source code must retain the above copyright10 #notice, this list of conditions and the following disclaimer.11 #- Redistributions in binary form must reproduce the above copyright12 #notice, this list of conditions and the following disclaimer in the13 #documentation and/or other materials provided with the distribution.14 #- The name of the author may not be used to endorse or promote products15 #derived from this software without specific prior written permission.16 # 17 #THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR18 #IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES19 #OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.20 #IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,21 #INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT22 #NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,23 #DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY24 #THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT25 #(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF26 #THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.27 # 1 /* 2 * Copyright (c) 2005 Jakub Jermar 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 9 * - Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer. 11 * - Redistributions in binary form must reproduce the above copyright 12 * notice, this list of conditions and the following disclaimer in the 13 * documentation and/or other materials provided with the distribution. 14 * - The name of the author may not be used to endorse or promote products 15 * derived from this software without specific prior written permission. 16 * 17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 */ 28 28 29 29 #include <arch/arch.h> … … 32 32 .text 33 33 34 .register %g2, #scratch35 .register %g3, #scratch34 .register %g2, #scratch 35 .register %g3, #scratch 36 36 37 37 /* … … 40 40 .global memcpy 41 41 memcpy: 42 mov %o0, %o3 ! save dst 43 add %o1, 7, %g1 44 and %g1, -8, %g1 45 cmp %o1, %g1 46 be,pn %xcc, 3f 47 add %o0, 7, %g1 48 mov 0, %g3 49 0: 50 brz,pn %o2, 2f 51 mov 0, %g2 52 1: 53 ldub [%g3 + %o1], %g1 54 add %g2, 1, %g2 55 cmp %o2, %g2 56 stb %g1, [%g3 + %o0] 57 bne,pt %xcc, 1b 58 mov %g2, %g3 59 2: 60 jmp %o7 + 8 ! exit point 61 mov %o3, %o0 62 3: 63 and %g1, -8, %g1 64 cmp %o0, %g1 65 bne,pt %xcc, 0b 66 mov 0, %g3 67 srlx %o2, 3, %g4 68 brz,pn %g4, 5f 69 mov 0, %g5 70 4: 71 sllx %g3, 3, %g2 72 add %g5, 1, %g3 73 ldx [%o1 + %g2], %g1 74 mov %g3, %g5 75 cmp %g4, %g3 76 bne,pt %xcc, 4b 77 stx %g1, [%o0 + %g2] 78 5: 79 and %o2, 7, %o2 80 brz,pn %o2, 2b 81 sllx %g4, 3, %g1 82 mov 0, %g2 83 add %g1, %o0, %o0 84 add %g1, %o1, %g4 85 mov 0, %g3 86 6: 87 ldub [%g2 + %g4], %g1 88 stb %g1, [%g2 + %o0] 89 add %g3, 1, %g2 90 cmp %o2, %g2 91 bne,pt %xcc, 6b 92 mov %g2, %g3 93 94 jmp %o7 + 8 ! exit point 95 mov %o3, %o0 42 mov %o0, %o3 /* save dst */ 43 add %o1, 7, %g1 44 and %g1, -8, %g1 45 cmp %o1, %g1 46 be,pn %xcc, 3f 47 add %o0, 7, %g1 48 mov 0, %g3 49 50 0: 51 52 brz,pn %o2, 2f 53 mov 0, %g2 54 55 1: 56 57 ldub [%g3 + %o1], %g1 58 add %g2, 1, %g2 59 cmp %o2, %g2 60 stb %g1, [%g3 + %o0] 61 bne,pt %xcc, 1b 62 mov %g2, %g3 63 64 2: 65 66 jmp %o7 + 8 /* exit point */ 67 mov %o3, %o0 68 69 3: 70 71 and %g1, -8, %g1 72 cmp %o0, %g1 73 bne,pt %xcc, 0b 74 mov 0, %g3 75 srlx %o2, 3, %g4 76 brz,pn %g4, 5f 77 mov 0, %g5 78 79 4: 80 81 sllx %g3, 3, %g2 82 add %g5, 1, %g3 83 ldx [%o1 + %g2], %g1 84 mov %g3, %g5 85 cmp %g4, %g3 86 bne,pt %xcc, 4b 87 stx %g1, [%o0 + %g2] 88 89 5: 90 91 and %o2, 7, %o2 92 brz,pn %o2, 2b 93 sllx %g4, 3, %g1 94 mov 0, %g2 95 add %g1, %o0, %o0 96 add %g1, %o1, %g4 97 mov 0, %g3 98 99 6: 100 101 ldub [%g2 + %g4], %g1 102 stb %g1, [%g2 + %o0] 103 add %g3, 1, %g2 104 cmp %o2, %g2 105 bne,pt %xcc, 6b 106 mov %g2, %g3 107 108 jmp %o7 + 8 /* exit point */ 109 mov %o3, %o0 96 110 97 111 /* … … 100 114 .global memcpy_from_uspace 101 115 memcpy_from_uspace: 102 mov %o0, %o3 ! save dst 103 add %o1, 7, %g1 104 and %g1, -8, %g1 105 cmp %o1, %g1 106 be,pn %xcc, 3f 107 add %o0, 7, %g1 108 mov 0, %g3 109 0: 110 brz,pn %o2, 2f 111 mov 0, %g2 112 1: 113 lduba [%g3 + %o1] ASI_AIUS, %g1 114 add %g2, 1, %g2 115 cmp %o2, %g2 116 stb %g1, [%g3 + %o0] 117 bne,pt %xcc, 1b 118 mov %g2, %g3 119 2: 120 jmp %o7 + 8 ! exit point 121 mov %o3, %o0 122 3: 123 and %g1, -8, %g1 124 cmp %o0, %g1 125 bne,pt %xcc, 0b 126 mov 0, %g3 127 srlx %o2, 3, %g4 128 brz,pn %g4, 5f 129 mov 0, %g5 130 4: 131 sllx %g3, 3, %g2 132 add %g5, 1, %g3 133 ldxa [%o1 + %g2] ASI_AIUS, %g1 134 mov %g3, %g5 135 cmp %g4, %g3 136 bne,pt %xcc, 4b 137 stx %g1, [%o0 + %g2] 138 5: 139 and %o2, 7, %o2 140 brz,pn %o2, 2b 141 sllx %g4, 3, %g1 142 mov 0, %g2 143 add %g1, %o0, %o0 144 add %g1, %o1, %g4 145 mov 0, %g3 146 6: 147 lduba [%g2 + %g4] ASI_AIUS, %g1 148 stb %g1, [%g2 + %o0] 149 add %g3, 1, %g2 150 cmp %o2, %g2 151 bne,pt %xcc, 6b 152 mov %g2, %g3 153 154 jmp %o7 + 8 ! exit point 155 mov %o3, %o0 116 mov %o0, %o3 /* save dst */ 117 add %o1, 7, %g1 118 and %g1, -8, %g1 119 cmp %o1, %g1 120 be,pn %xcc, 3f 121 add %o0, 7, %g1 122 mov 0, %g3 123 124 0: 125 126 brz,pn %o2, 2f 127 mov 0, %g2 128 129 1: 130 131 lduba [%g3 + %o1] ASI_AIUS, %g1 132 add %g2, 1, %g2 133 cmp %o2, %g2 134 stb %g1, [%g3 + %o0] 135 bne,pt %xcc, 1b 136 mov %g2, %g3 137 138 2: 139 140 jmp %o7 + 8 /* exit point */ 141 mov %o3, %o0 142 143 3: 144 145 and %g1, -8, %g1 146 cmp %o0, %g1 147 bne,pt %xcc, 0b 148 mov 0, %g3 149 srlx %o2, 3, %g4 150 brz,pn %g4, 5f 151 mov 0, %g5 152 153 4: 154 155 sllx %g3, 3, %g2 156 add %g5, 1, %g3 157 ldxa [%o1 + %g2] ASI_AIUS, %g1 158 mov %g3, %g5 159 cmp %g4, %g3 160 bne,pt %xcc, 4b 161 stx %g1, [%o0 + %g2] 162 163 5: 164 165 and %o2, 7, %o2 166 brz,pn %o2, 2b 167 sllx %g4, 3, %g1 168 mov 0, %g2 169 add %g1, %o0, %o0 170 add %g1, %o1, %g4 171 mov 0, %g3 172 173 6: 174 175 lduba [%g2 + %g4] ASI_AIUS, %g1 176 stb %g1, [%g2 + %o0] 177 add %g3, 1, %g2 178 cmp %o2, %g2 179 bne,pt %xcc, 6b 180 mov %g2, %g3 181 182 jmp %o7 + 8 /* exit point */ 183 mov %o3, %o0 156 184 157 185 /* … … 160 188 .global memcpy_to_uspace 161 189 memcpy_to_uspace: 162 mov %o0, %o3 ! save dst 163 add %o1, 7, %g1 164 and %g1, -8, %g1 165 cmp %o1, %g1 166 be,pn %xcc, 3f 167 add %o0, 7, %g1 168 mov 0, %g3 169 0: 170 brz,pn %o2, 2f 171 mov 0, %g2 172 1: 173 ldub [%g3 + %o1], %g1 174 add %g2, 1, %g2 175 cmp %o2, %g2 176 stba %g1, [%g3 + %o0] ASI_AIUS 177 bne,pt %xcc, 1b 178 mov %g2, %g3 179 2: 180 jmp %o7 + 8 ! exit point 181 mov %o3, %o0 182 3: 183 and %g1, -8, %g1 184 cmp %o0, %g1 185 bne,pt %xcc, 0b 186 mov 0, %g3 187 srlx %o2, 3, %g4 188 brz,pn %g4, 5f 189 mov 0, %g5 190 4: 191 sllx %g3, 3, %g2 192 add %g5, 1, %g3 193 ldx [%o1 + %g2], %g1 194 mov %g3, %g5 195 cmp %g4, %g3 196 bne,pt %xcc, 4b 197 stxa %g1, [%o0 + %g2] ASI_AIUS 198 5: 199 and %o2, 7, %o2 200 brz,pn %o2, 2b 201 sllx %g4, 3, %g1 202 mov 0, %g2 203 add %g1, %o0, %o0 204 add %g1, %o1, %g4 205 mov 0, %g3 206 6: 207 ldub [%g2 + %g4], %g1 208 stba %g1, [%g2 + %o0] ASI_AIUS 209 add %g3, 1, %g2 210 cmp %o2, %g2 211 bne,pt %xcc, 6b 212 mov %g2, %g3 213 214 jmp %o7 + 8 ! exit point 215 mov %o3, %o0 190 mov %o0, %o3 /* save dst */ 191 add %o1, 7, %g1 192 and %g1, -8, %g1 193 cmp %o1, %g1 194 be,pn %xcc, 3f 195 add %o0, 7, %g1 196 mov 0, %g3 197 198 0: 199 200 brz,pn %o2, 2f 201 mov 0, %g2 202 203 1: 204 205 ldub [%g3 + %o1], %g1 206 add %g2, 1, %g2 207 cmp %o2, %g2 208 stba %g1, [%g3 + %o0] ASI_AIUS 209 bne,pt %xcc, 1b 210 mov %g2, %g3 211 212 2: 213 214 jmp %o7 + 8 /* exit point */ 215 mov %o3, %o0 216 217 3: 218 219 and %g1, -8, %g1 220 cmp %o0, %g1 221 bne,pt %xcc, 0b 222 mov 0, %g3 223 srlx %o2, 3, %g4 224 brz,pn %g4, 5f 225 mov 0, %g5 226 227 4: 228 229 sllx %g3, 3, %g2 230 add %g5, 1, %g3 231 ldx [%o1 + %g2], %g1 232 mov %g3, %g5 233 cmp %g4, %g3 234 bne,pt %xcc, 4b 235 stxa %g1, [%o0 + %g2] ASI_AIUS 236 237 5: 238 239 and %o2, 7, %o2 240 brz,pn %o2, 2b 241 sllx %g4, 3, %g1 242 mov 0, %g2 243 add %g1, %o0, %o0 244 add %g1, %o1, %g4 245 mov 0, %g3 246 247 6: 248 249 ldub [%g2 + %g4], %g1 250 stba %g1, [%g2 + %o0] ASI_AIUS 251 add %g3, 1, %g2 252 cmp %o2, %g2 253 bne,pt %xcc, 6b 254 mov %g2, %g3 255 256 jmp %o7 + 8 /* exit point */ 257 mov %o3, %o0 216 258 217 259 .global memcpy_from_uspace_failover_address … … 219 261 memcpy_from_uspace_failover_address: 220 262 memcpy_to_uspace_failover_address: 221 jmp %o7 + 8 ! exit point222 mov %g0, %o0 ! return 0 on failure263 jmp %o7 + 8 /* exit point */ 264 mov %g0, %o0 /* return 0 on failure */ 223 265 224 266 .global memsetb … … 232 274 nop 233 275 276 .global early_putchar 277 early_putchar: 278 retl 279 nop -
kernel/arch/sparc64/src/drivers/tick.c
rfe7abd0 rcefb126 27 27 */ 28 28 29 /** @addtogroup sparc64 29 /** @addtogroup sparc64 30 30 * @{ 31 31 */ … … 77 77 /** Process tick interrupt. 78 78 * 79 * @param n Interrupt Level, 14, (can be ignored)79 * @param n Interrupt Level (14, can be ignored) 80 80 * @param istate Interrupted state. 81 * 81 82 */ 82 void tick_interrupt( int n, istate_t *istate)83 void tick_interrupt(unsigned int n, istate_t *istate) 83 84 { 84 85 softint_reg_t softint, clear; -
kernel/arch/sparc64/src/mm/sun4u/frame.c
rfe7abd0 rcefb126 49 49 void frame_arch_init(void) 50 50 { 51 unsigned int i;52 pfn_t confdata;53 54 51 if (config.cpu_active == 1) { 52 unsigned int i; 53 55 54 for (i = 0; i < memmap.cnt; i++) { 56 uintptr_t start = (uintptr_t) memmap.zones[i].start; 57 size_t size = memmap.zones[i].size; 58 55 /* To be safe, make the available zone possibly smaller */ 56 uintptr_t new_start = ALIGN_UP((uintptr_t) memmap.zones[i].start, 57 FRAME_SIZE); 58 size_t new_size = ALIGN_DOWN(memmap.zones[i].size - 59 (new_start - ((uintptr_t) memmap.zones[i].start)), FRAME_SIZE); 60 59 61 /* 60 62 * The memmap is created by HelenOS boot loader. 61 63 * It already contains no holes. 62 64 */ 63 64 confdata = ADDR2PFN(start); 65 66 pfn_t confdata = ADDR2PFN(new_start); 67 65 68 if (confdata == ADDR2PFN(KA2PA(PFN2ADDR(0)))) 66 69 confdata = ADDR2PFN(KA2PA(PFN2ADDR(2))); 67 zone_create(ADDR2PFN(start),68 SIZE2FRAMES(ALIGN_DOWN(size, FRAME_SIZE)),70 71 zone_create(ADDR2PFN(new_start), SIZE2FRAMES(new_size), 69 72 confdata, 0); 70 last_frame = max(last_frame, start + ALIGN_UP(size,71 FRAME_SIZE));73 74 last_frame = max(last_frame, new_start + new_size); 72 75 } 73 76 74 77 /* 75 78 * On sparc64, physical memory can start on a non-zero address. … … 80 83 frame_mark_unavailable(ADDR2PFN(KA2PA(PFN2ADDR(0))), 1); 81 84 } 82 85 83 86 end_of_identity = PA2KA(last_frame); 84 87 } -
kernel/arch/sparc64/src/mm/sun4u/tlb.c
rfe7abd0 rcefb126 27 27 */ 28 28 29 /** @addtogroup sparc64mm 29 /** @addtogroup sparc64mm 30 30 * @{ 31 31 */ … … 58 58 static void dtlb_pte_copy(pte_t *, size_t, bool); 59 59 static void itlb_pte_copy(pte_t *, size_t); 60 static void do_fast_instruction_access_mmu_miss_fault(istate_t *, const char *); 60 static void do_fast_instruction_access_mmu_miss_fault(istate_t *, uintptr_t, 61 const char *); 61 62 static void do_fast_data_access_mmu_miss_fault(istate_t *, tlb_tag_access_reg_t, 62 63 const char *); … … 222 223 * Forward the page fault to the address space page fault 223 224 * handler. 224 */ 225 */ 225 226 page_table_unlock(AS, true); 226 227 if (as_page_fault(page_16k, PF_ACCESS_EXEC, istate) == 227 228 AS_PF_FAULT) { 228 229 do_fast_instruction_access_mmu_miss_fault(istate, 229 __func__);230 istate->tpc, __func__); 230 231 } 231 232 } … … 258 259 /* NULL access in kernel */ 259 260 do_fast_data_access_mmu_miss_fault(istate, tag, 260 __func__);261 "Dereferencing NULL pointer"); 261 262 } else if (page_8k >= end_of_identity) { 262 263 /* … … 438 439 439 440 void do_fast_instruction_access_mmu_miss_fault(istate_t *istate, 440 const char *str) 441 { 442 fault_if_from_uspace(istate, "%s.", str); 443 dump_istate(istate); 444 panic("%s.", str); 441 uintptr_t va, const char *str) 442 { 443 fault_if_from_uspace(istate, "%s, Address=%p.", str, va); 444 panic_memtrap(istate, PF_ACCESS_EXEC, va, "%s.", str); 445 445 } 446 446 … … 451 451 452 452 va = tag.vpn << MMU_PAGE_WIDTH; 453 if (tag.context) { 454 fault_if_from_uspace(istate, "%s, Page=%p (ASID=%d).", str, va, 455 tag.context); 456 } 457 dump_istate(istate); 458 printf("Faulting page: %p, ASID=%d.\n", va, tag.context); 459 panic("%s.", str); 453 fault_if_from_uspace(istate, "%s, Page=%p (ASID=%d).", str, va, 454 tag.context); 455 panic_memtrap(istate, PF_ACCESS_READ, va, "%s.", str); 460 456 } 461 457 … … 466 462 467 463 va = tag.vpn << MMU_PAGE_WIDTH; 468 469 if (tag.context) { 470 fault_if_from_uspace(istate, "%s, Page=%p (ASID=%d).", str, va, 471 tag.context); 472 } 473 printf("Faulting page: %p, ASID=%d\n", va, tag.context); 474 dump_istate(istate); 475 panic("%s.", str); 464 fault_if_from_uspace(istate, "%s, Page=%p (ASID=%d).", str, va, 465 tag.context); 466 panic_memtrap(istate, PF_ACCESS_WRITE, va, "%s.", str); 476 467 } 477 468 -
kernel/arch/sparc64/src/mm/sun4v/frame.c
rfe7abd0 rcefb126 47 47 void frame_arch_init(void) 48 48 { 49 unsigned int i;50 pfn_t confdata;51 52 49 if (config.cpu_active == 1) { 50 unsigned int i; 51 53 52 for (i = 0; i < memmap.cnt; i++) { 54 uintptr_t start = (uintptr_t) memmap.zones[i].start; 55 size_t size = memmap.zones[i].size; 56 53 /* To be safe, make the available zone possibly smaller */ 54 uintptr_t new_start = ALIGN_UP((uintptr_t) memmap.zones[i].start, 55 FRAME_SIZE); 56 size_t new_size = ALIGN_DOWN(memmap.zones[i].size - 57 (new_start - ((uintptr_t) memmap.zones[i].start)), FRAME_SIZE); 58 57 59 /* 58 60 * The memmap is created by HelenOS boot loader. 59 61 * It already contains no holes. 60 62 */ 61 62 confdata = ADDR2PFN(start); 63 64 pfn_t confdata = ADDR2PFN(new_start); 65 63 66 if (confdata == ADDR2PFN(KA2PA(PFN2ADDR(0)))) 64 67 confdata = ADDR2PFN(KA2PA(PFN2ADDR(2))); 65 zone_create(ADDR2PFN(start),66 SIZE2FRAMES(ALIGN_DOWN(size, FRAME_SIZE)),68 69 zone_create(ADDR2PFN(new_start), SIZE2FRAMES(new_size), 67 70 confdata, 0); 68 71 } 69 72 70 73 /* 71 74 * On sparc64, physical memory can start on a non-zero address. -
kernel/arch/sparc64/src/mm/sun4v/tlb.c
rfe7abd0 rcefb126 28 28 */ 29 29 30 /** @addtogroup sparc64mm 30 /** @addtogroup sparc64mm 31 31 * @{ 32 32 */ … … 62 62 static void itlb_pte_copy(pte_t *); 63 63 static void dtlb_pte_copy(pte_t *, bool); 64 static void do_fast_instruction_access_mmu_miss_fault(istate_t *, const char *); 64 static void do_fast_instruction_access_mmu_miss_fault(istate_t *, uintptr_t, 65 const char *); 65 66 static void do_fast_data_access_mmu_miss_fault(istate_t *, uint64_t, 66 67 const char *); … … 235 236 * Forward the page fault to the address space page fault 236 237 * handler. 237 */ 238 */ 238 239 page_table_unlock(AS, true); 239 240 if (as_page_fault(va, PF_ACCESS_EXEC, istate) == AS_PF_FAULT) { 240 241 do_fast_instruction_access_mmu_miss_fault(istate, 241 __func__);242 istate->tpc, __func__); 242 243 } 243 244 } … … 354 355 } 355 356 356 void do_fast_instruction_access_mmu_miss_fault(istate_t *istate, 357 void do_fast_instruction_access_mmu_miss_fault(istate_t *istate, uintptr_t va, 357 358 const char *str) 358 359 { 359 fault_if_from_uspace(istate, "%s.", str); 360 dump_istate(istate); 361 panic("%s.", str); 360 fault_if_from_uspace(istate, "%s, Address=%p.", str, va); 361 panic_memtrap(istate, PF_ACCESS_EXEC, va, "%s.", str); 362 362 } 363 363 … … 365 365 uint64_t page_and_ctx, const char *str) 366 366 { 367 if (DMISS_CONTEXT(page_and_ctx)) { 368 fault_if_from_uspace(istate, "%s, Page=%p (ASID=%d)\n", str, DMISS_ADDRESS(page_and_ctx), 369 DMISS_CONTEXT(page_and_ctx)); 370 } 371 dump_istate(istate); 372 printf("Faulting page: %p, ASID=%d\n", DMISS_ADDRESS(page_and_ctx), DMISS_CONTEXT(page_and_ctx)); 373 panic("%s\n", str); 367 fault_if_from_uspace(istate, "%s, Page=%p (ASID=%d).", str, 368 DMISS_ADDRESS(page_and_ctx), DMISS_CONTEXT(page_and_ctx)); 369 panic_memtrap(istate, PF_ACCESS_READ, DMISS_ADDRESS(page_and_ctx), 370 "%s."); 374 371 } 375 372 … … 377 374 uint64_t page_and_ctx, const char *str) 378 375 { 379 if (DMISS_CONTEXT(page_and_ctx)) { 380 fault_if_from_uspace(istate, "%s, Page=%p (ASID=%d)\n", str, DMISS_ADDRESS(page_and_ctx), 381 DMISS_CONTEXT(page_and_ctx)); 382 } 383 printf("Faulting page: %p, ASID=%d\n", DMISS_ADDRESS(page_and_ctx), DMISS_CONTEXT(page_and_ctx)); 384 dump_istate(istate); 385 panic("%s\n", str); 376 fault_if_from_uspace(istate, "%s, Page=%p (ASID=%d).", str, 377 DMISS_ADDRESS(page_and_ctx), DMISS_CONTEXT(page_and_ctx)); 378 panic_memtrap(istate, PF_ACCESS_WRITE, DMISS_ADDRESS(page_and_ctx), 379 "%s."); 386 380 } 387 381 -
kernel/arch/sparc64/src/trap/exception.c
rfe7abd0 rcefb126 44 44 #include <symtab.h> 45 45 46 void dump_istate(istate_t *istate)46 void istate_decode(istate_t *istate) 47 47 { 48 48 const char *tpcs = symtab_fmt_name_lookup(istate->tpc); … … 58 58 { 59 59 fault_if_from_uspace(istate, "%s.", __func__); 60 dump_istate(istate); 61 panic("%s.", __func__); 60 panic_badtrap(istate, n, "%s.", __func__); 62 61 } 63 62 … … 66 65 { 67 66 fault_if_from_uspace(istate, "%s.", __func__); 68 dump_istate(istate); 69 panic("%s.", __func__); 67 panic_badtrap(istate, n, "%s.", __func__); 70 68 } 71 69 … … 74 72 { 75 73 fault_if_from_uspace(istate, "%s.", __func__); 76 dump_istate(istate); 77 panic("%s.", __func__); 74 panic_badtrap(istate, n, "%s.", __func__); 78 75 } 79 76 … … 82 79 { 83 80 fault_if_from_uspace(istate, "%s.", __func__); 84 dump_istate(istate); 85 panic("%s.", __func__); 81 panic_badtrap(istate, n, "%s.", __func__); 86 82 } 87 83 … … 90 86 { 91 87 fault_if_from_uspace(istate, "%s.", __func__); 92 dump_istate(istate); 93 panic("%s.", __func__); 88 panic_badtrap(istate, n, "%s.", __func__); 94 89 } 95 90 … … 98 93 { 99 94 fault_if_from_uspace(istate, "%s.", __func__); 100 dump_istate(istate); 101 panic("%s.", __func__); 95 panic_badtrap(istate, n, "%s.", __func__); 102 96 } 103 97 … … 118 112 #else 119 113 fault_if_from_uspace(istate, "%s.", __func__); 120 dump_istate(istate); 121 panic("%s.", __func__); 114 panic_badtrap(istate, n, "%s.", __func__); 122 115 #endif 123 116 } … … 127 120 { 128 121 fault_if_from_uspace(istate, "%s.", __func__); 129 dump_istate(istate); 130 panic("%s.", __func__); 122 panic_badtrap(istate, n, "%s.", __func__); 131 123 } 132 124 … … 135 127 { 136 128 fault_if_from_uspace(istate, "%s.", __func__); 137 dump_istate(istate); 138 panic("%s.", __func__); 129 panic_badtrap(istate, n, "%s.", __func__); 139 130 } 140 131 … … 143 134 { 144 135 fault_if_from_uspace(istate, "%s.", __func__); 145 dump_istate(istate); 146 panic("%s.", __func__); 136 panic_badtrap(istate, n, "%s.", __func__); 147 137 } 148 138 … … 151 141 { 152 142 fault_if_from_uspace(istate, "%s.", __func__); 153 dump_istate(istate); 154 panic("%s.", __func__); 143 panic_badtrap(istate, n, "%s.", __func__); 155 144 } 156 145 … … 159 148 { 160 149 fault_if_from_uspace(istate, "%s.", __func__); 161 dump_istate(istate); 162 describe_dmmu_fault(); 163 panic("%s.", __func__); 150 panic_badtrap(istate, n, "%s.", __func__); 164 151 } 165 152 … … 168 155 { 169 156 fault_if_from_uspace(istate, "%s.", __func__); 170 dump_istate(istate); 171 panic("%s.", __func__); 157 panic_badtrap(istate, n, "%s.", __func__); 172 158 } 173 159 … … 176 162 { 177 163 fault_if_from_uspace(istate, "%s.", __func__); 178 dump_istate(istate); 179 panic("%s.", __func__); 164 panic_badtrap(istate, n, "%s.", __func__); 180 165 } 181 166 … … 184 169 { 185 170 fault_if_from_uspace(istate, "%s.", __func__); 186 dump_istate(istate); 187 panic("%s.", __func__); 171 panic_badtrap(istate, n, "%s.", __func__); 188 172 } 189 173 … … 192 176 { 193 177 fault_if_from_uspace(istate, "%s.", __func__); 194 dump_istate(istate); 195 panic("%s.", __func__); 178 panic_badtrap(istate, n, "%s.", __func__); 196 179 } 197 180 … … 200 183 { 201 184 fault_if_from_uspace(istate, "%s.", __func__); 202 dump_istate(istate); 203 panic("%s.", __func__); 185 panic_badtrap(istate, n, "%s.", __func__); 204 186 } 205 187 … … 208 190 { 209 191 fault_if_from_uspace(istate, "%s.", __func__); 210 dump_istate(istate); 211 panic("%s.", __func__); 192 panic_badtrap(istate, n, "%s.", __func__); 212 193 } 213 194 … … 216 197 { 217 198 fault_if_from_uspace(istate, "%s.", __func__); 218 dump_istate(istate); 219 panic("%s.", __func__); 199 panic_badtrap(istate, n, "%s.", __func__); 220 200 } 221 201 -
kernel/arch/sparc64/src/trap/sun4v/interrupt.c
rfe7abd0 rcefb126 111 111 ((void (*)(void)) data1)(); 112 112 } else { 113 printf("Spurious interrupt on %d, data = % lx.\n",113 printf("Spurious interrupt on %d, data = %" PRIx64 ".\n", 114 114 CPU->arch.id, data1); 115 115 }
Note:
See TracChangeset
for help on using the changeset viewer.
