Commit graph

330 commits

Author SHA1 Message Date
Hesham Almatary
6af207a078 RISC-V: Port FDT from riscv-pk (priv-1.10) 2018-04-18 10:10:14 +10:00
Adrian Danis
459eb10d66 riscv: Remove dead code
These definitions match no existing kernel interface or abstraction and being removed
2018-04-18 10:10:14 +10:00
Adrian Danis
aafa594258 RISCV: Place TODOs in the source 2018-04-18 10:10:14 +10:00
Hesham Almatary
83ba084713 [SELFOUR-1156] RISC-V Port
Experimental release that supports both RV32 and RV64
2018-04-18 10:10:14 +10:00
Yanyan Shen
b95eb21782 armv8/tx1: Expose more devices to user mode 2018-04-03 10:34:01 +10:00
Yanyan Shen
fa0d3823e3 armv8/tx1: Fix a typo: Kb->KB 2018-04-03 10:34:01 +10:00
Yanyan Shen
a5a118458c armv8/tx1: Handle VGIC_MAINTENANCE interrupts 2018-04-03 10:34:01 +10:00
Anna Lyons
f6ff7806dd define KERNEL_PMU_IRQ for TX1, HIKEY 2018-03-22 13:12:03 +11:00
Yanyan Shen
396cfaac0e armv8/tx1: Map GIC VCPU control interface for EL2. 2018-03-05 16:05:48 +11:00
Yanyan Shen
c1bf4fe432 armv8/tx1: Introduce KDEV_PPTR.
The KDEV_PPTR is defined for EL1 and EL2 differently as the
base for kernel-device virtual addresses.
2018-03-05 15:58:37 +11:00
Yanyan Shen
28014895dd armv8/tx1: Define kernelBase and USER_TOP for EL2. 2018-03-05 15:42:36 +11:00
Yanyan Shen
151506c7bb armv8/tx1: Increase physical memory size for TX1. 2018-03-05 15:35:03 +11:00
Yanyan Shen
5d3154da80 armv8/tx1: Fix a typo
Change GIC_CONTROLLER0_PADDR to GIC_CONTROLLER_PADDR
2018-03-05 15:30:11 +11:00
Yanyan Shen
2337827e3a arm/tx1: Add device physical addresses for TX1. 2018-03-05 15:09:46 +11:00
Yanyan Shen
7ce75bb2ae arm/tx1: Define the IRQs used in EL2. 2018-02-28 10:54:18 +11:00
Hesham Almatary
4812ddf440 SELFOUR-711: Add Eth/CPSW IO addresses to am335x platform 2018-02-13 15:00:28 +11:00
Adrian Danis
4857dcb000 x86: Separate header for TLB bitmap definitions
Having a separate header allows for them to be included into the platform hardware
definition without causing a circular include
2018-01-16 14:51:26 +11:00
Adrian Danis
b851560cf7 x64: Restrict user to non sign extended vaddr
This simplifies the kernel preventing the need to validate that addresses are canonical
on the return from syscalls and interrupts.
2018-01-16 11:33:29 +11:00
Adrian Danis
c8eb525782 pc99: Make hardware.h usable from assembly
Rearranges hardware.h and makes use of the UL_CONST macro so that the header can be
included into assmebly files for its definitions
2018-01-09 14:13:41 +11:00
Adrian Danis
9f9578a7ae aarch64: Restrict USER_TOP to virtual addresses without high bits
Restricting virtual addresses to essentially be only addresses without bit 47 set
allows us to not need to check that an address passed in by the user is canonical
or not. Any address that is in danger of not being canonical (has bit 47 set but
not bits 48 to 63) will all by higher than USER_TOP and will not be permitted.
2017-12-20 16:11:06 +11:00
Alexander Boettcher
a4a52c5dcb pc99: Explicitly declare sizes for different versions of ACPI RSDP 2017-11-28 16:25:07 +11:00
Bamboo
a32264bfb5 [STYLE_FIX] 2017-11-28 00:02:37 +00:00
Anna Lyons
cddc4e6ef5 Inline resetTimer for all platforms
- for arm generic timer platforms, we remove resetTimer ->
resetGenericTimer indirection and simply include generic_timer.h
- this reduces boiler plate for platforms that share timer drivers, as
  they simply include the one header
- there is far more timer code in the RT kernel, which motivates this
change
2017-11-28 10:21:46 +11:00
Anna Lyons
31b8c158ba Trivial: add missing guards 2017-11-28 10:21:46 +11:00
Anna Lyons
7fd2783653 Refactor mct.c into mct.h and hardware.c
This prepares for inlinining the generic timer in header files, which will reduce the
redundancy for all platforms that use it.

Since mct.c shared code with the generic timer, both could not define a
resetTimer function. This commit splits the logic and definitions used
by exynos4 and exynos4* into common definitions in mct.h, with the
unique code for both in hardware.c
2017-11-28 10:21:46 +11:00
Anna Lyons
c89b9828db Make TIMER_CLOCK_HZ available in timer.h for ARM
The RT kernel needs this value accessible to common functions.
2017-11-28 10:21:46 +11:00
Anna Lyons
1a408880f1 Add a timer.h for all ARM platforms. 2017-11-28 10:21:46 +11:00
Joel Beeren
092042f7c5 x64: add MODIFIES statements for extern functions
The CParser can't deduce modifies rules for functions without
definitions (like in8, out8 et al and interrupt handler functions).
This adds explicit modifies rules for these functions.
2017-11-09 12:18:31 +11:00
Adrian Danis
e8625c6d81 pc99: Provide public function for validating an RSDP
RSDP validation was previously done directly in acpi_init. This splits the validation
into a seperate, publicly useable, function. The intention is for this to be used in
boot scenarios where an RSDP is given and does not need to be searched for.
2017-10-06 10:08:46 +11:00
Adrian Danis
ee380609c6 x86: Copy RSDP table in acpi_init instead of returning physical address of rsdt
The full RSDP is useful beyond just extracting the RSDT address out of it. In particular
this prepares us for being able to pass a copy of the RSDP to the rootserver.

The previous function signature might lead a user to believe that they were getting a
pointer to a useable acpi_rsdt_t structure. This was in fact not the case and was
actually returning the physical address, that may or may not be mapped in, of the rsdt
table. All of the other acpi *_scan functions would therefore immediately map in the physical
rsdt pointer they were given.

This commit changes acpi_init to return a boolean indicating whether it found a valid
rsdp, and then fills in a copy of the rsdp data. The copy is necessary as the rsdp
data may be at a temporary mapping.

As a result of changing acpi_init the boot code and state is changed to have a acpi_rsdt_t
instance that can be filled out.
2017-10-06 10:08:40 +11:00
Bamboo
3b84ab41e0 [STYLE_FIX] 2017-10-03 01:18:48 +00:00
Adrian Danis
383a6d959f Merge branch zcu102-7.0.0 into master 2017-10-03 12:16:08 +11:00
Robbie VanVossen
4ba89d4aa0 Added 64-bit support for the zynqmp.
Split up the bit specific code into new folders and added 64-bit
support. Also, changed the device register sizes to be based off of
PAGE_BITS instead of a hardcoded number.

TIMER_CLOCK_HZ is set to the default clock rate from the ATF,
which is the same for both AARCH32 and AARCH64.It may require changes
to the FSBL to work correctly.
2017-09-27 12:59:07 -04:00
Robbie VanVossen
02ca6a80a4 Added 32-bit support for the zynqmp.
The Zynq UltraScale+ MPSoC (PLAT zynqmp) is a Multi-Processor SOC
made by Xilinx that has a quad-core Cortex-A53, a dual-core Cortex-R5
and an FPGA.

This adds 32-bit, single-core support on the the Cortex-A53 cluster.
2017-09-27 12:58:49 -04:00
Adrian Danis
95b505bee2 pc99: Make irq_t a uint8_t type instead of an enum type
This renames the previous irq_t enum into a platform_irq_t enum and provides irq_t
as a 'well defined' uint8_t typedef. Having irq_t be an integer type, and not an enum,
is necessary for consistency with verification. As part of explicitly defining irq_t
as an unsigned integer type the definition of irqInvalid is changed to prevent sign
extension leading to unexpected invalid comparisons.
2017-09-26 16:57:10 +10:00
Adrian Danis
2bf586fe3d x86: Correct return type of servicePendingIRQ
This function returns an interrupt_t, and its call sites expect an interrupt_t,
despite the types being written as irq_t.

Closes #66
2017-08-29 10:56:43 +10:00
Adrian Danis
a9e1f51713 SELFOUR-1062: Hide all IOMMU related code behind #ifdef guards
The IOMMU implementation is not going to be verified at the moment, and so the code for
it needs to be hidden from verification, which we do by #ifdef'ing it out if the IOMMU
is not enabled. As a result the IOMMU configuration depends on a non verification target
2017-08-21 16:44:58 +10:00
Adrian Danis
8c8b53a5f7 pc99: Define PCI helpers in a pci header instead of iospace header
These helpers are generic PCI and are used outside of the iospace code
2017-08-21 16:44:58 +10:00
Hesham Almatary
57fa0e0f85 Share linker.h between architectures 2017-08-10 08:38:36 +10:00
Hesham Almatary
ee28936d48 SMP: Introduce ENABLE_SMP_SUPPORT
- Make it more readable and less confusing compared to the 'CONFIG_MAX_NUM_NODES > 1' check
2017-06-29 16:23:39 +10:00
Anna Lyons
40c61e5c18 Fix licenses (the rest) 2017-06-22 15:29:12 +10:00
Jonas Claeson
d8c31a8583 Removed unnecessary comparison in updateIRQState
./kernel/include/plat/pc99/plat/machine/interrupt.h:115:14:
error: comparison of unsigned expression >= 0
      is always true [-Werror,-Wtautological-compare]
    if(!(irq >= 0 && irq <= maxIRQ)) _assert_fail(...
         ~~~ ^  ~
2017-06-13 16:50:43 +02:00
Yanyan Shen
c6900c98e7 arm/imx7: add/correct dev mem/int; generic timer
Add more device memory regions and interrupts.
Merged Anna's generic timer impl.
2017-06-09 10:48:57 +10:00
Adrian Danis
1f2f6b98bb Use CONFIG_ variables instead of configuration definitions 2017-05-29 17:04:47 +10:00
Adrian Danis
551e73f22f Check for configuration variables being 'defined' instead of 'true'
This is to conform with existing style of checking configuration options
2017-05-03 10:35:44 +10:00
Adrian Danis
4e3839e315 Move standalone autoconf.h files out of include directories
When performing non standalone builds a separate autoconf.h file is generated and defines
the configuration of the kernel. Currently the directory with that file as well as the
kernels include/plat/${PLAT} directory are both listed as include directories to the
compiler. Due to the directory with the generated autoconf.h being earlier in the -I
list the generated autoconf.h will be used in preference to the standalone autoconf.h.

Relying on the order of -I directives is too unstable and so this commit moves the
autoconf.h files to a dedicated configs directory, which is only added as a -I
directive if a standalone build is being performed.
2017-04-10 11:16:57 +10:00
Rafal Kolanski
7680bab494 tk1: disable SMMU in autoconf.h
This is overwritten by KConfig but used on verified platform where the
SMMU is likely to come much later.
2017-04-05 09:50:52 +10:00
Rafal Kolanski
9b17e8afca tk1: maxIRQ off-by-one w.r.t. N_INTERRUPTS 2017-04-04 15:59:40 +10:00
Rafal Kolanski
9098528719 tk1: set CONFIG_NUM_DOMAINS=16 for verified kernel 2017-04-04 11:55:07 +10:00
Bamboo
9601f0fdfe [STYLE_FIX] 2017-03-09 02:36:15 +00:00
Kent McLeod
adeb341f48 tk1: Add missing device regions 2017-03-09 12:40:56 +11:00
amrzar
dea3d9819d X64: add CONFIG_HAVE_FPU to autoconf.h 2017-02-27 14:25:08 +11:00
amrzar
195e5a0db8 pcc99: move max restore config value to main Kconfig 2017-02-27 12:52:18 +11:00
Adrian Danis
eccaae51dc s/D61/DATA61/ in license headers for consistency 2017-02-21 16:38:51 +11:00
Hesham Almatary
bca46830e9 Merge pull request #420 in SEL4/sel4 from ~HALMATARY/sel4:x86RemovePAE to master
* commit '3e57e647e9a882fc7ba07329bcfe41ff87af5bdb':
  SELFOUR-501: x86 - Remove PAE support
2017-02-21 16:14:34 +11:00
Hesham Almatary
3e57e647e9 SELFOUR-501: x86 - Remove PAE support 2017-02-17 13:13:43 +11:00
Jack Suann
9f67d21c3d x86: Handle pending interrupt before scheduling thread in handleSyscall
In handleSyscall the current thread may be preempted to handle a pending interrupt.
With kernel mode interrupts in x86 this handling was delayed until we were about
to switch back to user mode. This change unifies the handling with ARM, where the
interrupt is handled prior to calling the thread scheduler.
2017-02-15 14:31:55 +11:00
Bamboo
d691d637d3 [STYLE_FIX] 2017-02-15 03:13:44 +00:00
amrzar
2e250fcce5 plat: add tx1 support 2017-02-15 12:35:13 +11:00
Hesham Almatary
671c353b6c Merge pull request #619 in SEL4/sel4 from ~HALMATARY/sel4:BenchmarkFixTK1 to master
* commit '3b33d2f9bd76b4af519a85051770a64f18245ae7':
  Benchmark/TK1: add missing include benchmark_overflowHandler.h
2017-02-14 09:57:47 +11:00
amrzar
08ecacb013 KZM: add aarch32 config variable to autoconf.h 2017-02-13 07:24:53 +11:00
amrzar
0b2fe8d605 aarch64: Initial implementation 2017-02-10 16:43:55 +11:00
amrzar
fac16fe89e aarch64: add preliminary folders and Makefiles 2017-02-10 16:43:55 +11:00
amrzar
acea60e3d6 ARM: Prepare hikey for aarch64 2017-02-10 16:43:55 +11:00
Jack Suann
ebf593561c x86: Add missing memory clobber in receivePendingIRQ
In receivePendingIRQ() the global variable x86KSPendingInterrupt may be
updated but compiler was previously unaware of this.
2017-02-08 12:48:46 +11:00
Adrian Danis
4fe72d09f5 x86: Mechanism for catching GP faults and returning to an error handler
Provides a mechanism where if af GP fault is potentially expected it can be caught
and the calling code returned to. The GP happening can be detected by setting
a specific return to handler and additionally by the return to handler being
cleared if a GP happened.
2017-02-06 09:02:19 +11:00
Jack Suann
cea45cd1bd x86: Handling pending interrupts in kernel mode
This commit allows x86 to completely handle a pending interrupt without switching
out to user mode. To handle an interrupt on x86 the APIC *must* generate an exception,
prior to you being able to acknowledge it. Previously we only allow exceptions (i.e.
interrupts) to be generated outside of kernel mode when we are in user mode.

This change allows us to 'poll' for an interrupt and transition the APIC whilst in kernel
mode by enabling and taking interrupts at carefully defined points. A pending interrupt
will be stored by the exception handler, allowing us to then handle the interrupt and
acknowledge the hardware APIC. Handling is done by waiting until after we have 'left' the
kernel and are about to switch to user mode and then 'entering' the kernel again by jumping
to the interrupt entry point.

Handling interrupts entirely in kernel mode provides two advantages
 * It will allow, in the future, the ability to handle kernel interrupts in situations
   where we need to handle the interrupt before actually performing the hardware switch
   back to user mode. This case happens where the user thread is using vt-x and so
   pending interrupts do not generate an interrupt exception, but rather cause an exception
   to be generated telling the system that there is a pending interrupt
 * Where there are multiple pending interrupts it is more efficient to avoid additional
   switches in and out of the user thread

Whilst this change does not enable pre-emption points to handle the interrupt before
returning out of `handleSyscall` it should be easily implementable with what is provided.
2017-02-01 12:44:14 +11:00
Kofi Doku Atuah
3cfcb676bc hikey: Add the rest of the dual timers for hi6220 2017-02-01 11:17:46 +11:00
Kofi Doku Atuah
6f953bf826 hi6220: Add RTC0 and RTC1 device UTs 2017-02-01 06:58:37 +11:00
Adrian Danis
d5bafdc74b arm: SELFOUR-779: Remove ARM_MPCORE config
The ARM_MPCORE configuration was added to capture which systems have the additional
ThreadID registers. This was an unneeded indirection as any arm version from v7 and
beyond has these registers. For the purposes of seL4 this means any arm version
except v6. This change scrubs ARM_MPCORE and replaces it with negated usages of
ARCH_ARM_V6. Additionally the IPC buffer config defaults were updated as the
ARM_MPCORE config was explicitly selecting the optimal one.
2017-01-23 09:45:34 +11:00
Hesham Almatary
3b33d2f9bd Benchmark/TK1: add missing include benchmark_overflowHandler.h 2017-01-20 13:57:17 +11:00
Kent McLeod
80d32b1609 SELFOUR-780: Add reserved entry to TK1 SMMU struct
This missing entry caused later entries to be offset from the actual
registers in hardware.
2017-01-20 10:20:28 +11:00
Hesham Almatary
c156c9dddd Merge pull request #607 in SEL4/sel4 from ~HALMATARY/sel4:KernelStacks to master
* commit 'be77963e5bb4c5c28ad3ebd8746c292e7b5876f6':
  Define CONFIG_MAX_NUM_NODES and CONFIG_KERNEL_STACK_BITS in plat/autoconf.h
  Unify kernel stack definition/declaration and share it between architecures/modes
2017-01-18 12:43:34 +11:00
Adrian Danis
f653dfaa64 x86: Support 52-bit physical addresses in IOMMU when in 64-bit mode
Defines the vtd structures to be their full 52-bit size when in 64-bit mode by
making the hardware.bf per mode in the pc99 platform.

Updates some variables in iospace.c that were hard defined to be 32-bit
2017-01-18 10:48:20 +11:00
Adrian Danis
ce96b41db1 pc99: Remove unused PCI definitions 2017-01-18 10:48:20 +11:00
Hesham Almatary
be77963e5b Define CONFIG_MAX_NUM_NODES and CONFIG_KERNEL_STACK_BITS in plat/autoconf.h
For the sake of verification and standalone kernel builds
2017-01-17 17:03:07 +11:00
Kent Mcleod
76f83bd4f5 Merge pull request #609 in SEL4/sel4 from ~KMCLEOD/sel4:tk1-interrupts to master
* commit 'c2b9d7b3e4a07c9b78d540992692fe6ee8987c52':
  SELFOUR-775: Fix tk1 interrupt off-by-one error
2017-01-17 14:58:29 +11:00
Kent McLeod
c2b9d7b3e4 SELFOUR-775: Fix tk1 interrupt off-by-one error 2017-01-17 12:01:22 +11:00
Adrian Danis
654e92e37c pc99: Update autoconf.h to have stack size definition 2017-01-13 15:22:34 +11:00
Thomas Sewell
97bac2345f Remove many MODIFIES annotations.
These are redundant for any function which the C-to-Isabelle parser
actually analyses, which is now the vast majority of functions.
2016-12-12 17:30:51 +11:00
Thomas Sewell
f658276abb Remove many DONT_TRANSLATE markers.
The vast majority of the DONT_TRANSLATE markers in the kernel are used
to hide __asm__ statements and builtin functions
(e.g. __builtin_unreachable ()) from the C-to-Isabelle parser.

The parser now supports underscore identifiers and many __asm__ statements,
and the builtin functions are prototyped, meaning the vast majority of the
DONT_TRANSLATE markers can be dropped. The remaining markers cover functions
that must be treated specially.
2016-12-12 17:30:50 +11:00
amrzar
125bc17149 SELFOUR-723: kernel config for the hikey platform
Also:
- cleanup unused Cortex A57
- Cortex A53 is v8 so removing 'ARM_CORTEX_A53' form v7 files
- define rpi3 as v8
2016-12-01 08:07:44 +11:00
Adrian Danis
37a5eedb01 bcm2837: Add missing include for printf 2016-11-25 16:30:31 +11:00
Adrian Danis
8221326a07 pc99: Update standalone build config 2016-11-24 15:25:52 +11:00
Adrian Danis
bdf10bb4c1 Refactor includes so trace point support builds
benchmark.h requires a definition of KS_LOG_PPTR, but its previous
placement in machine.h resulted in a circular include. This commit
factors out KS_LOG_PPTR and related definitions to a separate header,
creates the corresponding header for x86, and prevents circular
includes in the x86 builds
2016-11-23 14:29:00 +11:00
Kent McLeod
6e5cb27835 Fix KS_LOG_PPTR incorrect naming 2016-11-23 11:59:13 +11:00
Adrian Danis
fc56575ea6 x64: Define TLB bitmap region
Defines the TLB bitmap to be located, virtually, just below the kernel
window. To get an initialized bitmap in each new address space we
change copyGlobalMappings to copy from USER_TOP (which includes the
initialized TLB bitmap in the global address space) instead of just
the kernel window base
2016-11-22 14:05:55 +11:00
Adrian Danis
117c53e583 imx32: Update autoconf.h for standalone build 2016-11-22 11:53:29 +11:00
Adrian Danis
db0a8184e7 SELFOUR-553: Update standalone kernel configurations
This changes the kernel configurations for the verified platform to
not use the globals frame.
2016-11-22 11:49:52 +11:00
amrzar
27afc1bd92 x86: add logical id mapping for x2APIC IPI boradcasting 2016-11-22 09:40:31 +11:00
amrzar
2955bd46b2 add x2apic to x86-64 autoconfig 2016-11-18 07:26:12 +11:00
Adrian Danis
2c49729da5 x86: Refactor tlb_bitmap to be mode generic
Refactors the TLB bitmap code to be generic across ia32 and x86-64.
2016-11-09 15:24:17 +11:00
Adrian Danis
828a14d853 SELFOUR-222: Configure IRQ cnode size per platform 2016-11-08 11:48:31 +11:00
Adrian Danis
9899c60c8b x86: Reduce number of irqs to 128
On x86-64 the irq cnode will be larger than a page if there is more
than 128 irqs.
2016-11-07 14:58:46 +11:00
Adrian Danis
858fa717c6 tk1: Remove temporary SMMU memory mapping support 2016-11-02 15:12:56 +11:00
Adrian Danis
e3be5fa8e4 tk1: Correct SMMU PD and PT indexing 2016-11-02 15:12:56 +11:00
amrzar
a228c492a6 Incuede TLBBitmap in PD to keep track of cores currently accessing this PD 2016-11-01 10:07:57 +11:00
Anna Lyons
40383a9882 Fix arm builds broken in 44ed6adb6 2016-10-28 16:16:04 +11:00
amrzar
f050e6a9c5 implement layout of ipi interrupt handling 2016-10-23 12:21:14 +11:00
Adrian Danis
ea47c2d4a4 Remove self include 2016-10-21 12:05:02 +11:00
Adrian Danis
ccb2e4b446 Remove circular include
machine/hardware.h is already including machine/interrupt.h
2016-10-21 12:05:02 +11:00
Adrian Danis
63649f2636 Remove arch/machine.h include from statedata.h
statedata.h gets included from arch/machine.h, and statedata
does not require any of the machine.h definitions.

As a result of removing this various other, previously missing,
includes need to be added
2016-10-21 12:05:02 +11:00
Adrian Danis
b90238d089 Replace #pragma once with include guards 2016-10-21 12:05:02 +11:00
Adrian Danis
9396783741 am335x: Prevent out of bounds array access 2016-10-20 10:56:58 +11:00
Adrian Danis
a3c88cfc5b pc99: Update autoconf.h for standalone builds 2016-10-12 14:18:55 +11:00
Adrian Danis
48df6d3ab4 x64: Define kernelBase for breakpoint code 2016-10-12 12:22:32 +11:00
Adrian Danis
7f9970e5e2 x64: Add x86_64 support 2016-10-12 12:22:31 +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
Kofi Doku Atuah
8b39c73544 Define kernelBase for 32-bit x86. 2016-10-06 16:03:04 +11:00
Kofi Doku Atuah
b1f8d21e96 TK1: Split the mux controller from the misc region
The TK1 manual's address map has a 16K MMIO region called the "Misc" region,
where they lump together several controllers that aren't all page aligned,
including a USB controller and a SATA controller of some kind.

They also lump the pinmux controller into this "misc" region, but the
pinmux controller is at a page aligned boundary, and has no other devices
sharing that page, so it can be split off into its own device untyped.

This also makes it easier to request that mapping from userspace.
2016-09-29 15:13:16 +10:00
amrzar
2cbc7123b6 SELFOUR-630:preliminary booting application processors
- update core detection code and Kconfig file
    - update kernel stack managment so that BSP does not use boot stack before IPI APs
    - move arch dependant data to a single structure
    - add cache line size to Kconfig
    - add cpu indexing and apic id mapping
    - boot APs to halting state
    - add guard for kernel stack if there is only one core
2016-09-28 16:10:25 +10:00
Adrian Danis
2a84b7d792 Merge pull request #120 in SEL4/sel4 from ~ADANIS/sel4:deviceuntyped to master
* commit '8e77cdb5e91e971f49747492a3350c2b443a3827':
  SELFOUR-421: Add padding for untyped in bootinfo
  SELFOUR-421: minor changes for c-refine
  SELFOUR-421: fix up boolean equality in Arch_sameObjectAs
  SELFOUR-421: added device check to sameObjectAs
  SELFOUR-421: Arch_createObject changed to use new user_data_device in ghostupdates for device pages
  SELFOUR-421 Introduce explicit device frames and untypeds
2016-09-23 04:16:22 +00:00
Adrian Danis
d507b2d39e SELFOUR-421 Introduce explicit device frames and untypeds
Kernel objects cannot be created from device untypeds, with the
exception of frames, which do not get zeroed and cannot be used
as an IPC buffer. Device untypeds additionally cannot be used
in the construction of ASID pools.

This then changes the API to the rootserver (i.e. bootinfo) to
send device untypeds instead of device frames. On ARM these
device untypeds are the same as the previously exported device
frame regions. On x86 PCI scanning is removed and all physical
memory addresses (that are not important for kernel integrity)
are released to the user.

In order to have bits in the frame and untyped caps on ARM the
number of software ASIDs had to be reduced from 2^18 to 2^17,
and the maximum untyped size reduced from 2^31 to 2^30
2016-09-23 14:15:08 +10:00
Adrian Danis
4044e20412 Revert "Merge pull request #358 in SEL4/sel4 from ~AZARRABI/sel4:multicore to master"
This reverts commit ce2f666bb8, reversing
changes made to dc183f96b8.
2016-09-22 14:22:18 +10:00
Adrian Danis
7f4694ec3e pc99: Update standalone config with CACHE_LN_SZ 2016-09-22 14:10:08 +10:00
Amirreza Zarrabi
ce2f666bb8 Merge pull request #358 in SEL4/sel4 from ~AZARRABI/sel4:multicore to master
* commit 'fbc071b4f11b3d7d423e26908a661f416b07cda2':
  SELFOUR-630:preliminary booting application processors - update core detection code and Kconfig file - update kernel stack managment so that BSP does not use boot stack before IPI APs - move arch dependant data to a single structure - add cache line size to Kconfig - add cpu indexing and apic id mapping - boot APs to halting state - add guard for kernel stack if there is only one core
2016-09-22 03:59:32 +00:00
amrzar
fbc071b4f1 SELFOUR-630:preliminary booting application processors
- update core detection code and Kconfig file
- update kernel stack managment so that BSP does not use boot stack before IPI APs
- move arch dependant data to a single structure
- add cache line size to Kconfig
- add cpu indexing and apic id mapping
- boot APs to halting state
- add guard for kernel stack if there is only one core
2016-09-21 12:14:10 +10:00
Kent McLeod
41ec5cf754 SELFOUR-537: Support for raspberry pi3 2016-09-19 15:53:53 +10:00
Stephen Sherratt
5a0bdb7480 Store active irq in global variable on kzm
The first time the irq number is read from the controller, the interrupt
is acknowledged. Subsequent reads of the irq number result in an invalid
irq number being read.

This modifies the kzm interrupt controller driver to save the current irq
number when it's first read from the interrupt controller, preventing the
need for future reads from the controller until the next interrupt arrives.
2016-09-14 13:43:35 +10:00
Adrian Danis
3cde4fa8f3 SELFOUR-556: Rationalize BITS vs INDEX_BITS
s/SMMU_PD_BITS/SMMU_PD_INDEX_BITS
Current convention is to say that X_BITS is the log base 2
size of an object, not the log base 2 number of indices
2016-08-31 09:24:47 +10:00
Adrian Danis
f251953f60 SELFOUR-556: Rationalize BITS vs INDEX_BITS
s/PT_BITS/PT_INDEX_BITS
Current convention is to say that X_BITS is the log base 2
size of an object, not the log base 2 number of indices
2016-08-31 09:24:47 +10:00
Anna Lyons
49510f9df4 SELFOUR-624: remove redundancy in io.[c|h]
And clean up a bit while we are there
2016-08-23 08:00:47 +10:00
Anna Lyons
f34f354a5d SELFOUR-617: one source of memory object sizes
Adds the following constants to libsel4
and uses them in the kernel.

seL4_SectionSize (arm)
seL4_SuperSectionSize (arm)
seL4_HugePageSize (x86 - pae)
seL4_LargePageSize (arm)
seL4_DataFault
seL4_InstructionFault
2016-08-17 12:42:38 +10:00
Hesham Almatary
90628a75a7 Benchmark: share and use KS_LOG_PPTR and PPTR_TOP for x86 and ARM 2016-08-12 11:14:04 +10:00
Anna Lyons
f33ae44e13 SELFOUR-612: one generic timer impl
This commit unifies 3 implementations of the arm
generic timer and cleans up existing code.
2016-08-10 07:16:46 +10:00
Anna Lyons
872cd4923a Fix problem in omap irq code
If an irq over max IRQ came in (unlikely) then it would result in an
array bounds over flow. gcc detected this as a result of the inlining of
the irq functions.
2016-08-09 16:18:34 +10:00
Anna Lyons
ce2c058f3d SELFOUR-607: inline remaining irq path functions 2016-08-09 16:18:34 +10:00
Adrian Danis
adb0c08e23 arm/tk1: Explicitly define device region sizes
ARMSectionBits is variable depending on the current virtual addres space
scheme
2016-08-09 11:21:34 +10:00
Anna Lyons
0fd41318f1 trivial: fix tk1 release build 2016-08-09 09:52:26 +10:00
Anna Lyons
d727922b97 trivial: fix a few arm builds 2016-08-09 09:52:26 +10:00
Anna Lyons
652cafd729 trivial: fix beagle release build 2016-08-08 11:53:52 +10:00
Anna Lyons
4a486779ac SELFOUR-519: remove map_kernel_devices duplication
* move devices to static array in hardware.h
* use one higher level function to map them in.
2016-08-06 17:53:04 +10:00
Anna Lyons
ed61b3030c SELFOUR-607: remove stray irqInvalid def 2016-08-06 17:53:03 +10:00
Anna Lyons
9456b3e690 SELFOUR-519: remove more duplication in hardware.c
* move p_reg functions up a level
* move p_reg definitions to hardware.h
2016-08-06 17:53:03 +10:00
Anna Lyons
859091b414 SELFOUR-519: remove duplicated constants
* rename physBaseMapping to BASE_OFFSET
* because physBaseMapping was only used explicity in a few places
* move duplicated arm definions up a level
    - PPTR_TOP
    - PADDR_TOP
    - BASE_OFFSET
2016-08-05 17:08:21 +10:00
Anna Lyons
6859e3bbd9 SELFOUR-607: unify irqInvalid for arm gic_pl390.h 2016-08-05 10:45:32 +10:00
Anna Lyons
ef2fca4bc1 SELFOUR-607: gic_pl390: inline and cleanup.
Inline non-boot irq functions called on the irq path.
This improves performance of interrupt paths through code locality.

Additionally, remove unused functions and use the BIT macro
rather than redefining it.
2016-08-04 16:10:11 +10:00
Adrian Danis
9bedaaa873 SELFOUR-552: Translate IO-ASIDs->PDs by table
Previously looking up the page directory base for a SysteMMU was
done by writing the ASID into the hardware and reading out the
currently set page directory for that ASID. This is confusing for
verification so this commit introduces a global translation table
for converting an ASID to a page directory.
2016-07-08 15:38:33 +10:00
Hesham Almatary
935e8054a6 SELFOUR-448 Benchmark: Add PMU IRQ support to ARM platforms
Currently supported boards are:
- imx6 (sabre)
- tk1 (Jeston)
- kzm
2016-06-24 12:44:09 +10:00
Hesham Almatary
09358f9b6a SELFOUR-448 Benchmark: Track thread's CPU utilisation time 2016-06-24 12:43:09 +10:00
Adrian Danis
0830533513 arm-hyp: Add preprocessor guard comments 2016-06-22 16:25:06 +10:00
Adrian Danis
1d777adbe4 arm-hyp: Correct previous merge with master 2016-06-08 15:11:16 +10:00
Adrian Danis
e67be6acee Merge branch master into arm_hyp
Conflicts:
	src/plat/exynos5/machine/hardware.c
	src/plat/tk1/machine/hardware.c
2016-06-08 15:04:03 +10:00
Anna Lyons
c5b6a6a58a Refactor duplicated code in hardware.h
One copy to rule them all.
2016-06-07 12:01:14 +10:00
Anna Lyons
c9684b964f trivial: consolidate timer function declarations
This moves all timer function declarations to a single
header instead of duplication them for each platform
2016-06-07 11:50:11 +10:00
Anna Lyons
0ec5e93771 SELFOUR-402: remove isReservedIRQ
While provided by each hardware platform this function is never called.
2016-06-07 11:50:11 +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
c64ae63e5c Merge branch master into arm_hyp 2016-06-06 11:51:46 +10:00
Adrian Danis
6915cf03be x86: Update autoconf.h for standalone builds 2016-06-03 09:42:37 +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