Thread local storage for x86
authorBarret Rhoden <brho@cs.berkeley.edu>
Thu, 7 Jan 2010 21:53:47 +0000 (13:53 -0800)
committerBarret Rhoden <brho@cs.berkeley.edu>
Thu, 7 Jan 2010 21:53:47 +0000 (13:53 -0800)
commit9db6c4b714c1f0c3c89b3a15553b78d814f80d78
treefeeaaccee46cc207fa593b64790d9c4c4195c9c9
parent35c3494cbc1af5fac1d9049b3037379e5af5e5bc
Thread local storage for x86

On parlib, using the TLS array.  There is no protection from
segmentation: userspace can write its own LDT (exposed via procdata),
which could also be a decent way to select different TLSs for a core
(for user threading).

This also fixes a bug where the stack_ptr_array pointer was too small
and was clobbering things next to it.

Note that procdata and procinfo are not currently contiguous, which
means if the kernel accesses them and they are more than one page long,
it is accessing random memory.
16 files changed:
kern/arch/i386/env.c
kern/arch/i386/mmu.h
kern/arch/i386/pmap.c
kern/arch/i386/smp_boot.c
kern/arch/i386/trap.h
kern/arch/i386/trapentry.S
kern/include/ros/procdata.h
kern/include/smp.h
kern/src/Makefrag
kern/src/kfs.c
kern/src/manager.c
user/apps/parlib/mhello.c [new file with mode: 0644]
user/parlib/src/hart.c
user/parlib/src/i386/Makefrag
user/parlib/src/i386/entry.S
user/parlib/src/i386/ldt.c [new file with mode: 0644]