Descriptionruntime: add NaCl IRT support for 386.
Native client system calls are mediated through an "outer sandbox."
System calls are invoked through a stub stored in a system call table.
They execute in the same address space as the caller, using the caller's
stack.
However, the system call interface is not part of the NaCl public API,
and it is subject to change. The NaCl IRT (for "integrated runtime") is
the official, stable API. In fact, the IRT is really just a thin
wrapper around the system calls. It changes the function signatures
somewhat, but in general there is a 1-1 correspondence with raw
syscalls.
This change uses the IRT for the runtime. However, we continue to
support raw system calls, mainly to support the Go playground. If the
IRT is available, we use the IRT function; otherwise, we invoke the raw
system call.
Since syscalls execute on the caller's stack, we switch to the main
m->g0 stack, invoke the system call, then switch back to the original
stack. Here's the skeleton of a runtime call.
switch to main thread stack
if !irt_is_enabled
invoke raw syscall
else
invoke IRT function
switch back to original stack
The IRT is passed using the Elf aux vector. If it exists, we fetch the
IRT function tables, and enable the IRT.
This change also sets the linker to decouple the elf address from the
file offset. The IRT data segments need to start at 0x10000000 to make
room for the IRT at 0xfa00000, resulting in huge executable files if the
address and file offset are the same.
Patch Set 1 #Patch Set 2 : diff -r 2af1cf6a6559 https://code.google.com/p/go #Patch Set 3 : diff -r 2af1cf6a6559 https://code.google.com/p/go #Patch Set 4 : diff -r 2699961d1143 https://code.google.com/p/go #Patch Set 5 : diff -r 38cd9f03739fe6cf029acf00a3d178c696c4399f https://code.google.com/p/go #Patch Set 6 : diff -r 38cd9f03739fe6cf029acf00a3d178c696c4399f https://code.google.com/p/go #Patch Set 7 : diff -r 38cd9f03739fe6cf029acf00a3d178c696c4399f https://code.google.com/p/go #MessagesTotal messages: 3
|