This patch adds information to the core process structures for enabling
the getcount() systemcall. This systemcall when passed a valid
systemcall number as an argument, will return the number of times the
referenced systemcall was invoked by the calling process.
Allocate proper kernel page table immediately in main using boot allocator
Remove pginit
Simplify address space layout a tiny bit
More to come (e.g., superpages to simplify static table)
Variable declarations at top of function,
separate from initialization.
Use == 0 instead of ! for checking pointers.
Consistent spacing around {, *, casts.
Declare 0-parameter functions as (void) not ().
Integer valued functions return -1 on failure, 0 on success.
Change pushcli / popcli so that they can never turn on
interrupts unexpectedly. That is, if interrupts are on,
then pushcli(); popcli(); turns them off and back on, but
if they are off to begin with, then pushcli(); popcli(); is
a no-op.
I think our fundamental mistake was having a primitive
(release and then popcli nee spllo) that could turn
interrupts on at unexpected moments instead of being
explicit about when we want to start allowing interrupts.
With the new semantics, all the manual fiddling of ncli
to force interrupts off in certain sections goes away.
In return, we must explicitly mark the places where
we want to enable interrupts unconditionally, by calling sti().
There is only one: inside the scheduler loop.
I don't actually think this is worthwhile, but I figured
I would check it in before reverting it, so that it can
be in the revision history.
Pros:
* curproc doesn't need to turn on/off interrupts
* scheduler doesn't have to edit curproc anymore
Cons:
* it's ugly
* all the stack computation is more complicated.
* it doesn't actually simplify anything but curproc,
and even curproc is harder to follow.