Skip to content

Commit

Permalink
Merge pull request openhwgroup#1678 from silabs-robin/ci_check_direct…
Browse files Browse the repository at this point in the history
…eds_fix

Fix directed tests compilation
  • Loading branch information
silabs-hfegran committed Feb 27, 2023
2 parents 03897bc + 7f30272 commit 6008653
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 6 deletions.
3 changes: 2 additions & 1 deletion bsp/vectors.S
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

.section .vectors, "ax"
.option push
.option norvc
.global vector_table

Expand Down Expand Up @@ -51,4 +52,4 @@ vector_table:
j m_fast13_irq_handler
j m_fast14_irq_handler
j m_fast15_irq_handler

.option pop
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ int main(int argc, char *argv[])

volatile unsigned int mcycle_count;

__asm__ volatile(".option rvc");

//////////////////////////////////////////////////////////////
// Cycle count
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ int main(int argc, char *argv[])

volatile unsigned int mcycle_count;

__asm__ volatile(".option rvc");

//////////////////////////////////////////////////////////////
// Cycle count
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ int main(int argc, char *argv[])

volatile unsigned int minstret;

__asm__ volatile(".option rvc");

//////////////////////////////////////////////////////////////
// Count load use hazards
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ _fini:
.section .vectors.alt, "ax"

.global alt_vector_table
.option push
.option norvc
.align 8

Expand Down Expand Up @@ -99,3 +100,4 @@ alt_vector_table:
j m_fast14_irq_handler
j m_fast15_irq_handler

.option pop
6 changes: 6 additions & 0 deletions tests/programs/custom/interrupt_test/interrupt_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ __attribute__((interrupt ("machine"))) void u_sw_direct_irq_handler(void) {

asm (
".global alt_vector_table\n"
".option push\n"
".option norvc\n"
".align 8\n"
"alt_vector_table:\n"
Expand Down Expand Up @@ -200,23 +201,28 @@ __attribute__((interrupt ("machine"))) void u_sw_direct_irq_handler(void) {
"j m_fast13_irq_handler\n"
"j m_fast14_irq_handler\n"
"j m_fast15_irq_handler\n"
".option pop\n"
);

asm (
".global alt_direct_vector_table\n"
".option push\n"
".option norvc\n"
".align 8\n"
"alt_direct_vector_table:\n"
"j u_sw_direct_irq_handler\n"
".option pop\n"
);

asm (
".global alt_direct_ecall_table\n"
".option push\n"
".option norvc\n"
".align 8\n"
"alt_direct_ecall_table:\n"
"wfi\n"
"j u_sw_irq_handler\n"
".option pop\n"
);

int main(int argc, char *argv[]) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11963,6 +11963,7 @@ mmode_intr_vector_15:

.align 7
mtvec_handler:
.option push;
.option norvc;
j mmode_exception_handler
j mmode_intr_vector_1
Expand All @@ -11980,7 +11981,7 @@ mtvec_handler:
j mmode_intr_vector_13
j mmode_intr_vector_14
j mmode_intr_vector_15
.option rvc;
.option pop;

mmode_exception_handler:
csrrw x12, 0x340, x12
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12009,6 +12009,7 @@ mmode_intr_vector_15:

.align 7
mtvec_handler:
.option push;
.option norvc;
j mmode_exception_handler
j mmode_intr_vector_1
Expand All @@ -12026,7 +12027,7 @@ mtvec_handler:
j mmode_intr_vector_13
j mmode_intr_vector_14
j mmode_intr_vector_15
.option rvc;
.option pop;

mmode_exception_handler:
csrrw x15, 0x340, x15
Expand Down
4 changes: 4 additions & 0 deletions tests/uvmt/test-programs/vectors.S
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

.section .vectors, "ax"
.option push
.option norvc
vector_table:
j sw_irq_handler
Expand Down Expand Up @@ -58,6 +59,9 @@ new vector table (which is at mtvec) */
/* j __no_irq_handler */
/* j __no_irq_handler */

.option pop


.section .text.vecs
/* exception handling */
__no_irq_handler:
Expand Down

0 comments on commit 6008653

Please sign in to comment.