disable mm

This commit is contained in:
xoviat 2023-06-17 10:44:36 -05:00
parent 391f0b5d09
commit 6ef060ca17

View file

@ -31,36 +31,36 @@ impl MemoryManager {
} }
pub fn evt_drop(evt: *mut EvtPacket) { pub fn evt_drop(evt: *mut EvtPacket) {
unsafe { // unsafe {
let list_node = evt.cast(); // let list_node = evt.cast();
//
LinkedListNode::insert_tail(LOCAL_FREE_BUF_QUEUE.as_mut_ptr(), list_node); // LinkedListNode::insert_tail(LOCAL_FREE_BUF_QUEUE.as_mut_ptr(), list_node);
//
let channel_is_busy = Ipcc::c1_is_active_flag(channels::cpu1::IPCC_MM_RELEASE_BUFFER_CHANNEL); // let channel_is_busy = Ipcc::c1_is_active_flag(channels::cpu1::IPCC_MM_RELEASE_BUFFER_CHANNEL);
//
// postpone event buffer freeing to IPCC interrupt handler // // postpone event buffer freeing to IPCC interrupt handler
if channel_is_busy { // if channel_is_busy {
Ipcc::c1_set_tx_channel(channels::cpu1::IPCC_MM_RELEASE_BUFFER_CHANNEL, true); // Ipcc::c1_set_tx_channel(channels::cpu1::IPCC_MM_RELEASE_BUFFER_CHANNEL, true);
} else { // } else {
Self::send_free_buf(); // Self::send_free_buf();
Ipcc::c1_set_flag_channel(channels::cpu1::IPCC_MM_RELEASE_BUFFER_CHANNEL); // Ipcc::c1_set_flag_channel(channels::cpu1::IPCC_MM_RELEASE_BUFFER_CHANNEL);
} // }
} // }
} }
/// gives free event buffers back to CPU2 from local buffer queue /// gives free event buffers back to CPU2 from local buffer queue
pub fn send_free_buf() { pub fn send_free_buf() {
unsafe { // unsafe {
while let Some(node_ptr) = LinkedListNode::remove_head(LOCAL_FREE_BUF_QUEUE.as_mut_ptr()) { // while let Some(node_ptr) = LinkedListNode::remove_head(LOCAL_FREE_BUF_QUEUE.as_mut_ptr()) {
LinkedListNode::insert_head(FREE_BUF_QUEUE.as_mut_ptr(), node_ptr); // LinkedListNode::insert_head(FREE_BUF_QUEUE.as_mut_ptr(), node_ptr);
} // }
} // }
} }
/// free buffer channel interrupt handler /// free buffer channel interrupt handler
pub fn free_buf_handler() { pub fn free_buf_handler() {
Ipcc::c1_set_tx_channel(channels::cpu1::IPCC_MM_RELEASE_BUFFER_CHANNEL, false); // Ipcc::c1_set_tx_channel(channels::cpu1::IPCC_MM_RELEASE_BUFFER_CHANNEL, false);
Self::send_free_buf(); // Self::send_free_buf();
Ipcc::c1_set_flag_channel(channels::cpu1::IPCC_MM_RELEASE_BUFFER_CHANNEL); // Ipcc::c1_set_flag_channel(channels::cpu1::IPCC_MM_RELEASE_BUFFER_CHANNEL);
} }
} }