Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions build_sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@
DEFAULT_KERNEL_OPTIONS = {
"KernelIsMCS": True,
"KernelRootCNodeSizeBits": "17",
# Thread local storage is painful and annoying to configure.
# We'd really rather NOT use thread local storage (especially
# consider we never have more than one thread in a Vspace)
#
# Turning off this feature removes the __thread attribute on
# __sel4_ipc_buffer and makes it a true global.
"LibSel4UseThreadLocals": False,
}

DEFAULT_KERNEL_OPTIONS_AARCH64 = {
Expand Down
1 change: 0 additions & 1 deletion libmicrokit/include/microkit.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

#pragma once

#define __thread
#include <sel4/sel4.h>

typedef unsigned int microkit_channel;
Expand Down
1 change: 0 additions & 1 deletion libmicrokit/src/dbg.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*/
#include <microkit.h>

#define __thread
#include <sel4/sel4.h>

void microkit_dbg_putc(int c)
Expand Down
1 change: 0 additions & 1 deletion libmicrokit/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include <stddef.h>
#include <stdint.h>

#define __thread
#include <sel4/sel4.h>

#include <microkit.h>
Expand Down
21 changes: 0 additions & 21 deletions monitor/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,6 @@
* Acting as the fault handler for protection domains.
*/

/*
* Why this you may ask? Well, the seL4 headers depend on
* a global `__sel4_ipc_buffer` which is a pointer to the
* thread's IPC buffer. Which is reasonable enough, passing
* that explicitly to every function would be annoying.
*
* The seL4 headers make this global a thread-local global,
* which is also reasonable, considering it applies to a
* specific thread! But, for our purposes we don't have threads!
*
* Thread local storage is painful and annoying to configure.
* We'd really rather NOT use thread local storage (especially
* consider we never have more than one thread in a Vspace)
*
* So, by defining __thread to be empty it means the variable
* becomes a true global rather than thread local storage
* variable, which means, we don't need to waste a bunch
* of effort and complexity on thread local storage implementation.
*/
#define __thread

#include <stdbool.h>
#include <stdint.h>
#include <sel4/sel4.h>
Expand Down
Loading