The following code creates an interrupt vector table. You can relocate the segment VECs (the segment storing the middle section vector table) to an address, such as the starting L2 address of the DSP (for core1, 0x10800000), and point ISTP to this address.
; Create interrupt vector table for C6000 DSP; done; this file can be modified to add interrupt service routine (ISR); for an interrupt, the steps are:; 1, reference to the externally defined ISR, for example ;. ref edma_isr; 2, modify the corresponding entry in the interrupt vector table .; for example, if interrupt 8 is used for edma, then you shoshould; Modify the entry number 8 like below:; vec_entry edma_isr; interrupt 8; Reference to the externally defined ISR. ref _ c_int00.ref prediction_service_routine.ref nested_prediction_service_routine.ref ll2_edc_isr.ref sl2_edc_isr.ref timer_isr.ref prediction_record.global vectors; external ;--------------------------------------------------------------. sect ". text "; nmi_isr code will be saved in. text Segment; interrupt vector for Nmin Mi_isr: STW B1, *-B15 [1]; save some key registers when exception happensmvkl prediction_record, b1mvkh prediction_record, b1stw B3, * + B1 [0] STW A4, * + B1 [1] STW B4, * + B1 [2] STW B14, * + B1 [3] STW B15, * + B1 [4]; jump to exception service routinemvkl exception_service_routine, b1mvkh exception_service_routine, B1b b1ldw *-B15 [1], b1nop 4; role; Create interrup T vector for Reset (Interrupt 0 ),". macro. endm "is a macro that defines Assembly statements, similar to # define in C. Macros can be used for calling, such as vec_reset nmi_isr. the ADDR parameter is equivalent to nmi_isr. Vec_reset. macro addrmvkl ADDR, b0mvkh ADDR, b0b b0mvc pce1, b0nop 4. align 32. endm; Create interrupt vector for other used interruptsvec_entry. macro addrstw B0, * -- b15mvkl ADDR, b0mvkh ADDR, b0b b0ldw * B15 ++, b0nop 4. align 32. endm; Create interrupt vector for unused interrupts. Macros without parameters are directly used with the macro name vec_dummy. Vec_dummy. macrounused_int?: B unused_int?; Dead loop for unused interrupts. If the Code enters the unused interrupt vector, an endless loop is executed. NOP 5. Align 32. endm; partition; interrupt vector table. Sect "VECs"; creates a VECs segment. The following interrupt vector code vectors will be stored in the VECs segment .. Align 1024;. The purpose of the align pseudo-assembly is to tell the assembler that the memory variables under this pseudo command must be allocated from the next address that can be divisible by 1024. If the next address can be divisible by 1024, the pseudo-command does not work. Otherwise, the assembler will leave several bytes blank until the next address can be divisible by 1024. Vectors: vec_entry values; reset vec_entry values; NMI/values; rsvd vec_entry values; interrupt 4vec_entry values; interrupt 8 values; interrupt 10vec_dummy; interrupt 11vec_dummy; interrupt 12vec_dummy; interrupt 13vec_entry timer_isr; interrupt 14vec_dummy; interrupt 15.end
The Code comes from the network and comments are added by the author.