Commit graph

1144 commits

Author SHA1 Message Date
Edward Pierzchalski
1ca215cfea RISCV: make sure i has a uniform type.
The C parser produces abbreviations for local variables that depend on
the variable type and the order they appear in the source.

The signature for `get_avail_p_reg` on RISCV has a different type for
`i` than every other function, which causes issues when `hardware.h` is
included early in `kernel_all.c_pp`. Changing the type to `word_t`
avoids these issues.
2019-03-20 17:37:41 +11:00
Oliver Scott
ea365a8553 capdl-dump: tcbDebug list, multicore-support, add tcb command
-Use debuglist for runqueues and filter idle and root thread.
-Refactor sendEPQueue.
-Add multicore support.
-Added TCB_COMMAND, kernel now does translation
depending on how it's configured.
2019-03-20 12:55:30 +11:00
Anna Lyons
7fc45c4ef1 style: set code width to 120 2019-03-19 14:05:44 +11:00
Anna Lyons
306453e347 style: set min-conditional-indent to 0
Given we use braces all the time conditional indents do not make code
cleaner.
2019-03-19 14:05:44 +11:00
Anna Lyons
d0930f67de style: consistently attach return type
Add attach-return-type to astyle
2019-03-19 14:05:36 +11:00
Anna Lyons
761006e03b style: consistently align pointer with name
Run astyle with align-pointer=name
2019-03-19 14:04:54 +11:00
Anna Lyons
3d10ef0c4d style: correct parenthesis padding
Use astyle's unpad-paren to unpad all parentheses that are not included
by pad-header, pad-oper, and pad-comma.
2019-03-19 14:02:59 +11:00
Siwei Zhuang
3914931b32 RISCV: Remove hartid and DTB parsing from the boot code. 2019-03-19 13:39:36 +11:00
Anna Lyons
fa017b6d45 Upgrade to astyle 3.1
This produces minor changes
2019-03-18 15:46:44 +11:00
Jasper Lowell
cf113c619b x86_64: Use sys[ret/exit]q instead of rex prefix
Clang does not support the rex.w instruction prefix and instead requires
sys[ret/exit] mnemonics.
2019-03-18 14:11:07 +11:00
Jasper Lowell
7262cb87e6 Treat optimize attribute as gcc specific
Clang doesn't provide support for __attribute__((optimize ...)). There
are alternatives to provide the same functionality but due to how rarely
the kernel is compiled without optimisations, this can be added on
demand.
2019-03-18 14:11:07 +11:00
Anna Lyons
a39c9b6a76 RISC-V: handle all faults
This change alters RISC-V fault handling to pass all non-VM faults as
user exceptions. As we cannot guarantee what the hardware will send us
in the scause register, we must handle all possible values.

It also makes fault handling more consistent with other architectures in
c_traps.c.
2019-03-15 08:35:47 +11:00
Sylvain Gauthier
63ed19c9b7 handleReservedIRQ now implemented on arch level except for pc99 2019-03-14 15:23:54 +11:00
Sylvain Gauthier
330cbfbdad Made declaration of handleReservedIRQ optional, refactored consequently 2019-03-14 15:23:21 +11:00
Anna Lyons
7b019e3def serial: remove putConsoleChar
putConsoleChar was needless indirection around putDebugChar. Remove
this.
2019-03-14 14:31:12 +11:00
Jasper Lowell
445e09150c aarch32: Rework access of fpu control registers
GCC accepts MCR/MRC instructions to modify fpu control registers. Clang
does not. VMSR/VMRS are instructions that the ARM specification suggests
to use when accessing fpu control registers.
2019-03-12 14:42:38 +11:00
Yanyan Shen
bc5c7883ed arm: Make Arm VCPU states per-node. 2019-02-26 10:29:06 +11:00
Yanyan Shen
973c1ac503 arm/hyp: Trap SMC calls. 2019-02-26 10:29:06 +11:00
Kent McLeod
b88d770112 arm: Rename plat_cleanInvalidateCache
Rename plat_cleanInvalidateCache to plat_cleanInvalidateL2Cache to
indicate that it is a L2 cache maintenance operation only.
2019-02-15 14:49:13 +11:00
Simon Shields
5cd3b7e317 zynqmp: Remove devices.h
These values are now autogenerated.
2019-02-15 14:05:06 +11:00
Kent McLeod
89dd2603b6 arm: Remove empty level2 cache code 2019-02-15 12:39:09 +11:00
Kent McLeod
7f34e19a43 Remove empty hardware.bf definitions
These have no effect when there aren't any definitions.
2019-02-13 14:21:04 +11:00
Kent McLeod
a5da502b13 riscv,RV64,bf: Correct cannonical address to 39
We currently only support Sv39 on RV64. Sv39 has a cannonical address
range of -2^38 and 2^38-1. This means that bits 63-39 must be equal to
bit 38, or that we sign extend from bit 39 to 63 based on the value of
bit 38. It also means that we only have 39 bits of addressable space,
which limits our max untype size.
2019-02-08 17:17:02 +11:00
Kent McLeod
c1b1d07579 bitfields: Split definition cannonical addresses
These shared objects have different definitions based on the cannonical
address of the virtual memory system.
2019-02-08 17:17:02 +11:00
Kent McLeod
960a9927bd riscv,RV32,structures.bf: Remove sign extension
base 32 implies base of 32 and mask of 32 with no sign extension which
is required for Sv32
2019-02-08 17:17:02 +11:00
Kent McLeod
3cd581ddd5 riscv,RV32,structures.bf: Add newline in bitfields
Conventionally a newline is used to signify a system word boundary. This
is supposed to improve readability
2019-02-08 17:17:02 +11:00
Simon Shields
21993d8bbc hardware_gen: generate kernel_devices
This change fixes support for instances where we have
multiple kernel devices in the same page, or kernel devices
which aren't at page-aligned addresses.

Also use seL4_UserTop to pick the right address to start
putting the kernel device pages.
2019-02-05 14:58:17 +11:00
Simon Shields
0fac956e9f ARM platforms: use auto-generated kernel_devices
Note that the auto-generated kernel_devices will differ slightly from
the ones present in the kernel until now. When devices have
registers that aren't page-aligned we now always set the appropriate
PPTR to be the start address of the device, while previously the PPTR
was sometimes page-aligned.

Specifically, this change to PPTRs affects:
- bcm2837 intc
- bcm2837 uart
- allwinnerA20 timer
2019-02-05 14:47:38 +11:00
Simon Shields
7a93479e63 ARM: add KDEV_BASE for aarch32 and aarch64
KDEV_BASE is the first address that can be used for mapping devices.
This will be used by hardware_gen to auto-generate the kernel_devices
table.
2019-02-05 14:47:38 +11:00
Simon Shields
3989d95473 arm: use UART_PPTR for all uarts 2019-02-05 14:47:38 +11:00
Chris Guikema
31733b6bf2 Fixed IPI VM bound notification bug
doRemoteOp1Arg data1 and cpu arguments were switched,
which triggered a conditional statement preventing
the VM from exiting and handling a bound notification.

Change-Id: I019faeaf0c7d51ef7f6b2a2ffa83bea1cf76f811
2019-01-31 09:16:50 +11:00
Simon Shields
dcc8f7ec39 arm: use auto-generated interrupt numbers
This removes the big tables of interrupt numbers from each platform.
2019-01-16 14:46:08 +11:00
Simon Shields
fc4447708a arm: use DTS to generate memory region lists
This changes all ARM platforms over to using the device tree found in
the kernel to generate memory region information.
2019-01-16 14:45:56 +11:00
Simon Shields
4d2bd90c84 tx2: adjust PHYS_BASE to match generated one
Move PHYS_BASE 16MiB into RAM to match the /memreserve/ in the DTS.
2019-01-16 14:37:13 +11:00
Simon Shields
86da489f6b exynos5: adjust PHYS_BASE to match generated one
Adjust PHYS_BASE to the start of RAM to match the DTS.
2019-01-16 14:36:19 +11:00
Simon Shields
3dc0cb0a8d Ensure we always have enough freemem regions on ARM 2019-01-15 11:16:53 +11:00
Simon Shields
d6b1dcf962 allwinnerA20: remove irqNumbers enum 2019-01-15 11:16:04 +11:00
Kofi Doku Atuah
91969a9038 AArch64: Benchmark log: Add convenience pointer to PD entry
* Also document the reason why the particular address for KS_LOG_PPTR was chosen.

This patch adds a pointer to the PD entry that sets the benchmark log frame.
2019-01-15 09:05:15 +11:00
Simon Shields
468d1c5505 am335x: use KERNEL_TIMER_IRQ for timer IRQ number 2019-01-08 13:07:36 +11:00
Simon Shields
73874a75df omap3: use KERNEL_TIMER_IRQ for timer IRQ number 2019-01-08 13:07:36 +11:00
Curtis Millar
da3b028650 Add system timer device untyped for BCM2837 (RPi3) 2019-01-03 12:41:43 +11:00
Curtis Millar
2fd77252e3 Reflow style of physical device frame list. 2019-01-03 12:41:43 +11:00
Kent McLeod
d56175ec3e aarch64: Add missing include for fastpath.h
vcpu_switch gets preprocessed away on non hyp configurations, but
arch/object/vcpu.h needs to be included for this.
2018-12-20 14:01:45 +11:00
Anna Lyons
5fe6d0bcef riscv/spike: fix seL4_UserTop for riscv
Use correct values and document them.
2018-12-20 12:27:23 +11:00
Kofi Doku Atuah
cd26d7d00c Aarch64 HYP Fastpath: Call vcpu_switch when switching from Guest to native threads
Previously the kernel did not call vcpu_switch on the fastpath since the fastpath avoids
calling setVMRoot, so when sending an IPC message from a guest thread to a native thread,
if the IPC was small enough to go on the fastpath the kernel would fail to disable the
HYP traps and would treat the native thread like a guest thread.
2018-12-18 15:38:43 +11:00
Kent McLeod
0348468c87 aarch64: Add pgde enum for tracking hyp hw_asids
aarch64 hyp mode only has support for 8 bit hardware ASIDs. We use the
same strategy used in aarch32 for hardware asids where we maintain a
pool of hwasids that seL4 ASIDs are allocated. The allocation is stored
in the last entry of top level paging structure. This commit
encapsulates this into the bitfield specification in the same way as
aarch32.
2018-12-13 18:09:04 +11:00
Anna Lyons
4bc6b76f5f Remove empty plat_mode/machine header files 2018-12-12 16:24:31 +11:00
Anna Lyons
2a0d682ff2 Remove MAX_IRQ
MAX_IRQ was used on several platforms. Remote it. This is a layer of indirection which adds no value.
2018-12-12 16:24:31 +11:00
Anna Lyons
403f5dace7 Remove N_INTERRUPTS constant
The N_INTERRUPTS constant is never used. maxIRQ tracks this value.
2018-12-12 16:24:31 +11:00
Anna Lyons
e5bb674594 Calculate IRQ_CNODE_BITS from maxIRQ
IRQ_CNODE_BITS is determined by the maxIRQ on the platform. Calculate
this value from maxIRQ instead of hardcoding for each platform.
2018-12-12 16:24:31 +11:00