Commit graph

919 commits

Author SHA1 Message Date
Adrian Danis
64aed5370a x86: Move APIC frequency calculation to APIC init, instead of doing it before we initialize paging 2015-12-14 19:13:20 +11:00
Adrian Danis
022287c38b x86: Minimal changes to fix previous commit that renamed headers 2015-12-14 12:55:46 +11:00
Adrian Danis
c597c72fdf Move files that contain 32-bit specific code into specific 'mode'
directories

This commit is 'broken' as it leaves the repository in an unbuildable state.
The purpose of having this commit is so that there is a commit where the
modifications to these files is *just* a rename, making it easier to merge
these changes into other branches.
2015-12-14 12:48:12 +11:00
Adrian Danis
fbb4affde7 x86: Make parts of what is currently the 32-bit specific structures common 2015-12-14 12:48:12 +11:00
Adrian Danis
78e2457e91 Minimal modifications to structures file to make repository build again 2015-12-14 12:48:12 +11:00
Adrian Danis
bd7f06d2dc Move structures.bf files that contain 32-bit specific code into specific
mode directories

This commit is 'broken' as it leaves the repository in an unbuildable state.
The purpose of having this commit is so that there is a commit where the
modifications to these files is *just* a rename, making it easier to merge
these changes into other branches.
2015-12-14 12:48:12 +11:00
Adrian Danis
994c22dd13 trivial: style 2015-12-10 16:09:39 +11:00
Joel Beeren
84fb0dcdfe conversion: fixed hardcoded spec rule for clzl 2015-12-10 10:45:23 +11:00
Joel Beeren
a0c228c953 conversion: fix stray unsigned int size 2015-12-10 10:45:23 +11:00
Joel Beeren
8b62754402 conversion: standardised type of 'length' for arm 2015-12-10 10:45:22 +11:00
Joel Beeren
912089fac5 conversion: fixed unnecessary word_t change 2015-12-10 10:45:22 +11:00
Joel Beeren
94b0216258 conversion: fixed bitfield generator, clz spec 2015-12-10 10:45:22 +11:00
Adrian Danis
171824f7b7 Change additional int->word_t due to interraction with the C parser to ease verification 2015-12-10 10:45:22 +11:00
Adrian Danis
0ecff9f393 unsigned int -> word_t 2015-12-10 10:45:21 +11:00
Adrian Danis
2d61910e0f Rename uint32_t -> word_t in any relevant places 2015-12-10 10:45:20 +11:00
Adrian Danis
e3e9780a27 Rename CTZ and CLZ functions to long variants, change parameters from uint32_t to word_t to make compatible between 32 and 64-bit 2015-12-10 10:45:20 +11:00
Yanyan Shen
9f2d521979 Make cspace address walking 32/64-bit agnostic 2015-12-10 10:45:19 +11:00
Adrian Danis
3ef267618d Make utility functions 64bit friendly 2015-12-10 10:45:19 +11:00
Adrian Danis
e2c6dbca3f Cast to word_t instead of 'int' to be compatible with both 32 and 64 bit applications 2015-12-10 10:45:18 +11:00
Adrian Danis
d58d4f3e87 Use word_t for zombie pointers to be 64-bit compatible 2015-12-10 10:45:18 +11:00
Adrian Danis
fee26a8816 Change casting from int->long to be compatible with both 32 and 64 bit compilations 2015-12-10 10:45:18 +11:00
Adrian Danis
617df4a723 Rationalize standard types
This commit aims to rationalize how we represent different types
for compatiblity between ARM and x86, as well as between 32 and
64 bit code. The choices being made here is to declare that a
uint32_t has a type of 'int', this allows uint32_t to be declared
consistently across 32 and 64 bit (at least in GCC).
The word_t type is declared using a 'long' (not a uint32_t or uint64_t) to
allow for a word_t to be backed by the same type on both 32 and 64 bit
All other types that want to be declared as the size of a native word
get declared in terms of a word_t
2015-12-10 10:45:17 +11:00
Gerwin Klein
142627ade0 terminology: updated two async stragglers in comments 2015-12-03 15:54:53 +11:00
Adrian Danis
9aa7059465 Merge remote-tracking branch 'local/master' into HEAD 2015-12-02 17:49:40 +11:00
Adrian Danis
a079bd6084 Merge commit '88d73db06c327d45b6405f1ad5b94a0319f5921d' into HEAD
Conflicts:
	include/arch/arm/arch/object/structures.h
2015-12-02 17:34:02 +11:00
Adrian Danis
460c87ddf3 Merge commit '5d64d156f47c20ae049c0c854797291436f84021' into HEAD 2015-12-02 17:13:07 +11:00
Adrian Danis
6ef0b35313 x86: Add missing case for PDPT objects in cap_get_archCapSizeBits 2015-11-27 14:39:19 +11:00
Anna Lyons
a99a10408d SELFOUR-279: rename Wait -> Recv, add wrappers for seL4_Poll and seL4_Wait for notification objects.
This commit deprecates seL4_ReplyWait, removes seL4_NBwait completely,
and changes the return type of seL4_Wait to void (seL4_Wait should be
used for notification objects, and seL4_Recv should be used where
seL4_Wait was used previously for endpoints).
2015-11-20 15:28:18 +11:00
Matthew Fernandez
ab4fa44236 ARM: Replace various direct use of __attribute__ with util.h abstractions.
Use of these abstractions aids compiler portability, as only a single place in
the kernel needs to be adapted. This commit is not intended to affect either
verification or generated code.
2015-11-19 17:17:41 +11:00
Matthew Fernandez
affb802b85 Add 'fastcall' abstraction to util.h.
This change has no effect on verification or generated code.
2015-11-19 17:14:49 +11:00
Adrian Danis
a72e0468e3 Move object size definitions to arch specific headers
The size of these objects cannot be considered a common constant as
they will be different in the upcoming 64-bit ports
2015-11-13 14:43:20 +11:00
Adrian Danis
c75b3158d8 Fix definition of TCB_NAME_LENGTH to make it more correct
The previous definition of TCB_NAME_LENGTH assumed that the TCB was
split evenly into the cnode region and the rest. It did this by
calculating the size of the rest by using the size of the cnode
region. In actual fact the cnode region might be smaller, making
the size of the rest the size of the total tcb block size, minus
the cnode size. The max name length is therefore this region, minus
the size of the tcb_t
2015-11-13 14:37:13 +11:00
Adrian Danis
4db6ec7afb Always have compile_assert enabled
A compile assert has no runtime or image size overhead and so there
is no reason to not have them enabled

This commit addresses SELFOUR-289
2015-11-11 11:09:24 +11:00
Matthew Fernandez
dc147f8d3d ARM: Fix uninitialised variables.
This commit fixes two functions where a branch to the default case of a switch
statement returns an uninitialised value.
2015-11-10 17:44:04 +11:00
Anna Lyons
88d73db06c refactor tcb_t to remove duplication between x86 and arm header files 2015-11-09 17:18:43 +11:00
Anna Lyons
54603123e6 SELFOUR-317: rename async endpoint to notification object, and other
fallout.
2015-11-09 17:18:43 +11:00
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
Siwei Zhuang
73a7410638 Update the size of tcb structure. 2015-10-19 17:33:41 +11:00
Siwei Zhuang
9d909f743a Merge remote-tracking branch 'seL4/master' into arm_hyp
Conflicts:
	include/arch/arm/arch/api/constants.h
	libsel4/arch_include/arm/sel4/arch/types.h
	src/fastpath/fastpath.c
	src/plat/exynos5/machine/hardware.c
2015-10-16 14:41:36 +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
Anna Lyons
6860020137 Merge branch 'master' of github.inside.nicta.com.au:seL4/seL4 into arm_hyp
Conflicts:
	include/arch/arm/arch/object/structures.bf
	include/arch/arm/arch/object/structures.h
	include/arch/arm/armv/armv7-a/armv/fastpath.h
	src/arch/arm/armv/armv7-a/context_switch.c
	src/arch/arm/fastpath/fastpath.c
	src/arch/arm/kernel/vspace.c
	src/plat/exynos_common/mct.c
2015-07-30 11:35:12 +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
91c474cb95 Merge commit '952e5a272b5077ce6550035fbc5e2d6c55d09670' into arm_hyp
Conflicts:
	include/arch/arm/arch/object/structures.h
	src/arch/arm/kernel/thread.c
2015-07-21 09:40:06 +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
452f549228 Merge branch 'master' into arm_hyp 2015-02-25 13:50:16 +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
akroh
908c589a87 ARM HYP: Trap SMC 2015-02-20 15:09:25 +11:00
akroh
161125e3a8 Merge branch 'master' into arm_hyp
Conflicts:
	src/plat/exynos_common/io.c
2015-02-20 12:53:51 +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
akroh
b56f84aa1e Merge commit '212ab3f3fd3f8a054db1d2d03f662655c730b4e2' into arm_hyp
Conflicts:
	Kconfig
2015-01-21 15:49:07 +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
akroh
bcdb09d93b Merge exynos debug serial drivers 2015-01-06 17:49:07 +11:00
Anna Lyons
28d7fda6a9 make include/api/constants.h the same as libsel4/include/sel4/constants.h 2014-12-23 13:21:28 +11:00
akroh
98ac528fc7 Zynq7000: split coresite and trustzone device memory blocks 2014-12-18 13:59:23 +11:00
akroh
d46a234a3f Add support for Zynq-7000 2014-12-18 12:29:25 +11:00
Adrian Danis
47624ce008 trivial: style 2014-11-27 16:04:50 +11:00
Matthew Fernandez
644dff497b further support for XN bit on ARM 2014-11-26 12:44:06 +11:00
Anna Lyons
e6451f8d00 enable existing armv7 log buffer address for odriod-xu: tested, it works 2014-11-19 15:13:11 +11:00
Adrian Danis
68a8b6877f exynos5: Use high mem for seL4 and export low mem as device region 2014-11-07 09:27:40 +11:00
Gerwin Klein
3179696494 Merge pull request #38 from mfernandez/trivial
trivial: Print domain values as unsigned integers in user errors.
2014-10-22 09:42:49 +11:00
Matthew Fernandez
6d31d46024 trivial: Standardise on 32-bit unsigned variables for domain values.
Domains are unnecessarily treated explicitly as 8-bit values within boot info.
Though there are existing proof constraints that limit the maximum domain value
to 8 bits, most of the code would permit domain values up to 32 bits. The
maximum value is unnecessarily constrained in boot info, a restriction which
this commit removes.

Closes VER-341
2014-10-21 13:32:42 +11:00
Matthew Fernandez
931879af5a trivial: Remove unimplemented function prototype. 2014-10-21 11:52:24 +11:00
Peter Chubb
54b5cb6920 Add support for Odroid XU3
The XU3 uses a 5422 which for seL4's purposes is almost the same as
the Odroid XU's 5410.  Define a new PLAT_EXYNOS54XX to cover both.

Keep PLAT_EXYNOS5410 and ...5422 for the few places (not in the
kernel) where the difference matters.
2014-10-16 09:41:46 +11:00
akroh
911d135e2f merge with master 2014-09-29 13:11:13 +10:00
Anna Lyons
fb7dd823bb Set default MAX_NUM_BOOTINFO_DEVICE_REGIONS to a value that will fit into the initial boot info frame 2014-09-03 14:06:03 +10:00
Joel Beeren
3695d22b18 ioapic: refactored C code and first attempt at haskell spec 2014-09-02 16:22:40 +10:00
Adrian Danis
c0e9c63804 Support IOAPIC on ia32 and modify interrupt handling to support user level setting of modes 2014-09-02 16:22:40 +10:00
Thomas Sewell
5d439655bd DONT_TRANSLATE more inline asm functions.
The c-parser can now parse these functions, but it does it by
discarding the inline ASM block, creating a misleading and likely
malformed function body. It is better to not translate these
with a DONT_TRANSLATE comment.

This change has been made for the current verification platform
only, and should probably be extended to any other verification
targets as necessary.
2014-09-01 16:58:32 +10:00
Adrian Danis
828a1e57a1 arm: FSR is 14 bits in newer arm versions, not 12 2014-08-20 15:48:17 +10:00
Adrian Danis
7d877465de ia32: Move as much of the interrupt and syscall traps into C as possible 2014-08-12 14:00:28 +10:00
akroh
3cdc25599e EXYNOS5: Add additional device regions and IRQS 2014-07-25 14:13:08 +10:00
Adrian Danis
fad4707817 Merge branch 'master' into arm_hyp
Conflicts:
	src/arch/arm/head.S
	src/arch/arm/kernel/vspace.c
2014-07-18 14:49:54 +10:00
TrustworthySystems
a318446f8c Recommit of arm_hyp branch on release snapshot 2014-07-18 14:48:43 +10:00
Adrian Danis
43e1a215bb arm: Add work around for errata on some Cortex-A15 boards and move errata checking to C code 2014-07-18 11:37:11 +10:00
TrustworthySystems
784a367b37 Release cleanup 2014-07-18 05:10:23 +10:00
TrusthworthySystems
91b7da8625 Release snapshot 2014-07-18 05:03:59 +10:00