mirror of
https://github.com/rcore-os/rCore-Tutorial-v3.git
synced 2024-11-23 01:46:24 +04:00
clean comments in kernel, and fix typo in usr app:sig_ctrlc
This commit is contained in:
parent
ce7e6bc668
commit
aa91ba8a9e
@ -25,7 +25,7 @@ impl File for Stdin {
|
||||
continue;
|
||||
} else if c == 3 {
|
||||
// 3 is ctrl_c
|
||||
println!("[K] os/fs/stdio/read: Got Ctrl_C");
|
||||
//println!("[K] os/fs/stdio/read: Got Ctrl_C");
|
||||
current_add_signal(SignalFlags::SIGINT);
|
||||
break;
|
||||
} else {
|
||||
|
@ -95,10 +95,10 @@ pub fn add_initproc() {
|
||||
pub fn check_signals_error_of_current() -> Option<(i32, &'static str)> {
|
||||
let task = current_task().unwrap();
|
||||
let task_inner = task.inner_exclusive_access();
|
||||
println!(
|
||||
"[K] check_signals_error_of_current {:?}",
|
||||
task_inner.signals
|
||||
);
|
||||
// println!(
|
||||
// "[K] check_signals_error_of_current {:?}",
|
||||
// task_inner.signals
|
||||
// );
|
||||
task_inner.signals.check_error()
|
||||
}
|
||||
|
||||
@ -106,10 +106,10 @@ pub fn current_add_signal(signal: SignalFlags) {
|
||||
let task = current_task().unwrap();
|
||||
let mut task_inner = task.inner_exclusive_access();
|
||||
task_inner.signals |= signal;
|
||||
println!(
|
||||
"[K] current_add_signal:: current task sigflag {:?}",
|
||||
task_inner.signals
|
||||
);
|
||||
// println!(
|
||||
// "[K] current_add_signal:: current task sigflag {:?}",
|
||||
// task_inner.signals
|
||||
// );
|
||||
}
|
||||
|
||||
fn call_kernel_signal_handler(signal: SignalFlags) {
|
||||
@ -127,10 +127,10 @@ fn call_kernel_signal_handler(signal: SignalFlags) {
|
||||
}
|
||||
}
|
||||
_ => {
|
||||
println!(
|
||||
"[K] call_kernel_signal_handler:: current task sigflag {:?}",
|
||||
task_inner.signals
|
||||
);
|
||||
// println!(
|
||||
// "[K] call_kernel_signal_handler:: current task sigflag {:?}",
|
||||
// task_inner.signals
|
||||
// );
|
||||
task_inner.killed = true;
|
||||
}
|
||||
}
|
||||
@ -161,7 +161,7 @@ fn call_user_signal_handler(sig: usize, signal: SignalFlags) {
|
||||
trap_ctx.x[10] = sig;
|
||||
} else {
|
||||
// default action
|
||||
println!("[K] task/call_user_signal_handler: default action, kill current process");
|
||||
//println!("[K] task/call_user_signal_handler: default action, kill current process");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -86,7 +86,7 @@ pub fn trap_handler() -> ! {
|
||||
}
|
||||
}
|
||||
// handle signals (handle the sent signal)
|
||||
println!("[K] trap_handler:: handle_signals");
|
||||
//println!("[K] trap_handler:: handle_signals");
|
||||
handle_signals();
|
||||
|
||||
// check error signals (if error then exit)
|
||||
|
@ -12,7 +12,7 @@ const LF: u8 = 0x0au8;
|
||||
const CR: u8 = 0x0du8;
|
||||
|
||||
fn func() {
|
||||
println!("signal_handler: caught signal SIGINT, and exit(1)");
|
||||
println!("signal_handler: caught signal SIGINT, and exit(1)");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user