Skip to content

Commit

Permalink
COMP2
Browse files Browse the repository at this point in the history
  • Loading branch information
js2xxx committed Aug 1, 2023
1 parent ab3f53d commit e2188ac
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
3 changes: 2 additions & 1 deletion mizu/dev/sdmmc/src/imp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,8 @@ impl Inner {

let mut state = map_field!(regs.present_state).read();
let inhibit_cmd = state.inhibit_cmd().get();
let inhibit_data = occupies_data_line && state.inhibit_data().get();
let inhibit_data =
(occupies_data_line && state.inhibit_data().get()) || self.data_slot.is_some();
if inhibit_cmd || inhibit_data {
if inhibit_cmd {
self.cmd_idle.register(cx.waker());
Expand Down
3 changes: 0 additions & 3 deletions mizu/kernel/src/task/fd/syscall.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,6 @@ pub async fn socket_pair(
ts: &mut TaskState,
cx: UserCx<'_, fn(usize, usize, usize, UserPtr<i32, Out>) -> Result<(), Error>>,
) -> ScRet {
loop {
crate::task::yield_now().await;
}
let fut = pipe_inner(&ts.files, &ts.virt, cx.args().3);
cx.ret(fut.await);
ScRet::Continue(None)
Expand Down
2 changes: 1 addition & 1 deletion mizu/kernel/src/task/future.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ impl TaskState {
}
};

if scn != Scn::WRITE || tf.syscall_arg::<0>() >= 3 {
if (scn != Scn::WRITE && scn != Scn::WRITEV) || tf.syscall_arg::<0>() >= 3 {
// Get rid of tracing writes to STDIO.
log::info!(
"task {} syscall {scn:?}, sepc = {:#x}",
Expand Down
7 changes: 6 additions & 1 deletion mizu/lib/kmem/src/insn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,14 @@ pub fn thead_flush(base: LAddr) {
unsafe { asm!(".insn r 0b1011, 0, 1, zero, {}, x7", in(reg) base.val()) }
}

pub fn thead_sync_s() {
unsafe { asm!(".long 0x0190000b") }
}

fn cmo<F: Fn(LAddr)>(range: Range<LAddr>, f: F) {
let range = (range.start.val() & !(CACHE_SIZE - 1))..range.end.val();
range.step_by(CACHE_SIZE).for_each(|addr| f(addr.into()))
range.step_by(CACHE_SIZE).for_each(|addr| f(addr.into()));
thead_sync_s();
}

// pub fn cmo_inval(range: Range<LAddr>) {
Expand Down

0 comments on commit e2188ac

Please sign in to comment.