diff --git a/proc.h b/proc.h index 41860c6..7269b66 100644 --- a/proc.h +++ b/proc.h @@ -24,19 +24,19 @@ enum proc_state { UNUSED, EMBRYO, SLEEPING, RUNNABLE, RUNNING, ZOMBIE }; // Per-process state struct proc { - char *mem; // Start of process memory (kernel address) - uint sz; // Size of process memory (bytes) - char *kstack; // Bottom of kernel stack for this process - enum proc_state state; // Process state - int pid; // Process ID - struct proc *parent; // Parent process - void *chan; // If non-zero, sleeping on chan - int killed; // If non-zero, have been killed + char *mem; // Start of process memory (kernel address) + uint sz; // Size of process memory (bytes) + char *kstack; // Bottom of kernel stack for this process + enum proc_state state; // Process state + int pid; // Process ID + struct proc *parent; // Parent process + void *chan; // If non-zero, sleeping on chan + int killed; // If non-zero, have been killed struct file *ofile[NOFILE]; // Open files - struct inode *cwd; // Current directory - struct context *context; // Switch here to run process - struct trapframe *tf; // Trap frame for current syscall - char name[16]; // Process name (debugging) + struct inode *cwd; // Current directory + struct context *context; // Switch here to run process + struct trapframe *tf; // Trap frame for current syscall + char name[16]; // Process name (debugging) }; // Process memory is laid out contiguously, low addresses first: @@ -47,14 +47,14 @@ struct proc { // Per-CPU state struct cpu { - uchar apicid; // Local APIC ID - struct proc *curproc; // Process currently running. - struct context *context; // Switch here to enter scheduler - struct taskstate ts; // Used by x86 to find stack for interrupt - struct segdesc gdt[NSEGS]; // x86 global descriptor table + uchar apicid; // Local APIC ID + struct proc *curproc; // Process currently running. + struct context *context; // Switch here to enter scheduler + struct taskstate ts; // Used by x86 to find stack for interrupt + struct segdesc gdt[NSEGS]; // x86 global descriptor table volatile uint booted; // Has the CPU started? - int ncli; // Depth of pushcli nesting. - int intena; // Were interrupts enabled before pushcli? + int ncli; // Depth of pushcli nesting. + int intena; // Were interrupts enabled before pushcli? }; extern struct cpu cpus[NCPU];