summaryrefslogtreecommitdiff
path: root/proc.h
diff options
context:
space:
mode:
authorrtm <rtm>2007-08-24 14:56:17 +0000
committerrtm <rtm>2007-08-24 14:56:17 +0000
commit2036534834841641edf3a6d1e142c4798e146b7b (patch)
tree2f2b1bbeff631d55d7ec0dc1bd0b5271723e95bf /proc.h
parentb55513796f2234d1fbdb816015506f981befb60d (diff)
downloadxv6-labs-2036534834841641edf3a6d1e142c4798e146b7b.tar.gz
xv6-labs-2036534834841641edf3a6d1e142c4798e146b7b.tar.bz2
xv6-labs-2036534834841641edf3a6d1e142c4798e146b7b.zip
add missing iput() at end of _namei()
Diffstat (limited to 'proc.h')
-rw-r--r--proc.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/proc.h b/proc.h
index 9750c15..137bda3 100644
--- a/proc.h
+++ b/proc.h
@@ -43,19 +43,15 @@ struct proc {
char name[16]; // Process name (debugging)
};
-// Process memory is laid out contiguously:
+// Process memory is laid out contiguously, low addresses first:
// text
// original data and bss
// fixed-size stack
// expandable heap
-// If xv6 was only for uniprocessors, this could be
-// struct proc *cp;
-// Instead we have an array curproc, one per
-// processor, and #define cp to the right element
-// in the array. In general such preprocessor
-// subterfuge is to be avoided, but cp is used
-// so often that having the shorthand is worth the ugliness.
+// Arrange that cp point to the struct proc that this
+// CPU is currently running. Such preprocessor
+// subterfuge can be confusing, but saves a lot of typing.
extern struct proc *curproc[NCPU]; // Current (running) process per CPU
#define cp (curproc[cpu()]) // Current process on this CPU