From c308c2a8d360c67966fa82bf061ebcd8747a2f1c Mon Sep 17 00:00:00 2001 From: Simon Southwell Date: Fri, 26 Jan 2024 13:52:05 +0000 Subject: [PATCH] Made vectored and level interrupts mutually exclusive, with VSched returning on interrupt calls if vectored IRQ callback registered. --- code/VSched.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/code/VSched.c b/code/VSched.c index f53a795..16eee71 100644 --- a/code/VSched.c +++ b/code/VSched.c @@ -378,6 +378,13 @@ VPROC_RTN_TYPE VSched (VSCHED_PARAMS) // Sample inputs and update node state ns[node]->rcv_buf.data_in = VPDataIn; ns[node]->rcv_buf.interrupt = Interrupt; + + // If call to VSched is for interrupt and vector IRQ enabled (with callback registered) + // don't process here with the level interrupt code and just return. + if (Interrupt && ns[node]->VUserIrqCB != NULL) + { + return 0; + } // Send message to VUser with VPDataIn value debug_io_printf("VSched(): setting rcv[%d] semaphore\n", node);