1# SPDX-License-Identifier: Apache-2.0 2# Copyright (c) 2024 sensry.io 3 4#include <zephyr/toolchain.h> 5 6 7GTEXT(__initialize) 8 9 # abs 0x0000 - entry point after bootloader 10.section .pre_start, "ax" 11.global __pre_start 12__pre_start: 13 jal x0, __prestart_routine 14 15 16 # abs 0x0080 - will be checked by bootloader 17.section .validity_marker, "ax" 18 .word 0xAA551234 19 20 # abs 0x0100 - text 21.section .text, "ax" 22__prestart_routine: 23 /* things that will be done prior to actually starting zephyr */ 24 csrwi mstatus, 0x00 25 26 /* Call into Zephyr initialization. */ 27 jal x0, __start 28 29GTEXT(__soc_is_irq) 30SECTION_FUNC(exception.other, __soc_is_irq) 31 csrr a0, mcause 32 srli a0, a0, 31 33 ret 34 35GTEXT(__soc_handle_irq) 36SECTION_FUNC(exception.other, __soc_handle_irq) 37 ## clear pending interrupt 38 ret 39 40# we provide a "backup" isr table, if generation (ex. in tests) is disabled 41.global _irq_vector_table 42.weak _irq_vector_table 43.section .text, "ax" 44_irq_vector_table: 45.option norvc; 46 47 j __no_irq_handler0 48 j __no_irq_handler1 49 j __no_irq_handler2 50 j __no_irq_handler3 51 j __no_irq_handler4 52 j __no_irq_handler5 53 j __no_irq_handler6 54 j __no_irq_handler7 55 j __no_irq_handler8 56 j __no_irq_handler9 57 j __no_irq_handler10 58 j __no_irq_handler11 59 j __no_irq_handler12 60 j __no_irq_handler13 61 j __no_irq_handler14 62 j __no_irq_handler15 63 j __no_irq_handler16 64 j __no_irq_handler17 65 j __no_irq_handler18 66 j __no_irq_handler19 67 j __no_irq_handler20 68 j __no_irq_handler21 69 j __no_irq_handler22 70 j __no_irq_handler23 71 j __no_irq_handler24 72 j __no_irq_handler25 73 j __no_irq_handler26 74 j __no_irq_handler27 75 j __no_irq_handler28 76 j __no_irq_handler29 77 j __no_irq_handler30 78 j __no_irq_handler31 79 80 81__no_irq_handler0: 82 j __no_irq_handler0 83__no_irq_handler1: 84 j __no_irq_handler1 85__no_irq_handler2: 86 j __no_irq_handler2 87__no_irq_handler3: 88 j __no_irq_handler3 89__no_irq_handler4: 90 j __no_irq_handler4 91__no_irq_handler5: 92 j __no_irq_handler5 93__no_irq_handler6: 94 j __no_irq_handler6 95__no_irq_handler7: 96 j __no_irq_handler7 97__no_irq_handler8: 98 j __no_irq_handler8 99__no_irq_handler9: 100 j __no_irq_handler9 101__no_irq_handler10: 102 j __no_irq_handler10 103__no_irq_handler11: 104 j __no_irq_handler11 105__no_irq_handler12: 106 j __no_irq_handler12 107__no_irq_handler13: 108 j __no_irq_handler13 109__no_irq_handler14: 110 j __no_irq_handler14 111__no_irq_handler15: 112 j __no_irq_handler15 113__no_irq_handler16: 114 j __no_irq_handler16 115__no_irq_handler17: 116 j __no_irq_handler17 117__no_irq_handler18: 118 j __no_irq_handler18 119__no_irq_handler19: 120 j __no_irq_handler19 121__no_irq_handler20: 122 j __no_irq_handler20 123__no_irq_handler21: 124 j __no_irq_handler21 125__no_irq_handler22: 126 j __no_irq_handler22 127__no_irq_handler23: 128 j __no_irq_handler23 129__no_irq_handler24: 130 j __no_irq_handler24 131__no_irq_handler25: 132 j __no_irq_handler25 133__no_irq_handler26: 134 j __no_irq_handler26 135__no_irq_handler27: 136 j __no_irq_handler27 137__no_irq_handler28: 138 j __no_irq_handler28 139__no_irq_handler29: 140 j __no_irq_handler29 141__no_irq_handler30: 142 j __no_irq_handler30 143__no_irq_handler31: 144 j __no_irq_handler31 145