Fix elf loading 'current' management
authorBarret Rhoden <brho@cs.berkeley.edu>
Sun, 9 Feb 2014 04:34:48 +0000 (20:34 -0800)
committerBarret Rhoden <brho@cs.berkeley.edu>
Sun, 9 Feb 2014 07:23:00 +0000 (23:23 -0800)
commited208ddd57d737093ce07cd6d5f1c2e8ecbbfc46
tree972b67b9a287476770c791675aed8f5181b712d6
parent52dbc2c2fe965444eec656860fc84bca58048d62
Fix elf loading 'current' management

By not keeping current in sync with the cr3, and not properly switching
back, we expose ourselves to some issues.  Specifically, if we block
after improperly clearing current, we could come back with the
boot_pgdir (the one for current = 0), and then later fail to restore
that.  sys_proc_create caused this with KFS blocking.
kern/src/elf.c
kern/src/process.c