Commit graph

41 commits

Author SHA1 Message Date
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
cc6853017d Remove unneeded usages of VISIBLE
Using `VISIBLE` where it is not needed limits the ability for the
compiler to optimize, especially when using whole program optimizations
2016-11-24 14:46:01 +11:00
Adrian Danis
5340bb790f Correct constant type in userError 2016-11-22 17:22:50 +11:00
Adrian Danis
28d21e68a2 Print current CPU in debug messages 2016-11-22 17:14:09 +11:00
Adrian Danis
325643ac19 Remove circular include between debug and benchmark_track
benchmark_track.h does not depend upon anything in debug.h and
so it does not need to include it. Once this include is removed
debug.h can pull its definition of ksKernelEntry from benchmark_track.h
2016-10-20 15:45:06 +11:00
Hesham Almatary
5f7fa2fcc8 Benchmark: Pack arch-independent benchmark-related files into separate directories 2016-10-20 11:42:04 +11:00
Anna Lyons
3a185a5c32 debug: generate list of syscall names 2016-10-18 14:05:41 +11:00
Adrian Danis
f3094f2e86 x64: extend message_info_t to 64-bit 2016-10-12 12:22:32 +11:00
amrzar
3f9eb7c873 SELFOUR-632: implement cores non-architecture dependent structres 2016-10-10 16:33:48 +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
Anna Lyons
7336303b7f SELFOUR-276: Add MCP field to threads.
Where MCP = Maximum Controlled Priority

This commit adds:

* seL4_TCB_SetMCPriority

and changes the arguments to

* seL4_TCB_Configure

As of this commit, a thread cannot create or set a threads
priority (including itself) above its mcp. Previously the kernel
did this check against a threads priority, which prevented a thread
from setting it's own priority down and then up again.
2016-10-05 11:11:19 +11:00
Kofi Doku Atuah
df6fe18acf Link libsel4's macros.h into the kernel
Also, include libsel4 macros.h link in types.h.
2016-09-21 13:57:44 +10:00
Hesham Almatary
d97603bd84 SELFOUR-566: Decouble seL4_DebugNameThread from CONFIG_PRINTING 2016-07-15 12:30:17 +10:00
Matthew Fernandez
7ad7cfba0a Fix standalone debug compilation on ARMv6.
This commit moves a declaration of `ksKernelEntry` such that it is now only
guarded by `DEBUG`, not additionally `CONFIG_PRINTING`. This allows the kernel
to be built standalone with debugging enabled using the following invocation:

    DEBUG=1 TOOLPREFIX=arm-none-eabi- CPU=arm1136jf-s PLAT=imx31 ARCH=arm \
      ARMV=armv6 make
2016-06-16 12:09:17 +10:00
Hesham Almatary
efde16c864 fix: kernel debug build fails without ksKernelEntry there 2016-06-07 10:17:46 +10:00
Hesham Almatary
fc1feb670e SELFOUR-446 Benchmark: Track syscall feature
Benchmark feature that currently:
- Keeps track of system calls info
- Start time
- Duration
- Capability type
- Invocation tag
- Log the number of invocations of each system call*
- Log the number of invocations for each capability type per syscall.
- Has 3 new syscalls (dump, reset, get size).
- This new feature uses the existing log buffer (which is 1MiB for x86
and ARM). Since the number of syscall invocations is not
deterministic, the logged number of invocations is limited by the size
of the buffer. I suggested to enable the users to pass their own
user-level buffer, to enable more flexibility, later.
- ENABLE_BENCHMARKS is now a parent config option of trace points and
system call track features, they can't be used at the same time.
2016-05-25 13:47:49 +10:00
Adrian Danis
1287590e97 Correct separation of printing and debug builds
Fixes some build issues with 541289a326
as well as further allowing debugging (via the capdl interface) to
happen when printing is turned off.
2016-05-17 15:10:08 +10:00
Anna Lyons
289bf92bf0 SELFOUR-114: remove bootinfo.h duplication 2016-03-01 17:25:22 +11:00
Adrian Danis
915a404d5c libsel4: Provide a layer of indirection around types.bf and shared_types.bf to allow for 64-bit variants 2016-01-21 13:31:54 +11:00
Adrian Danis
54fdda0bea Merge pull request #32 in SEL4/sel4 from ~MFERNANDEZ/sel4:2aadcc6c-5d97-4cab-82eb-d35f8d62b9eb to master
* commit '0cb33dec6df40b0e4d4c1e6f2fa646017b26f40f':
  Add a configuration option to disable ANSI colours.
2016-01-11 03:28:50 +00:00
Anna Lyons
e619975c0e SELFOUR-114: make IPC buffer definition accessible to the kernel 2016-01-11 11:16:24 +11:00
Anna Lyons
d93699c9a3 SELFOUR-114: remove duplication of seL4_MessageInfo_t, adjust naming to avoid cparser mangling 2016-01-11 11:16:08 +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
Matthew Fernandez
0cb33dec6d Add a configuration option to disable ANSI colours.
Note that the default is for ANSI colours to be enabled, so behaviour will be
unchanged for projects that update to this commit and make no build
configuration changes.
2015-12-18 12:22:19 +11:00
Anna Lyons
a0e5db7a2a Add debug functionality to print the kernel entry reason and arguments at any point in the kernel 2015-12-15 12:01:18 +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
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
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
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
d9802d179f Add seL4_NBWait: non blocking wait for notifications and endpoints. 2015-10-21 13:43:39 +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
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
e588986797 Use CONFIG_NUM_PRIORITIES when defining seL4_MaxPrio (Fixes SELFOUR-261) 2015-07-28 15:10:16 +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
Anna Lyons
28d7fda6a9 make include/api/constants.h the same as libsel4/include/sel4/constants.h 2014-12-23 13:21:28 +11:00
TrusthworthySystems
91b7da8625 Release snapshot 2014-07-18 05:03:59 +10:00