diff --git a/open-platform-models/isolate-ethernet-simple/aadl/SW.aadl b/open-platform-models/isolate-ethernet-simple/aadl/SW.aadl index f8968ff..cd59ba3 100644 --- a/open-platform-models/isolate-ethernet-simple/aadl/SW.aadl +++ b/open-platform-models/isolate-ethernet-simple/aadl/SW.aadl @@ -33,8 +33,14 @@ public thread LowLevelEthernetDriver features -- Ethernet Frames: Raw Ethernet frames received from the physical network interface. - EthernetFramesRx: out data port RawEthernetMessage.Impl; - EthernetFramesTx: in data port SizedEthernetMessage.Impl; + EthernetFramesRx0: out data port RawEthernetMessage.Impl; + EthernetFramesRx1: out data port RawEthernetMessage.Impl; + EthernetFramesRx2: out data port RawEthernetMessage.Impl; + EthernetFramesRx3: out data port RawEthernetMessage.Impl; + EthernetFramesTx0: in data port SizedEthernetMessage.Impl; + EthernetFramesTx1: in data port SizedEthernetMessage.Impl; + EthernetFramesTx2: in data port SizedEthernetMessage.Impl; + EthernetFramesTx3: in data port SizedEthernetMessage.Impl; end LowLevelEthernetDriver; thread implementation LowLevelEthernetDriver.Impl @@ -51,26 +57,50 @@ public process LowLevelEthernetDriver_seL4 features -- Ethernet Frames: Raw Ethernet frames received from the physical network interface. - EthernetFramesRx: out data port RawEthernetMessage.Impl; - EthernetFramesTx: in data port SizedEthernetMessage.Impl; + EthernetFramesRx0: out data port RawEthernetMessage.Impl; + EthernetFramesRx1: out data port RawEthernetMessage.Impl; + EthernetFramesRx2: out data port RawEthernetMessage.Impl; + EthernetFramesRx3: out data port RawEthernetMessage.Impl; + EthernetFramesTx0: in data port SizedEthernetMessage.Impl; + EthernetFramesTx1: in data port SizedEthernetMessage.Impl; + EthernetFramesTx2: in data port SizedEthernetMessage.Impl; + EthernetFramesTx3: in data port SizedEthernetMessage.Impl; end LowLevelEthernetDriver_seL4; process implementation LowLevelEthernetDriver_seL4.Impl subcomponents LowLevelEthernetDriver: thread LowLevelEthernetDriver.Impl; connections - c1: port EthernetFramesTx -> LowLevelEthernetDriver.EthernetFramesTx; - c2: port LowLevelEthernetDriver.EthernetFramesRx -> EthernetFramesRx; + c1: port EthernetFramesTx0 -> LowLevelEthernetDriver.EthernetFramesTx0; + c2: port EthernetFramesTx1 -> LowLevelEthernetDriver.EthernetFramesTx1; + c3: port EthernetFramesTx2 -> LowLevelEthernetDriver.EthernetFramesTx2; + c4: port EthernetFramesTx3 -> LowLevelEthernetDriver.EthernetFramesTx3; + c5: port LowLevelEthernetDriver.EthernetFramesRx0 -> EthernetFramesRx0; + c6: port LowLevelEthernetDriver.EthernetFramesRx1 -> EthernetFramesRx1; + c7: port LowLevelEthernetDriver.EthernetFramesRx2 -> EthernetFramesRx2; + c8: port LowLevelEthernetDriver.EthernetFramesRx3 -> EthernetFramesRx3; properties CASE_Scheduling::Domain => 2; end LowLevelEthernetDriver_seL4.Impl; thread Firewall features - EthernetFramesRxIn: in data port RawEthernetMessage.Impl; - EthernetFramesTxIn: in data port RawEthernetMessage.Impl; - EthernetFramesRxOut: out data port RawEthernetMessage.Impl; - EthernetFramesTxOut: out data port SizedEthernetMessage.Impl; + EthernetFramesRxIn0: in data port RawEthernetMessage.Impl; + EthernetFramesRxIn1: in data port RawEthernetMessage.Impl; + EthernetFramesRxIn2: in data port RawEthernetMessage.Impl; + EthernetFramesRxIn3: in data port RawEthernetMessage.Impl; + EthernetFramesTxIn0: in data port RawEthernetMessage.Impl; + EthernetFramesTxIn1: in data port RawEthernetMessage.Impl; + EthernetFramesTxIn2: in data port RawEthernetMessage.Impl; + EthernetFramesTxIn3: in data port RawEthernetMessage.Impl; + EthernetFramesRxOut0: out data port RawEthernetMessage.Impl; + EthernetFramesRxOut1: out data port RawEthernetMessage.Impl; + EthernetFramesRxOut2: out data port RawEthernetMessage.Impl; + EthernetFramesRxOut3: out data port RawEthernetMessage.Impl; + EthernetFramesTxOut0: out data port SizedEthernetMessage.Impl; + EthernetFramesTxOut1: out data port SizedEthernetMessage.Impl; + EthernetFramesTxOut2: out data port SizedEthernetMessage.Impl; + EthernetFramesTxOut3: out data port SizedEthernetMessage.Impl; end Firewall; thread implementation Firewall.Impl @@ -86,28 +116,58 @@ public process Firewall_seL4 features - EthernetFramesRxIn: in data port RawEthernetMessage.Impl; - EthernetFramesTxIn: in data port RawEthernetMessage.Impl; - EthernetFramesRxOut: out data port RawEthernetMessage.Impl; - EthernetFramesTxOut: out data port SizedEthernetMessage.Impl; + EthernetFramesRxIn0: in data port RawEthernetMessage.Impl; + EthernetFramesRxIn1: in data port RawEthernetMessage.Impl; + EthernetFramesRxIn2: in data port RawEthernetMessage.Impl; + EthernetFramesRxIn3: in data port RawEthernetMessage.Impl; + EthernetFramesTxIn0: in data port RawEthernetMessage.Impl; + EthernetFramesTxIn1: in data port RawEthernetMessage.Impl; + EthernetFramesTxIn2: in data port RawEthernetMessage.Impl; + EthernetFramesTxIn3: in data port RawEthernetMessage.Impl; + EthernetFramesRxOut0: out data port RawEthernetMessage.Impl; + EthernetFramesRxOut1: out data port RawEthernetMessage.Impl; + EthernetFramesRxOut2: out data port RawEthernetMessage.Impl; + EthernetFramesRxOut3: out data port RawEthernetMessage.Impl; + EthernetFramesTxOut0: out data port SizedEthernetMessage.Impl; + EthernetFramesTxOut1: out data port SizedEthernetMessage.Impl; + EthernetFramesTxOut2: out data port SizedEthernetMessage.Impl; + EthernetFramesTxOut3: out data port SizedEthernetMessage.Impl; end Firewall_seL4; process implementation Firewall_seL4.Impl subcomponents Firewall: thread Firewall.Impl; connections - c1: port EthernetFramesRxIn -> Firewall.EthernetFramesRxIn; - c2: port EthernetFramesTxIn -> Firewall.EthernetFramesTxIn; - c3: port Firewall.EthernetFramesRxOut -> EthernetFramesRxOut; - c4: port Firewall.EthernetFramesTxOut -> EthernetFramesTxOut; + c1: port EthernetFramesRxIn0 -> Firewall.EthernetFramesRxIn0; + c2: port EthernetFramesRxIn1 -> Firewall.EthernetFramesRxIn1; + c3: port EthernetFramesRxIn2 -> Firewall.EthernetFramesRxIn2; + c4: port EthernetFramesRxIn3 -> Firewall.EthernetFramesRxIn3; + c5: port EthernetFramesTxIn0 -> Firewall.EthernetFramesTxIn0; + c6: port EthernetFramesTxIn1 -> Firewall.EthernetFramesTxIn1; + c7: port EthernetFramesTxIn2 -> Firewall.EthernetFramesTxIn2; + c8: port EthernetFramesTxIn3 -> Firewall.EthernetFramesTxIn3; + c9: port Firewall.EthernetFramesRxOut0 -> EthernetFramesRxOut0; + c10: port Firewall.EthernetFramesRxOut1 -> EthernetFramesRxOut1; + c11: port Firewall.EthernetFramesRxOut2 -> EthernetFramesRxOut2; + c12: port Firewall.EthernetFramesRxOut3 -> EthernetFramesRxOut3; + c13: port Firewall.EthernetFramesTxOut0 -> EthernetFramesTxOut0; + c14: port Firewall.EthernetFramesTxOut1 -> EthernetFramesTxOut1; + c15: port Firewall.EthernetFramesTxOut2 -> EthernetFramesTxOut2; + c16: port Firewall.EthernetFramesTxOut3 -> EthernetFramesTxOut3; properties CASE_Scheduling::Domain => 3; end Firewall_seL4.Impl; thread ArduPilot features - EthernetFramesRx: in data port RawEthernetMessage.Impl; - EthernetFramesTx: out data port RawEthernetMessage.Impl; + EthernetFramesRx0: in data port RawEthernetMessage.Impl; + EthernetFramesRx1: in data port RawEthernetMessage.Impl; + EthernetFramesRx2: in data port RawEthernetMessage.Impl; + EthernetFramesRx3: in data port RawEthernetMessage.Impl; + EthernetFramesTx0: out data port RawEthernetMessage.Impl; + EthernetFramesTx1: out data port RawEthernetMessage.Impl; + EthernetFramesTx2: out data port RawEthernetMessage.Impl; + EthernetFramesTx3: out data port RawEthernetMessage.Impl; end ArduPilot; thread implementation ArduPilot.Impl @@ -123,16 +183,28 @@ public process ArduPilot_seL4 features - EthernetFramesRx: in data port RawEthernetMessage.Impl; - EthernetFramesTx: out data port RawEthernetMessage.Impl; + EthernetFramesRx0: in data port RawEthernetMessage.Impl; + EthernetFramesRx1: in data port RawEthernetMessage.Impl; + EthernetFramesRx2: in data port RawEthernetMessage.Impl; + EthernetFramesRx3: in data port RawEthernetMessage.Impl; + EthernetFramesTx0: out data port RawEthernetMessage.Impl; + EthernetFramesTx1: out data port RawEthernetMessage.Impl; + EthernetFramesTx2: out data port RawEthernetMessage.Impl; + EthernetFramesTx3: out data port RawEthernetMessage.Impl; end ArduPilot_seL4; process implementation ArduPilot_seL4.Impl subcomponents ArduPilot: thread ArduPilot.Impl; connections - c1: port EthernetFramesRx -> ArduPilot.EthernetFramesRx; - c2: port ArduPilot.EthernetFramesTx -> EthernetFramesTx; + c1: port EthernetFramesRx0 -> ArduPilot.EthernetFramesRx0; + c2: port EthernetFramesRx1 -> ArduPilot.EthernetFramesRx1; + c3: port EthernetFramesRx2 -> ArduPilot.EthernetFramesRx2; + c4: port EthernetFramesRx3 -> ArduPilot.EthernetFramesRx3; + c5: port ArduPilot.EthernetFramesTx0 -> EthernetFramesTx0; + c6: port ArduPilot.EthernetFramesTx1 -> EthernetFramesTx1; + c7: port ArduPilot.EthernetFramesTx2 -> EthernetFramesTx2; + c8: port ArduPilot.EthernetFramesTx3 -> EthernetFramesTx3; properties CASE_Scheduling::Domain => 4; end ArduPilot_seL4.Impl; @@ -152,11 +224,23 @@ public connections -- Incoming traffic - c1: port LowLevelEthernetDriver.EthernetFramesRx -> Firewall.EthernetFramesRxIn; - c2: port Firewall.EthernetFramesRxOut -> ArduPilot.EthernetFramesRx; + c1: port LowLevelEthernetDriver.EthernetFramesRx0 -> Firewall.EthernetFramesRxIn0; + c2: port LowLevelEthernetDriver.EthernetFramesRx1 -> Firewall.EthernetFramesRxIn1; + c3: port LowLevelEthernetDriver.EthernetFramesRx2 -> Firewall.EthernetFramesRxIn2; + c4: port LowLevelEthernetDriver.EthernetFramesRx3 -> Firewall.EthernetFramesRxIn3; + c5: port Firewall.EthernetFramesRxOut0 -> ArduPilot.EthernetFramesRx0; + c6: port Firewall.EthernetFramesRxOut1 -> ArduPilot.EthernetFramesRx1; + c7: port Firewall.EthernetFramesRxOut2 -> ArduPilot.EthernetFramesRx2; + c8: port Firewall.EthernetFramesRxOut3 -> ArduPilot.EthernetFramesRx3; -- Outgoing traffic - c3: port ArduPilot.EthernetFramesTx -> Firewall.EthernetFramesTxIn; - c4: port Firewall.EthernetFramesTxOut -> LowLevelEthernetDriver.EthernetFramesTx; + c9: port ArduPilot.EthernetFramesTx0 -> Firewall.EthernetFramesTxIn0; + c10: port ArduPilot.EthernetFramesTx1 -> Firewall.EthernetFramesTxIn1; + c11: port ArduPilot.EthernetFramesTx2 -> Firewall.EthernetFramesTxIn2; + c12: port ArduPilot.EthernetFramesTx3 -> Firewall.EthernetFramesTxIn3; + c13: port Firewall.EthernetFramesTxOut0 -> LowLevelEthernetDriver.EthernetFramesTx0; + c14: port Firewall.EthernetFramesTxOut1 -> LowLevelEthernetDriver.EthernetFramesTx1; + c15: port Firewall.EthernetFramesTxOut2 -> LowLevelEthernetDriver.EthernetFramesTx2; + c16: port Firewall.EthernetFramesTxOut3 -> LowLevelEthernetDriver.EthernetFramesTx3; end seL4.Impl; end SW; diff --git a/open-platform-models/isolate-ethernet-simple/microkit/components/seL4_ArduPilot_ArduPilot/include/seL4_ArduPilot_ArduPilot.h b/open-platform-models/isolate-ethernet-simple/microkit/components/seL4_ArduPilot_ArduPilot/include/seL4_ArduPilot_ArduPilot.h index 812d6aa..d571044 100644 --- a/open-platform-models/isolate-ethernet-simple/microkit/components/seL4_ArduPilot_ArduPilot/include/seL4_ArduPilot_ArduPilot.h +++ b/open-platform-models/isolate-ethernet-simple/microkit/components/seL4_ArduPilot_ArduPilot/include/seL4_ArduPilot_ArduPilot.h @@ -3,5 +3,11 @@ #include #include -bool put_EthernetFramesTx(const base_SW_RawEthernetMessage_Impl *data); -bool get_EthernetFramesRx(base_SW_RawEthernetMessage_Impl *data); +bool put_EthernetFramesTx0(const base_SW_RawEthernetMessage_Impl *data); +bool put_EthernetFramesTx1(const base_SW_RawEthernetMessage_Impl *data); +bool put_EthernetFramesTx2(const base_SW_RawEthernetMessage_Impl *data); +bool put_EthernetFramesTx3(const base_SW_RawEthernetMessage_Impl *data); +bool get_EthernetFramesRx0(base_SW_RawEthernetMessage_Impl *data); +bool get_EthernetFramesRx1(base_SW_RawEthernetMessage_Impl *data); +bool get_EthernetFramesRx2(base_SW_RawEthernetMessage_Impl *data); +bool get_EthernetFramesRx3(base_SW_RawEthernetMessage_Impl *data); diff --git a/open-platform-models/isolate-ethernet-simple/microkit/components/seL4_ArduPilot_ArduPilot/src/seL4_ArduPilot_ArduPilot.c b/open-platform-models/isolate-ethernet-simple/microkit/components/seL4_ArduPilot_ArduPilot/src/seL4_ArduPilot_ArduPilot.c index 83b81fb..bad3d0d 100644 --- a/open-platform-models/isolate-ethernet-simple/microkit/components/seL4_ArduPilot_ArduPilot/src/seL4_ArduPilot_ArduPilot.c +++ b/open-platform-models/isolate-ethernet-simple/microkit/components/seL4_ArduPilot_ArduPilot/src/seL4_ArduPilot_ArduPilot.c @@ -3,36 +3,113 @@ void seL4_ArduPilot_ArduPilot_initialize(void); void seL4_ArduPilot_ArduPilot_timeTriggered(void); -volatile sb_queue_base_SW_RawEthernetMessage_Impl_1_t *EthernetFramesTx_queue_1; -volatile sb_queue_base_SW_RawEthernetMessage_Impl_1_t *EthernetFramesRx_queue_1; -sb_queue_base_SW_RawEthernetMessage_Impl_1_Recv_t EthernetFramesRx_recv_queue; +volatile sb_queue_base_SW_RawEthernetMessage_Impl_1_t *EthernetFramesTx0_queue_1; +volatile sb_queue_base_SW_RawEthernetMessage_Impl_1_t *EthernetFramesTx1_queue_1; +volatile sb_queue_base_SW_RawEthernetMessage_Impl_1_t *EthernetFramesTx2_queue_1; +volatile sb_queue_base_SW_RawEthernetMessage_Impl_1_t *EthernetFramesTx3_queue_1; +volatile sb_queue_base_SW_RawEthernetMessage_Impl_1_t *EthernetFramesRx0_queue_1; +sb_queue_base_SW_RawEthernetMessage_Impl_1_Recv_t EthernetFramesRx0_recv_queue; +volatile sb_queue_base_SW_RawEthernetMessage_Impl_1_t *EthernetFramesRx1_queue_1; +sb_queue_base_SW_RawEthernetMessage_Impl_1_Recv_t EthernetFramesRx1_recv_queue; +volatile sb_queue_base_SW_RawEthernetMessage_Impl_1_t *EthernetFramesRx2_queue_1; +sb_queue_base_SW_RawEthernetMessage_Impl_1_Recv_t EthernetFramesRx2_recv_queue; +volatile sb_queue_base_SW_RawEthernetMessage_Impl_1_t *EthernetFramesRx3_queue_1; +sb_queue_base_SW_RawEthernetMessage_Impl_1_Recv_t EthernetFramesRx3_recv_queue; #define PORT_FROM_MON 60 -bool put_EthernetFramesTx(const base_SW_RawEthernetMessage_Impl *data) { - sb_queue_base_SW_RawEthernetMessage_Impl_1_enqueue((sb_queue_base_SW_RawEthernetMessage_Impl_1_t *) EthernetFramesTx_queue_1, (base_SW_RawEthernetMessage_Impl *) data); +bool put_EthernetFramesTx0(const base_SW_RawEthernetMessage_Impl *data) { + sb_queue_base_SW_RawEthernetMessage_Impl_1_enqueue((sb_queue_base_SW_RawEthernetMessage_Impl_1_t *) EthernetFramesTx0_queue_1, (base_SW_RawEthernetMessage_Impl *) data); return true; } -base_SW_RawEthernetMessage_Impl last_EthernetFramesRx_payload; +bool put_EthernetFramesTx1(const base_SW_RawEthernetMessage_Impl *data) { + sb_queue_base_SW_RawEthernetMessage_Impl_1_enqueue((sb_queue_base_SW_RawEthernetMessage_Impl_1_t *) EthernetFramesTx1_queue_1, (base_SW_RawEthernetMessage_Impl *) data); -bool get_EthernetFramesRx(base_SW_RawEthernetMessage_Impl *data) { + return true; +} + +bool put_EthernetFramesTx2(const base_SW_RawEthernetMessage_Impl *data) { + sb_queue_base_SW_RawEthernetMessage_Impl_1_enqueue((sb_queue_base_SW_RawEthernetMessage_Impl_1_t *) EthernetFramesTx2_queue_1, (base_SW_RawEthernetMessage_Impl *) data); + + return true; +} + +bool put_EthernetFramesTx3(const base_SW_RawEthernetMessage_Impl *data) { + sb_queue_base_SW_RawEthernetMessage_Impl_1_enqueue((sb_queue_base_SW_RawEthernetMessage_Impl_1_t *) EthernetFramesTx3_queue_1, (base_SW_RawEthernetMessage_Impl *) data); + + return true; +} + +base_SW_RawEthernetMessage_Impl last_EthernetFramesRx0_payload; + +bool get_EthernetFramesRx0(base_SW_RawEthernetMessage_Impl *data) { + sb_event_counter_t numDropped; + base_SW_RawEthernetMessage_Impl fresh_data; + bool isFresh = sb_queue_base_SW_RawEthernetMessage_Impl_1_dequeue((sb_queue_base_SW_RawEthernetMessage_Impl_1_Recv_t *) &EthernetFramesRx0_recv_queue, &numDropped, &fresh_data); + if (isFresh) { + memcpy(&last_EthernetFramesRx0_payload, &fresh_data, base_SW_RawEthernetMessage_Impl_SIZE); + } + memcpy(data, &last_EthernetFramesRx0_payload, base_SW_RawEthernetMessage_Impl_SIZE); + return isFresh; +} + +base_SW_RawEthernetMessage_Impl last_EthernetFramesRx1_payload; + +bool get_EthernetFramesRx1(base_SW_RawEthernetMessage_Impl *data) { sb_event_counter_t numDropped; base_SW_RawEthernetMessage_Impl fresh_data; - bool isFresh = false; - if (sb_queue_base_SW_RawEthernetMessage_Impl_1_dequeue((sb_queue_base_SW_RawEthernetMessage_Impl_1_Recv_t *) &EthernetFramesRx_recv_queue, &numDropped, &fresh_data)) { - last_EthernetFramesRx_payload = fresh_data; - isFresh = true; + bool isFresh = sb_queue_base_SW_RawEthernetMessage_Impl_1_dequeue((sb_queue_base_SW_RawEthernetMessage_Impl_1_Recv_t *) &EthernetFramesRx1_recv_queue, &numDropped, &fresh_data); + if (isFresh) { + memcpy(&last_EthernetFramesRx1_payload, &fresh_data, base_SW_RawEthernetMessage_Impl_SIZE); } - *data = last_EthernetFramesRx_payload; + memcpy(data, &last_EthernetFramesRx1_payload, base_SW_RawEthernetMessage_Impl_SIZE); + return isFresh; +} + +base_SW_RawEthernetMessage_Impl last_EthernetFramesRx2_payload; + +bool get_EthernetFramesRx2(base_SW_RawEthernetMessage_Impl *data) { + sb_event_counter_t numDropped; + base_SW_RawEthernetMessage_Impl fresh_data; + bool isFresh = sb_queue_base_SW_RawEthernetMessage_Impl_1_dequeue((sb_queue_base_SW_RawEthernetMessage_Impl_1_Recv_t *) &EthernetFramesRx2_recv_queue, &numDropped, &fresh_data); + if (isFresh) { + memcpy(&last_EthernetFramesRx2_payload, &fresh_data, base_SW_RawEthernetMessage_Impl_SIZE); + } + memcpy(data, &last_EthernetFramesRx2_payload, base_SW_RawEthernetMessage_Impl_SIZE); + return isFresh; +} + +base_SW_RawEthernetMessage_Impl last_EthernetFramesRx3_payload; + +bool get_EthernetFramesRx3(base_SW_RawEthernetMessage_Impl *data) { + sb_event_counter_t numDropped; + base_SW_RawEthernetMessage_Impl fresh_data; + bool isFresh = sb_queue_base_SW_RawEthernetMessage_Impl_1_dequeue((sb_queue_base_SW_RawEthernetMessage_Impl_1_Recv_t *) &EthernetFramesRx3_recv_queue, &numDropped, &fresh_data); + if (isFresh) { + memcpy(&last_EthernetFramesRx3_payload, &fresh_data, base_SW_RawEthernetMessage_Impl_SIZE); + } + memcpy(data, &last_EthernetFramesRx3_payload, base_SW_RawEthernetMessage_Impl_SIZE); return isFresh; } void init(void) { - sb_queue_base_SW_RawEthernetMessage_Impl_1_init((sb_queue_base_SW_RawEthernetMessage_Impl_1_t *) EthernetFramesTx_queue_1); + sb_queue_base_SW_RawEthernetMessage_Impl_1_init((sb_queue_base_SW_RawEthernetMessage_Impl_1_t *) EthernetFramesTx0_queue_1); + + sb_queue_base_SW_RawEthernetMessage_Impl_1_init((sb_queue_base_SW_RawEthernetMessage_Impl_1_t *) EthernetFramesTx1_queue_1); + + sb_queue_base_SW_RawEthernetMessage_Impl_1_init((sb_queue_base_SW_RawEthernetMessage_Impl_1_t *) EthernetFramesTx2_queue_1); + + sb_queue_base_SW_RawEthernetMessage_Impl_1_init((sb_queue_base_SW_RawEthernetMessage_Impl_1_t *) EthernetFramesTx3_queue_1); + + sb_queue_base_SW_RawEthernetMessage_Impl_1_Recv_init(&EthernetFramesRx0_recv_queue, (sb_queue_base_SW_RawEthernetMessage_Impl_1_t *) EthernetFramesRx0_queue_1); + + sb_queue_base_SW_RawEthernetMessage_Impl_1_Recv_init(&EthernetFramesRx1_recv_queue, (sb_queue_base_SW_RawEthernetMessage_Impl_1_t *) EthernetFramesRx1_queue_1); + + sb_queue_base_SW_RawEthernetMessage_Impl_1_Recv_init(&EthernetFramesRx2_recv_queue, (sb_queue_base_SW_RawEthernetMessage_Impl_1_t *) EthernetFramesRx2_queue_1); - sb_queue_base_SW_RawEthernetMessage_Impl_1_Recv_init(&EthernetFramesRx_recv_queue, (sb_queue_base_SW_RawEthernetMessage_Impl_1_t *) EthernetFramesRx_queue_1); + sb_queue_base_SW_RawEthernetMessage_Impl_1_Recv_init(&EthernetFramesRx3_recv_queue, (sb_queue_base_SW_RawEthernetMessage_Impl_1_t *) EthernetFramesRx3_queue_1); seL4_ArduPilot_ArduPilot_initialize(); } diff --git a/open-platform-models/isolate-ethernet-simple/microkit/components/seL4_Firewall_Firewall/include/seL4_Firewall_Firewall.h b/open-platform-models/isolate-ethernet-simple/microkit/components/seL4_Firewall_Firewall/include/seL4_Firewall_Firewall.h index 26689a6..975a4cc 100644 --- a/open-platform-models/isolate-ethernet-simple/microkit/components/seL4_Firewall_Firewall/include/seL4_Firewall_Firewall.h +++ b/open-platform-models/isolate-ethernet-simple/microkit/components/seL4_Firewall_Firewall/include/seL4_Firewall_Firewall.h @@ -3,7 +3,19 @@ #include #include -bool get_EthernetFramesTxIn(base_SW_RawEthernetMessage_Impl *data); -bool put_EthernetFramesRxOut(const base_SW_RawEthernetMessage_Impl *data); -bool put_EthernetFramesTxOut(const base_SW_SizedEthernetMessage_Impl *data); -bool get_EthernetFramesRxIn(base_SW_RawEthernetMessage_Impl *data); +bool get_EthernetFramesTxIn0(base_SW_RawEthernetMessage_Impl *data); +bool get_EthernetFramesTxIn1(base_SW_RawEthernetMessage_Impl *data); +bool get_EthernetFramesTxIn2(base_SW_RawEthernetMessage_Impl *data); +bool get_EthernetFramesTxIn3(base_SW_RawEthernetMessage_Impl *data); +bool put_EthernetFramesRxOut0(const base_SW_RawEthernetMessage_Impl *data); +bool put_EthernetFramesRxOut1(const base_SW_RawEthernetMessage_Impl *data); +bool put_EthernetFramesRxOut2(const base_SW_RawEthernetMessage_Impl *data); +bool put_EthernetFramesRxOut3(const base_SW_RawEthernetMessage_Impl *data); +bool put_EthernetFramesTxOut0(const base_SW_SizedEthernetMessage_Impl *data); +bool put_EthernetFramesTxOut1(const base_SW_SizedEthernetMessage_Impl *data); +bool put_EthernetFramesTxOut2(const base_SW_SizedEthernetMessage_Impl *data); +bool put_EthernetFramesTxOut3(const base_SW_SizedEthernetMessage_Impl *data); +bool get_EthernetFramesRxIn0(base_SW_RawEthernetMessage_Impl *data); +bool get_EthernetFramesRxIn1(base_SW_RawEthernetMessage_Impl *data); +bool get_EthernetFramesRxIn2(base_SW_RawEthernetMessage_Impl *data); +bool get_EthernetFramesRxIn3(base_SW_RawEthernetMessage_Impl *data); diff --git a/open-platform-models/isolate-ethernet-simple/microkit/components/seL4_Firewall_Firewall/src/seL4_Firewall_Firewall.c b/open-platform-models/isolate-ethernet-simple/microkit/components/seL4_Firewall_Firewall/src/seL4_Firewall_Firewall.c index ad553ed..1d45c73 100644 --- a/open-platform-models/isolate-ethernet-simple/microkit/components/seL4_Firewall_Firewall/src/seL4_Firewall_Firewall.c +++ b/open-platform-models/isolate-ethernet-simple/microkit/components/seL4_Firewall_Firewall/src/seL4_Firewall_Firewall.c @@ -3,63 +3,217 @@ void seL4_Firewall_Firewall_initialize(void); void seL4_Firewall_Firewall_timeTriggered(void); -volatile sb_queue_base_SW_RawEthernetMessage_Impl_1_t *EthernetFramesTxIn_queue_1; -sb_queue_base_SW_RawEthernetMessage_Impl_1_Recv_t EthernetFramesTxIn_recv_queue; -volatile sb_queue_base_SW_RawEthernetMessage_Impl_1_t *EthernetFramesRxOut_queue_1; -volatile sb_queue_base_SW_SizedEthernetMessage_Impl_1_t *EthernetFramesTxOut_queue_1; -volatile sb_queue_base_SW_RawEthernetMessage_Impl_1_t *EthernetFramesRxIn_queue_1; -sb_queue_base_SW_RawEthernetMessage_Impl_1_Recv_t EthernetFramesRxIn_recv_queue; +volatile sb_queue_base_SW_RawEthernetMessage_Impl_1_t *EthernetFramesTxIn0_queue_1; +sb_queue_base_SW_RawEthernetMessage_Impl_1_Recv_t EthernetFramesTxIn0_recv_queue; +volatile sb_queue_base_SW_RawEthernetMessage_Impl_1_t *EthernetFramesTxIn1_queue_1; +sb_queue_base_SW_RawEthernetMessage_Impl_1_Recv_t EthernetFramesTxIn1_recv_queue; +volatile sb_queue_base_SW_RawEthernetMessage_Impl_1_t *EthernetFramesTxIn2_queue_1; +sb_queue_base_SW_RawEthernetMessage_Impl_1_Recv_t EthernetFramesTxIn2_recv_queue; +volatile sb_queue_base_SW_RawEthernetMessage_Impl_1_t *EthernetFramesTxIn3_queue_1; +sb_queue_base_SW_RawEthernetMessage_Impl_1_Recv_t EthernetFramesTxIn3_recv_queue; +volatile sb_queue_base_SW_RawEthernetMessage_Impl_1_t *EthernetFramesRxOut0_queue_1; +volatile sb_queue_base_SW_RawEthernetMessage_Impl_1_t *EthernetFramesRxOut1_queue_1; +volatile sb_queue_base_SW_RawEthernetMessage_Impl_1_t *EthernetFramesRxOut2_queue_1; +volatile sb_queue_base_SW_RawEthernetMessage_Impl_1_t *EthernetFramesRxOut3_queue_1; +volatile sb_queue_base_SW_SizedEthernetMessage_Impl_1_t *EthernetFramesTxOut0_queue_1; +volatile sb_queue_base_SW_SizedEthernetMessage_Impl_1_t *EthernetFramesTxOut1_queue_1; +volatile sb_queue_base_SW_SizedEthernetMessage_Impl_1_t *EthernetFramesTxOut2_queue_1; +volatile sb_queue_base_SW_SizedEthernetMessage_Impl_1_t *EthernetFramesTxOut3_queue_1; +volatile sb_queue_base_SW_RawEthernetMessage_Impl_1_t *EthernetFramesRxIn0_queue_1; +sb_queue_base_SW_RawEthernetMessage_Impl_1_Recv_t EthernetFramesRxIn0_recv_queue; +volatile sb_queue_base_SW_RawEthernetMessage_Impl_1_t *EthernetFramesRxIn1_queue_1; +sb_queue_base_SW_RawEthernetMessage_Impl_1_Recv_t EthernetFramesRxIn1_recv_queue; +volatile sb_queue_base_SW_RawEthernetMessage_Impl_1_t *EthernetFramesRxIn2_queue_1; +sb_queue_base_SW_RawEthernetMessage_Impl_1_Recv_t EthernetFramesRxIn2_recv_queue; +volatile sb_queue_base_SW_RawEthernetMessage_Impl_1_t *EthernetFramesRxIn3_queue_1; +sb_queue_base_SW_RawEthernetMessage_Impl_1_Recv_t EthernetFramesRxIn3_recv_queue; #define PORT_FROM_MON 58 -base_SW_RawEthernetMessage_Impl last_EthernetFramesTxIn_payload; +base_SW_RawEthernetMessage_Impl last_EthernetFramesTxIn0_payload; -bool get_EthernetFramesTxIn(base_SW_RawEthernetMessage_Impl *data) { +bool get_EthernetFramesTxIn0(base_SW_RawEthernetMessage_Impl *data) { sb_event_counter_t numDropped; base_SW_RawEthernetMessage_Impl fresh_data; - bool isFresh = false; - if (sb_queue_base_SW_RawEthernetMessage_Impl_1_dequeue((sb_queue_base_SW_RawEthernetMessage_Impl_1_Recv_t *) &EthernetFramesTxIn_recv_queue, &numDropped, &fresh_data)) { - last_EthernetFramesTxIn_payload = fresh_data; - isFresh = true; + bool isFresh = sb_queue_base_SW_RawEthernetMessage_Impl_1_dequeue((sb_queue_base_SW_RawEthernetMessage_Impl_1_Recv_t *) &EthernetFramesTxIn0_recv_queue, &numDropped, &fresh_data); + if (isFresh) { + memcpy(&last_EthernetFramesTxIn0_payload, &fresh_data, base_SW_RawEthernetMessage_Impl_SIZE); } - *data = last_EthernetFramesTxIn_payload; + memcpy(data, &last_EthernetFramesTxIn0_payload, base_SW_RawEthernetMessage_Impl_SIZE); return isFresh; } -bool put_EthernetFramesRxOut(const base_SW_RawEthernetMessage_Impl *data) { - sb_queue_base_SW_RawEthernetMessage_Impl_1_enqueue((sb_queue_base_SW_RawEthernetMessage_Impl_1_t *) EthernetFramesRxOut_queue_1, (base_SW_RawEthernetMessage_Impl *) data); +base_SW_RawEthernetMessage_Impl last_EthernetFramesTxIn1_payload; + +bool get_EthernetFramesTxIn1(base_SW_RawEthernetMessage_Impl *data) { + sb_event_counter_t numDropped; + base_SW_RawEthernetMessage_Impl fresh_data; + bool isFresh = sb_queue_base_SW_RawEthernetMessage_Impl_1_dequeue((sb_queue_base_SW_RawEthernetMessage_Impl_1_Recv_t *) &EthernetFramesTxIn1_recv_queue, &numDropped, &fresh_data); + if (isFresh) { + memcpy(&last_EthernetFramesTxIn1_payload, &fresh_data, base_SW_RawEthernetMessage_Impl_SIZE); + } + memcpy(data, &last_EthernetFramesTxIn1_payload, base_SW_RawEthernetMessage_Impl_SIZE); + return isFresh; +} + +base_SW_RawEthernetMessage_Impl last_EthernetFramesTxIn2_payload; + +bool get_EthernetFramesTxIn2(base_SW_RawEthernetMessage_Impl *data) { + sb_event_counter_t numDropped; + base_SW_RawEthernetMessage_Impl fresh_data; + bool isFresh = sb_queue_base_SW_RawEthernetMessage_Impl_1_dequeue((sb_queue_base_SW_RawEthernetMessage_Impl_1_Recv_t *) &EthernetFramesTxIn2_recv_queue, &numDropped, &fresh_data); + if (isFresh) { + memcpy(&last_EthernetFramesTxIn2_payload, &fresh_data, base_SW_RawEthernetMessage_Impl_SIZE); + } + memcpy(data, &last_EthernetFramesTxIn2_payload, base_SW_RawEthernetMessage_Impl_SIZE); + return isFresh; +} + +base_SW_RawEthernetMessage_Impl last_EthernetFramesTxIn3_payload; + +bool get_EthernetFramesTxIn3(base_SW_RawEthernetMessage_Impl *data) { + sb_event_counter_t numDropped; + base_SW_RawEthernetMessage_Impl fresh_data; + bool isFresh = sb_queue_base_SW_RawEthernetMessage_Impl_1_dequeue((sb_queue_base_SW_RawEthernetMessage_Impl_1_Recv_t *) &EthernetFramesTxIn3_recv_queue, &numDropped, &fresh_data); + if (isFresh) { + memcpy(&last_EthernetFramesTxIn3_payload, &fresh_data, base_SW_RawEthernetMessage_Impl_SIZE); + } + memcpy(data, &last_EthernetFramesTxIn3_payload, base_SW_RawEthernetMessage_Impl_SIZE); + return isFresh; +} + +bool put_EthernetFramesRxOut0(const base_SW_RawEthernetMessage_Impl *data) { + sb_queue_base_SW_RawEthernetMessage_Impl_1_enqueue((sb_queue_base_SW_RawEthernetMessage_Impl_1_t *) EthernetFramesRxOut0_queue_1, (base_SW_RawEthernetMessage_Impl *) data); + + return true; +} + +bool put_EthernetFramesRxOut1(const base_SW_RawEthernetMessage_Impl *data) { + sb_queue_base_SW_RawEthernetMessage_Impl_1_enqueue((sb_queue_base_SW_RawEthernetMessage_Impl_1_t *) EthernetFramesRxOut1_queue_1, (base_SW_RawEthernetMessage_Impl *) data); + + return true; +} + +bool put_EthernetFramesRxOut2(const base_SW_RawEthernetMessage_Impl *data) { + sb_queue_base_SW_RawEthernetMessage_Impl_1_enqueue((sb_queue_base_SW_RawEthernetMessage_Impl_1_t *) EthernetFramesRxOut2_queue_1, (base_SW_RawEthernetMessage_Impl *) data); + + return true; +} + +bool put_EthernetFramesRxOut3(const base_SW_RawEthernetMessage_Impl *data) { + sb_queue_base_SW_RawEthernetMessage_Impl_1_enqueue((sb_queue_base_SW_RawEthernetMessage_Impl_1_t *) EthernetFramesRxOut3_queue_1, (base_SW_RawEthernetMessage_Impl *) data); + + return true; +} + +bool put_EthernetFramesTxOut0(const base_SW_SizedEthernetMessage_Impl *data) { + sb_queue_base_SW_SizedEthernetMessage_Impl_1_enqueue((sb_queue_base_SW_SizedEthernetMessage_Impl_1_t *) EthernetFramesTxOut0_queue_1, (base_SW_SizedEthernetMessage_Impl *) data); + + return true; +} + +bool put_EthernetFramesTxOut1(const base_SW_SizedEthernetMessage_Impl *data) { + sb_queue_base_SW_SizedEthernetMessage_Impl_1_enqueue((sb_queue_base_SW_SizedEthernetMessage_Impl_1_t *) EthernetFramesTxOut1_queue_1, (base_SW_SizedEthernetMessage_Impl *) data); + + return true; +} + +bool put_EthernetFramesTxOut2(const base_SW_SizedEthernetMessage_Impl *data) { + sb_queue_base_SW_SizedEthernetMessage_Impl_1_enqueue((sb_queue_base_SW_SizedEthernetMessage_Impl_1_t *) EthernetFramesTxOut2_queue_1, (base_SW_SizedEthernetMessage_Impl *) data); return true; } -bool put_EthernetFramesTxOut(const base_SW_SizedEthernetMessage_Impl *data) { - sb_queue_base_SW_SizedEthernetMessage_Impl_1_enqueue((sb_queue_base_SW_SizedEthernetMessage_Impl_1_t *) EthernetFramesTxOut_queue_1, (base_SW_SizedEthernetMessage_Impl *) data); +bool put_EthernetFramesTxOut3(const base_SW_SizedEthernetMessage_Impl *data) { + sb_queue_base_SW_SizedEthernetMessage_Impl_1_enqueue((sb_queue_base_SW_SizedEthernetMessage_Impl_1_t *) EthernetFramesTxOut3_queue_1, (base_SW_SizedEthernetMessage_Impl *) data); return true; } -base_SW_RawEthernetMessage_Impl last_EthernetFramesRxIn_payload; +base_SW_RawEthernetMessage_Impl last_EthernetFramesRxIn0_payload; + +bool get_EthernetFramesRxIn0(base_SW_RawEthernetMessage_Impl *data) { + sb_event_counter_t numDropped; + base_SW_RawEthernetMessage_Impl fresh_data; + bool isFresh = sb_queue_base_SW_RawEthernetMessage_Impl_1_dequeue((sb_queue_base_SW_RawEthernetMessage_Impl_1_Recv_t *) &EthernetFramesRxIn0_recv_queue, &numDropped, &fresh_data); + if (isFresh) { + memcpy(&last_EthernetFramesRxIn0_payload, &fresh_data, base_SW_RawEthernetMessage_Impl_SIZE); + } + memcpy(data, &last_EthernetFramesRxIn0_payload, base_SW_RawEthernetMessage_Impl_SIZE); + return isFresh; +} + +base_SW_RawEthernetMessage_Impl last_EthernetFramesRxIn1_payload; + +bool get_EthernetFramesRxIn1(base_SW_RawEthernetMessage_Impl *data) { + sb_event_counter_t numDropped; + base_SW_RawEthernetMessage_Impl fresh_data; + bool isFresh = sb_queue_base_SW_RawEthernetMessage_Impl_1_dequeue((sb_queue_base_SW_RawEthernetMessage_Impl_1_Recv_t *) &EthernetFramesRxIn1_recv_queue, &numDropped, &fresh_data); + if (isFresh) { + memcpy(&last_EthernetFramesRxIn1_payload, &fresh_data, base_SW_RawEthernetMessage_Impl_SIZE); + } + memcpy(data, &last_EthernetFramesRxIn1_payload, base_SW_RawEthernetMessage_Impl_SIZE); + return isFresh; +} + +base_SW_RawEthernetMessage_Impl last_EthernetFramesRxIn2_payload; -bool get_EthernetFramesRxIn(base_SW_RawEthernetMessage_Impl *data) { +bool get_EthernetFramesRxIn2(base_SW_RawEthernetMessage_Impl *data) { sb_event_counter_t numDropped; base_SW_RawEthernetMessage_Impl fresh_data; - bool isFresh = false; - if (sb_queue_base_SW_RawEthernetMessage_Impl_1_dequeue((sb_queue_base_SW_RawEthernetMessage_Impl_1_Recv_t *) &EthernetFramesRxIn_recv_queue, &numDropped, &fresh_data)) { - last_EthernetFramesRxIn_payload = fresh_data; - isFresh = true; + bool isFresh = sb_queue_base_SW_RawEthernetMessage_Impl_1_dequeue((sb_queue_base_SW_RawEthernetMessage_Impl_1_Recv_t *) &EthernetFramesRxIn2_recv_queue, &numDropped, &fresh_data); + if (isFresh) { + memcpy(&last_EthernetFramesRxIn2_payload, &fresh_data, base_SW_RawEthernetMessage_Impl_SIZE); } - *data = last_EthernetFramesRxIn_payload; + memcpy(data, &last_EthernetFramesRxIn2_payload, base_SW_RawEthernetMessage_Impl_SIZE); + return isFresh; +} + +base_SW_RawEthernetMessage_Impl last_EthernetFramesRxIn3_payload; + +bool get_EthernetFramesRxIn3(base_SW_RawEthernetMessage_Impl *data) { + sb_event_counter_t numDropped; + base_SW_RawEthernetMessage_Impl fresh_data; + bool isFresh = sb_queue_base_SW_RawEthernetMessage_Impl_1_dequeue((sb_queue_base_SW_RawEthernetMessage_Impl_1_Recv_t *) &EthernetFramesRxIn3_recv_queue, &numDropped, &fresh_data); + if (isFresh) { + memcpy(&last_EthernetFramesRxIn3_payload, &fresh_data, base_SW_RawEthernetMessage_Impl_SIZE); + } + memcpy(data, &last_EthernetFramesRxIn3_payload, base_SW_RawEthernetMessage_Impl_SIZE); return isFresh; } void init(void) { - sb_queue_base_SW_RawEthernetMessage_Impl_1_Recv_init(&EthernetFramesTxIn_recv_queue, (sb_queue_base_SW_RawEthernetMessage_Impl_1_t *) EthernetFramesTxIn_queue_1); + sb_queue_base_SW_RawEthernetMessage_Impl_1_Recv_init(&EthernetFramesTxIn0_recv_queue, (sb_queue_base_SW_RawEthernetMessage_Impl_1_t *) EthernetFramesTxIn0_queue_1); + + sb_queue_base_SW_RawEthernetMessage_Impl_1_Recv_init(&EthernetFramesTxIn1_recv_queue, (sb_queue_base_SW_RawEthernetMessage_Impl_1_t *) EthernetFramesTxIn1_queue_1); + + sb_queue_base_SW_RawEthernetMessage_Impl_1_Recv_init(&EthernetFramesTxIn2_recv_queue, (sb_queue_base_SW_RawEthernetMessage_Impl_1_t *) EthernetFramesTxIn2_queue_1); + + sb_queue_base_SW_RawEthernetMessage_Impl_1_Recv_init(&EthernetFramesTxIn3_recv_queue, (sb_queue_base_SW_RawEthernetMessage_Impl_1_t *) EthernetFramesTxIn3_queue_1); + + sb_queue_base_SW_RawEthernetMessage_Impl_1_init((sb_queue_base_SW_RawEthernetMessage_Impl_1_t *) EthernetFramesRxOut0_queue_1); + + sb_queue_base_SW_RawEthernetMessage_Impl_1_init((sb_queue_base_SW_RawEthernetMessage_Impl_1_t *) EthernetFramesRxOut1_queue_1); + + sb_queue_base_SW_RawEthernetMessage_Impl_1_init((sb_queue_base_SW_RawEthernetMessage_Impl_1_t *) EthernetFramesRxOut2_queue_1); + + sb_queue_base_SW_RawEthernetMessage_Impl_1_init((sb_queue_base_SW_RawEthernetMessage_Impl_1_t *) EthernetFramesRxOut3_queue_1); + + sb_queue_base_SW_SizedEthernetMessage_Impl_1_init((sb_queue_base_SW_SizedEthernetMessage_Impl_1_t *) EthernetFramesTxOut0_queue_1); + + sb_queue_base_SW_SizedEthernetMessage_Impl_1_init((sb_queue_base_SW_SizedEthernetMessage_Impl_1_t *) EthernetFramesTxOut1_queue_1); + + sb_queue_base_SW_SizedEthernetMessage_Impl_1_init((sb_queue_base_SW_SizedEthernetMessage_Impl_1_t *) EthernetFramesTxOut2_queue_1); + + sb_queue_base_SW_SizedEthernetMessage_Impl_1_init((sb_queue_base_SW_SizedEthernetMessage_Impl_1_t *) EthernetFramesTxOut3_queue_1); + + sb_queue_base_SW_RawEthernetMessage_Impl_1_Recv_init(&EthernetFramesRxIn0_recv_queue, (sb_queue_base_SW_RawEthernetMessage_Impl_1_t *) EthernetFramesRxIn0_queue_1); - sb_queue_base_SW_RawEthernetMessage_Impl_1_init((sb_queue_base_SW_RawEthernetMessage_Impl_1_t *) EthernetFramesRxOut_queue_1); + sb_queue_base_SW_RawEthernetMessage_Impl_1_Recv_init(&EthernetFramesRxIn1_recv_queue, (sb_queue_base_SW_RawEthernetMessage_Impl_1_t *) EthernetFramesRxIn1_queue_1); - sb_queue_base_SW_SizedEthernetMessage_Impl_1_init((sb_queue_base_SW_SizedEthernetMessage_Impl_1_t *) EthernetFramesTxOut_queue_1); + sb_queue_base_SW_RawEthernetMessage_Impl_1_Recv_init(&EthernetFramesRxIn2_recv_queue, (sb_queue_base_SW_RawEthernetMessage_Impl_1_t *) EthernetFramesRxIn2_queue_1); - sb_queue_base_SW_RawEthernetMessage_Impl_1_Recv_init(&EthernetFramesRxIn_recv_queue, (sb_queue_base_SW_RawEthernetMessage_Impl_1_t *) EthernetFramesRxIn_queue_1); + sb_queue_base_SW_RawEthernetMessage_Impl_1_Recv_init(&EthernetFramesRxIn3_recv_queue, (sb_queue_base_SW_RawEthernetMessage_Impl_1_t *) EthernetFramesRxIn3_queue_1); seL4_Firewall_Firewall_initialize(); } diff --git a/open-platform-models/isolate-ethernet-simple/microkit/components/seL4_LowLevelEthernetDriver_LowLevelEthernetDriver/include/seL4_LowLevelEthernetDriver_LowLevelEthernetDriver.h b/open-platform-models/isolate-ethernet-simple/microkit/components/seL4_LowLevelEthernetDriver_LowLevelEthernetDriver/include/seL4_LowLevelEthernetDriver_LowLevelEthernetDriver.h index fc46ec7..d35f635 100644 --- a/open-platform-models/isolate-ethernet-simple/microkit/components/seL4_LowLevelEthernetDriver_LowLevelEthernetDriver/include/seL4_LowLevelEthernetDriver_LowLevelEthernetDriver.h +++ b/open-platform-models/isolate-ethernet-simple/microkit/components/seL4_LowLevelEthernetDriver_LowLevelEthernetDriver/include/seL4_LowLevelEthernetDriver_LowLevelEthernetDriver.h @@ -3,5 +3,11 @@ #include #include -bool get_EthernetFramesTx(base_SW_SizedEthernetMessage_Impl *data); -bool put_EthernetFramesRx(const base_SW_RawEthernetMessage_Impl *data); +bool get_EthernetFramesTx0(base_SW_SizedEthernetMessage_Impl *data); +bool get_EthernetFramesTx1(base_SW_SizedEthernetMessage_Impl *data); +bool get_EthernetFramesTx2(base_SW_SizedEthernetMessage_Impl *data); +bool get_EthernetFramesTx3(base_SW_SizedEthernetMessage_Impl *data); +bool put_EthernetFramesRx0(const base_SW_RawEthernetMessage_Impl *data); +bool put_EthernetFramesRx1(const base_SW_RawEthernetMessage_Impl *data); +bool put_EthernetFramesRx2(const base_SW_RawEthernetMessage_Impl *data); +bool put_EthernetFramesRx3(const base_SW_RawEthernetMessage_Impl *data); diff --git a/open-platform-models/isolate-ethernet-simple/microkit/components/seL4_LowLevelEthernetDriver_LowLevelEthernetDriver/src/seL4_LowLevelEthernetDriver_LowLevelEthernetDriver.c b/open-platform-models/isolate-ethernet-simple/microkit/components/seL4_LowLevelEthernetDriver_LowLevelEthernetDriver/src/seL4_LowLevelEthernetDriver_LowLevelEthernetDriver.c index cf61fbc..1388445 100644 --- a/open-platform-models/isolate-ethernet-simple/microkit/components/seL4_LowLevelEthernetDriver_LowLevelEthernetDriver/src/seL4_LowLevelEthernetDriver_LowLevelEthernetDriver.c +++ b/open-platform-models/isolate-ethernet-simple/microkit/components/seL4_LowLevelEthernetDriver_LowLevelEthernetDriver/src/seL4_LowLevelEthernetDriver_LowLevelEthernetDriver.c @@ -3,36 +3,113 @@ void seL4_LowLevelEthernetDriver_LowLevelEthernetDriver_initialize(void); void seL4_LowLevelEthernetDriver_LowLevelEthernetDriver_timeTriggered(void); -volatile sb_queue_base_SW_SizedEthernetMessage_Impl_1_t *EthernetFramesTx_queue_1; -sb_queue_base_SW_SizedEthernetMessage_Impl_1_Recv_t EthernetFramesTx_recv_queue; -volatile sb_queue_base_SW_RawEthernetMessage_Impl_1_t *EthernetFramesRx_queue_1; +volatile sb_queue_base_SW_SizedEthernetMessage_Impl_1_t *EthernetFramesTx0_queue_1; +sb_queue_base_SW_SizedEthernetMessage_Impl_1_Recv_t EthernetFramesTx0_recv_queue; +volatile sb_queue_base_SW_SizedEthernetMessage_Impl_1_t *EthernetFramesTx1_queue_1; +sb_queue_base_SW_SizedEthernetMessage_Impl_1_Recv_t EthernetFramesTx1_recv_queue; +volatile sb_queue_base_SW_SizedEthernetMessage_Impl_1_t *EthernetFramesTx2_queue_1; +sb_queue_base_SW_SizedEthernetMessage_Impl_1_Recv_t EthernetFramesTx2_recv_queue; +volatile sb_queue_base_SW_SizedEthernetMessage_Impl_1_t *EthernetFramesTx3_queue_1; +sb_queue_base_SW_SizedEthernetMessage_Impl_1_Recv_t EthernetFramesTx3_recv_queue; +volatile sb_queue_base_SW_RawEthernetMessage_Impl_1_t *EthernetFramesRx0_queue_1; +volatile sb_queue_base_SW_RawEthernetMessage_Impl_1_t *EthernetFramesRx1_queue_1; +volatile sb_queue_base_SW_RawEthernetMessage_Impl_1_t *EthernetFramesRx2_queue_1; +volatile sb_queue_base_SW_RawEthernetMessage_Impl_1_t *EthernetFramesRx3_queue_1; #define PORT_FROM_MON 56 -base_SW_SizedEthernetMessage_Impl last_EthernetFramesTx_payload; +base_SW_SizedEthernetMessage_Impl last_EthernetFramesTx0_payload; -bool get_EthernetFramesTx(base_SW_SizedEthernetMessage_Impl *data) { +bool get_EthernetFramesTx0(base_SW_SizedEthernetMessage_Impl *data) { sb_event_counter_t numDropped; base_SW_SizedEthernetMessage_Impl fresh_data; - bool isFresh = false; - if (sb_queue_base_SW_SizedEthernetMessage_Impl_1_dequeue((sb_queue_base_SW_SizedEthernetMessage_Impl_1_Recv_t *) &EthernetFramesTx_recv_queue, &numDropped, &fresh_data)) { - last_EthernetFramesTx_payload = fresh_data; - isFresh = true; + bool isFresh = sb_queue_base_SW_SizedEthernetMessage_Impl_1_dequeue((sb_queue_base_SW_SizedEthernetMessage_Impl_1_Recv_t *) &EthernetFramesTx0_recv_queue, &numDropped, &fresh_data); + if (isFresh) { + last_EthernetFramesTx0_payload = fresh_data; } - *data = last_EthernetFramesTx_payload; + *data = last_EthernetFramesTx0_payload; return isFresh; } -bool put_EthernetFramesRx(const base_SW_RawEthernetMessage_Impl *data) { - sb_queue_base_SW_RawEthernetMessage_Impl_1_enqueue((sb_queue_base_SW_RawEthernetMessage_Impl_1_t *) EthernetFramesRx_queue_1, (base_SW_RawEthernetMessage_Impl *) data); +base_SW_SizedEthernetMessage_Impl last_EthernetFramesTx1_payload; + +bool get_EthernetFramesTx1(base_SW_SizedEthernetMessage_Impl *data) { + sb_event_counter_t numDropped; + base_SW_SizedEthernetMessage_Impl fresh_data; + bool isFresh = sb_queue_base_SW_SizedEthernetMessage_Impl_1_dequeue((sb_queue_base_SW_SizedEthernetMessage_Impl_1_Recv_t *) &EthernetFramesTx1_recv_queue, &numDropped, &fresh_data); + if (isFresh) { + last_EthernetFramesTx1_payload = fresh_data; + } + *data = last_EthernetFramesTx1_payload; + return isFresh; +} + +base_SW_SizedEthernetMessage_Impl last_EthernetFramesTx2_payload; + +bool get_EthernetFramesTx2(base_SW_SizedEthernetMessage_Impl *data) { + sb_event_counter_t numDropped; + base_SW_SizedEthernetMessage_Impl fresh_data; + bool isFresh = sb_queue_base_SW_SizedEthernetMessage_Impl_1_dequeue((sb_queue_base_SW_SizedEthernetMessage_Impl_1_Recv_t *) &EthernetFramesTx2_recv_queue, &numDropped, &fresh_data); + if (isFresh) { + last_EthernetFramesTx2_payload = fresh_data; + } + *data = last_EthernetFramesTx2_payload; + return isFresh; +} + +base_SW_SizedEthernetMessage_Impl last_EthernetFramesTx3_payload; + +bool get_EthernetFramesTx3(base_SW_SizedEthernetMessage_Impl *data) { + sb_event_counter_t numDropped; + base_SW_SizedEthernetMessage_Impl fresh_data; + bool isFresh = sb_queue_base_SW_SizedEthernetMessage_Impl_1_dequeue((sb_queue_base_SW_SizedEthernetMessage_Impl_1_Recv_t *) &EthernetFramesTx3_recv_queue, &numDropped, &fresh_data); + if (isFresh) { + last_EthernetFramesTx3_payload = fresh_data; + } + *data = last_EthernetFramesTx3_payload; + return isFresh; +} + +bool put_EthernetFramesRx0(const base_SW_RawEthernetMessage_Impl *data) { + sb_queue_base_SW_RawEthernetMessage_Impl_1_enqueue((sb_queue_base_SW_RawEthernetMessage_Impl_1_t *) EthernetFramesRx0_queue_1, (base_SW_RawEthernetMessage_Impl *) data); + + return true; +} + +bool put_EthernetFramesRx1(const base_SW_RawEthernetMessage_Impl *data) { + sb_queue_base_SW_RawEthernetMessage_Impl_1_enqueue((sb_queue_base_SW_RawEthernetMessage_Impl_1_t *) EthernetFramesRx1_queue_1, (base_SW_RawEthernetMessage_Impl *) data); + + return true; +} + +bool put_EthernetFramesRx2(const base_SW_RawEthernetMessage_Impl *data) { + sb_queue_base_SW_RawEthernetMessage_Impl_1_enqueue((sb_queue_base_SW_RawEthernetMessage_Impl_1_t *) EthernetFramesRx2_queue_1, (base_SW_RawEthernetMessage_Impl *) data); + + return true; +} + +bool put_EthernetFramesRx3(const base_SW_RawEthernetMessage_Impl *data) { + sb_queue_base_SW_RawEthernetMessage_Impl_1_enqueue((sb_queue_base_SW_RawEthernetMessage_Impl_1_t *) EthernetFramesRx3_queue_1, (base_SW_RawEthernetMessage_Impl *) data); return true; } void init(void) { - sb_queue_base_SW_SizedEthernetMessage_Impl_1_Recv_init(&EthernetFramesTx_recv_queue, (sb_queue_base_SW_SizedEthernetMessage_Impl_1_t *) EthernetFramesTx_queue_1); + sb_queue_base_SW_SizedEthernetMessage_Impl_1_Recv_init(&EthernetFramesTx0_recv_queue, (sb_queue_base_SW_SizedEthernetMessage_Impl_1_t *) EthernetFramesTx0_queue_1); + + sb_queue_base_SW_SizedEthernetMessage_Impl_1_Recv_init(&EthernetFramesTx1_recv_queue, (sb_queue_base_SW_SizedEthernetMessage_Impl_1_t *) EthernetFramesTx1_queue_1); + + sb_queue_base_SW_SizedEthernetMessage_Impl_1_Recv_init(&EthernetFramesTx2_recv_queue, (sb_queue_base_SW_SizedEthernetMessage_Impl_1_t *) EthernetFramesTx2_queue_1); + + sb_queue_base_SW_SizedEthernetMessage_Impl_1_Recv_init(&EthernetFramesTx3_recv_queue, (sb_queue_base_SW_SizedEthernetMessage_Impl_1_t *) EthernetFramesTx3_queue_1); + + sb_queue_base_SW_RawEthernetMessage_Impl_1_init((sb_queue_base_SW_RawEthernetMessage_Impl_1_t *) EthernetFramesRx0_queue_1); + + sb_queue_base_SW_RawEthernetMessage_Impl_1_init((sb_queue_base_SW_RawEthernetMessage_Impl_1_t *) EthernetFramesRx1_queue_1); + + sb_queue_base_SW_RawEthernetMessage_Impl_1_init((sb_queue_base_SW_RawEthernetMessage_Impl_1_t *) EthernetFramesRx2_queue_1); - sb_queue_base_SW_RawEthernetMessage_Impl_1_init((sb_queue_base_SW_RawEthernetMessage_Impl_1_t *) EthernetFramesRx_queue_1); + sb_queue_base_SW_RawEthernetMessage_Impl_1_init((sb_queue_base_SW_RawEthernetMessage_Impl_1_t *) EthernetFramesRx3_queue_1); seL4_LowLevelEthernetDriver_LowLevelEthernetDriver_initialize(); } diff --git a/open-platform-models/isolate-ethernet-simple/microkit/include/sb_aadl_types.h b/open-platform-models/isolate-ethernet-simple/microkit/include/sb_aadl_types.h index 3e705c0..20ade33 100644 --- a/open-platform-models/isolate-ethernet-simple/microkit/include/sb_aadl_types.h +++ b/open-platform-models/isolate-ethernet-simple/microkit/include/sb_aadl_types.h @@ -6,8 +6,9 @@ typedef struct base_SW_SizedEthernetMessage_Impl base_SW_SizedEthernetMessage_Impl; #define base_SW_RawEthernetMessage_Impl_SIZE 1600 +#define base_SW_RawEthernetMessage_Impl_DIM 1600 -typedef uint8_t base_SW_RawEthernetMessage_Impl [base_SW_RawEthernetMessage_Impl_SIZE]; +typedef uint8_t base_SW_RawEthernetMessage_Impl [base_SW_RawEthernetMessage_Impl_DIM]; typedef struct base_SW_RawEthernetMessage_Impl_container{ @@ -15,8 +16,9 @@ typedef } base_SW_RawEthernetMessage_Impl_container; #define base_SW_RawEthernetMessage_SIZE 1600 +#define base_SW_RawEthernetMessage_DIM 1600 -typedef uint8_t base_SW_RawEthernetMessage [base_SW_RawEthernetMessage_SIZE]; +typedef uint8_t base_SW_RawEthernetMessage [base_SW_RawEthernetMessage_DIM]; typedef struct base_SW_RawEthernetMessage_container{ @@ -24,8 +26,8 @@ typedef } base_SW_RawEthernetMessage_container; struct base_SW_SizedEthernetMessage_Impl { - message; - size; + base_SW_RawEthernetMessage message; + uint16_t size; }; #endif diff --git a/open-platform-models/isolate-ethernet-simple/microkit/include/sb_queue_base_SW_RawEthernetMessage_Impl_1.h b/open-platform-models/isolate-ethernet-simple/microkit/include/sb_queue_base_SW_RawEthernetMessage_Impl_1.h index ed23c59..b76aef0 100644 --- a/open-platform-models/isolate-ethernet-simple/microkit/include/sb_queue_base_SW_RawEthernetMessage_Impl_1.h +++ b/open-platform-models/isolate-ethernet-simple/microkit/include/sb_queue_base_SW_RawEthernetMessage_Impl_1.h @@ -28,6 +28,7 @@ #include #include #include +#include // Queue size must be an integer factor of the size for sb_event_counter_t (an unsigned // integer type). Since we are using standard C unsigned integers for the diff --git a/open-platform-models/isolate-ethernet-simple/microkit/include/sb_queue_base_SW_SizedEthernetMessage_Impl_1.h b/open-platform-models/isolate-ethernet-simple/microkit/include/sb_queue_base_SW_SizedEthernetMessage_Impl_1.h index ff25d1b..8d92fb2 100644 --- a/open-platform-models/isolate-ethernet-simple/microkit/include/sb_queue_base_SW_SizedEthernetMessage_Impl_1.h +++ b/open-platform-models/isolate-ethernet-simple/microkit/include/sb_queue_base_SW_SizedEthernetMessage_Impl_1.h @@ -28,6 +28,7 @@ #include #include #include +#include // Queue size must be an integer factor of the size for sb_event_counter_t (an unsigned // integer type). Since we are using standard C unsigned integers for the diff --git a/open-platform-models/isolate-ethernet-simple/microkit/include/sb_types.h b/open-platform-models/isolate-ethernet-simple/microkit/include/sb_types.h index 61c36a3..b276e2a 100644 --- a/open-platform-models/isolate-ethernet-simple/microkit/include/sb_types.h +++ b/open-platform-models/isolate-ethernet-simple/microkit/include/sb_types.h @@ -4,7 +4,19 @@ #include #include #include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include #include #endif \ No newline at end of file diff --git a/open-platform-models/isolate-ethernet-simple/microkit/include/util.h b/open-platform-models/isolate-ethernet-simple/microkit/include/util.h index 9623aba..d8518e0 100644 --- a/open-platform-models/isolate-ethernet-simple/microkit/include/util.h +++ b/open-platform-models/isolate-ethernet-simple/microkit/include/util.h @@ -117,20 +117,8 @@ print_tcb_regs(seL4_UserContext *ctx) { #endif } -static void *memcpy(void *restrict dest, const void *restrict src, size_t n) -{ - unsigned char *d = dest; - const unsigned char *s = src; - for (; n; n--) *d++ = *s++; - return dest; -} - -static void *memset(void *dest, int c, size_t n) -{ - unsigned char *s = dest; - for (; n; n--, s++) *s = c; - return dest; -} +void *memcpy(void *restrict dest, const void *restrict src, size_t n); +void *memset(void *dest, int c, size_t n); static void assert_fail( const char *assertion, diff --git a/open-platform-models/isolate-ethernet-simple/microkit/microkit.dot b/open-platform-models/isolate-ethernet-simple/microkit/microkit.dot index b99e5c9..eabfb4a 100644 --- a/open-platform-models/isolate-ethernet-simple/microkit/microkit.dot +++ b/open-platform-models/isolate-ethernet-simple/microkit/microkit.dot @@ -12,8 +12,14 @@ digraph microkit { label = "seL4_ArduPilot_ArduPilot"; seL4_ArduPilot_ArduPilot_INVIS [label="", style=invis, width=.5, height=.5, fixedsize=true] - pd_seL4_ArduPilot_ArduPilot_EthernetFramesTx_queue_1 [label=EthernetFramesTx_queue_1]; - pd_seL4_ArduPilot_ArduPilot_EthernetFramesRx_queue_1 [label=EthernetFramesRx_queue_1]; + pd_seL4_ArduPilot_ArduPilot_EthernetFramesTx0_queue_1 [label=EthernetFramesTx0_queue_1]; + pd_seL4_ArduPilot_ArduPilot_EthernetFramesTx1_queue_1 [label=EthernetFramesTx1_queue_1]; + pd_seL4_ArduPilot_ArduPilot_EthernetFramesTx2_queue_1 [label=EthernetFramesTx2_queue_1]; + pd_seL4_ArduPilot_ArduPilot_EthernetFramesTx3_queue_1 [label=EthernetFramesTx3_queue_1]; + pd_seL4_ArduPilot_ArduPilot_EthernetFramesRx0_queue_1 [label=EthernetFramesRx0_queue_1]; + pd_seL4_ArduPilot_ArduPilot_EthernetFramesRx1_queue_1 [label=EthernetFramesRx1_queue_1]; + pd_seL4_ArduPilot_ArduPilot_EthernetFramesRx2_queue_1 [label=EthernetFramesRx2_queue_1]; + pd_seL4_ArduPilot_ArduPilot_EthernetFramesRx3_queue_1 [label=EthernetFramesRx3_queue_1]; } } @@ -27,10 +33,22 @@ digraph microkit { label = "seL4_Firewall_Firewall"; seL4_Firewall_Firewall_INVIS [label="", style=invis, width=.5, height=.5, fixedsize=true] - pd_seL4_Firewall_Firewall_EthernetFramesTxIn_queue_1 [label=EthernetFramesTxIn_queue_1]; - pd_seL4_Firewall_Firewall_EthernetFramesRxOut_queue_1 [label=EthernetFramesRxOut_queue_1]; - pd_seL4_Firewall_Firewall_EthernetFramesTxOut_queue_1 [label=EthernetFramesTxOut_queue_1]; - pd_seL4_Firewall_Firewall_EthernetFramesRxIn_queue_1 [label=EthernetFramesRxIn_queue_1]; + pd_seL4_Firewall_Firewall_EthernetFramesTxIn0_queue_1 [label=EthernetFramesTxIn0_queue_1]; + pd_seL4_Firewall_Firewall_EthernetFramesTxIn1_queue_1 [label=EthernetFramesTxIn1_queue_1]; + pd_seL4_Firewall_Firewall_EthernetFramesTxIn2_queue_1 [label=EthernetFramesTxIn2_queue_1]; + pd_seL4_Firewall_Firewall_EthernetFramesTxIn3_queue_1 [label=EthernetFramesTxIn3_queue_1]; + pd_seL4_Firewall_Firewall_EthernetFramesRxOut0_queue_1 [label=EthernetFramesRxOut0_queue_1]; + pd_seL4_Firewall_Firewall_EthernetFramesRxOut1_queue_1 [label=EthernetFramesRxOut1_queue_1]; + pd_seL4_Firewall_Firewall_EthernetFramesRxOut2_queue_1 [label=EthernetFramesRxOut2_queue_1]; + pd_seL4_Firewall_Firewall_EthernetFramesRxOut3_queue_1 [label=EthernetFramesRxOut3_queue_1]; + pd_seL4_Firewall_Firewall_EthernetFramesTxOut0_queue_1 [label=EthernetFramesTxOut0_queue_1]; + pd_seL4_Firewall_Firewall_EthernetFramesTxOut1_queue_1 [label=EthernetFramesTxOut1_queue_1]; + pd_seL4_Firewall_Firewall_EthernetFramesTxOut2_queue_1 [label=EthernetFramesTxOut2_queue_1]; + pd_seL4_Firewall_Firewall_EthernetFramesTxOut3_queue_1 [label=EthernetFramesTxOut3_queue_1]; + pd_seL4_Firewall_Firewall_EthernetFramesRxIn0_queue_1 [label=EthernetFramesRxIn0_queue_1]; + pd_seL4_Firewall_Firewall_EthernetFramesRxIn1_queue_1 [label=EthernetFramesRxIn1_queue_1]; + pd_seL4_Firewall_Firewall_EthernetFramesRxIn2_queue_1 [label=EthernetFramesRxIn2_queue_1]; + pd_seL4_Firewall_Firewall_EthernetFramesRxIn3_queue_1 [label=EthernetFramesRxIn3_queue_1]; } } @@ -44,8 +62,14 @@ digraph microkit { label = "seL4_LowLevelEthernetDriver_LowLevelEthernetDriver"; seL4_LowLevelEthernetDriver_LowLevelEthernetDriver_INVIS [label="", style=invis, width=.5, height=.5, fixedsize=true] - pd_seL4_LowLevelEthernetDriver_LowLevelEthernetDriver_EthernetFramesTx_queue_1 [label=EthernetFramesTx_queue_1]; - pd_seL4_LowLevelEthernetDriver_LowLevelEthernetDriver_EthernetFramesRx_queue_1 [label=EthernetFramesRx_queue_1]; + pd_seL4_LowLevelEthernetDriver_LowLevelEthernetDriver_EthernetFramesTx0_queue_1 [label=EthernetFramesTx0_queue_1]; + pd_seL4_LowLevelEthernetDriver_LowLevelEthernetDriver_EthernetFramesTx1_queue_1 [label=EthernetFramesTx1_queue_1]; + pd_seL4_LowLevelEthernetDriver_LowLevelEthernetDriver_EthernetFramesTx2_queue_1 [label=EthernetFramesTx2_queue_1]; + pd_seL4_LowLevelEthernetDriver_LowLevelEthernetDriver_EthernetFramesTx3_queue_1 [label=EthernetFramesTx3_queue_1]; + pd_seL4_LowLevelEthernetDriver_LowLevelEthernetDriver_EthernetFramesRx0_queue_1 [label=EthernetFramesRx0_queue_1]; + pd_seL4_LowLevelEthernetDriver_LowLevelEthernetDriver_EthernetFramesRx1_queue_1 [label=EthernetFramesRx1_queue_1]; + pd_seL4_LowLevelEthernetDriver_LowLevelEthernetDriver_EthernetFramesRx2_queue_1 [label=EthernetFramesRx2_queue_1]; + pd_seL4_LowLevelEthernetDriver_LowLevelEthernetDriver_EthernetFramesRx3_queue_1 [label=EthernetFramesRx3_queue_1]; } } @@ -57,13 +81,37 @@ digraph microkit { } // memory regions - ZCU102_Impl_Instance_seL4_ArduPilot_ArduPilot_EthernetFramesTx_1_Memory_Region; + ZCU102_Impl_Instance_seL4_ArduPilot_ArduPilot_EthernetFramesTx0_1_Memory_Region; - ZCU102_Impl_Instance_seL4_Firewall_Firewall_EthernetFramesRxOut_1_Memory_Region; + ZCU102_Impl_Instance_seL4_ArduPilot_ArduPilot_EthernetFramesTx1_1_Memory_Region; - ZCU102_Impl_Instance_seL4_Firewall_Firewall_EthernetFramesTxOut_1_Memory_Region; + ZCU102_Impl_Instance_seL4_ArduPilot_ArduPilot_EthernetFramesTx2_1_Memory_Region; - ZCU102_Impl_Instance_seL4_LowLevelEthernetDriver_LowLevelEthernetDriver_EthernetFramesRx_1_Memory_Region; + ZCU102_Impl_Instance_seL4_ArduPilot_ArduPilot_EthernetFramesTx3_1_Memory_Region; + + ZCU102_Impl_Instance_seL4_Firewall_Firewall_EthernetFramesRxOut0_1_Memory_Region; + + ZCU102_Impl_Instance_seL4_Firewall_Firewall_EthernetFramesRxOut1_1_Memory_Region; + + ZCU102_Impl_Instance_seL4_Firewall_Firewall_EthernetFramesRxOut2_1_Memory_Region; + + ZCU102_Impl_Instance_seL4_Firewall_Firewall_EthernetFramesRxOut3_1_Memory_Region; + + ZCU102_Impl_Instance_seL4_Firewall_Firewall_EthernetFramesTxOut0_1_Memory_Region; + + ZCU102_Impl_Instance_seL4_Firewall_Firewall_EthernetFramesTxOut1_1_Memory_Region; + + ZCU102_Impl_Instance_seL4_Firewall_Firewall_EthernetFramesTxOut2_1_Memory_Region; + + ZCU102_Impl_Instance_seL4_Firewall_Firewall_EthernetFramesTxOut3_1_Memory_Region; + + ZCU102_Impl_Instance_seL4_LowLevelEthernetDriver_LowLevelEthernetDriver_EthernetFramesRx0_1_Memory_Region; + + ZCU102_Impl_Instance_seL4_LowLevelEthernetDriver_LowLevelEthernetDriver_EthernetFramesRx1_1_Memory_Region; + + ZCU102_Impl_Instance_seL4_LowLevelEthernetDriver_LowLevelEthernetDriver_EthernetFramesRx2_1_Memory_Region; + + ZCU102_Impl_Instance_seL4_LowLevelEthernetDriver_LowLevelEthernetDriver_EthernetFramesRx3_1_Memory_Region; // channels pacer_INVIS -> seL4_ArduPilot_ArduPilot_MON_INVIS [lhead=cluster_seL4_ArduPilot_ArduPilot_MON, minlen=2, dir=both]; @@ -74,12 +122,36 @@ digraph microkit { seL4_LowLevelEthernetDriver_LowLevelEthernetDriver_MON_INVIS -> seL4_LowLevelEthernetDriver_LowLevelEthernetDriver_INVIS [lhead=cluster_seL4_LowLevelEthernetDriver_LowLevelEthernetDriver, minlen=2, dir=both]; // shared memory mappings - pd_seL4_ArduPilot_ArduPilot_EthernetFramesTx_queue_1 -> ZCU102_Impl_Instance_seL4_ArduPilot_ArduPilot_EthernetFramesTx_1_Memory_Region [dir=both, style=dashed]; - pd_seL4_ArduPilot_ArduPilot_EthernetFramesRx_queue_1 -> ZCU102_Impl_Instance_seL4_Firewall_Firewall_EthernetFramesRxOut_1_Memory_Region [dir=back, style=dashed]; - pd_seL4_Firewall_Firewall_EthernetFramesTxIn_queue_1 -> ZCU102_Impl_Instance_seL4_ArduPilot_ArduPilot_EthernetFramesTx_1_Memory_Region [dir=back, style=dashed]; - pd_seL4_Firewall_Firewall_EthernetFramesRxOut_queue_1 -> ZCU102_Impl_Instance_seL4_Firewall_Firewall_EthernetFramesRxOut_1_Memory_Region [dir=both, style=dashed]; - pd_seL4_Firewall_Firewall_EthernetFramesTxOut_queue_1 -> ZCU102_Impl_Instance_seL4_Firewall_Firewall_EthernetFramesTxOut_1_Memory_Region [dir=both, style=dashed]; - pd_seL4_Firewall_Firewall_EthernetFramesRxIn_queue_1 -> ZCU102_Impl_Instance_seL4_LowLevelEthernetDriver_LowLevelEthernetDriver_EthernetFramesRx_1_Memory_Region [dir=back, style=dashed]; - pd_seL4_LowLevelEthernetDriver_LowLevelEthernetDriver_EthernetFramesTx_queue_1 -> ZCU102_Impl_Instance_seL4_Firewall_Firewall_EthernetFramesTxOut_1_Memory_Region [dir=back, style=dashed]; - pd_seL4_LowLevelEthernetDriver_LowLevelEthernetDriver_EthernetFramesRx_queue_1 -> ZCU102_Impl_Instance_seL4_LowLevelEthernetDriver_LowLevelEthernetDriver_EthernetFramesRx_1_Memory_Region [dir=both, style=dashed]; + pd_seL4_ArduPilot_ArduPilot_EthernetFramesTx0_queue_1 -> ZCU102_Impl_Instance_seL4_ArduPilot_ArduPilot_EthernetFramesTx0_1_Memory_Region [dir=both, style=dashed]; + pd_seL4_ArduPilot_ArduPilot_EthernetFramesTx1_queue_1 -> ZCU102_Impl_Instance_seL4_ArduPilot_ArduPilot_EthernetFramesTx1_1_Memory_Region [dir=both, style=dashed]; + pd_seL4_ArduPilot_ArduPilot_EthernetFramesTx2_queue_1 -> ZCU102_Impl_Instance_seL4_ArduPilot_ArduPilot_EthernetFramesTx2_1_Memory_Region [dir=both, style=dashed]; + pd_seL4_ArduPilot_ArduPilot_EthernetFramesTx3_queue_1 -> ZCU102_Impl_Instance_seL4_ArduPilot_ArduPilot_EthernetFramesTx3_1_Memory_Region [dir=both, style=dashed]; + pd_seL4_ArduPilot_ArduPilot_EthernetFramesRx0_queue_1 -> ZCU102_Impl_Instance_seL4_Firewall_Firewall_EthernetFramesRxOut0_1_Memory_Region [dir=back, style=dashed]; + pd_seL4_ArduPilot_ArduPilot_EthernetFramesRx1_queue_1 -> ZCU102_Impl_Instance_seL4_Firewall_Firewall_EthernetFramesRxOut1_1_Memory_Region [dir=back, style=dashed]; + pd_seL4_ArduPilot_ArduPilot_EthernetFramesRx2_queue_1 -> ZCU102_Impl_Instance_seL4_Firewall_Firewall_EthernetFramesRxOut2_1_Memory_Region [dir=back, style=dashed]; + pd_seL4_ArduPilot_ArduPilot_EthernetFramesRx3_queue_1 -> ZCU102_Impl_Instance_seL4_Firewall_Firewall_EthernetFramesRxOut3_1_Memory_Region [dir=back, style=dashed]; + pd_seL4_Firewall_Firewall_EthernetFramesTxIn0_queue_1 -> ZCU102_Impl_Instance_seL4_ArduPilot_ArduPilot_EthernetFramesTx0_1_Memory_Region [dir=back, style=dashed]; + pd_seL4_Firewall_Firewall_EthernetFramesTxIn1_queue_1 -> ZCU102_Impl_Instance_seL4_ArduPilot_ArduPilot_EthernetFramesTx1_1_Memory_Region [dir=back, style=dashed]; + pd_seL4_Firewall_Firewall_EthernetFramesTxIn2_queue_1 -> ZCU102_Impl_Instance_seL4_ArduPilot_ArduPilot_EthernetFramesTx2_1_Memory_Region [dir=back, style=dashed]; + pd_seL4_Firewall_Firewall_EthernetFramesTxIn3_queue_1 -> ZCU102_Impl_Instance_seL4_ArduPilot_ArduPilot_EthernetFramesTx3_1_Memory_Region [dir=back, style=dashed]; + pd_seL4_Firewall_Firewall_EthernetFramesRxOut0_queue_1 -> ZCU102_Impl_Instance_seL4_Firewall_Firewall_EthernetFramesRxOut0_1_Memory_Region [dir=both, style=dashed]; + pd_seL4_Firewall_Firewall_EthernetFramesRxOut1_queue_1 -> ZCU102_Impl_Instance_seL4_Firewall_Firewall_EthernetFramesRxOut1_1_Memory_Region [dir=both, style=dashed]; + pd_seL4_Firewall_Firewall_EthernetFramesRxOut2_queue_1 -> ZCU102_Impl_Instance_seL4_Firewall_Firewall_EthernetFramesRxOut2_1_Memory_Region [dir=both, style=dashed]; + pd_seL4_Firewall_Firewall_EthernetFramesRxOut3_queue_1 -> ZCU102_Impl_Instance_seL4_Firewall_Firewall_EthernetFramesRxOut3_1_Memory_Region [dir=both, style=dashed]; + pd_seL4_Firewall_Firewall_EthernetFramesTxOut0_queue_1 -> ZCU102_Impl_Instance_seL4_Firewall_Firewall_EthernetFramesTxOut0_1_Memory_Region [dir=both, style=dashed]; + pd_seL4_Firewall_Firewall_EthernetFramesTxOut1_queue_1 -> ZCU102_Impl_Instance_seL4_Firewall_Firewall_EthernetFramesTxOut1_1_Memory_Region [dir=both, style=dashed]; + pd_seL4_Firewall_Firewall_EthernetFramesTxOut2_queue_1 -> ZCU102_Impl_Instance_seL4_Firewall_Firewall_EthernetFramesTxOut2_1_Memory_Region [dir=both, style=dashed]; + pd_seL4_Firewall_Firewall_EthernetFramesTxOut3_queue_1 -> ZCU102_Impl_Instance_seL4_Firewall_Firewall_EthernetFramesTxOut3_1_Memory_Region [dir=both, style=dashed]; + pd_seL4_Firewall_Firewall_EthernetFramesRxIn0_queue_1 -> ZCU102_Impl_Instance_seL4_LowLevelEthernetDriver_LowLevelEthernetDriver_EthernetFramesRx0_1_Memory_Region [dir=back, style=dashed]; + pd_seL4_Firewall_Firewall_EthernetFramesRxIn1_queue_1 -> ZCU102_Impl_Instance_seL4_LowLevelEthernetDriver_LowLevelEthernetDriver_EthernetFramesRx1_1_Memory_Region [dir=back, style=dashed]; + pd_seL4_Firewall_Firewall_EthernetFramesRxIn2_queue_1 -> ZCU102_Impl_Instance_seL4_LowLevelEthernetDriver_LowLevelEthernetDriver_EthernetFramesRx2_1_Memory_Region [dir=back, style=dashed]; + pd_seL4_Firewall_Firewall_EthernetFramesRxIn3_queue_1 -> ZCU102_Impl_Instance_seL4_LowLevelEthernetDriver_LowLevelEthernetDriver_EthernetFramesRx3_1_Memory_Region [dir=back, style=dashed]; + pd_seL4_LowLevelEthernetDriver_LowLevelEthernetDriver_EthernetFramesTx0_queue_1 -> ZCU102_Impl_Instance_seL4_Firewall_Firewall_EthernetFramesTxOut0_1_Memory_Region [dir=back, style=dashed]; + pd_seL4_LowLevelEthernetDriver_LowLevelEthernetDriver_EthernetFramesTx1_queue_1 -> ZCU102_Impl_Instance_seL4_Firewall_Firewall_EthernetFramesTxOut1_1_Memory_Region [dir=back, style=dashed]; + pd_seL4_LowLevelEthernetDriver_LowLevelEthernetDriver_EthernetFramesTx2_queue_1 -> ZCU102_Impl_Instance_seL4_Firewall_Firewall_EthernetFramesTxOut2_1_Memory_Region [dir=back, style=dashed]; + pd_seL4_LowLevelEthernetDriver_LowLevelEthernetDriver_EthernetFramesTx3_queue_1 -> ZCU102_Impl_Instance_seL4_Firewall_Firewall_EthernetFramesTxOut3_1_Memory_Region [dir=back, style=dashed]; + pd_seL4_LowLevelEthernetDriver_LowLevelEthernetDriver_EthernetFramesRx0_queue_1 -> ZCU102_Impl_Instance_seL4_LowLevelEthernetDriver_LowLevelEthernetDriver_EthernetFramesRx0_1_Memory_Region [dir=both, style=dashed]; + pd_seL4_LowLevelEthernetDriver_LowLevelEthernetDriver_EthernetFramesRx1_queue_1 -> ZCU102_Impl_Instance_seL4_LowLevelEthernetDriver_LowLevelEthernetDriver_EthernetFramesRx1_1_Memory_Region [dir=both, style=dashed]; + pd_seL4_LowLevelEthernetDriver_LowLevelEthernetDriver_EthernetFramesRx2_queue_1 -> ZCU102_Impl_Instance_seL4_LowLevelEthernetDriver_LowLevelEthernetDriver_EthernetFramesRx2_1_Memory_Region [dir=both, style=dashed]; + pd_seL4_LowLevelEthernetDriver_LowLevelEthernetDriver_EthernetFramesRx3_queue_1 -> ZCU102_Impl_Instance_seL4_LowLevelEthernetDriver_LowLevelEthernetDriver_EthernetFramesRx3_1_Memory_Region [dir=both, style=dashed]; } \ No newline at end of file diff --git a/open-platform-models/isolate-ethernet-simple/microkit/microkit.system b/open-platform-models/isolate-ethernet-simple/microkit/microkit.system index 289ca7a..a562989 100644 --- a/open-platform-models/isolate-ethernet-simple/microkit/microkit.system +++ b/open-platform-models/isolate-ethernet-simple/microkit/microkit.system @@ -11,53 +11,149 @@ - - + - + + + + + + setvar_vaddr="EthernetFramesRx1_queue_1" /> + + - - + - + - + - + + setvar_vaddr="EthernetFramesTxIn3_queue_1" /> + + + + + + + + + + + + - - + - + + + + + + + setvar_vaddr="EthernetFramesRx2_queue_1" /> + @@ -67,13 +163,37 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + diff --git a/open-platform-models/isolate-ethernet-simple/microkit/src/sb_queue_base_SW_RawEthernetMessage_Impl_1.c b/open-platform-models/isolate-ethernet-simple/microkit/src/sb_queue_base_SW_RawEthernetMessage_Impl_1.c index bc5aab5..5d1a74d 100644 --- a/open-platform-models/isolate-ethernet-simple/microkit/src/sb_queue_base_SW_RawEthernetMessage_Impl_1.c +++ b/open-platform-models/isolate-ethernet-simple/microkit/src/sb_queue_base_SW_RawEthernetMessage_Impl_1.c @@ -40,7 +40,7 @@ void sb_queue_base_SW_RawEthernetMessage_Impl_1_enqueue( size_t index = queue->numSent % SB_QUEUE_BASE_SW_RAWETHERNETMESSAGE_IMPL_1_SIZE; - queue->elt[index] = *data; // Copy data into queue + memcpy(&queue->elt[index], data, base_SW_RawEthernetMessage_Impl_SIZE); // Copy data into queue // Release memory fence - ensure that data write above completes BEFORE we advance queue->numSent __atomic_thread_fence(__ATOMIC_RELEASE); @@ -96,7 +96,7 @@ bool sb_queue_base_SW_RawEthernetMessage_Impl_1_dequeue( //sb_event_counter_t numRemaining = numSent - *numRecv; size_t index = (*numRecv - 1) % SB_QUEUE_BASE_SW_RAWETHERNETMESSAGE_IMPL_1_SIZE; - *data = queue->elt[index]; // Copy data + memcpy(data, &queue->elt[index], base_SW_RawEthernetMessage_Impl_SIZE); // Copy data // Acquire memory fence - ensure read of data BEFORE reading queue->numSent again __atomic_thread_fence(__ATOMIC_ACQUIRE); diff --git a/open-platform-models/isolate-ethernet-simple/microkit/src/util.c b/open-platform-models/isolate-ethernet-simple/microkit/src/util.c index 2a85941..61c20d6 100644 --- a/open-platform-models/isolate-ethernet-simple/microkit/src/util.c +++ b/open-platform-models/isolate-ethernet-simple/microkit/src/util.c @@ -26,3 +26,18 @@ void __assert_func(const char *file, int line, const char *function, const char microkit_dbg_puts("\n"); while (1) {} } + +void *memcpy(void *restrict dest, const void *restrict src, size_t n) +{ + unsigned char *d = dest; + const unsigned char *s = src; + for (; n; n--) *d++ = *s++; + return dest; +} + +void *memset(void *dest, int c, size_t n) +{ + unsigned char *s = dest; + for (; n; n--, s++) *s = c; + return dest; +} diff --git a/open-platform-models/isolate-ethernet-simple/microkit/system.mk b/open-platform-models/isolate-ethernet-simple/microkit/system.mk index 2520c9b..76fe47b 100644 --- a/open-platform-models/isolate-ethernet-simple/microkit/system.mk +++ b/open-platform-models/isolate-ethernet-simple/microkit/system.mk @@ -36,14 +36,13 @@ LDFLAGS := -L$(BOARD_DIR)/lib LIBS := --start-group -lmicrokit -Tmicrokit.ld --end-group -TYPE_OBJS := printf.o util.o sb_queue_base_SW_RawEthernetMessage_Impl_1.o sb_queue_base_SW_RawEthernetMessage_Impl_1.o sb_queue_base_SW_SizedEthernetMessage_Impl_1.o sb_queue_base_SW_RawEthernetMessage_Impl_1.o +TYPE_OBJS := printf.o util.o sb_queue_base_SW_RawEthernetMessage_Impl_1.o sb_queue_base_SW_RawEthernetMessage_Impl_1.o sb_queue_base_SW_RawEthernetMessage_Impl_1.o sb_queue_base_SW_RawEthernetMessage_Impl_1.o sb_queue_base_SW_RawEthernetMessage_Impl_1.o sb_queue_base_SW_RawEthernetMessage_Impl_1.o sb_queue_base_SW_RawEthernetMessage_Impl_1.o sb_queue_base_SW_RawEthernetMessage_Impl_1.o sb_queue_base_SW_SizedEthernetMessage_Impl_1.o sb_queue_base_SW_SizedEthernetMessage_Impl_1.o sb_queue_base_SW_SizedEthernetMessage_Impl_1.o sb_queue_base_SW_SizedEthernetMessage_Impl_1.o sb_queue_base_SW_RawEthernetMessage_Impl_1.o sb_queue_base_SW_RawEthernetMessage_Impl_1.o sb_queue_base_SW_RawEthernetMessage_Impl_1.o sb_queue_base_SW_RawEthernetMessage_Impl_1.o SYSTEM_FILE := ${TOP}/microkit.system IMAGES := seL4_ArduPilot_ArduPilot.elf seL4_ArduPilot_ArduPilot_MON.elf seL4_Firewall_Firewall.elf seL4_Firewall_Firewall_MON.elf seL4_LowLevelEthernetDriver_LowLevelEthernetDriver.elf seL4_LowLevelEthernetDriver_LowLevelEthernetDriver_MON.elf pacer.elf -IMAGE_FILE_DATAPORT = microkit.img IMAGE_FILE = loader.img -REPORT_FILE = /report.txt +REPORT_FILE = report.txt all: $(IMAGE_FILE) CHECK_FLAGS_BOARD_MD5:=.board_cflags-$(shell echo -- ${CFLAGS} ${BOARD} ${MICROKIT_CONFIG}| shasum | sed 's/ *-//') @@ -69,10 +68,58 @@ sb_queue_base_SW_RawEthernetMessage_Impl_1.o: ${TOP}/src/sb_queue_base_SW_RawEth $(CC) -c $(CFLAGS) $< -o $@ -I${TOP}/include +sb_queue_base_SW_RawEthernetMessage_Impl_1.o: ${TOP}/src/sb_queue_base_SW_RawEthernetMessage_Impl_1.c Makefile + $(CC) -c $(CFLAGS) $< -o $@ -I${TOP}/include + + +sb_queue_base_SW_RawEthernetMessage_Impl_1.o: ${TOP}/src/sb_queue_base_SW_RawEthernetMessage_Impl_1.c Makefile + $(CC) -c $(CFLAGS) $< -o $@ -I${TOP}/include + + +sb_queue_base_SW_RawEthernetMessage_Impl_1.o: ${TOP}/src/sb_queue_base_SW_RawEthernetMessage_Impl_1.c Makefile + $(CC) -c $(CFLAGS) $< -o $@ -I${TOP}/include + + +sb_queue_base_SW_RawEthernetMessage_Impl_1.o: ${TOP}/src/sb_queue_base_SW_RawEthernetMessage_Impl_1.c Makefile + $(CC) -c $(CFLAGS) $< -o $@ -I${TOP}/include + + +sb_queue_base_SW_RawEthernetMessage_Impl_1.o: ${TOP}/src/sb_queue_base_SW_RawEthernetMessage_Impl_1.c Makefile + $(CC) -c $(CFLAGS) $< -o $@ -I${TOP}/include + + +sb_queue_base_SW_RawEthernetMessage_Impl_1.o: ${TOP}/src/sb_queue_base_SW_RawEthernetMessage_Impl_1.c Makefile + $(CC) -c $(CFLAGS) $< -o $@ -I${TOP}/include + + sb_queue_base_SW_SizedEthernetMessage_Impl_1.o: ${TOP}/src/sb_queue_base_SW_SizedEthernetMessage_Impl_1.c Makefile $(CC) -c $(CFLAGS) $< -o $@ -I${TOP}/include +sb_queue_base_SW_SizedEthernetMessage_Impl_1.o: ${TOP}/src/sb_queue_base_SW_SizedEthernetMessage_Impl_1.c Makefile + $(CC) -c $(CFLAGS) $< -o $@ -I${TOP}/include + + +sb_queue_base_SW_SizedEthernetMessage_Impl_1.o: ${TOP}/src/sb_queue_base_SW_SizedEthernetMessage_Impl_1.c Makefile + $(CC) -c $(CFLAGS) $< -o $@ -I${TOP}/include + + +sb_queue_base_SW_SizedEthernetMessage_Impl_1.o: ${TOP}/src/sb_queue_base_SW_SizedEthernetMessage_Impl_1.c Makefile + $(CC) -c $(CFLAGS) $< -o $@ -I${TOP}/include + + +sb_queue_base_SW_RawEthernetMessage_Impl_1.o: ${TOP}/src/sb_queue_base_SW_RawEthernetMessage_Impl_1.c Makefile + $(CC) -c $(CFLAGS) $< -o $@ -I${TOP}/include + + +sb_queue_base_SW_RawEthernetMessage_Impl_1.o: ${TOP}/src/sb_queue_base_SW_RawEthernetMessage_Impl_1.c Makefile + $(CC) -c $(CFLAGS) $< -o $@ -I${TOP}/include + + +sb_queue_base_SW_RawEthernetMessage_Impl_1.o: ${TOP}/src/sb_queue_base_SW_RawEthernetMessage_Impl_1.c Makefile + $(CC) -c $(CFLAGS) $< -o $@ -I${TOP}/include + + sb_queue_base_SW_RawEthernetMessage_Impl_1.o: ${TOP}/src/sb_queue_base_SW_RawEthernetMessage_Impl_1.c Makefile $(CC) -c $(CFLAGS) $< -o $@ -I${TOP}/include