History log of /seL4-test-master/projects/sel4runtime/src/env.c
Revision Date Author Comments
# 8a6620fc 11-Sep-2020 Curtis Millar <curtis@curtism.me>

Don't set external __sysinfo in runtime

This removes the assumption in the runtime that a __vsyscall references
to a virtual syscall handler must be set by the runtime in an external
libc.

To ensure that musl can still initialise, there is a reference made to
the vsyscall handler in the stack of the root task if one exists
(otherwise the stack references a dummy).

Signed-off-by: Curtis Millar <curtis@curtism.me>


# e3190dad 11-Sep-2020 Curtis Millar <curtis@curtism.me>

Use internal stdint and stddef

This changes sel4runtime to use the internal minimal stdint and stddef
removing the dependency for those files from an external libc.

This also removes the imports and dependencies for stdbool, string, and
assert.

Signed-off-by: Curtis Millar <curtis@curtism.me>


# 4e4705c7 24-Aug-2020 Curtis Millar <curtis@curtism.me>

trivial: style fix

Signed-off-by: Curtis Millar <curtis@curtism.me>


# 9f46f301 24-Aug-2020 Curtis Millar <curtis@curtism.me>

Move env init into external includes

This allows an external runtime to re-use the initialisation of the
runtime environment.

Signed-off-by: Curtis Millar <curtis@curtism.me>


# a0a49f48 21-Aug-2020 Curtis Millar <curtis@curtism.me>

trivial: add auxv and envp accessors

Signed-off-by: Curtis Millar <curtis@curtism.me>


# bf0f1411 21-Aug-2020 Curtis Millar <curtis@curtism.me>

trivial: envp/auxv saved before constructors run

Signed-off-by: Curtis Millar <curtis@curtism.me>


# 2e194926 21-Aug-2020 Curtis Millar <curtis@curtism.me>

Save argv in runtime

Ensure that the runtime captures argv so that it can be accessed later
in the process without needing to be explicitly passed around.

Signed-off-by: Curtis Millar <curtis@curtism.me>


# 48c16794 21-Aug-2020 Curtis Millar <curtis@curtism.me>

configurable exit callback

Allow the process to provide a callback to be used to exit the
applicaiton.

As this runtime is lightweight, it knows nothing about the environment
in which it is executing and so there is no way to exit the process
'properly'.

If a process attempts to exit and there is no configured exit callback,
the thread tha called exit will fault after all destructors have run.

Signed-off-by: Curtis Millar <curtis@curtism.me>


# b07c83e8 01-Aug-2020 Stefan O'Rear <sorear@fastmail.com>

Do not define __sysinfo twice

It is already defined in musllibc and defining it here results in
multiple definition errors with clang 11. Will need to be revisited
when musllibc is removed.

Signed-off-by: Stefan O'Rear <sorear@fastmail.com>


# 2bd3ae65 18-Jul-2019 Yu Hou <Yu.Hou@data61.csiro.au>

Trivial: style fix

make the style checker happy


# 101c34f9 15-Jul-2019 Yu Hou <Yu.Hou@data61.csiro.au>

fix various including problem

1: replace quote includes with bracket includes
2: add missing kernel autoconf
3: remove one unused include


# 10117b2a 04-Jul-2019 Yu Hou <Yu.Hou@data61.csiro.au>

sel4runtime: include configs

since global autoconf is removed, we need to manually add
back the kernel config and sel4runtime_Config


# 82c704af 11-Mar-2019 Anna Lyons <Anna.Lyons@data61.csiro.au>

Initialise sys_info

This forces sys_info to be allocated in an earlier linking stage
avoiding the symbol being merged which linking component groups


# bf4c85db 05-Mar-2019 Anna Lyons <Anna.Lyons@data61.csiro.au>

Only use seL4_TCB_Suspend if a tcb cap is set

Camkes components don't always have access to their TCB cap.


# d8df4eca 12-Mar-2019 Anna Lyons <Anna.Lyons@data61.csiro.au>

Handle NULL process names


# d0dd09af 12-Mar-2019 Anna Lyons <Anna.Lyons@data61.csiro.au>

Call constructors after static TLS init


# 7405ffd7 11-Mar-2019 Anna Lyons <Anna.Lyons@data61.csiro.au>

Make static_tls static

This avoids a problem where static_tls is not allocated until final
linking, causing private static tls regions to be merged when creating
grouped camkes components.


# 2aba9139 18-Mar-2019 Curtis Millar <curtis.millar@data61.csiro.au>

Remove const for bootinfo.


# 248660a9 06-Mar-2019 Anna Lyons <Anna.Lyons@data61.csiro.au>

Remove initial_thread_tcb check in try_init_static_tls

We no longer require the initial threads tcb to set TLS.


# 07aecbe7 04-Mar-2019 Anna Lyons <Anna.Lyons@data61.csiro.au>

Expose elf_helper.h in runtime interface as elf.h

This needs to be used by other libraries that need to intialise an
environment.


# 3afdd8be 03-Mar-2019 Anna Lyons <Anna.Lyons@data61.csiro.au>

Set process name if tcb and ipc buffer are set

Otherwise it crashes.


# 0c7e1cc9 03-Mar-2019 Anna Lyons <Anna.Lyons@data61.csiro.au>

Fix minor issues in sel4runtime_move_initial_tls

- always set the tls base
- only name the thread if initial_thread_tcb is set


# 7dc9747d 27-Feb-2019 Curtis Millar <curtis.millar@data61.csiro.au>

Fix alignment.

Alignment fixed for real this time.


# 83775384 27-Feb-2019 Curtis Millar <curtis.millar@data61.csiro.au>

Update licence dates.


# 0b4e4064 24-Feb-2019 Curtis Millar <curtis.millar@data61.csiro.au>

Make thread methods publically available.

Make access to thread ID registers publically inlineable.

Add function to set tls_base of current thread.

Clarify use of registers in ARMv6

The function to write to tpidr_el0 should not exist for ARMv6.

Refer to public version of thread_arch.h

Use new TLS base function.

Clarify the ARMv6 requirements.

Remove additional endif.

Make set_tls_base always succeed.

sel4runtime_tls_base -> sel4runtime_get_tls_base

Fix sel4runtime rename in aarch32


# 19dfa0f7 21-Feb-2019 Curtis Millar <curtis.millar@data61.csiro.au>

Don't name thread without an IPC buffer.


# f7a90c0d 20-Feb-2019 Curtis Millar <curtis.millar@data61.csiro.au>

Restore implementation of sel4runtime_initial_tls_enabled


# 3434e9b5 20-Feb-2019 Curtis Millar <curtis.millar@data61.csiro.au>

Remove empty line.


# d38043d6 30-Jan-2019 Curtis Millar <curtis.millar@data61.csiro.au>

Remove TLS book-keeping structure.

All of the logic that the runtime performs can be done relative to
a TLS base address (provided or current). This means that no
book-keeping objects are needed.


# e69a5450 15-Jan-2019 Curtis Millar <curtis.millar@data61.csiro.au>

Improve setting of remote TLS variable.

Discourage using the function directly and encourage using the macro
which enforces generic type checking.

Perform the type check without creating an unused variable.


# c98d62b8 08-Jan-2019 Curtis Millar <curtis.millar@data61.csiro.au>

Handle IPC buffer initialisation when thread cannot modify itself.


# 2072fc0e 06-Jan-2019 Curtis Millar <curtis.millar@data61.csiro.au>

Generalise setting of remote TLS variables.


# 3f559adf 06-Jan-2019 Curtis Millar <curtis.millar@data61.csiro.au>

Fix exit procedure.

Partially remedies process exit with multiple threads. There are still
S


# b609fcdd 06-Jan-2019 Curtis Millar <curtis.millar@data61.csiro.au>

Remove extraneous capability tracking.


# 03d6ddd8 12-Dec-2018 Curtis Millar <curtis.millar@data61.csiro.au>

Copy memcopy and memset for musl libc.

memset and memcopy have been taken from our fork of the musl libc
library. Appropriate copyright has been added to each file.


# 90432829 21-Nov-2018 Curtis Millar <curtis.millar@data61.csiro.au>

Use correct alignment values.


# 31dfffde 12-Nov-2018 Curtis Millar <curtis.millar@data61.csiro.au>

Add additional functions to aid rumprun.

This provides rumprun with enough information to allocate and
pre-initalise the TLS with minimal modification. This should also assist
in the creation of green-threading libraries.

Make the initialisation process clearer to better describe the resultant
TLS layout across differing platforms. Also fixes alignment issue on
ia32 when TLS is of an odd word size.


# 931a2fe6 12-Nov-2018 Curtis Millar <curtis.millar@data61.csiro.au>

Zero memory for TLS bss.


# cc5ca313 12-Nov-2018 Curtis Millar <curtis.millar@data61.csiro.au>

Single IPC buffer variable.

Remove duplicate IPC buffer variable in threads.

Note that the use of `seL4_GetIPCBuffer` requires an initialised TLS
region.


# 24e828ae 06-Nov-2018 Curtis Millar <curtis.millar@data61.csiro.au>

Automatically set the libsel4 ipcbuffer for new TLS.


# dfdb74a6 06-Nov-2018 Curtis Millar <curtis.millar@data61.csiro.au>

Defer storing of IPC buffer to libsel4.


# 6fdd1f9b 14-Oct-2018 Curtis Millar <curtis.millar@data61.csiro.au>

Make `seL4_GetIPCBuffer` assume initialised TLS.

This means that most invocations cannot occur unles TLS is initialised.
As a side effect, the `seL4_DebugNameThread` needs to be delayed until
TLS is initialised.


# 9aae1fb9 10-Oct-2018 Curtis Millar <curtis.millar@data61.csiro.au>

Parse ALL the ELF headers.

Turns out that the elf headers are provided as an array, not
individually.

We now parse the entire array rather than the first element.


# 5f50ea45 10-Oct-2018 Curtis Millar <curtis.millar@data61.csiro.au>

Remove unnecessary 2-word padding.


# 6fdf7fbe 26-Sep-2018 Curtis Millar <curtis.millar@data61.csiro.au>

Allow re-initialisation of initial thread TLS.

Due to the manner in which sel4test 'forks', it does not configure a
valid TLS for the new process. This change allows it to re-initialise
the TLS of the initial thread (assuming it has the same essential CNode
layout that the initial process did at startup).

This change is hazardous and makes it easier to configure an invalid TLS
and thread object within a process and should be used with care.


# 7c84dc79 26-Sep-2018 Curtis Millar <curtis.millar@data61.csiro.au>

Set up empty TLS correctly.


# f7e7ee4c 24-Sep-2018 Curtis Millar <curtis.millar@data61.csiro.au>

Consumer auxiliary vectors for seL4 environment.


# a713d7a3 24-Sep-2018 Curtis Millar <curtis.millar@data61.csiro.au>

Relocate the auxv.h for sel4runtime

This will make the auxv.h for sel4runtime externally available (such as
for sel4utils).


# 31a39ee8 24-Sep-2018 Curtis Millar <curtis.millar@data61.csiro.au>

Set sysinfo pointer.


# 38e4a771 23-Sep-2018 Curtis Millar <curtis.millar@data61.csiro.au>

Minimise external dependencies.

At the momement, it appears that we will need to rely on at least _some_
C library, although it doesn't matter which.


# f9317f16 19-Sep-2018 Curtis Millar <curtis.millar@data61.csiro.au>

Execute constructors and destructors.

Execute all constructors on process startup and all destructors on exit.


# 7e9c4366 20-Sep-2018 Curtis Millar <curtis.millar@data61.csiro.au>

Rename IPC buffer access methods.


# df706df7 18-Sep-2018 Curtis Millar <curtis.millar@data61.csiro.au>

Track TLS and thread object on all platforms.


# 12d57793 11-Sep-2018 Curtis Millar <curtis.millar@data61.csiro.au>

Add thread variable in TLS.


# 2141e90b 19-Sep-2018 Curtis Millar <curtis.millar@data61.csiro.au>

Add licenses


# e90a4c87 18-Sep-2018 Curtis Millar <curtis.millar@data61.csiro.au>

Use direct bootinfo instead of cspace descriptor.


# 8819bc51 11-Sep-2018 Curtis Millar <curtis.millar@data61.csiro.au>

Add thread structure and debug name.


# 94628a9a 11-Sep-2018 Curtis Millar <curtis.millar@data61.csiro.au>

Fix cspace tagged union.


# 751716a1 05-Sep-2018 Curtis Millar <curtis.millar@data61.csiro.au>

Fix duplication of NULL and constness.


# 0b42cd49 05-Sep-2018 Curtis Millar <curtis.millar@data61.csiro.au>

Store more of the runtime state.


# 1d79022d 06-Sep-2018 Curtis Millar <curtis.millar@data61.csiro.au>

Load environment into runtime.