Commit graph

195 commits

Author SHA1 Message Date
Kent McLeod
56e9e28d49 libsel4: add comments to multiboot fields 2017-05-15 15:41:32 +10:00
Anna Lyons
f8f25d7fd0 trivial: fix #ifdef guard
it was duplicating another one
2017-05-09 11:35:52 +10:00
Anna Lyons
9ca253a3d0 SELFOUR-879: expose index and entry constants 2017-05-09 11:35:52 +10:00
Kent McLeod
108c325b0f libsel4: Change PACKED to SEL4_PACKED 2017-05-05 14:49:46 +10:00
Anna Lyons
50d72007c6 SELFOUR-862: CONFIG_PRINTING --> seL4_DebugPutChar
seL4_DebugPutChar is only available when CONFIG_PRINTING is enabled
2017-05-04 16:07:16 +10:00
Kent McLeod
d13544c737 SELFOUR-865: Pass memory map information to user 2017-05-03 16:17:03 +10:00
Adrian Danis
256c30ae02 x86: Pass VBE information from multiboot through bootinfo 2017-02-28 16:35:50 +11:00
Kent McLeod
aa656604db Modify FinalizeLog syscall
There is no way to know how many entries the syscall log contains
otherwise.  One option was iterating through until finding a 0
terminator, however this requires the log to be zeroed before each
trial.  This changes the FinalizeLog syscall to return the number of
entries.
2017-02-24 15:55:34 +11:00
Kent McLeod
e937d96801 Change debug #ifdefs to be from autoconf.h
Previously the #ifdefs for some debug syscalls relied on definitions
from Makefile.flags in sel4_tools.  This changes them to use configs
defined in autoconf.h which makes them easier to import when building
projects that don't use sel4_tools.
2017-02-24 14:15:59 +11:00
Adrian Danis
eccaae51dc s/D61/DATA61/ in license headers for consistency 2017-02-21 16:38:51 +11:00
amrzar
c72bdc0cde trivial: fix typo 2017-02-13 08:27:52 +11:00
amrzar
6428e959b4 aarch64: Add aarch64 libsel4 implementation 2017-02-10 16:43:46 +11:00
amrzar
efb28fec20 Unify arch_shared_types.bf from the libsel 2017-02-06 09:08:35 +11:00
Jeff Waugh
803dd5c2ae libsel4: Optional public symbols for external interfaces
CONFIG_LIB_SEL4_PUBLIC_SYMBOLS=y will disable inlining for external
interfaces (except deprecated functions), thereby providing public
symbols for easy linkage with other languages.
2016-12-06 18:08:39 +11:00
Stephen Sherratt
cd8b5de27e manual: Add docs to arch-independent inv xml file
This also moves the description of TCBSetEPTRoot from the general object
invocation xml file to the x86-specific one to prevent the need for
documentation-generating scripts to distinguish between VTX (ie. x86)
invocations, and truly architecture independent invocations.

JIRA: SELFOUR-606
2016-11-29 14:30:41 +11:00
Anna Lyons
2fea9a0fe2 SELFOUR-567: use seL4_CapRights_t from libsel4
This change

* changes seL4_CapRights from the kernel to be seL4_CapRights_t in
libsel4
* deprecates the duplicated seL4_CapRights in libsel4, which is
  now the bitfield generated type seL4_CapRights_t.
* fixes all usages in kernel and libsel4

Impact: for verification, this will require the type to change name
from cap_rights to seL4_CapRights_t.
This is a breaking libsel4 API change, although most code uses
seL4_AllRights or similar constants, which will not break
at a source level as these constants have been updated.
2016-11-25 12:29:07 +11:00
Anna Lyons
b827ad37ba SELFOUR-413: refactor libsel4 fault API
This is a *breaking API change*

This commit:

* makes seL4_Fault_tag_t common between the kernel and libsel4
* deprecates the existing functions from sel4/messages.h includes
* introduces a new fault API in sel4/faults.h and
* sel4/sel4_arch/faults.h
* deprecates seL4_GetTag(), as the function did not work without
  the user calling seL4_SetTag() first (seL4_MessageInfo is passed
  in registers and not set in the IPC buffer)
* removes previously deprecated functions (deprecated prior to 3.0.0)
* updates the seL4 manual to reflect the changes
2016-11-25 12:29:07 +11:00
Anna Lyons
33a771d3cb Split fault types into arch/generic
Prior to this commit faults were separate
per architecture. This commit extracts the common
fault types and introduces arch specific faults,
reducing code duplication across architectures.
2016-11-25 12:29:07 +11:00
Adrian Danis
e78cdf9b64 SELFOUR-553: Support alternate IPC buffer locations without globals frame
This commit adds support for using the ThreadID registers of the ARM MPCore
platforms for storing the address of the IPC buffer instead of the globals
frame. The choice of using the user readable/writeable ThreadID register
is chosen, even though it means the user cannot use it for its own
purposes, as it leaves room in the future for doing TLS support in the
user read only register, where compilers expect it.
2016-11-22 11:49:52 +11:00
Adrian Danis
151e95d908 libsel4: Update VTX invocations to use condition= instead of config= 2016-10-28 14:09:28 +11:00
Adrian Danis
48f99701c3 libsel4: Move vt-x definitions into common x86 2016-10-28 12:16:41 +11:00
Adrian Danis
7fbde1bbcb SELFOUR-287: 32-bit vt-x implementation
This is an implementation of vt-x for x86 kernels running in
ia32 mode.
2016-10-27 16:20:30 +11:00
amrzar
ee75f086f3 update #ifdef to #if in auto generated files 2016-10-17 12:18:58 +11:00
Kofi Doku Atuah
bebfcf6d27 SELFOUR-499: X86, ARM: Add userspace invocations for hardware debugging
This commit implements the body of SELFOUR-499. The API exposes the x86 DR0-7
and ARM coprocessor 14 features to userspace by virtualizing them as context-
switched registers in the TCB. Implemented as TCB invocations. This feature is
only built when CONFIG_HARDWARE_DEBUG_API is selected.

* Add low-level support routines for setting, unsetting, getting, enabling
  and disabling breakpoints.
* Add support for single-stepping as well.
  ^ Single-stepping is not supported on ARMv6 since the hardware
    doesn't have support.
  ^ ARM implements single-stepping as instruction breakpoints
    configured to fault on every instruction -- this is achieved through
    the "mismatch" mode, which is only supported from ARMv7 onwards.
* Also support explicit software break requests, a la "BKPT" and "INT $3".

* New invocations:
  * seL4_TCB_SetBreakpoint().
  * seL4_TCB_GetBreakpoint().
  * seL4_TCB_UnsetBreakpoint().
  * seL4_TCB_ConfigureSingleStepping().
* New constants:
  ^ Event types:
    ^ seL4_InstructionBreakpoint.
    ^ seL4_DataBreakpoint.
    ^ seL4_SoftwareBreakRequest.
  ^ Access types:
    ^ seL4_BreakOnRead.
    ^ seL4_BreakOnWrite.
    ^ seL4_BreakOnReadWrite.
  ^ Exports:
    ^ seL4_NumHWBreakpoints.
    ^ seL4_NumExclusiveBreakpoints.
    ^ seL4_NumExclusiveWatchpoints.
    ^ seL4_NumDualFunctionMonitors.
    ^ seL4_FirstBreakpoint.
    ^ seL4_FirstWatchpoint.
    ^ seL4_FirstDualFunctionMonitor.

See documentation in the seL4 API manual.
2016-10-10 13:53:21 +11:00
Adrian Danis
f14dcdd0da arm-hyp: Add conditions to invocations 2016-06-15 17:53:25 +10:00
Adrian Danis
5f0ae410f4 arm-hyp: Minor cleanups
Cleanup some small licensing, whitespace and configuration details
2016-06-06 11:51:58 +10:00
Adrian Danis
41603a26ca Correct merge of master 2016-06-02 12:15:46 +10:00
Adrian Danis
b001bc4489 Merge branch 'master' into 'arm_hyp'
Conflicts:
	Kconfig
	libsel4/tools/syscall_stub_gen.py
	src/plat/exynos5/machine/hardware.c
	src/plat/tk1/machine/Makefile
	src/plat/tk1/machine/hardware.c
2016-06-02 10:57:12 +10:00
Hesham Almatary
46698d5383 Merge pull request #192 in SEL4/sel4 from ~HALMATARY/sel4:feature/syscall_bench2 to master
* commit 'bcf0a235b114fe8c24c3a187f55c67c373f259d3':
  SELFOUR-446 Unify code base for trace points and track feature
  SELFOUR-446 Benchmark: Track interrupts and user/vm faults
  Fix: move seL4_LogBufferSize to the correct file
  SELFOUR-446 Benchmark: Track syscall feature
2016-06-02 00:53:20 +00:00
Adrian Danis
0d73506a21 SELFOUR-484 x86: Get status bits invocation
This adds an invocation on page directories that returns the
status (accessed + dirty) bits of mapping.
2016-05-26 10:55:39 +10:00
Hesham Almatary
9ec83284c4 Fix: move seL4_LogBufferSize to the correct file 2016-05-25 13:48:43 +10:00
Yanyan Shen
508e87477f arm/tk1: connect objects with SMMU invocations 2016-05-17 12:16:34 +10:00
Yanyan Shen
879d9724c1 arm/tk1: a checkpoint for SMMU implementation 2016-05-13 16:42:53 +10:00
Adrian Danis
22623be2f8 Merge branch master into arm_hyp
Conflicts:
	include/arch/arm/arch/32/mode/object/structures.h
	libsel4/sel4_arch_include/aarch32/sel4/sel4_arch/types.h
	src/arch/arm/32/model/statedata.c
2016-02-22 15:55:31 +11:00
Adrian Danis
d0a42bbf49 Merge commit '812a73a9f58670cb18c36694d505dcd742c2ba8b' into arm_hyp 2016-02-22 15:02:12 +11:00
Adrian Danis
5349282478 x86/libsel4: Rename ia32->x86
Rename all functions, constants and types in libsel4 that are in the
general x86 architecture to have an X86 name instead of an IA32 name.
As libsel4 and the kernel share names this requires changing those
in the kernel as well.

All the original IA32 names can still be used for the moment, but are
marked as deprecated.
2016-02-10 16:50:49 +11:00
Adrian Danis
bddd804a6e x86: IOAPIC/MSI syscalls
Restructure the x86 interrupt handling to allow for a more flexible
method of using IOAPIC and MSI interrupts. The essence of this change
is to allow for the user to pick, for both IOAPIC and MSIs, which
CPU vector to use. Additionally there is future support, in the API,
for seL4 to eventually protect MSI interrupts with the vt-d interrupt
routing tables.

API behaviour for legacy systems using the PIC is preserved

Part of SELFOUR-281
2016-02-02 15:58:18 +11:00
Adrian Danis
d1eb5a12ec Correct previous merge 2016-02-02 15:00:05 +11:00
Adrian Danis
95c33147c0 Merge branch master into arm_hyp
Conflicts:
	Kconfig
	include/arch/arm/arch/fastpath/fastpath.h
	include/arch/arm/arch/machine.h
	include/arch/arm/arch/machine/hardware.h
	include/arch/arm/arch/machine/registerset.h
	include/arch/arm/arch/model/statedata.h
	include/arch/arm/arch/object/structures.bf
	include/arch/arm/arch/object/structures.h
	libsel4/arch_include/arm/sel4/arch/exIPC.h
	libsel4/arch_include/arm/sel4/arch/types.h
2016-02-01 14:57:37 +11:00
Adrian Danis
be67fdb0bc libsel4: Move arm object types from aarch32/objecttype.h back to arm/objecttype.h
Moving the section and super section objects to the aarch32 mode headers caused the
object orders to be reordered, which breaks verification. This commit undoes this
until it can either be verified or refactored a different way.
2016-01-20 09:26:11 +11:00
Adrian Danis
a701481095 Merge pull request #85 in SEL4/sel4 from ~AZARRABI/sel4:aarch32 to master
* commit '1a1110a0949c76a2d372e2bba6b2526898c51a68':
  Modify Kconfig and Makefile for aach32 as sel4_arch libsel4: updates to include aarch32 as sel4_arch
2016-01-19 05:17:46 +00:00
amrzar
1a1110a094 Modify Kconfig and Makefile for aach32 as sel4_arch
libsel4: updates to include aarch32 as sel4_arch
2016-01-19 15:37:52 +11:00
Adrian Danis
c3b04449d7 x86: Remove nonexistant iospace syscalls 2016-01-19 12:27:18 +11:00
Adrian Danis
93ca3581fc Merge branch master into arm_hyp
Conflicts:
	include/arch/arm/arch/api/objecttype.h
	libsel4/tools/syscall_stub_gen.py
	src/arch/arm/kernel/vspace.c
	src/arch/arm/object/objecttype.c
2016-01-19 10:52:25 +11:00
Adrian Danis
e89bb3f37a x86: avoid packing/unpacking for IOPortOut 2016-01-14 17:15:39 +11:00
Anna Lyons
6c6a925233 SELFOUR-406: fix message length used by seL4_Signal in libsel4 2016-01-12 10:33:16 +11:00
Adrian Danis
44a522dce2 libsel4: Generate libsel4 definitions from the current ARCH as well as the SEL4_ARCH 2016-01-08 10:16:30 +11:00
Anna Lyons
7758899844 SELFOUR-244: symlink duplicated files from libsel4 into kernel rather than duplicating them, remove sanity target as a result 2016-01-05 08:33:39 +11:00
Adrian Danis
8e15c42921 x86: Port some of the IOMMU changes on the experimental branch
This changes the IOMMU from using passthrough devices and instead
directly mapping in the reserved regions that are needed for each
device.
2015-12-18 15:06:39 +11:00
Adrian Danis
646638efee x86: Do not conditionally compile IOMMU code, use build/run time checks
Guarding code with #ifdef's makes even cursor testing of 'does this code compile'
difficult due to code being hidden by the pre-processor. Using config_set in
regular C if statements is performant as the compiler can trivially detect
dead code at compile time, and at -O1 and above will not even link in symbols
referenced by dead code in these blocks, so this will not bloat image size
2015-12-17 14:37:08 +11:00
Adrian Danis
5d42d0143e x86: Do not conditionally compile IRQ controller code, use build/run time checks
Guarding code with #ifdef's makes even cursor testing of 'does this code compile'
difficult due to code being hidden by the pre-processor. Using config_set in
regular C if statements is performant as the compiler can trivially detect
dead code at compile time, and at -O1 and above will not even link in symbols
referenced by dead code in these blocks, so this will not bloat image size
2015-12-17 14:37:08 +11:00
Adrian Danis
c2a85cdcb1 libsel4: Define different lookup levels for PAE 2015-12-17 14:02:22 +11:00
Adrian Danis
9113dfa8e5 trivial: style 2015-12-17 10:49:13 +11:00
Adrian Danis
5a6f0c71b8 libsel4: Add standard way of interpreting the meaning of a 'FailedLookup' for mapping operations 2015-12-16 12:29:25 +11:00
Adrian Danis
0e3afb487b libsel4: use seL4_Word for object types and update the sanity script to match word_t to seL4_Word 2015-12-10 16:08:39 +11:00
Stephen Sherratt
7bb064ab2b Removed whitespace difference between kernel and user objecttype.h 2015-12-03 10:37:20 +11:00
Adrian Danis
9aa7059465 Merge remote-tracking branch 'local/master' into HEAD 2015-12-02 17:49:40 +11:00
Adrian Danis
460c87ddf3 Merge commit '5d64d156f47c20ae049c0c854797291436f84021' into HEAD 2015-12-02 17:13:07 +11:00
Anna Lyons
ddc1ce7e90 SELFOUR-365: libsel4: Use compile time offsets instead of hard coding offsets 2015-12-01 12:14:06 +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
Anna Lyons
052feb222e trivial: move seL4_Notify to deprecated.h 2015-11-10 17:47:54 +11:00
Adrian Danis
aef03c325e libsel4: Restrict syscall stub compilation at -O0
The 'WithMRs' variants of the syscall stubs are known to be broken
on ARM with GCC at -O0. This commit prevents the generation and
usage of these stubs when -O0 is set in the common tool configuration
options.

Due to limitations in specifying Kconfig constraints, and to preserve
the existing meaning of the Kconfig variables, the 'LIB_SEl4_STUBS_USE_IPC_BUFFER_ONLY'
config variable has to be duplicated with two variants, one for use
when the user is free to pick either and one hidden for when selection
has to be forced. Also to prevent the sub options from not appearing
in the libsel4 submenu I had to change libsel4 to be a 'true' menu
instead of a 'menuconfig'

This commit closes SELFOUR-187
2015-11-03 10:54:37 +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
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
0489e00f88 add seL4_NotificationBits for x86 2015-10-13 15:08:21 +11:00
Anna Lyons
7cfcfd1f27 trivial: fix typo in x86 definition of seL4_Signal 2015-10-13 15:08:08 +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
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
4c2554dcc9 Added support for using multiple tracepoints at the same time. 2015-09-03 11:39:31 +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
f15814b73f libsel4: Remove old stdint include 2015-07-27 11:48:53 +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
Wink Saville
e653f8f65a Streamline libsel4 and remove its libc dependencies.
There are now separate libs for benchmark, assert, printf, putchar
start/stop:

      libs/libsel4benchmark
      libs/libsel4assert
      libs/libsel4printf
      libs/libsel4putchar
      libs/libsel4startstop

The primary changes are introducing sel4/sel4.h and removing std* types
plus porting assert and IO code from the kernel to libsel4assert,
libsel4printf, libsel4putchar.

This means the code within libsel4 and the newlibs do not overload any
typical libc entities. Instead the libraries use types like
seL4_Uint32 ... instead of uint32_t. And printf is now seL4_Printf and
assert is seL4_Assert ....

Finally, the only file modified that effects kernel code is
kernel/tools/bitfield_gen.py. It needed to be modified as it generates
files for both kernel and user space. And for user space the generated code
(types_gen.h) needed to use the new types and asserts. The changes should
not change what is generated for the kernel and I did a comparison of
kernel_final.{c|s} before and after my change and the only differences
were time stamps.

Bug: #15 Streamline kernel/libsel4 and remove its libc dependencies
2015-07-09 18:03:46 -07: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
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
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
a9111d4b5d libsel4: Support multiple struct types for the generated syscall stubs 2015-03-10 15:12:06 +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
a5e442a70e Merge branch master into pae 2015-02-17 10:37:33 +11:00
Matthew Fernandez
5e7030cb0a libsel4: Name the user context struct.
Without a name, this struct (and its typedef) comes out as an anonymous type
when imported into Isabelle. This makes it difficult to automate proofs of
functions that use this type.

See also JIRA VER-434
2015-02-11 09:54:04 +11: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
09b22d3f6a Trivial: style 2015-01-13 16:41:18 +11:00
Adrian Danis
0adf212462 libsel4: Ensure the ARM syscall stubs always treat instances of seL4_MessageInfo as POD
A C++ compiler will attempt to interpret 'return info' as an invocation of a copy
constructor. Even though the copy constructor is auto-generated (and eventually
completely eliminated due to inlining) and just does obvious member copying it
still results in an intermediate invocation that must take a reference to 'info'.
Because 'info' is a register variable it is not permissable to take a reference
to it. Manually reconstructing a new info from the .words keeps everything as
Plain Old Data
2015-01-13 14:22:29 +11:00
Matthew Fernandez
644dff497b further support for XN bit on ARM 2014-11-26 12:44:06 +11:00
Matthew Fernandez
ef17cd318e libsel4: Avoid implicit pointer coercion from 0.
Comparing a pointer against a literal without an explicit cast is not supported
by the C parser.

JIRA: VER-429
2014-11-17 14:33:42 +11:00
Matthew Fernandez
7a78d03b37 libsel4: Unify ARM/IA32 IPC buffer functions.
Implements two trivial functions that were present for IA32, but not included
in the corresponding ARM header.

Closes SELFOUR-226
2014-10-20 15:51:20 +11:00
akroh
911d135e2f merge with master 2014-09-29 13:11:13 +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
akroh
fe18dca1b9 Merge branch 'master' into arm_hyp 2014-07-25 14:14:35 +10:00
Adrian Danis
2732406e98 Recomment of branch getpaddr on release snapshot 2014-07-18 15:14:00 +10:00
TrustworthySystems
a318446f8c Recommit of arm_hyp branch on release snapshot 2014-07-18 14:48:43 +10:00
TrusthworthySystems
91b7da8625 Release snapshot 2014-07-18 05:03:59 +10:00