Commit graph

70 commits

Author SHA1 Message Date
Adrian Danis
f6ae69f0f0 Use autoconf generated header for standalone kernel builds
Configuring standalone kernel builds (such as those used by verification)
has been done in a completely different way to how the kernel is
configured for project builds. As the kernel gains additional options
it becomes difficult to maintain standalone kernel builds without
tediously exporting these additional options, such tedious work is
what autoconf.h is meant to address

The new configuration strategy requires a include/plat/PLAT/autoconf.h
file to exist for any platform that wants to hae standalone builds
performed on it. This configuration also becomes the *verified*
configuration, and makes it clear for projects to build the kernel
in the verified configuration.
2015-11-09 14:41:18 +11:00
Adrian Danis
8743737dae Use CONST instead of PURE in thread functions
As these functions do not read any global state they fit
within the subset of PURE that can be declared as CONST
2015-10-23 15:02:53 +11:00
Rafal Kolanski
991d7afbd5 Wrap __builtin_clz for C Parser (verification)
Create new function "clz" which invokes __builtin_clz
Tell the C parser to not try translate it (DONT_TRANSLATE), but instead
to trust the spec we provide (FNSPEC+MODIFIES).

Squashed the fix by Anna Lyons:

rearrange CLZ in util.h and s/__builtin__clz/__builtin_clz/
2015-10-21 18:52:53 +11:00
Stephen Sherratt
62727e30a2 Using bitfields to track for which priorities there exist non-empty ready queues.
Background
seL4 organizes threads into ready queues, of which there is one for each
domain, for each priority level. The ready queue for a given
domain/priority combination can be found by indexing the array
`ksReadyQueues` with "domain*num_priorities + priority".

Current scheduler implementation
To find the non-empty ready queue with the maximum priority for the current domain,
seL4 iterates through `ksReadyQueues`, starting with the element
corresponding to the current domain and maximum possible priority, and
decrementing the priority until a non-empty queue is found. This is
problematic in cases where the only ready threads have low priorities,
as iterating through many elements of an array effectively flushes the
cache.

Changes in this patch
This patch replaces the iteration with a lookup into a table of
bitfields per domain. Using bitfields allows the kernel to determine the
highest priority level with a non-empty ready queue for the current
domain by counting the leading zeroes in bitfields. This removes the
negative cache effects of iterating through an array.

Implementation details
For each domain, a multilevel table of bitfields is maintained which
stores the priority levels within that domain for which there exist
ready threads. On a 32-bit architecture, the top level of the table is a 32-bit bitfield where if
the ith bit is set, there is at least 1 priority level in
[i*32..i*32+31] with a non-empty ready queue. The positions of bits in
this bitfield are used as indices into the second level table, which is
an array of 32-bit bitfields. The ith bit of the jth bitfield in this
array set to 1, indicates that priority level j*32+i has a non-empty
ready queue.
2015-10-21 18:52:44 +11:00
Stephen Sherratt
c99c1b79a0 Added a wordRadix constant to x86 kernel. 2015-10-21 18:33:16 +11:00
Anna Lyons
d9802d179f Add seL4_NBWait: non blocking wait for notifications and endpoints. 2015-10-21 13:43:39 +11:00
Anna Lyons
1fecec2560 add compile asserts to check objects are the sizes we expect them to be 2015-10-13 15:30:20 +11:00
Anna Lyons
79be32ace2 AEP -> Notification: deprecate old API syscalls, functions and constants that refer to AEP's and introduce new ones that refer to Notifications 2015-10-13 13:26:04 +11:00
Adrian Danis
97042a0f07 Introduce 'Notification Binding': a new feature which allows a tcb to be bound to a single asynchronous endpoint. 2015-10-09 15:19:58 +11:00
Anna Lyons
07a7f4c42e generate warnings for incorrect format strings for kprintf, bring stdint.h
inline for x86 and arm and fix some format strings as a consequence
2015-09-30 12:31:39 +10:00
Stephen Sherratt
0a2340c3e8 Trivial: style 2015-09-08 12:46:09 +10:00
Stephen Sherratt
4b3ac0e8e7 Surrounding benchmarking definitions with "#if CONFIG_MAX_NUM_TRACE_POINTS > 0". 2015-09-08 12:46:09 +10:00
Stephen Sherratt
e82953a194 Removed CONFIG_BENCHMARK config option. All checks for '#ifdef CONFIG_BENCHMARK' replaced with '#if CONFIG_MAX_NUM_TRACE_POINTS > 0'. 2015-09-03 11:39:31 +10:00
Stephen Sherratt
bea651d6c2 Config sections in syscall.xml files take a condition which is passed to #if. 2015-09-03 11:39:31 +10:00
Stephen Sherratt
4c2554dcc9 Added support for using multiple tracepoints at the same time. 2015-09-03 11:39:31 +10:00
Adrian Danis
f2b2301aa2 Refactor ARM and ia32 fastpath to use a common code base 2015-08-21 08:34:08 +10:00
Anna Lyons
ec78890001 xIntroduce RELEASE_PRINTF, which allows a renamed printf (release_printf) to be used in a release build of the kernel - userful for debugging tests that only fail on a release build of the kernel 2015-08-03 10:26:41 +10:00
Adrian Danis
e588986797 Use CONFIG_NUM_PRIORITIES when defining seL4_MaxPrio (Fixes SELFOUR-261) 2015-07-28 15:10:16 +10:00
Adrian Danis
f86435c0f8 Refactor some common elements across arm and x86 structures.h files.
This change purely changes the ordering of C symbols, as well as
adding some extra checking
2015-06-15 17:17:07 +10:00
akroh
507e0b9d16 Fixed quoted size in thread state comment 2015-06-02 14:59:26 +10:00
Adrian Danis
914741ea33 x86: Make x86 the name of the architecture instead of IA32
IA32 is 32bit version of the x86 architecture. Whilst only IA32
is supported, much of the code is generic x86. Using a generic
x86 architecture will aid in future 64bit support
2015-05-28 15:15:23 +10:00
Adrian Danis
f7a902198e ia32: Explicitly pack ACPI structs
Use explicit struct packing instead of using compiler asserts
to check that packing happened as expected
2015-05-28 12:09:13 +10:00
Adrian Danis
ca1191c7dc ia32: Use explicitly sized types for ACPI tables
The ACPI standard says these fields are 32bits, not the size
of a machine word or pointer
2015-05-28 12:09:12 +10:00
Adrian Danis
481bdffa99 ia32: Use unsigned long for reading / writing machine cpu registers
Using an unsigned long instead of forcing to 32bits allows this code
to be reused in a 64-bit context
2015-05-28 12:09:12 +10:00
Adrian Danis
2637108626 ia32: Ensure multiboot structs are packed
This is a paranoia commit as most compilers will not
pad members of a struct if they are all the same size,
but this commit ensures it.
2015-05-28 12:09:12 +10:00
Adrian Danis
01e39adb66 ia32: Use explicitly sized types for multiboot structs
The multiboot specification states that these fields are 32bits in sized,
not the size of machine pointer or integer.
2015-05-28 12:09:12 +10:00
Adrian Danis
682374dbef arm: Rearrange context switching code to make fastpath and regular code not duplicate functionality 2015-05-27 13:05:27 +10:00
Anna Lyons
f5afc2d917 change include/arch/ia32/arch/api/objecttype.h to match the libsel4 equivalent 2015-05-15 14:43:24 +10:00
Adrian Danis
b97c75ffb4 Move arch independent object definitions to common location 2015-05-14 09:42:19 +10:00
Adrian Danis
ae52b9eb02 Make reply and cnode caps the same on x86 and ARM and move to common structures file 2015-05-14 09:42:19 +10:00
Adrian Danis
9f812d695a Make async endpoint caps the same on x86 and ARM and move to common structures file 2015-05-14 09:42:19 +10:00
Adrian Danis
dd4372e9c4 Make endpoint caps the same on x86 and ARM and move to common structures file 2015-05-14 09:42:19 +10:00
Adrian Danis
f65ff11956 Make cap types that are exactly the same on ARM and x86 defined in a common location 2015-05-14 09:42:18 +10:00
Adrian Danis
952e5a272b Add ability to set a human readable thread name when running kernel in debug mode 2015-05-14 09:32:58 +10:00
Adrian Danis
fc1e413e5b ia32: Move many assembly operations from .S file into inline assembly 2015-05-13 17:00:26 +10:00
Tim Newsham
7bd0da5533 am335x: setup clock and enable dmtimer3 2015-05-04 11:46:06 +10:00
Adrian Danis
e581882c3c trivial: style 2015-04-17 13:52:37 +10:00
Sean Peters
8abdf6c5ed ia32: added the option to disable prefetchers 2015-04-15 14:38:55 +10:00
Sean Peters
efcacb55ba split the types header into basic and compound to resolve circular dependencies 2015-04-15 11:57:08 +10:00
akroh
a5f61c7166 ARM: Fix hardcoded CPSR value for the idle thread 2015-03-23 10:34:08 +11:00
Matthew Fernandez
4f12acd270 ARM: Map the initial thread's IPC buffer and boot info as non-executable.
Note that this also required some irrelevant x86 changes to match function
arguments.
2015-03-09 14:16:37 +11:00
akroh
b62b20f24d ARM: Add config options for exporting PMU and ARM generic timer physical count registers to PL0 2015-02-24 11:15:46 +11:00
Adrian Danis
e7c9885f35 ia32: Rework the notion of isValidVTableRoot to be a check for what is permissable for a TCB to contain in its VTableRoot, and create a new isValidNativeRoot to be a check for whether a capability is a PD or PDPT that can be directly run. VTableRoots that are not native would be something like EPT if using vtx 2015-02-17 16:43:30 +11:00
Adrian Danis
a5e442a70e Merge branch master into pae 2015-02-17 10:37:33 +11:00
Tim Newsham
80308386e7 - fix am335x interrupt handling and disable watchdog 2015-02-17 10:15:12 +11:00
Adrian Danis
01ba49802c trivial: style 2015-02-16 10:20:06 +11:00
Robbie VanVossen
f28eb2c586 Added support for the Allwinner A20 platform (specifically the CubieTruck board) 2015-02-13 10:24:42 -05:00
Adrian Danis
af0f3b361f ia32: Large commit that implements PAE paging for x86
This commit involves the PAE paging itself, refactoring the
vspace code to extra what is common between PAE and 32bit paging,
as well as some renaming to not call the root paging structure
a PD
2015-01-28 12:11:51 +11:00
Adrian Danis
14bfc396b2 ia32: Move _boot_pd definition from linker script to C 2015-01-16 11:14:36 +11:00
akroh
d796aa0a22 zynq: Increase kernel window size (start at 0xe0000000) now that the elfloader does not attempt to access the serial port at 0xe0001000 after PD switch 2015-01-07 16:58:33 +11:00