are machine-specific) from userland unless _KERNEL/_KMEMUSER and a
new _KERNTYPES variables is defined. The _KERNTYPES should be fixed
for many subsystems that should not be using it (rump)...
KASSERT() that we don't.
When calculating the load address for the interpreter (e.g. ld.elf_so),
we need to take into account wether the exec'd process will run with
topdown memory or bottom up. We can not use the current vmspace's flags
to test for that, as this happens too early. Luckily the execpack already
knows what the new state will be later, so instead of testing the current
vmspace, pass the info as additional argument to struct emul
e_vm_default_addr.
Fix all such functions and adopt all callers.
pthread types in C++ builds, attempt 2.
The problem with attempt 1 was making assumptions of what the MD
__cpu_simple_lock_t (declared volatile) looks like. To get a same type
except non-volatile, we change the MD type to __cpu_simple_lock_nv_t
and typedef __cpu_simple_lock_t as a volatile __cpu_simple_lock_nv_t.
IMO, __cpu_simple_lock_t should not be volatile at all, but changing it
now is too risky.
Fixes at least Rumprun w/ gcc 5.1/5.2. Furthermore, the mpd application
(and possibly others) will no longer require NetBSD-specific patches.
Tested: build.sh for i386, Rumprun for x86_64 w/ gcc 5.2.
Based on the patch from Christos in lib/49989.
lists only help to make them harder to read.
If those sections are found in inputs, they simply appear in outputs as
orphaned sections, sorted by section types and attributes.
up with a new scheme for its use. Use PTR_LA, INT_S/INT_L, etc. Disable
interrupts when returning from exceptions. Use L_CPU(tp) to get the curcpu
pointer.
When the cpu gets an exception from kernel mode, the sscratch register will be
0 and curlwp will be in the "tp" register. When the cpu gets an exception from
user mode, the sscratch register will be a pointer to the current lwp.
When an exception happends, the sp is atomically swapped with the sscratch
register.
If the sp is zero, the exception was a kernel exception and the
kernel exception path is taken: sp and sscratch are swapped again
so sscratch is zero again and then a trapframe is allocated from
the kernel stack. The t1 register is saved and then the pre-trapframe
sp is written to the trapframe.
If sp was non-zero, the exception was from user mode. The tp register
is temporarily saved in L_MD_TP(sp) and sp is moved tp. tp now
contains a pointer to the current lwp. A pointer to the user
trapframe is loaded from L_MD_UTF(tp). Then t1 is saved in the
trapframe so it can be used. The old sp is fetched from sscratch
while sscratch is zeroed (indicated kernel mode). The old sp is
saved in the trapframe.
Upon exiting the exception, if the exception is returning to user
mode, the contents of tp is written to sscratch.
committed and probably won't be for awhile. This is mostly preliminary
waiting for the supervisor specification to come out. Lots of missing pieces
but it mostly builds.