Skip to content

Commit 6645759

Browse files
committed
cleanup unused commented code
1 parent 690502f commit 6645759

File tree

2 files changed

+2
-16
lines changed

2 files changed

+2
-16
lines changed

src/kernel/process/scheduler.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,7 @@ int process_scheduler_get_next_pid(int lastpid) {
5050
}
5151

5252
static void handle_fork(unsigned int ppid, struct Process *process) {
53-
// if(process->flagirq0_fork_ready>0 && ppid!=2) {
54-
// print_log("[ignore] handle fork for %d", ppid);
55-
// }
5653
if(process->flagirq0_fork_ready>0) {
57-
// print_log("handle fork for %d", ppid);
5854
int npid = process_fork(ppid);
5955
if(npid<0) {
6056
process->flagirq0_fork_ready = -1; // request failed;
@@ -91,19 +87,14 @@ void process_scheduler(int *_e_ip, int *_e_cs, int *_e_sp, int *_e_ss) {
9187
handle_fork(pid, process);
9288
}
9389

94-
// last process can be
95-
// - RUNNING
96-
// - BLOCK # TODO: implement
97-
9890
int npid = process_scheduler_get_next_pid(pid);
9991

10092
if(npid<0) {
10193
PANIC(0, "[process_scheduler] no STATE_READY process alive");
10294
}
10395

10496
if(pid != npid) {
105-
// print_log("[process_scheduler] pid: %d -> %d", pid, npid);
106-
// print_log("[process_scheduler] pid: %d -> %d, at eip: %x", pid, npid, e_ip);
97+
print_info("[process_scheduler] pid: %d -> %d", pid, npid);
10798
}
10899

109100
struct Process *nprocess = get_process(npid);

src/usr/lib/process.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,10 @@ int fork() {
7575
}
7676
// fork requested.
7777
// let's process scheduler fork the job.
78-
// printf("calling yield\n");
7978
yield();
80-
// while(1);
81-
// exit(0);
82-
// while(1);
83-
// printf("yield over\n");
79+
8480
// fork request should be complete by now.
8581
int status = SYSCALL_A2(SYSCALL_PROCESS, SYSCALL_PROCESS_SUB_FORK, SYSCALL_PROCESS_SUB_FORK_CHECK_READY);
86-
// printf("fork_check_ready: %d\n", status);
8782
if(status < 0) {
8883
// request either failed
8984
// or still waiting: it's a bad state, but we are going to let that slide.

0 commit comments

Comments
 (0)