mirror of
https://github.com/mmueller41/genode.git
synced 2026-01-22 04:52:56 +01:00
Compare commits
221 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8d31590a66 | ||
|
|
8a5277d53f | ||
|
|
fb6549a092 | ||
|
|
c649307720 | ||
|
|
bf0f3b65b4 | ||
|
|
b9a21ee3ae | ||
|
|
8d790010bf | ||
|
|
e29485fa59 | ||
|
|
ace172ebf3 | ||
|
|
bbfda019df | ||
|
|
5cc2adb421 | ||
|
|
90b3b72a91 | ||
|
|
dd4a3b0263 | ||
|
|
7d0cb9620b | ||
|
|
2c29bf5a21 | ||
|
|
80bc1cff5f | ||
|
|
a5f6d0f081 | ||
|
|
e223be32ce | ||
|
|
73d3698e2f | ||
|
|
5f5ad41ad3 | ||
|
|
7ba31d4447 | ||
|
|
224f5907b2 | ||
|
|
70f98fcc44 | ||
|
|
06edc0d52b | ||
|
|
af6d2a8c54 | ||
|
|
157f4b1270 | ||
|
|
66ff18a53e | ||
|
|
2a4adc895c | ||
|
|
d21bc8268b | ||
|
|
8b556a9435 | ||
|
|
a68a6665ac | ||
|
|
1e7c94759d | ||
|
|
9ec2a19cc0 | ||
|
|
9bc6b8be5a | ||
|
|
f8f8b665c3 | ||
|
|
31397d67ae | ||
|
|
dd8777093d | ||
|
|
2f55ffdf20 | ||
|
|
7c1a4522d6 | ||
|
|
3e8824908d | ||
|
|
28714979bd | ||
|
|
658091bfad | ||
|
|
e8e14ad1bf | ||
|
|
e544464354 | ||
|
|
969e59c599 | ||
|
|
f2d7f7aa6e | ||
|
|
a59b69758b | ||
|
|
c7d9b2ca92 | ||
|
|
2437d759b6 | ||
|
|
0434cb6fd6 | ||
|
|
556a5c8086 | ||
|
|
852ab79359 | ||
|
|
66063e5137 | ||
|
|
f03917ab7c | ||
|
|
5ed528a2ad | ||
|
|
81ae4599ae | ||
|
|
82090d2ea1 | ||
|
|
2e3b11b354 | ||
|
|
f3eaeb08ef | ||
|
|
3f97269988 | ||
|
|
1aed881313 | ||
|
|
3c78265e66 | ||
|
|
fcb21732e0 | ||
|
|
db0e86fa41 | ||
|
|
2e22498e5a | ||
|
|
264f695373 | ||
|
|
a2381c7e4c | ||
|
|
974118acec | ||
|
|
08ef528577 | ||
|
|
50b367c076 | ||
|
|
36b6ebc030 | ||
|
|
a89d61acf2 | ||
|
|
9e42a9ac7e | ||
|
|
19690193a4 | ||
|
|
78047b5bd8 | ||
|
|
9662d89cfb | ||
|
|
bc5b161260 | ||
|
|
c502e1d095 | ||
|
|
6c4ce86a34 | ||
|
|
7bac1ec7e5 | ||
|
|
7932c76d85 | ||
|
|
66c520cdae | ||
|
|
9453287a6b | ||
|
|
40e936911f | ||
|
|
d9121e50c3 | ||
|
|
cb15f40028 | ||
|
|
ce1d0464b8 | ||
|
|
bed531b604 | ||
|
|
257b3b6775 | ||
|
|
420ed91480 | ||
|
|
c6b17be744 | ||
|
|
d266f44ef3 | ||
|
|
5a2ac73b69 | ||
|
|
7996fc45f3 | ||
|
|
a03a37b1d9 | ||
|
|
76ac94f4f2 | ||
|
|
f4d3231034 | ||
|
|
b7ffeb51aa | ||
|
|
ed15a46ca4 | ||
|
|
c55a499009 | ||
|
|
d1be1281bc | ||
|
|
377dadd461 | ||
|
|
353baa9251 | ||
|
|
60106ac2c8 | ||
|
|
de7d4a5523 | ||
|
|
9b6cc75f1c | ||
|
|
18b26ff595 | ||
|
|
e44ffa02c9 | ||
|
|
5122917d62 | ||
|
|
3639a1af80 | ||
|
|
851b842033 | ||
|
|
072a00ba18 | ||
|
|
7e0b66835b | ||
|
|
73e671893b | ||
|
|
fd682cd470 | ||
|
|
bfd94d64ba | ||
|
|
d8539af412 | ||
|
|
cd7a6fc9fe | ||
|
|
41380ff769 | ||
|
|
0ed7367c97 | ||
|
|
eab09a2f7c | ||
|
|
de795b1a6e | ||
|
|
73546a135a | ||
|
|
c888d856ee | ||
|
|
c81af531a3 | ||
|
|
6743669ab8 | ||
|
|
320387db89 | ||
|
|
4cad1a87df | ||
|
|
22cb6dded7 | ||
|
|
537b317273 | ||
|
|
795a817a33 | ||
|
|
067a7ad7e9 | ||
|
|
3863de9589 | ||
|
|
443d3c98dd | ||
|
|
602def9bdd | ||
|
|
3d1d1b439d | ||
|
|
49e907e5f6 | ||
|
|
c4a8c6798b | ||
|
|
21e48a8e12 | ||
|
|
a7d170adda | ||
|
|
91b71f7a9f | ||
|
|
641679f7e7 | ||
|
|
ed4594c76b | ||
|
|
997a77b3de | ||
|
|
6fa4307005 | ||
|
|
f3efbe50bb | ||
|
|
ce6f4dffe5 | ||
|
|
a0b0892df3 | ||
|
|
e163055f6a | ||
|
|
7acc34b48b | ||
|
|
a9827c662e | ||
|
|
9a8a42e819 | ||
|
|
5516dbcb1f | ||
|
|
b7cdb5840a | ||
|
|
61d798c629 | ||
|
|
973fbc98be | ||
|
|
3d634df34d | ||
|
|
ad284491e6 | ||
|
|
f946de4450 | ||
|
|
377c6ed0ce | ||
|
|
1609d8a92f | ||
|
|
169cad6059 | ||
|
|
bba4790002 | ||
|
|
c943e26913 | ||
|
|
7d1fd0b0a3 | ||
|
|
6d653b3c0f | ||
|
|
5936d00b5e | ||
|
|
5af4552511 | ||
|
|
0310c733d5 | ||
|
|
0e6c32f75e | ||
|
|
93ab972ddc | ||
|
|
35c3acdf05 | ||
|
|
103236fdca | ||
|
|
62848b1a68 | ||
|
|
64ef651d4d | ||
|
|
1a620acc17 | ||
|
|
6e71208db3 | ||
|
|
8e205e0324 | ||
|
|
9578fadae2 | ||
|
|
1ec823bf5e | ||
|
|
2471410fe5 | ||
|
|
3fb5ae4fdc | ||
|
|
4450b37ff5 | ||
|
|
309597bbda | ||
|
|
7dbf836217 | ||
|
|
5249f3358f | ||
|
|
1f91fd3f7d | ||
|
|
01676717e2 | ||
|
|
1cfb1af56e | ||
|
|
ef741ef80d | ||
|
|
6119e03081 | ||
|
|
6d945e6a61 | ||
|
|
6fc7ed55cf | ||
|
|
8b590e2330 | ||
|
|
ec711b008e | ||
|
|
e5b00d89fb | ||
|
|
be55f080e4 | ||
|
|
e1aab829ca | ||
|
|
e56dd15a4b | ||
|
|
103ae9df4a | ||
|
|
b5f0c07eb3 | ||
|
|
eb3a81a874 | ||
|
|
1e96510815 | ||
|
|
04d8c859d8 | ||
|
|
b11da67679 | ||
|
|
c8322ffd2a | ||
|
|
f63713694c | ||
|
|
7a97cd70aa | ||
|
|
48b4891f6e | ||
|
|
5d40c0c1ce | ||
|
|
e8f5706382 | ||
|
|
98f39c698f | ||
|
|
c6eda9bd80 | ||
|
|
87b08d6c7f | ||
|
|
5f7e670ebc | ||
|
|
e8fec3eed6 | ||
|
|
dc8b4eeb40 | ||
|
|
4f87fbd5ae | ||
|
|
df3f7dc1bc | ||
|
|
8e85d889f1 | ||
|
|
f687b0f3b9 |
@@ -31,9 +31,9 @@ of them is briefly characterized as follows:
|
||||
session interfaces. Naturally, a device driver is specific to a
|
||||
particular hardware platform. The hardware resources are accessed
|
||||
via core's IO_MEM, IO_PORT, and IRQ services. The functionality of
|
||||
the driver is made available to other system components by announcing
|
||||
the driver is made available to other system components via
|
||||
one of Genode's device-independent session interfaces, which are
|
||||
'platform_session', 'framebuffer_session', 'input_session', 'block_session',
|
||||
'platform_session', 'capture_session', 'event_session', 'block_session',
|
||||
'audio_out_session', 'log_session', 'nic_session', and 'timer_session'
|
||||
(see 'os/include/' for the interface definitions). Those interfaces are
|
||||
uniform across hardware platforms and kernel base platforms. Usually,
|
||||
@@ -112,19 +112,14 @@ The UART device drivers implement the UART-session interface.
|
||||
Framebuffer and input drivers
|
||||
=============================
|
||||
|
||||
Framebuffer and input drivers implement the framebuffer-session interface and
|
||||
input-session interfaces respectively.
|
||||
Framebuffer and input drivers are implemented as clients of the
|
||||
capture-session and event-session interfaces respectively.
|
||||
|
||||
:'os/src/drivers/input/dummy':
|
||||
Pseudo input driver without accessing any hardware. This component is useful
|
||||
to resolve a dependency from an input session for scenarios where no user
|
||||
input is required.
|
||||
|
||||
:'os/src/drivers/input/spec/ps2/x86':
|
||||
:'os/src/drivers/ps2/x86':
|
||||
Driver for the 'i8042' PS/2 controller as found in x86 PCs. It supports both
|
||||
mouse (including ImPS/2, ExPS/2) and keyboard.
|
||||
|
||||
:'os/src/drivers/input/spec/ps2/pl050':
|
||||
:'os/src/drivers/ps2/pl050':
|
||||
Driver for the PL050 PS/2 controller as found on ARM platforms such as
|
||||
VersatilePB. The physical base address used by the driver is obtained at
|
||||
compile time from a header file called 'pl050_defs.h'. The version of the
|
||||
@@ -132,10 +127,6 @@ input-session interfaces respectively.
|
||||
is made available to the driver via the SPECS machinery of the Genode build
|
||||
system.
|
||||
|
||||
:'os/src/drivers/input/spec/imx53':
|
||||
Input driver for Egalaxy touchscreen and Freescale's MPR121
|
||||
capacitative touch buttons on i.MX53.
|
||||
|
||||
:'libports/src/drivers/framebuffer/vesa':
|
||||
Driver using VESA mode setting on x86 PCs. For more information, please refer
|
||||
to the README file in the driver directory.
|
||||
@@ -147,13 +138,13 @@ input-session interfaces respectively.
|
||||
:'os/src/drivers/framebuffer/pl11x':
|
||||
Driver for the PL110/PL111 LCD display.
|
||||
|
||||
:'os/src/drivers/framebuffer/spec/imx53':
|
||||
:'os/src/drivers/framebuffer/imx53':
|
||||
Driver for LCD output on i.MX53 SoCs.
|
||||
|
||||
:'os/src/drivers/framebuffer/spec/rpi':
|
||||
:'os/src/drivers/framebuffer/rpi':
|
||||
Driver for the HDMI output of the Raspberry Pi.
|
||||
|
||||
:'os/src/drivers/framebuffer/spec/sdl':
|
||||
:'os/src/drivers/framebuffer/sdl':
|
||||
Serves as both framebuffer and input driver on Linux using libSDL. This
|
||||
driver is only usable on the Linux base platform.
|
||||
|
||||
@@ -165,9 +156,9 @@ input-session interfaces respectively.
|
||||
the Linux Intel KMS driver.
|
||||
|
||||
:'dde_linux/src/drivers/usb':
|
||||
USB driver that makes USB HID and USB storage devices available as input
|
||||
sessions and block session respectively. For examples of using this driver,
|
||||
refer to the run scripts at 'dde_linux/run/usb_hid' and
|
||||
USB driver that makes USB HID and USB storage devices available as an input
|
||||
event stream and a block session respectively. For examples of using this
|
||||
driver, refer to the run scripts at 'dde_linux/run/usb_hid' and
|
||||
'dde_linux/run/usb_storage'.
|
||||
|
||||
:'dde_linux/src/drivers/usb_hid':
|
||||
@@ -287,13 +278,14 @@ Resource multiplexers
|
||||
By convention, resource multiplexers are located at the 'src/server'
|
||||
subdirectory of a source repository.
|
||||
|
||||
:Framebuffer and input: The framebuffer and input session interfaces can be
|
||||
multiplexed using the Nitpicker GUI server, which allows multiple clients to
|
||||
create and manage rectangular areas on screen. Nitpicker uses one input
|
||||
session and one framebuffer session as back end and, in turn, provides
|
||||
so-called nitpicker sessions to one or multiple clients. Each nitpicker
|
||||
session contains a virtual framebuffer and a virtual input session. Nitpicker
|
||||
(including a README file) is located at 'os/src/server/nitpicker'.
|
||||
:Framebuffer and input: Framebuffer and input devices can be multiplexed using
|
||||
the Nitpicker GUI server, which allows multiple clients to create and manage
|
||||
rectangular areas on screen. Nitpicker serves as broker between input
|
||||
devices, output devices, and graphical applications. It provides an event
|
||||
service for input drivers, a capture service for output drivers, and a GUI
|
||||
service for the applications. Each GUI session contains a virtual
|
||||
framebuffer and a virtual input interface. Nitpicker (including a README
|
||||
file) is located at 'os/src/server/nitpicker'.
|
||||
|
||||
:Audio output: The audio mixer located at 'os/src/server/mixer' enables
|
||||
multiple clients to use the audio-out interface. The mixing is done by simply
|
||||
@@ -336,21 +328,21 @@ one session interface to another, or in the form of libraries.
|
||||
Separate components
|
||||
===================
|
||||
|
||||
:'os/src/server/nit_fb':
|
||||
Translates a nitpicker session to a pair of framebuffer and input sessions.
|
||||
Each 'nit_fb' instance is visible as a rectangular area on screen presenting
|
||||
:'os/src/server/gui_fb':
|
||||
Translates a GUI session to a pair of framebuffer and input sessions.
|
||||
Each 'gui_fb' instance is visible as a rectangular area on screen presenting
|
||||
a virtual frame buffer. The area is statically positioned. For more
|
||||
information, please refer to 'os/src/server/nit_fb/README'.
|
||||
information, please refer to 'os/src/server/gui_fb/README'.
|
||||
|
||||
:'gems/src/server/wm':
|
||||
Window manager that implements the nitpicker session interface but manages
|
||||
Window manager that implements the GUI session interface but manages
|
||||
each client view as a separate window. The window decorations are provided
|
||||
by a so-called decorator (e.g., 'gems/src/app/decorator'). The behaviour
|
||||
is defined by a so-called window layouter such as the floating window
|
||||
layouter located at 'gems/src/app/floating_window_layouter/'.
|
||||
|
||||
:'demo/src/server/liquid_framebuffer':
|
||||
Implements the same translation as 'nit_fb' but by presenting an interactive
|
||||
Implements the same translation as 'gui_fb' but by presenting an interactive
|
||||
window rather than a statically positioned screen area.
|
||||
|
||||
:'os/src/server/tar_rom':
|
||||
@@ -383,8 +375,7 @@ Separate components
|
||||
Adapter that writes LOG messages to files on a file system.
|
||||
|
||||
:'demo/src/server/nitlog':
|
||||
Provides a LOG session, printing log output on screen via a nitpicker
|
||||
session.
|
||||
Provides a LOG session, printing log output on screen via a GUI session.
|
||||
|
||||
:'os/src/app/rom_logger':
|
||||
The rom_logger component requests a ROM session and writes the
|
||||
@@ -450,16 +441,16 @@ Separate components
|
||||
is then propagated to the clients of the ROM service according to a
|
||||
configurable information-flow policy.
|
||||
|
||||
:'os/src/server/input_filter':
|
||||
:'os/src/server/event_filter':
|
||||
A component that transforms and merges input events from multiple sources
|
||||
into a single stream.
|
||||
into a single event stream.
|
||||
|
||||
:'libports/src/server/acpi_input':
|
||||
:'libports/src/app/acpi_event':
|
||||
A component that transforms ACPI events into Genode input events.
|
||||
|
||||
:'gems/src/server/nit_fader':
|
||||
A wrapper for nitpicker's session interface that applies alpha-blending to
|
||||
the of views a nitpicker client.
|
||||
:'gems/src/server/gui_fader':
|
||||
A wrapper for nitpicker's GUI session interface that applies alpha-blending
|
||||
to the of views a GUI client.
|
||||
|
||||
|
||||
VFS plugins
|
||||
@@ -526,7 +517,7 @@ Libraries
|
||||
run on a text terminal.
|
||||
|
||||
:'libports/lib/mk/qt5_*':
|
||||
Qt5 framework, using nitpicker session and NIC session as back end.
|
||||
Qt5 framework, using GUI session and NIC session as back end.
|
||||
|
||||
:'libports/lib/mk/vfs_jitterentropy.mk':
|
||||
A VFS plugin that makes a jitter-based random-number generator available
|
||||
@@ -555,8 +546,8 @@ subdirectory of a repository. Most applications come with README files
|
||||
located in their respective directory.
|
||||
|
||||
:'gems/src/app/backdrop':
|
||||
Nitpicker client application that sets a composition of PNG images as
|
||||
desktop background.
|
||||
GUI client application that sets a composition of PNG images as desktop
|
||||
background.
|
||||
|
||||
:'demo/src/app/launchpad':
|
||||
Graphical application for interactively starting and killing subsystems.
|
||||
|
||||
73
doc/news.txt
73
doc/news.txt
@@ -4,6 +4,79 @@
|
||||
===========
|
||||
|
||||
|
||||
Genode OS Framework release 20.08 | 2020-08-28
|
||||
##############################################
|
||||
|
||||
| With Genode 20.08, the low-level GUI stack underwent a profound redesign,
|
||||
| the Chromium web engine comes to life, the i.MX8 support covers clock and
|
||||
| power management, and the CBE block encrypter becomes highly modular.
|
||||
|
||||
The most stunning feature of Genode 20.08 is most certainly the new ability
|
||||
to host the Chromium web engine as native component in the form of the Falkon
|
||||
web browser. This long-time project involved overcoming countless road
|
||||
blocks along the way to the great benefit of Genode's users at large: building
|
||||
bridges between 3rd-party build systems and Genode, covering seemingly obscure
|
||||
corner cases of POSIX, solving instruction-cache invalidation issues on ARM -
|
||||
just to name a few.
|
||||
|
||||
Under the hood, we took the release cycle as opportunity to tackle a major
|
||||
surgery of the low-level GUI stack that we planned for more than two years.
|
||||
The architectural change lays the groundwork for swapping out graphics and
|
||||
input drivers on the fly without reboot. It also paves the ground for features
|
||||
like screen capturing and remote desktop scenarios in a privacy-protecting
|
||||
way.
|
||||
|
||||
On our mission of bringing the driver support for the 64-bit ARM-based i.MX8
|
||||
SoC on par with our driver coverage on Intel PCs, the release introduces a
|
||||
platform driver specifically for this SoC that covers clock and power
|
||||
management. One step closer to using Sculpt OS on the MNT Reform laptop.
|
||||
|
||||
Furthermore, Genode's custom block encrypter called CBE received continuous
|
||||
development. In particular, the cryptographic algorithm and trust anchor
|
||||
have become pluggable modules. This will allow for tailoring the CBE to
|
||||
custom products - like hardware trust anchors - without changing its
|
||||
implementation.
|
||||
|
||||
These and many more improvements are covered in detail in the
|
||||
[https:/documentation/release-notes/20.08 - release documentation of version 20.08...]
|
||||
|
||||
|
||||
Genode OS Framework release 20.05 | 2020-05-28
|
||||
##############################################
|
||||
|
||||
| Version 20.05 wraps up the consolidation of Noux with the C runtime,
|
||||
| advances the device-driver infrastructure and virtualization support on ARM,
|
||||
| reaches feature-completion of our block encryptor, and leverages seccomp for
|
||||
| sandboxing components on top of Linux.
|
||||
|
||||
It has become almost a tradition to dedicate the spring release to topics
|
||||
under the hood of the Genode OS framework, taking the time for careful
|
||||
consolidation, and architectural improvements.
|
||||
|
||||
On the latter account, the Linux version gained an architectural revamp of its
|
||||
inter-component communication model, leveraging the combination of the
|
||||
seccomp and epoll kernel mechanisms to enable Genode's capability-based
|
||||
security concept on this kernel. The new version applies strict sandboxing
|
||||
to each component individually. In particular, the host file system is
|
||||
shielded from Genode components and Genode's least-privilege access-control
|
||||
scheme comes into effect.
|
||||
|
||||
As the second prominent architectural topic, the release features new
|
||||
device-driver infrastructure for the ARM universe along with a unified
|
||||
version of the formerly distinct virtual machine monitors for ARMv7 and
|
||||
ARMv8. These are important steps to bring Genode on ARM to parity with the
|
||||
x86 version.
|
||||
|
||||
Further highlights of the release are the first feature-complete version
|
||||
of our custom block-encryption component, the improved management of CPU
|
||||
affinities on x86, and new tracing utilities. Last but not least, the
|
||||
release is accompanied with an updated version of the Genode Foundations
|
||||
book, reflecting the changes of the framework since one year ago.
|
||||
|
||||
Read the details of the new release in the
|
||||
[https:/documentation/release-notes/20.05 - release documentation of version 20.05...]
|
||||
|
||||
|
||||
Sculpt OS release 20.02 | 2020-03-10
|
||||
####################################
|
||||
|
||||
|
||||
@@ -274,7 +274,7 @@ generates configurations for some of those drivers. For the time being, the
|
||||
changes to the Sculpt manager are not yet part of the official release.
|
||||
Nevertheless, you can produce a Sculpt OS image to be run on an i.MX 8M EVK
|
||||
board by using the following
|
||||
[https://github.com/skalk/sculpt_20.02_imx8q_evk/ - topic branch].
|
||||
[https://github.com/skalk/genode/commits/sculpt_20.02_imx8q_evk - topic branch].
|
||||
|
||||
Alternatively, you can also have a look at Sculpt OS on ARMv8 hardware by
|
||||
following the video recordings of the following talk at FOSDEM 2020.
|
||||
|
||||
1015
doc/release_notes-20-08.txt
Normal file
1015
doc/release_notes-20-08.txt
Normal file
File diff suppressed because it is too large
Load Diff
@@ -111,11 +111,6 @@ but build upon of each other:
|
||||
The repository contains a server that uses a rump kernel to provide
|
||||
various NetBSD file systems to Genode.
|
||||
|
||||
:'dde_zircon':
|
||||
|
||||
This repository contains the emulation environment for drivers
|
||||
ported from the Zircon kernel.
|
||||
|
||||
:'ports':
|
||||
|
||||
This source-code repository hosts ports of 3rd-party applications to
|
||||
|
||||
@@ -1 +1 @@
|
||||
2020-05-26 02e84ead88242170c4d025cb7a62c2c2a0549c61
|
||||
2020-08-27 b77ed0937d21da6a407cb5fd9738055dfaf68507
|
||||
|
||||
@@ -102,11 +102,6 @@ namespace Genode {
|
||||
*/
|
||||
void resume();
|
||||
|
||||
/**
|
||||
* Cancel currently blocking operation
|
||||
*/
|
||||
void cancel_blocking();
|
||||
|
||||
/**
|
||||
* This thread is about to be bound
|
||||
*
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
#define _CORE__INCLUDE__RPC_CAP_FACTORY_H_
|
||||
|
||||
#include <base/allocator.h>
|
||||
#include <base/lock.h>
|
||||
#include <base/capability.h>
|
||||
|
||||
namespace Genode { class Rpc_cap_factory; }
|
||||
|
||||
@@ -142,17 +142,6 @@ Thread_state Platform_thread::state()
|
||||
}
|
||||
|
||||
|
||||
void Platform_thread::cancel_blocking()
|
||||
{
|
||||
l4_umword_t dummy;
|
||||
l4_threadid_t invalid = L4_INVALID_ID;
|
||||
|
||||
l4_inter_task_ex_regs(_l4_thread_id, ~0UL, ~0UL,
|
||||
&invalid, &invalid, &invalid,
|
||||
&dummy, &dummy, &dummy, 0, l4_utcb_get());
|
||||
}
|
||||
|
||||
|
||||
Platform_thread::Platform_thread(size_t, const char *name, unsigned,
|
||||
Affinity::Location, addr_t)
|
||||
: _l4_thread_id(L4_INVALID_ID), _name(name) { }
|
||||
|
||||
@@ -49,14 +49,6 @@ void Thread::start()
|
||||
}
|
||||
|
||||
|
||||
void Thread::cancel_blocking()
|
||||
{
|
||||
/*
|
||||
* Within core, we never need to unblock threads
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
void Thread::_deinit_platform_thread()
|
||||
{
|
||||
/* destruct platform thread */
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
*/
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/cancelable_lock.h>
|
||||
#include <base/thread.h>
|
||||
#include <cpu/atomic.h>
|
||||
#include <cpu/memory_barrier.h>
|
||||
@@ -25,7 +24,7 @@ namespace Fiasco {
|
||||
using namespace Genode;
|
||||
|
||||
|
||||
Cancelable_lock::Cancelable_lock(Cancelable_lock::State initial)
|
||||
Lock::Lock(Lock::State initial)
|
||||
: _state(UNLOCKED), _owner(nullptr)
|
||||
{
|
||||
if (initial == LOCKED)
|
||||
@@ -33,28 +32,27 @@ Cancelable_lock::Cancelable_lock(Cancelable_lock::State initial)
|
||||
}
|
||||
|
||||
|
||||
void Cancelable_lock::lock()
|
||||
void Lock::lock()
|
||||
{
|
||||
Applicant myself(Thread::myself());
|
||||
lock(myself);
|
||||
}
|
||||
|
||||
|
||||
void Cancelable_lock::lock(Applicant &myself)
|
||||
void Lock::lock(Applicant &myself)
|
||||
{
|
||||
/*
|
||||
* XXX: How to notice cancel-blocking signals issued when being outside the
|
||||
* 'l4_ipc_sleep' system call?
|
||||
*/
|
||||
while (!Genode::cmpxchg(&_state, UNLOCKED, LOCKED))
|
||||
if (Fiasco::l4_ipc_sleep(Fiasco::l4_ipc_timeout(0, 0, 500, 0)) != L4_IPC_RETIMEOUT)
|
||||
throw Genode::Blocking_canceled();
|
||||
Fiasco::l4_ipc_sleep(Fiasco::l4_ipc_timeout(0, 0, 500, 0));
|
||||
|
||||
_owner = myself;
|
||||
}
|
||||
|
||||
|
||||
void Cancelable_lock::unlock()
|
||||
void Lock::unlock()
|
||||
{
|
||||
_owner = Applicant(nullptr);
|
||||
Genode::memory_barrier();
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/sleep.h>
|
||||
#include <base/lock.h>
|
||||
|
||||
/* L4/Fiasco includes */
|
||||
namespace Fiasco {
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
#define _INCLUDE__FOC__THREAD_STATE_H_
|
||||
|
||||
#include <base/capability.h>
|
||||
#include <base/lock.h>
|
||||
#include <base/thread_state.h>
|
||||
|
||||
/* Fiasco includes */
|
||||
@@ -33,17 +32,11 @@ struct Genode::Foc_thread_state : Thread_state
|
||||
Fiasco::l4_cap_idx_t kcap; /* thread's gate cap in its pd */
|
||||
int id; /* id of gate capability */
|
||||
addr_t utcb; /* thread's utcb in its pd */
|
||||
unsigned exceptions; /* counts exceptions raised by the thread */
|
||||
bool paused; /* indicates whether thread is stopped */
|
||||
bool in_exception; /* true if thread is in exception */
|
||||
Lock lock { };
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
Foc_thread_state()
|
||||
: kcap(Fiasco::L4_INVALID_CAP), id(0), utcb(0), exceptions(0),
|
||||
paused(false), in_exception(false) { }
|
||||
Foc_thread_state() : kcap(Fiasco::L4_INVALID_CAP), id(0), utcb(0) { }
|
||||
};
|
||||
|
||||
#endif /* _INCLUDE__FOC__THREAD_STATE_H_ */
|
||||
|
||||
@@ -1 +1 @@
|
||||
2020-05-26 aaa0173203e45653f66c3d618ebb4f3f8c8ab824
|
||||
2020-08-27 5f44c34120046861ee02a488b0e34c859cc7f2ec
|
||||
|
||||
@@ -1 +1 @@
|
||||
2020-05-26 4765046a8124b5ccb91e5d5d99c25dbd77b4beee
|
||||
2020-08-27 c1913f289544881002ba648e34b076f39b6cfd90
|
||||
|
||||
@@ -1 +1 @@
|
||||
2020-05-26 a7b1bc8a7f5c49c55b78b4553c35e8c6f326a505
|
||||
2020-08-27 e73882245d240ad99888c6887525fed6b2085d5e
|
||||
|
||||
@@ -1 +1 @@
|
||||
2020-05-26 2e409e97f835d14938ed24e134251d20c1b1349a
|
||||
2020-08-27 40f98e27ab53cc631e951a745b292a6f722bbfce
|
||||
|
||||
@@ -1 +1 @@
|
||||
2020-05-26 0b9ad6d521217d2a0eedfc81d9313ec8eeed7d4d
|
||||
2020-08-27 9499c9b32821d0b483e00dab5321dc28acc59c09
|
||||
|
||||
@@ -14,8 +14,18 @@
|
||||
#ifndef _CORE__INCLUDE__PAGER_OBJECT_EXCEPTION_STATE_H_
|
||||
#define _CORE__INCLUDE__PAGER_OBJECT_EXCEPTION_STATE_H_
|
||||
|
||||
#include <base/mutex.h>
|
||||
#include <foc/thread_state.h>
|
||||
|
||||
namespace Genode { typedef Foc_thread_state Pager_object_exception_state; }
|
||||
namespace Genode { struct Pager_object_exception_state; }
|
||||
|
||||
struct Genode::Pager_object_exception_state
|
||||
{
|
||||
Mutex mutex { };
|
||||
unsigned exceptions; /* counts exceptions raised by the thread */
|
||||
bool paused; /* indicates whether thread is stopped */
|
||||
bool in_exception; /* true if thread is in exception */
|
||||
Foc_thread_state state; /* accessible via native cpu thread RPC */
|
||||
};
|
||||
|
||||
#endif /* _CORE__INCLUDE__PAGER_OBJECT_EXCEPTION_STATE_H_ */
|
||||
|
||||
@@ -116,11 +116,6 @@ namespace Genode {
|
||||
*/
|
||||
void resume();
|
||||
|
||||
/**
|
||||
* Cancel currently blocking operation
|
||||
*/
|
||||
void cancel_blocking();
|
||||
|
||||
/**
|
||||
* This thread is about to be bound
|
||||
*
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
/* Genode includes */
|
||||
#include <base/env.h>
|
||||
#include <base/log.h>
|
||||
#include <base/lock.h>
|
||||
|
||||
/* core includes */
|
||||
#include <pager.h>
|
||||
@@ -58,8 +57,8 @@ void Pager_entrypoint::entry()
|
||||
case Ipc_pager::EXCEPTION:
|
||||
{
|
||||
if (_pager.exception()) {
|
||||
Lock::Guard guard(obj->state.lock);
|
||||
_pager.get_regs(obj->state);
|
||||
Mutex::Guard guard(obj->state.mutex);
|
||||
_pager.get_regs(obj->state.state);
|
||||
obj->state.exceptions++;
|
||||
obj->state.in_exception = true;
|
||||
obj->submit_exception_signal();
|
||||
@@ -95,11 +94,11 @@ void Pager_entrypoint::entry()
|
||||
_pager.acknowledge_wakeup();
|
||||
|
||||
{
|
||||
Lock::Guard guard(obj->state.lock);
|
||||
Mutex::Guard guard(obj->state.mutex);
|
||||
/* revert exception flag */
|
||||
obj->state.in_exception = false;
|
||||
/* set new register contents */
|
||||
_pager.set_regs(obj->state);
|
||||
_pager.set_regs(obj->state.state);
|
||||
}
|
||||
|
||||
/* send wake up message to requested thread */
|
||||
@@ -114,8 +113,8 @@ void Pager_entrypoint::entry()
|
||||
*/
|
||||
case Ipc_pager::PAUSE:
|
||||
{
|
||||
Lock::Guard guard(obj->state.lock);
|
||||
_pager.get_regs(obj->state);
|
||||
Mutex::Guard guard(obj->state.mutex);
|
||||
_pager.get_regs(obj->state.state);
|
||||
obj->state.exceptions++;
|
||||
obj->state.in_exception = true;
|
||||
|
||||
|
||||
@@ -41,5 +41,5 @@ void Pager_object::wake_up()
|
||||
|
||||
void Pager_object::unresolved_page_fault_occurred()
|
||||
{
|
||||
state.unresolved_page_fault = true;
|
||||
state.state.unresolved_page_fault = true;
|
||||
}
|
||||
|
||||
@@ -89,16 +89,18 @@ void Platform_thread::pause()
|
||||
if (!_pager_obj)
|
||||
return;
|
||||
|
||||
_pager_obj->state.lock.lock();
|
||||
_pager_obj->state.mutex.acquire();
|
||||
|
||||
if (_pager_obj->state.paused == true) {
|
||||
_pager_obj->state.lock.unlock();
|
||||
_pager_obj->state.mutex.release();
|
||||
return;
|
||||
}
|
||||
|
||||
Foc_thread_state ®_state = _pager_obj->state.state;
|
||||
|
||||
unsigned exc = _pager_obj->state.exceptions;
|
||||
_pager_obj->state.ip = ~0UL;
|
||||
_pager_obj->state.sp = ~0UL;
|
||||
reg_state.ip = ~0UL;
|
||||
reg_state.sp = ~0UL;
|
||||
l4_umword_t flags = L4_THREAD_EX_REGS_TRIGGER_EXCEPTION;
|
||||
|
||||
/* Mark thread to be stopped */
|
||||
@@ -109,14 +111,14 @@ void Platform_thread::pause()
|
||||
* The pager thread, which also acts as exception handler, will
|
||||
* leave the thread in exception state until, it gets woken again
|
||||
*/
|
||||
l4_thread_ex_regs_ret(_thread.local.data()->kcap(), &_pager_obj->state.ip,
|
||||
&_pager_obj->state.sp, &flags);
|
||||
l4_thread_ex_regs_ret(_thread.local.data()->kcap(), ®_state.ip,
|
||||
®_state.sp, &flags);
|
||||
|
||||
/*
|
||||
* The thread state ("ready") is encoded in the lowest bit of the flags.
|
||||
*/
|
||||
bool in_syscall = (flags & 1) == 0;
|
||||
_pager_obj->state.lock.unlock();
|
||||
_pager_obj->state.mutex.release();
|
||||
|
||||
/**
|
||||
* Check whether the thread was in ongoing ipc, if so it won't raise
|
||||
@@ -149,11 +151,11 @@ void Platform_thread::resume()
|
||||
if (!_pager_obj)
|
||||
return;
|
||||
|
||||
_pager_obj->state.lock.lock();
|
||||
_pager_obj->state.mutex.acquire();
|
||||
|
||||
/* Mark thread to be runable again */
|
||||
_pager_obj->state.paused = false;
|
||||
_pager_obj->state.lock.unlock();
|
||||
_pager_obj->state.mutex.release();
|
||||
|
||||
/* Send a message to the exception handler, to unblock the client */
|
||||
Msgbuf<16> snd, rcv;
|
||||
@@ -202,14 +204,14 @@ void Platform_thread::pager(Pager_object &pager_obj)
|
||||
void Platform_thread::state(Thread_state s)
|
||||
{
|
||||
if (_pager_obj)
|
||||
*static_cast<Thread_state *>(&_pager_obj->state) = s;
|
||||
*static_cast<Thread_state *>(&_pager_obj->state.state) = s;
|
||||
}
|
||||
|
||||
|
||||
Foc_thread_state Platform_thread::state()
|
||||
{
|
||||
Foc_thread_state s;
|
||||
if (_pager_obj) s = _pager_obj->state;
|
||||
if (_pager_obj) s = _pager_obj->state.state;
|
||||
|
||||
s.kcap = _gate.remote;
|
||||
s.id = _gate.local.local_name();
|
||||
@@ -219,12 +221,6 @@ Foc_thread_state Platform_thread::state()
|
||||
}
|
||||
|
||||
|
||||
void Platform_thread::cancel_blocking()
|
||||
{
|
||||
l4_irq_trigger(_irq.local.data()->kcap());
|
||||
}
|
||||
|
||||
|
||||
void Platform_thread::affinity(Affinity::Location location)
|
||||
{
|
||||
_location = location;
|
||||
|
||||
@@ -110,11 +110,3 @@ void Thread::start()
|
||||
new (platform().core_mem_alloc()) Core_trace_source(Trace::sources(),
|
||||
*this, pt);
|
||||
}
|
||||
|
||||
|
||||
void Thread::cancel_blocking()
|
||||
{
|
||||
/*
|
||||
* Within core, we never need to unblock threads
|
||||
*/
|
||||
}
|
||||
|
||||
@@ -102,9 +102,3 @@ void Thread::start()
|
||||
Cpu_thread_client cpu_thread(_thread_cap);
|
||||
cpu_thread.start((addr_t)_thread_start, _stack->top());
|
||||
}
|
||||
|
||||
|
||||
void Thread::cancel_blocking()
|
||||
{
|
||||
Cpu_thread_client(_thread_cap).cancel_blocking();
|
||||
}
|
||||
|
||||
@@ -1,18 +1,9 @@
|
||||
INC_DIR += $(REP_DIR)/src/core/spec/imx8q_evk
|
||||
INC_DIR += $(REP_DIR)/src/core/spec/arm_v8
|
||||
INC_DIR += $(REP_DIR)/src/core/spec/arm/virtualization
|
||||
|
||||
# add C++ sources
|
||||
SRC_CC += kernel/cpu_mp.cc
|
||||
SRC_CC += kernel/vm_thread_on.cc
|
||||
SRC_CC += spec/64bit/memory_map.cc
|
||||
SRC_CC += spec/arm/generic_timer.cc
|
||||
SRC_CC += spec/arm/gicv3.cc
|
||||
SRC_CC += spec/arm/kernel/lock.cc
|
||||
SRC_CC += spec/arm/platform_support.cc
|
||||
SRC_CC += spec/arm_v8/cpu.cc
|
||||
SRC_CC += spec/arm_v8/kernel/cpu.cc
|
||||
SRC_CC += spec/arm_v8/kernel/thread.cc
|
||||
SRC_CC += spec/arm_v8/virtualization/kernel/vm.cc
|
||||
SRC_CC += spec/arm/virtualization/platform_services.cc
|
||||
SRC_CC += spec/arm/virtualization/vm_session_component.cc
|
||||
@@ -20,13 +11,9 @@ SRC_CC += vm_session_common.cc
|
||||
SRC_CC += vm_session_component.cc
|
||||
|
||||
#add assembly sources
|
||||
SRC_S += spec/arm_v8/exception_vector.s
|
||||
SRC_S += spec/arm_v8/crt0.s
|
||||
SRC_S += spec/arm_v8/virtualization/exception_vector.s
|
||||
|
||||
vpath spec/64bit/memory_map.cc $(REP_DIR)/src/lib/hw
|
||||
|
||||
NR_OF_CPUS = 4
|
||||
|
||||
# include less specific configuration
|
||||
include $(REP_DIR)/lib/mk/core-hw.inc
|
||||
include $(REP_DIR)/lib/mk/spec/arm_v8/core-hw.inc
|
||||
|
||||
@@ -1,26 +1,11 @@
|
||||
INC_DIR += $(REP_DIR)/src/core/spec/rpi3
|
||||
INC_DIR += $(REP_DIR)/src/core/spec/arm_v8
|
||||
|
||||
# add C++ sources
|
||||
SRC_CC += kernel/cpu_mp.cc
|
||||
SRC_CC += kernel/vm_thread_off.cc
|
||||
SRC_CC += platform_services.cc
|
||||
SRC_CC += spec/64bit/memory_map.cc
|
||||
SRC_CC += spec/arm/bcm2837_pic.cc
|
||||
SRC_CC += spec/arm/generic_timer.cc
|
||||
SRC_CC += spec/arm/kernel/lock.cc
|
||||
SRC_CC += spec/arm/platform_support.cc
|
||||
SRC_CC += spec/arm_v8/cpu.cc
|
||||
SRC_CC += spec/arm_v8/kernel/cpu.cc
|
||||
SRC_CC += spec/arm_v8/kernel/thread.cc
|
||||
|
||||
#add assembly sources
|
||||
SRC_S += spec/arm_v8/exception_vector.s
|
||||
SRC_S += spec/arm_v8/crt0.s
|
||||
|
||||
vpath spec/64bit/memory_map.cc $(REP_DIR)/src/lib/hw
|
||||
|
||||
NR_OF_CPUS = 4
|
||||
|
||||
# include less specific configuration
|
||||
include $(REP_DIR)/lib/mk/core-hw.inc
|
||||
include $(REP_DIR)/lib/mk/spec/arm_v8/core-hw.inc
|
||||
|
||||
@@ -1,18 +1,9 @@
|
||||
INC_DIR += $(REP_DIR)/src/core/spec/virt_qemu_64
|
||||
INC_DIR += $(REP_DIR)/src/core/spec/arm_v8
|
||||
INC_DIR += $(REP_DIR)/src/core/spec/arm/virtualization
|
||||
|
||||
# add C++ sources
|
||||
SRC_CC += kernel/cpu_mp.cc
|
||||
SRC_CC += kernel/vm_thread_on.cc
|
||||
SRC_CC += spec/64bit/memory_map.cc
|
||||
SRC_CC += spec/arm/generic_timer.cc
|
||||
SRC_CC += spec/arm/gicv3.cc
|
||||
SRC_CC += spec/arm/kernel/lock.cc
|
||||
SRC_CC += spec/arm/platform_support.cc
|
||||
SRC_CC += spec/arm_v8/cpu.cc
|
||||
SRC_CC += spec/arm_v8/kernel/cpu.cc
|
||||
SRC_CC += spec/arm_v8/kernel/thread.cc
|
||||
SRC_CC += spec/arm_v8/virtualization/kernel/vm.cc
|
||||
SRC_CC += spec/arm/virtualization/platform_services.cc
|
||||
SRC_CC += spec/arm/virtualization/vm_session_component.cc
|
||||
@@ -20,13 +11,9 @@ SRC_CC += vm_session_common.cc
|
||||
SRC_CC += vm_session_component.cc
|
||||
|
||||
#add assembly sources
|
||||
SRC_S += spec/arm_v8/exception_vector.s
|
||||
SRC_S += spec/arm_v8/crt0.s
|
||||
SRC_S += spec/arm_v8/virtualization/exception_vector.s
|
||||
|
||||
vpath spec/64bit/memory_map.cc $(REP_DIR)/src/lib/hw
|
||||
|
||||
NR_OF_CPUS = 4
|
||||
|
||||
# include less specific configuration
|
||||
include $(REP_DIR)/lib/mk/core-hw.inc
|
||||
include $(REP_DIR)/lib/mk/spec/arm_v8/core-hw.inc
|
||||
|
||||
22
repos/base-hw/lib/mk/spec/arm_v8/core-hw.inc
Normal file
22
repos/base-hw/lib/mk/spec/arm_v8/core-hw.inc
Normal file
@@ -0,0 +1,22 @@
|
||||
INC_DIR += $(REP_DIR)/src/core/spec/arm_v8
|
||||
|
||||
# add C++ sources
|
||||
SRC_CC += kernel/cpu_mp.cc
|
||||
SRC_CC += spec/64bit/memory_map.cc
|
||||
SRC_CC += spec/arm/generic_timer.cc
|
||||
SRC_CC += spec/arm/kernel/lock.cc
|
||||
SRC_CC += spec/arm/platform_support.cc
|
||||
SRC_CC += spec/arm_v8/cpu.cc
|
||||
SRC_CC += spec/arm_v8/kernel/cpu.cc
|
||||
SRC_CC += spec/arm_v8/kernel/thread.cc
|
||||
|
||||
#add assembly sources
|
||||
SRC_S += spec/arm_v8/exception_vector.s
|
||||
SRC_S += spec/arm_v8/crt0.s
|
||||
|
||||
vpath pd_session_support.cc $(REP_DIR)/src/core/spec/arm_v8
|
||||
vpath spec/64bit/memory_map.cc $(REP_DIR)/src/lib/hw
|
||||
|
||||
# include less specific configuration
|
||||
include $(REP_DIR)/lib/mk/core-hw.inc
|
||||
|
||||
@@ -1 +1 @@
|
||||
2020-05-26 d571b4008c077de6bf2847e2ca726f14bf9fd052
|
||||
2020-08-27 6ecb2cfd14c70ae61cfa19b88d7c54e3fedc1891
|
||||
|
||||
@@ -1 +1 @@
|
||||
2020-05-26 825299968d42f320869fa2e140bd9f9397f9af95
|
||||
2020-08-27 6b1d2b7cd8528da7d41fc67ea0e6e4582a31f733
|
||||
|
||||
@@ -1 +1 @@
|
||||
2020-05-26 3872892e68f287962ad090ceba64b1c42f034404
|
||||
2020-08-27 2c087fc74853bf34d922183b1389de285ee639c4
|
||||
|
||||
@@ -1 +1 @@
|
||||
2020-05-26 9b217c926d882d12df003323445ce122b3e0ef85
|
||||
2020-08-27 4cc0aa32af24a6442aff9392a04e021441d3c6bd
|
||||
|
||||
@@ -1 +1 @@
|
||||
2020-05-26 3602062e5feea490097300bc840909a8054ca25b
|
||||
2020-08-27 9901df07c863acf255813d7a52716615e6ca20d7
|
||||
|
||||
@@ -1 +1 @@
|
||||
2020-05-26 f0b22b9a092c04a2eb9b8e76512da07097cfcbfb
|
||||
2020-08-27 55519e0b080ced494049d3b08b382bb09624a162
|
||||
|
||||
@@ -1 +1 @@
|
||||
2020-05-26 330eb3b8279f1bc10832f5a33e1122cde44dcebd
|
||||
2020-08-27 0bd3fdff00c07aeb805468adabb215ec5a4078ca
|
||||
|
||||
@@ -1 +1 @@
|
||||
2020-05-26 f3ced2b1116769e290e95fdf1a3dd437427a232c
|
||||
2020-08-27 850472062a2942adaa849eef5294f4ac58f4fd47
|
||||
|
||||
@@ -1 +1 @@
|
||||
2020-05-26 03e080c0939c6a6af63e6e650768fb207def8be4
|
||||
2020-08-27 6b5459dc428c2a68082db740cacdbd75f98a55ec
|
||||
|
||||
@@ -1 +1 @@
|
||||
2020-05-26 65aa55292f1b669f072387358e385c21ea449b01
|
||||
2020-08-27 a92a3496cf9e1a8167a307b2620612d1581e465a
|
||||
|
||||
@@ -1 +1 @@
|
||||
2020-05-26 e9de8dfcd684d37f9e8ec53de543bfa710521b48
|
||||
2020-08-27 41fbf758fbd27c093d41e2230914529dcd6a1da8
|
||||
|
||||
@@ -1 +1 @@
|
||||
2020-05-26 3b3afdfbb3624537ef23d2824665f6fbfd60a44a
|
||||
2020-08-27 5a1e60456696346d25d1efa15dca0543bec8044c
|
||||
|
||||
@@ -1 +1 @@
|
||||
2020-05-26 9a3efd32f7ebcc9ffa76c2cf4bf65ff572707d96
|
||||
2020-08-27 7d3b349f032944c948b3659f238f1e56c343099c
|
||||
|
||||
@@ -15,18 +15,18 @@
|
||||
#include <base/mutex.h>
|
||||
#include <hw/assert.h>
|
||||
|
||||
Genode::Cancelable_lock::Cancelable_lock(Genode::Cancelable_lock::State state)
|
||||
Genode::Lock::Lock(Genode::Lock::State state)
|
||||
: _state(state), _owner(nullptr) { }
|
||||
|
||||
|
||||
void Genode::Cancelable_lock::unlock()
|
||||
void Genode::Lock::unlock()
|
||||
{
|
||||
assert(_state == LOCKED);
|
||||
_state = UNLOCKED;
|
||||
}
|
||||
|
||||
|
||||
void Genode::Cancelable_lock::lock()
|
||||
void Genode::Lock::lock()
|
||||
{
|
||||
assert(_state == UNLOCKED);
|
||||
_state = LOCKED;
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
|
||||
#include <platform.h>
|
||||
|
||||
|
||||
/**
|
||||
* Leave out the first page (being 0x0) from bootstraps RAM allocator,
|
||||
* some code does not feel happy with addresses being zero
|
||||
@@ -28,146 +29,7 @@ Bootstrap::Platform::Board::Board()
|
||||
{
|
||||
::Board::Pic pic {};
|
||||
|
||||
static volatile unsigned long initial_values[][2] {
|
||||
// GPC values
|
||||
{ 0x303A0004, 0x5050424 },
|
||||
{ 0x303A0030, 0xEB22DE22 },
|
||||
{ 0x303A0034, 0xFFFFF1C7 },
|
||||
{ 0x303A0038, 0x7BFFBC00 },
|
||||
{ 0x303A003C, 0xFA3BF12A },
|
||||
{ 0x303A004C, 0xFFFFDFFF },
|
||||
{ 0x303A01B4, 0x3980 },
|
||||
{ 0x303A01CC, 0xFFFFBFFF },
|
||||
{ 0x303A01D4, 0xFFFF7FFF },
|
||||
{ 0x303A01DC, 0xFFFF7FFF },
|
||||
{ 0x303A01FC, 0x107FF9F },
|
||||
{ 0x303A080C, 0x1 },
|
||||
{ 0x303A0840, 0x1 },
|
||||
{ 0x303A084C, 0x1 },
|
||||
{ 0x303A0880, 0x1 },
|
||||
{ 0x303A088C, 0x1 },
|
||||
{ 0x303A08C0, 0x1 },
|
||||
{ 0x303A08CC, 0x1 },
|
||||
{ 0x303A0C8C, 0x1 },
|
||||
{ 0x303A0DCC, 0x1 },
|
||||
{ 0x303A0E0C, 0x1 },
|
||||
{ 0x303A0ECC, 0x1 },
|
||||
{ 0x303A0F00, 0x1 },
|
||||
{ 0x303A0F0C, 0x1 },
|
||||
|
||||
// CCM values
|
||||
{ 0x303840B0, 0x2 },
|
||||
{ 0x303840B4, 0x2 },
|
||||
{ 0x303840B8, 0x2 },
|
||||
{ 0x303840BC, 0x2 },
|
||||
{ 0x303840C0, 0x2 },
|
||||
{ 0x303840C4, 0x2 },
|
||||
{ 0x303840C8, 0x2 },
|
||||
{ 0x303840CC, 0x2 },
|
||||
{ 0x303840D0, 0x2 },
|
||||
{ 0x303840D4, 0x2 },
|
||||
{ 0x303840D8, 0x2 },
|
||||
{ 0x303840DC, 0x2 },
|
||||
{ 0x303840E0, 0x2 },
|
||||
{ 0x303840E4, 0x2 },
|
||||
{ 0x303840E8, 0x2 },
|
||||
{ 0x303840EC, 0x2 },
|
||||
{ 0x303840F0, 0x2 },
|
||||
{ 0x303840F4, 0x2 },
|
||||
{ 0x303840F8, 0x2 },
|
||||
{ 0x303840FC, 0x2 },
|
||||
{ 0x30384250, 0x3 },
|
||||
{ 0x30384254, 0x3 },
|
||||
{ 0x30384258, 0x3 },
|
||||
{ 0x3038425C, 0x3 },
|
||||
{ 0x303843A0, 0x3 },
|
||||
{ 0x303843A4, 0x3 },
|
||||
{ 0x303843A8, 0x3 },
|
||||
{ 0x303843AC, 0x3 },
|
||||
{ 0x303844D0, 0x3 },
|
||||
{ 0x303844D4, 0x3 },
|
||||
{ 0x303844D8, 0x3 },
|
||||
{ 0x303844DC, 0x3 },
|
||||
{ 0x303844F0, 0x3 },
|
||||
{ 0x303844F4, 0x3 },
|
||||
{ 0x303844F8, 0x3 },
|
||||
{ 0x303844FC, 0x3 },
|
||||
{ 0x30384560, 0x0 },
|
||||
{ 0x30384564, 0x0 },
|
||||
{ 0x30384568, 0x0 },
|
||||
{ 0x3038456C, 0x0 },
|
||||
{ 0x303845D0, 0x3 },
|
||||
{ 0x303845D4, 0x3 },
|
||||
{ 0x303845D8, 0x3 },
|
||||
{ 0x303845DC, 0x3 },
|
||||
{ 0x30388010, 0x0 },
|
||||
{ 0x30388014, 0x0 },
|
||||
{ 0x30388018, 0x0 },
|
||||
{ 0x3038801C, 0x0 },
|
||||
{ 0x30388020, 0x0 },
|
||||
{ 0x30388024, 0x0 },
|
||||
{ 0x30388028, 0x0 },
|
||||
{ 0x3038802C, 0x0 },
|
||||
{ 0x30388030, 0x11000400 },
|
||||
{ 0x30388034, 0x11000400 },
|
||||
{ 0x30388038, 0x11000400 },
|
||||
{ 0x3038803C, 0x11000400 },
|
||||
{ 0x30388080, 0x11000000 },
|
||||
{ 0x30388084, 0x11000000 },
|
||||
{ 0x30388088, 0x11000000 },
|
||||
{ 0x3038808C, 0x11000000 },
|
||||
{ 0x30388090, 0x0 },
|
||||
{ 0x30388094, 0x0 },
|
||||
{ 0x30388098, 0x0 },
|
||||
{ 0x3038809C, 0x0 },
|
||||
{ 0x303880B0, 0x1100 },
|
||||
{ 0x303880B4, 0x1100 },
|
||||
{ 0x303880B8, 0x1100 },
|
||||
{ 0x303880BC, 0x1100 },
|
||||
{ 0x30388110, 0x0 },
|
||||
{ 0x30388114, 0x0 },
|
||||
{ 0x30388118, 0x0 },
|
||||
{ 0x3038811C, 0x0 },
|
||||
{ 0x30388180, 0x1000000 },
|
||||
{ 0x30388184, 0x1000000 },
|
||||
{ 0x30388188, 0x1000000 },
|
||||
{ 0x3038818C, 0x1000000 },
|
||||
{ 0x303881A0, 0x10000000 },
|
||||
{ 0x303881A4, 0x10000000 },
|
||||
{ 0x303881A8, 0x10000000 },
|
||||
{ 0x303881AC, 0x10000000 },
|
||||
{ 0x303881B0, 0x1000100 },
|
||||
{ 0x303881B4, 0x1000100 },
|
||||
{ 0x303881B8, 0x1000100 },
|
||||
{ 0x303881BC, 0x1000100 },
|
||||
{ 0x30388200, 0x1000000 },
|
||||
{ 0x30388204, 0x1000000 },
|
||||
{ 0x30388208, 0x1000000 },
|
||||
{ 0x3038820C, 0x1000000 },
|
||||
{ 0x30388220, 0x10000000 },
|
||||
{ 0x30388224, 0x10000000 },
|
||||
{ 0x30388228, 0x10000000 },
|
||||
{ 0x3038822C, 0x10000000 },
|
||||
{ 0x30388230, 0x1000100 },
|
||||
{ 0x30388234, 0x1000100 },
|
||||
{ 0x30388238, 0x1000100 },
|
||||
{ 0x3038823C, 0x1000100 },
|
||||
|
||||
// CCMA values
|
||||
{ 0x30360000, 0x88080 },
|
||||
{ 0x30360004, 0x292A2FA6 },
|
||||
{ 0x30360004, 0x292A2FA6 },
|
||||
{ 0x30360008, 0x88080 },
|
||||
{ 0x30360008, 0x88080 },
|
||||
{ 0x3036000C, 0x10385BA3 },
|
||||
{ 0x3036000C, 0x10385BA3 },
|
||||
{ 0x30360010, 0x98080 },
|
||||
{ 0x30360010, 0x98080 },
|
||||
{ 0x30360014, 0x3FFFFF1A },
|
||||
{ 0x30360014, 0x3FFFFF1A },
|
||||
{ 0x30360018, 0x88081 },
|
||||
{ 0x30360054, 0x2B9 },
|
||||
|
||||
static volatile unsigned long iomux_values[][2] {
|
||||
// IOMUXC
|
||||
{ 0x30330064, 0x6 },
|
||||
{ 0x30330140, 0x0 },
|
||||
@@ -267,9 +129,66 @@ Bootstrap::Platform::Board::Board()
|
||||
{ 0x30340040, 0x49409200 }
|
||||
};
|
||||
|
||||
unsigned num_values = sizeof(initial_values) / (2*sizeof(unsigned long));
|
||||
struct Gpio_reg : Genode::Mmio
|
||||
{
|
||||
Gpio_reg(Genode::addr_t const mmio_base)
|
||||
: Genode::Mmio(mmio_base) { }
|
||||
|
||||
struct Data : Register<0x0, 32> {};
|
||||
struct Dir : Register<0x4, 32> {};
|
||||
struct Int_conf_0 : Register<0xc, 32> {};
|
||||
struct Int_conf_1 : Register<0x10, 32> {};
|
||||
struct Int_mask : Register<0x14, 32> {};
|
||||
struct Int_stat : Register<0x18, 32> {};
|
||||
};
|
||||
|
||||
struct Ccm_reg : Genode::Mmio
|
||||
{
|
||||
Ccm_reg(Genode::addr_t const mmio_base)
|
||||
: Genode::Mmio(mmio_base) { }
|
||||
|
||||
struct Target_root_0 : Register<0x8000, 32> {};
|
||||
};
|
||||
|
||||
struct Pll_reg : Genode::Mmio
|
||||
{
|
||||
Pll_reg(Genode::addr_t const mmio_base)
|
||||
: Genode::Mmio(mmio_base) { }
|
||||
|
||||
struct Pll_arm_0 : Register<0x28, 32> {};
|
||||
struct Pll_arm_1 : Register<0x2c, 32> {};
|
||||
};
|
||||
|
||||
unsigned num_values = sizeof(iomux_values) / (2*sizeof(unsigned long));
|
||||
for (unsigned i = 0; i < num_values; i++)
|
||||
*((volatile Genode::uint32_t*)initial_values[i][0]) = (Genode::uint32_t)initial_values[i][1];
|
||||
*((volatile Genode::uint32_t*)iomux_values[i][0]) = (Genode::uint32_t)iomux_values[i][1];
|
||||
|
||||
|
||||
Ccm_reg ccm(0x30380000);
|
||||
Ccm_reg pll(0x30360000);
|
||||
|
||||
/* configure GPIO PIN 13 of GPIO 1 for high voltage */
|
||||
Gpio_reg regulator(0x30200000);
|
||||
regulator.write<Gpio_reg::Int_conf_0>(0);
|
||||
regulator.write<Gpio_reg::Int_conf_1>(0);
|
||||
regulator.write<Gpio_reg::Int_mask>(0x1000);
|
||||
regulator.write<Gpio_reg::Int_stat>(0xffffffff);
|
||||
regulator.write<Gpio_reg::Dir>(0x2328);
|
||||
regulator.write<Gpio_reg::Data>(0x9f40);
|
||||
|
||||
ccm.write<Ccm_reg::Target_root_0>(0x14000000);
|
||||
pll.write<Pll_reg::Pll_arm_1>(0x4a);
|
||||
|
||||
unsigned long v = pll.read<Pll_reg::Pll_arm_0>();
|
||||
pll.write<Pll_reg::Pll_arm_0>(v & 0xffffffe0);
|
||||
v = pll.read<Pll_reg::Pll_arm_0>();
|
||||
pll.write<Pll_reg::Pll_arm_0>(v | (1<<12));
|
||||
|
||||
while (!(pll.read<Pll_reg::Pll_arm_0>() & (1<<11))) { ; }
|
||||
|
||||
v = pll.read<Pll_reg::Pll_arm_0>();
|
||||
pll.write<Pll_reg::Pll_arm_0>(v ^ (1<<12));
|
||||
ccm.write<Ccm_reg::Target_root_0>(0x11000000);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -39,23 +39,7 @@ unsigned Bootstrap::Platform::enable_mmu()
|
||||
{
|
||||
using ::Board::Cpu;
|
||||
|
||||
struct Sctlr : Cpu::Sctlr
|
||||
{
|
||||
struct W : Bitfield<3,1> { }; /* enable write buffer */
|
||||
struct Dt : Bitfield<16,1> { }; /* global data TCM enable */
|
||||
struct It : Bitfield<18,1> { }; /* global instruction TCM enable */
|
||||
struct U : Bitfield<22,1> { }; /* enable unaligned data access */
|
||||
struct Xp : Bitfield<23,1> { }; /* disable subpage AP bits */
|
||||
};
|
||||
|
||||
Cpu::Sctlr::init();
|
||||
Cpu::Sctlr::access_t sctlr = Cpu::Sctlr::read();
|
||||
Sctlr::W::set(sctlr, 1);
|
||||
Sctlr::Dt::set(sctlr, 1);
|
||||
Sctlr::It::set(sctlr, 1);
|
||||
Sctlr::U::set(sctlr, 1);
|
||||
Sctlr::Xp::set(sctlr, 1);
|
||||
Cpu::Sctlr::write(sctlr);
|
||||
|
||||
Cpu::Cpsr::init();
|
||||
|
||||
@@ -82,9 +66,18 @@ unsigned Bootstrap::Platform::enable_mmu()
|
||||
Cpu::Ttbr0::write(ttbr);
|
||||
Cpu::Ttbr1::write(ttbr);
|
||||
|
||||
sctlr = Cpu::Sctlr::read();
|
||||
struct Sctlr : Cpu::Sctlr
|
||||
{
|
||||
struct U : Bitfield<22,1> { }; /* enable unaligned data access */
|
||||
struct Xp : Bitfield<23,1> { }; /* disable subpage AP bits */
|
||||
};
|
||||
|
||||
Cpu::Sctlr::access_t sctlr = Cpu::Sctlr::read();
|
||||
Cpu::Sctlr::C::set(sctlr, 1);
|
||||
Cpu::Sctlr::I::set(sctlr, 1);
|
||||
Sctlr::U::set(sctlr, 1);
|
||||
Sctlr::Xp::set(sctlr, 1);
|
||||
Cpu::Sctlr::Z::set(sctlr, 1);
|
||||
Cpu::Sctlr::M::set(sctlr, 1);
|
||||
Cpu::Sctlr::write(sctlr);
|
||||
|
||||
|
||||
@@ -59,8 +59,7 @@ namespace Kernel
|
||||
constexpr Call_arg call_id_ack_irq() { return 120; }
|
||||
constexpr Call_arg call_id_new_obj() { return 121; }
|
||||
constexpr Call_arg call_id_delete_obj() { return 122; }
|
||||
constexpr Call_arg call_id_cancel_thread_blocking() { return 123; }
|
||||
constexpr Call_arg call_id_new_core_thread() { return 124; }
|
||||
constexpr Call_arg call_id_new_core_thread() { return 123; }
|
||||
|
||||
/**
|
||||
* Invalidate TLB entries for the `pd` in region `addr`, `sz`
|
||||
@@ -140,27 +139,6 @@ namespace Kernel
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Cancel blocking of a thread if it is in a cancelable blocking state
|
||||
*
|
||||
* \param thread pointer to thread kernel object
|
||||
*
|
||||
* Does cleanly cancel a cancelable blocking thread state (IPC, signalling,
|
||||
* stopped). The thread whose blocking was cancelled goes back to the
|
||||
* 'active' thread state. If needed, it receives a syscall return value
|
||||
* that reflects the cancellation. This syscall doesn't affect the pause
|
||||
* state of the thread (see the 'pause_thread' syscall) which means that
|
||||
* the thread may still be not allowed for scheduling. The syscall is
|
||||
* core-restricted and may target any thread. It is actually used to
|
||||
* limit the time a parent waits for a server when closing a session
|
||||
* of one of its children.
|
||||
*/
|
||||
inline void cancel_thread_blocking(Thread & thread)
|
||||
{
|
||||
call(call_id_cancel_thread_blocking(), (Call_arg)&thread);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set or unset the handler of an event that can be triggered by a thread
|
||||
*
|
||||
|
||||
@@ -346,12 +346,6 @@ bool Thread::_restart()
|
||||
}
|
||||
|
||||
|
||||
void Thread::_call_cancel_thread_blocking()
|
||||
{
|
||||
reinterpret_cast<Thread*>(user_arg_1())->_cancel_blocking();
|
||||
}
|
||||
|
||||
|
||||
void Thread::_cancel_blocking()
|
||||
{
|
||||
switch (_state) {
|
||||
@@ -768,7 +762,6 @@ void Thread::_call()
|
||||
case call_id_delete_thread(): _call_delete_thread(); return;
|
||||
case call_id_start_thread(): _call_start_thread(); return;
|
||||
case call_id_resume_thread(): _call_resume_thread(); return;
|
||||
case call_id_cancel_thread_blocking(): _call_cancel_thread_blocking(); return;
|
||||
case call_id_thread_pager(): _call_pager(); return;
|
||||
case call_id_invalidate_tlb(): _call_invalidate_tlb(); return;
|
||||
case call_id_new_pd():
|
||||
|
||||
@@ -220,7 +220,6 @@ class Kernel::Thread : private Kernel::Object, public Cpu_job, private Timeout
|
||||
void _call_stop_thread();
|
||||
void _call_pause_thread();
|
||||
void _call_resume_thread();
|
||||
void _call_cancel_thread_blocking();
|
||||
void _call_restart_thread();
|
||||
void _call_yield_thread();
|
||||
void _call_delete_thread();
|
||||
|
||||
@@ -162,12 +162,6 @@ namespace Genode {
|
||||
*/
|
||||
void resume() { Kernel::resume_thread(*_kobj); }
|
||||
|
||||
/**
|
||||
* Cancel currently blocking operation
|
||||
*/
|
||||
void cancel_blocking() {
|
||||
Kernel::cancel_thread_blocking(*_kobj); }
|
||||
|
||||
/**
|
||||
* Set CPU quota of the thread to 'quota'
|
||||
*/
|
||||
|
||||
@@ -76,25 +76,16 @@ Board::Pic::Pic()
|
||||
|
||||
bool Board::Pic::take_request(unsigned &irq)
|
||||
{
|
||||
/* read basic IRQ status mask */
|
||||
uint32_t const p = read<Irq_pending_basic>();
|
||||
|
||||
|
||||
/* read GPU IRQ status mask */
|
||||
uint32_t const p1 = read<Irq_pending_gpu_1>(),
|
||||
p2 = read<Irq_pending_gpu_2>();
|
||||
|
||||
if (Irq_pending_basic::Timer::get(p)) {
|
||||
irq = Irq_pending_basic::Timer::SHIFT;
|
||||
return true;
|
||||
}
|
||||
|
||||
/* search for lowest set bit in pending masks */
|
||||
for (unsigned i = 0; i < NR_OF_IRQ; i++) {
|
||||
if (!_is_pending(i, p1, p2))
|
||||
continue;
|
||||
|
||||
irq = Board::GPU_IRQ_BASE + i;
|
||||
irq = i;
|
||||
|
||||
/* handle SOF interrupts locally, filter from the user land */
|
||||
if (irq == Board::DWC_IRQ)
|
||||
@@ -118,23 +109,15 @@ void Board::Pic::mask()
|
||||
|
||||
void Board::Pic::unmask(unsigned const i, unsigned)
|
||||
{
|
||||
if (i < 8)
|
||||
write<Irq_enable_basic>(1 << i);
|
||||
else if (i < 32 + 8)
|
||||
write<Irq_enable_gpu_1>(1 << (i - 8));
|
||||
else
|
||||
write<Irq_enable_gpu_2>(1 << (i - 8 - 32));
|
||||
if (i < 32) { write<Irq_enable_gpu_1>(1 << i); }
|
||||
else { write<Irq_enable_gpu_2>(1 << (i - 32)); }
|
||||
}
|
||||
|
||||
|
||||
void Board::Pic::mask(unsigned const i)
|
||||
{
|
||||
if (i < 8)
|
||||
write<Irq_disable_basic>(1 << i);
|
||||
else if (i < 32 + 8)
|
||||
write<Irq_disable_gpu_1>(1 << (i - 8));
|
||||
else
|
||||
write<Irq_disable_gpu_2>(1 << (i - 8 - 32));
|
||||
if (i < 32) { write<Irq_disable_gpu_1>(1 << i); }
|
||||
else { write<Irq_disable_gpu_2>(1 << (i - 32)); }
|
||||
}
|
||||
|
||||
|
||||
|
||||
36
repos/base-hw/src/core/spec/arm_v8/pd_session_support.cc
Normal file
36
repos/base-hw/src/core/spec/arm_v8/pd_session_support.cc
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* \brief Core implementation of the PD session interface
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2020-07-10
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2020 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
*/
|
||||
|
||||
#include <cpu/cpu_state.h>
|
||||
#include <hw/spec/arm_64/psci_call.h>
|
||||
#include <pd_session_component.h>
|
||||
|
||||
using namespace Genode;
|
||||
using State = Genode::Pd_session::Managing_system_state;
|
||||
|
||||
State Pd_session_component::managing_system(State const & s)
|
||||
{
|
||||
State ret;
|
||||
ret.r[0] = Hw::Psci_smc_functor::call(s.r[0], s.r[1], s.r[2], s.r[3]);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/***************************
|
||||
** Dummy implementations **
|
||||
***************************/
|
||||
|
||||
bool Pd_session_component::assign_pci(addr_t, uint16_t) { return true; }
|
||||
|
||||
void Pd_session_component::map(addr_t, addr_t) { }
|
||||
|
||||
@@ -77,12 +77,6 @@ void Thread::start()
|
||||
}
|
||||
|
||||
|
||||
void Thread::cancel_blocking()
|
||||
{
|
||||
native_thread().platform_thread->cancel_blocking();
|
||||
}
|
||||
|
||||
|
||||
void Thread::_deinit_platform_thread()
|
||||
{
|
||||
/* destruct platform thread */
|
||||
|
||||
@@ -385,6 +385,8 @@ class Hw::Level_3_translation_table :
|
||||
using Base = Long_translation_table<SIZE_LOG2_4KB,
|
||||
SIZE_LOG2_2MB>;
|
||||
using Block_descriptor = typename Stage_trait<Base, STAGE>::Type;
|
||||
if (!Descriptor::valid(desc))
|
||||
return;
|
||||
phys = Block_descriptor::Output_address::masked(desc);
|
||||
found = true;
|
||||
}
|
||||
|
||||
@@ -100,9 +100,3 @@ void Thread::start()
|
||||
/* start thread with its initial IP and aligned SP */
|
||||
Cpu_thread_client(_thread_cap).start((addr_t)_thread_start, _stack->top());
|
||||
}
|
||||
|
||||
|
||||
void Thread::cancel_blocking()
|
||||
{
|
||||
Cpu_thread_client(_thread_cap).cancel_blocking();
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
2020-05-26 46d65065a36a9fa7138641d229e72f3937bcefb1
|
||||
2020-08-24 eaaa49e682b67f10f04fc37a5486101ddb33d2b8
|
||||
|
||||
@@ -1 +1 @@
|
||||
2020-05-26 ee6bed9f98252773bb75fa00286427c6ffdf313b
|
||||
2020-08-27 0b80b3bf71f537843e9d419fff9979b6ca846d49
|
||||
|
||||
@@ -43,8 +43,8 @@ namespace Genode {
|
||||
|
||||
struct Registry
|
||||
{
|
||||
Lock _lock { };
|
||||
List<Platform_thread> _list { };
|
||||
Mutex _mutex { };
|
||||
List<Platform_thread> _list { };
|
||||
|
||||
void insert(Platform_thread *thread);
|
||||
void remove(Platform_thread *thread);
|
||||
@@ -80,11 +80,6 @@ namespace Genode {
|
||||
|
||||
~Platform_thread();
|
||||
|
||||
/**
|
||||
* Cancel currently blocking operation
|
||||
*/
|
||||
void cancel_blocking();
|
||||
|
||||
/**
|
||||
* Pause this thread
|
||||
*/
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
#define _CORE__INCLUDE__RPC_CAP_FACTORY_H_
|
||||
|
||||
#include <base/allocator.h>
|
||||
#include <base/lock.h>
|
||||
#include <base/capability.h>
|
||||
|
||||
namespace Genode { class Rpc_cap_factory; }
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
*/
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/lock.h>
|
||||
#include <linux_dataspace/client.h>
|
||||
|
||||
/* base-internal includes */
|
||||
|
||||
@@ -32,21 +32,21 @@ typedef Token<Scanner_policy_identifier_with_underline> Tid_token;
|
||||
|
||||
void Platform_thread::Registry::insert(Platform_thread *thread)
|
||||
{
|
||||
Lock::Guard guard(_lock);
|
||||
Mutex::Guard guard(_mutex);
|
||||
_list.insert(thread);
|
||||
}
|
||||
|
||||
|
||||
void Platform_thread::Registry::remove(Platform_thread *thread)
|
||||
{
|
||||
Lock::Guard guard(_lock);
|
||||
Mutex::Guard guard(_mutex);
|
||||
_list.remove(thread);
|
||||
}
|
||||
|
||||
|
||||
void Platform_thread::Registry::submit_exception(unsigned long pid)
|
||||
{
|
||||
Lock::Guard guard(_lock);
|
||||
Mutex::Guard guard(_mutex);
|
||||
|
||||
/* traverse list to find 'Platform_thread' with matching PID */
|
||||
for (Platform_thread *curr = _list.first(); curr; curr = curr->next()) {
|
||||
@@ -89,12 +89,6 @@ Platform_thread::~Platform_thread()
|
||||
}
|
||||
|
||||
|
||||
void Platform_thread::cancel_blocking()
|
||||
{
|
||||
lx_tgkill(_pid, _tid, LX_SIGUSR1);
|
||||
}
|
||||
|
||||
|
||||
void Platform_thread::pause()
|
||||
{
|
||||
warning(__func__, "not implemented");
|
||||
|
||||
@@ -69,6 +69,3 @@ void Thread::start()
|
||||
native_thread().tid = lx_create_thread(Thread::_thread_start, stack_top(), this);
|
||||
native_thread().pid = lx_getpid();
|
||||
}
|
||||
|
||||
|
||||
void Thread::cancel_blocking() { }
|
||||
|
||||
@@ -61,12 +61,12 @@ static bool is_sub_rm_session(Dataspace_capability ds)
|
||||
|
||||
|
||||
/**
|
||||
* Lock for protecting mmap/unmap sequences and region-map meta data
|
||||
* Mutex for protecting mmap/unmap sequences and region-map meta data
|
||||
*/
|
||||
static Lock &lock()
|
||||
static Mutex &mutex()
|
||||
{
|
||||
static Lock lock;
|
||||
return lock;
|
||||
static Mutex mutex { };
|
||||
return mutex;
|
||||
}
|
||||
|
||||
|
||||
@@ -175,7 +175,7 @@ Region_map::Local_addr Region_map_mmap::attach(Dataspace_capability ds,
|
||||
Region_map::Local_addr local_addr,
|
||||
bool executable, bool writeable)
|
||||
{
|
||||
Lock::Guard lock_guard(lock());
|
||||
Mutex::Guard mutex_guard(mutex());
|
||||
|
||||
/* only support attach_at for sub RM sessions */
|
||||
if (_sub_rm && !use_local_addr) {
|
||||
@@ -320,7 +320,7 @@ Region_map::Local_addr Region_map_mmap::attach(Dataspace_capability ds,
|
||||
|
||||
void Region_map_mmap::detach(Region_map::Local_addr local_addr)
|
||||
{
|
||||
Lock::Guard lock_guard(lock());
|
||||
Mutex::Guard mutex_guard(mutex());
|
||||
|
||||
/*
|
||||
* Cases
|
||||
|
||||
@@ -166,9 +166,3 @@ void Thread::start()
|
||||
/* wait until the 'thread_start' function got entered */
|
||||
startup_lock().block();
|
||||
}
|
||||
|
||||
|
||||
void Thread::cancel_blocking()
|
||||
{
|
||||
Cpu_thread_client(_thread_cap).cancel_blocking();
|
||||
}
|
||||
|
||||
@@ -531,14 +531,6 @@ Thread::Thread(Env &env, Name const &name, size_t stack_size)
|
||||
: Thread(env, name, stack_size, Location(), Weight(), env.cpu()) { }
|
||||
|
||||
|
||||
void Thread::cancel_blocking()
|
||||
{
|
||||
/*
|
||||
* XXX implement interaction with CPU session
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
Thread::~Thread()
|
||||
{
|
||||
bool const needs_join = (pthread_cancel(native_thread().meta_data->pt) == 0);
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -352,6 +352,11 @@ inline int lx_sigaction(int signum, void (*handler)(int), bool altstack)
|
||||
struct kernel_sigaction act;
|
||||
act.handler = handler;
|
||||
|
||||
/*
|
||||
* System calls should be restarted on signal occurrence and not return
|
||||
* with EINTR. We therefore set the SA_RESTART flag in signal handlers.
|
||||
*/
|
||||
|
||||
#ifdef _LP64
|
||||
/*
|
||||
* The SA_RESTORER flag is not officially documented, but used internally
|
||||
@@ -360,10 +365,10 @@ inline int lx_sigaction(int signum, void (*handler)(int), bool altstack)
|
||||
* when leaving the signal handler and it should call the rt_sigreturn syscall.
|
||||
*/
|
||||
enum { SA_RESTORER = 0x04000000 };
|
||||
act.flags = SA_RESTORER;
|
||||
act.flags = SA_RESTORER | SA_RESTART;
|
||||
act.restorer = lx_restore_rt;
|
||||
#else
|
||||
act.flags = 0;
|
||||
act.flags = SA_RESTART;
|
||||
act.restorer = 0;
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1,82 +0,0 @@
|
||||
/*
|
||||
* \brief Client-side CPU thread interface
|
||||
* \author Norman Feske
|
||||
* \date 2016-05-10
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2016-2017 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
*/
|
||||
|
||||
#ifndef _INCLUDE__CPU_THREAD__CLIENT_H_
|
||||
#define _INCLUDE__CPU_THREAD__CLIENT_H_
|
||||
|
||||
#include <cpu_thread/cpu_thread.h>
|
||||
#include <base/rpc_client.h>
|
||||
|
||||
namespace Genode { struct Cpu_thread_client; }
|
||||
|
||||
|
||||
struct Genode::Cpu_thread_client : Rpc_client<Cpu_thread>
|
||||
{
|
||||
explicit Cpu_thread_client(Thread_capability cap)
|
||||
: Rpc_client<Cpu_thread>(cap) { }
|
||||
|
||||
Dataspace_capability utcb() override {
|
||||
return call<Rpc_utcb>(); }
|
||||
|
||||
void start(addr_t ip, addr_t sp) override {
|
||||
call<Rpc_start>(ip, sp); }
|
||||
|
||||
void pause() override {
|
||||
|
||||
for (;;) {
|
||||
|
||||
call<Rpc_pause>();
|
||||
|
||||
try {
|
||||
/* check if the thread state is valid */
|
||||
state();
|
||||
/* the thread is paused */
|
||||
return;
|
||||
} catch (State_access_failed) {
|
||||
/* the thread is (most likely) running on a different CPU */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void resume() override {
|
||||
call<Rpc_resume>(); }
|
||||
|
||||
void cancel_blocking() override {
|
||||
call<Rpc_cancel_blocking>(); }
|
||||
|
||||
Thread_state state() override {
|
||||
return call<Rpc_get_state>(); }
|
||||
|
||||
void state(Thread_state const &state) override {
|
||||
call<Rpc_set_state>(state); }
|
||||
|
||||
void exception_sigh(Signal_context_capability handler) override {
|
||||
call<Rpc_exception_sigh>(handler); }
|
||||
|
||||
void single_step(bool enabled) override {
|
||||
call<Rpc_single_step>(enabled); }
|
||||
|
||||
void affinity(Affinity::Location location) override {
|
||||
call<Rpc_affinity>(location); }
|
||||
|
||||
unsigned trace_control_index() override {
|
||||
return call<Rpc_trace_control_index>(); }
|
||||
|
||||
Dataspace_capability trace_buffer() override {
|
||||
return call<Rpc_trace_buffer>(); }
|
||||
|
||||
Dataspace_capability trace_policy() override {
|
||||
return call<Rpc_trace_policy>(); }
|
||||
};
|
||||
|
||||
#endif /* _INCLUDE__CPU_THREAD__CLIENT_H_ */
|
||||
@@ -30,7 +30,6 @@ struct Genode::Native_thread
|
||||
|
||||
addr_t ec_sel { 0 }; /* selector for execution context */
|
||||
addr_t exc_pt_sel { 0 }; /* base of event portal window */
|
||||
bool vcpu { false }; /* true if thread is a virtual CPU */
|
||||
addr_t initial_ip { 0 }; /* initial IP of local thread */
|
||||
|
||||
/* receive window for capability selectors received at the server side */
|
||||
@@ -56,7 +55,6 @@ struct Genode::Native_thread
|
||||
|
||||
Native_thread() : ec_sel(INVALID_INDEX),
|
||||
exc_pt_sel(INVALID_INDEX),
|
||||
vcpu(false),
|
||||
initial_ip(0) { }
|
||||
};
|
||||
|
||||
|
||||
@@ -756,6 +756,7 @@ namespace Nova {
|
||||
PT_SEL_PARENT = 0x1a, /* convention on Genode */
|
||||
PT_SEL_MAIN_EC = 0x1c, /* convention on Genode */
|
||||
PT_SEL_STARTUP = 0x1e,
|
||||
SM_SEL_SIGNAL = 0x1e, /* alias of PT_SEL_STARTUP */
|
||||
PT_SEL_RECALL = 0x1f,
|
||||
SM_SEL_EC = 0x1d, /* convention on Genode */
|
||||
};
|
||||
|
||||
@@ -1 +1 @@
|
||||
2020-04-16 683d36c7e7fda9814c885cc0af3d3f0194c238b8
|
||||
2020-08-24 a9b37956ae35d240a5386c00db3086dd4c1c05f2
|
||||
|
||||
@@ -1 +1 @@
|
||||
2020-05-26 7a01a2d221cdac3c84365d43982503bd9bf7d2fc
|
||||
2020-08-27 373d79474bb7cbfd90f7e07d831051f8179883e3
|
||||
|
||||
@@ -256,12 +256,6 @@ namespace Genode {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cancel blocking in a lock so that recall exception can take
|
||||
* place.
|
||||
*/
|
||||
void client_cancel_blocking();
|
||||
|
||||
uint8_t client_recall(bool get_state_and_block);
|
||||
void client_set_ec(addr_t ec) { _state.sel_client_ec = ec; }
|
||||
|
||||
|
||||
@@ -123,11 +123,6 @@ namespace Genode {
|
||||
*/
|
||||
void resume();
|
||||
|
||||
/**
|
||||
* Cancel currently blocking operation
|
||||
*/
|
||||
void cancel_blocking();
|
||||
|
||||
/**
|
||||
* Override thread state with 's'
|
||||
*
|
||||
|
||||
@@ -450,21 +450,6 @@ void Pager_object::wake_up()
|
||||
}
|
||||
|
||||
|
||||
void Pager_object::client_cancel_blocking()
|
||||
{
|
||||
uint8_t res = sm_ctrl(exc_pt_sel_client() + SM_SEL_EC, SEMAPHORE_UP);
|
||||
if (res != NOVA_OK)
|
||||
warning("canceling blocked client failed (thread sm)");
|
||||
|
||||
if (!_state.has_signal_sm())
|
||||
return;
|
||||
|
||||
res = sm_ctrl(exc_pt_sel_client() + PT_SEL_STARTUP, SEMAPHORE_UP);
|
||||
if (res != NOVA_OK)
|
||||
warning("canceling blocked client failed (signal sm)");
|
||||
}
|
||||
|
||||
|
||||
uint8_t Pager_object::client_recall(bool get_state_and_block)
|
||||
{
|
||||
Mutex::Guard _state_lock_guard(_state_lock);
|
||||
|
||||
@@ -108,3 +108,8 @@ void Pd_session_component::map(addr_t virt, addr_t size)
|
||||
error(__func__, " failed ", Hex(virt), "+", Hex(size));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
using State = Genode::Pd_session::Managing_system_state;
|
||||
|
||||
State Pd_session_component::managing_system(State const &) { return State(); }
|
||||
|
||||
@@ -121,11 +121,7 @@ int Platform_thread::start(void *ip, void *sp)
|
||||
return -4;
|
||||
}
|
||||
|
||||
if (vcpu()) {
|
||||
if (!remote_pd())
|
||||
res = map_pagefault_portal(*_pager, _pager->exc_pt_sel_client(),
|
||||
_sel_exc_base, _pd->pd_sel(), utcb);
|
||||
} else
|
||||
if (!vcpu())
|
||||
res = map_thread_portals(*_pager, _sel_exc_base, utcb);
|
||||
|
||||
if (res != NOVA_OK) {
|
||||
@@ -278,14 +274,6 @@ void Platform_thread::state(Thread_state s)
|
||||
}
|
||||
|
||||
|
||||
void Platform_thread::cancel_blocking()
|
||||
{
|
||||
if (!_pager) return;
|
||||
|
||||
_pager->client_cancel_blocking();
|
||||
}
|
||||
|
||||
|
||||
void Platform_thread::single_step(bool on)
|
||||
{
|
||||
if (!_pager) return;
|
||||
|
||||
@@ -150,12 +150,3 @@ void Thread::start()
|
||||
new (platform().core_mem_alloc())
|
||||
Core_trace_source(Trace::sources(), *this);
|
||||
}
|
||||
|
||||
|
||||
void Thread::cancel_blocking()
|
||||
{
|
||||
using namespace Nova;
|
||||
|
||||
if (sm_ctrl(native_thread().exc_pt_sel + SM_SEL_EC, SEMAPHORE_UP))
|
||||
nova_die();
|
||||
}
|
||||
|
||||
@@ -54,9 +54,10 @@ namespace Genode {
|
||||
{
|
||||
/* request mapping of semaphore capability selector */
|
||||
Thread * myself = Thread::myself();
|
||||
request_signal_sm_cap(myself->native_thread().exc_pt_sel + Nova::PT_SEL_PAGE_FAULT,
|
||||
myself->native_thread().exc_pt_sel + Nova::PT_SEL_STARTUP);
|
||||
_sem = Capability_space::import(myself->native_thread().exc_pt_sel + Nova::PT_SEL_STARTUP);
|
||||
auto const &exc_base = myself->native_thread().exc_pt_sel;
|
||||
request_signal_sm_cap(exc_base + Nova::PT_SEL_PAGE_FAULT,
|
||||
exc_base + Nova::SM_SEL_SIGNAL);
|
||||
_sem = Capability_space::import(exc_base + Nova::SM_SEL_SIGNAL);
|
||||
call<Rpc_register_semaphore>(_sem);
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ Untyped_capability Rpc_entrypoint::_manage(Rpc_object_base *obj)
|
||||
}
|
||||
|
||||
static void cleanup_call(Rpc_object_base *obj, Nova::Utcb * ep_utcb,
|
||||
Native_capability &cap, Genode::Blockade &delay_start)
|
||||
Native_capability &cap)
|
||||
{
|
||||
|
||||
/* effectively invalidate the capability used before */
|
||||
@@ -84,9 +84,6 @@ static void cleanup_call(Rpc_object_base *obj, Nova::Utcb * ep_utcb,
|
||||
if (utcb == ep_utcb)
|
||||
return;
|
||||
|
||||
/* activate entrypoint now - otherwise cleanup call will block forever */
|
||||
delay_start.wakeup();
|
||||
|
||||
/* make a IPC to ensure that cap() identifier is not used anymore */
|
||||
utcb->msg()[0] = 0xdead;
|
||||
utcb->set_msg_word(1);
|
||||
@@ -109,8 +106,7 @@ void Rpc_entrypoint::_dissolve(Rpc_object_base *obj)
|
||||
/* make sure nobody is able to find this object */
|
||||
remove(obj);
|
||||
|
||||
cleanup_call(obj, reinterpret_cast<Nova::Utcb *>(this->utcb()), _cap,
|
||||
_delay_start);
|
||||
cleanup_call(obj, reinterpret_cast<Nova::Utcb *>(this->utcb()), _cap);
|
||||
}
|
||||
|
||||
static void reply(Nova::Utcb &utcb, Rpc_exception_code exc, Msgbuf_base &snd_msg)
|
||||
@@ -160,11 +156,6 @@ void Rpc_entrypoint::_activation_entry()
|
||||
reply(utcb, exc, ep._snd_buf);
|
||||
}
|
||||
|
||||
/* delay start */
|
||||
ep._delay_start.block();
|
||||
/* XXX inadequate usage of Blockade here is planned to be removed, see #3612 */
|
||||
ep._delay_start.wakeup();
|
||||
|
||||
/* atomically lookup and lock referenced object */
|
||||
auto lambda = [&] (Rpc_object_base *obj) {
|
||||
if (!obj) {
|
||||
@@ -198,20 +189,6 @@ void Rpc_entrypoint::entry()
|
||||
void Rpc_entrypoint::_block_until_cap_valid() { }
|
||||
|
||||
|
||||
void Rpc_entrypoint::activate()
|
||||
{
|
||||
/*
|
||||
* In contrast to a normal thread, a server activation is created at
|
||||
* construction time. However, it executes no code because processing
|
||||
* time is always provided by the caller of the server activation. To
|
||||
* delay the processing of requests until the 'activate' function is
|
||||
* called, we grab the '_delay_start' lock on construction and release it
|
||||
* here.
|
||||
*/
|
||||
_delay_start.wakeup();
|
||||
}
|
||||
|
||||
|
||||
bool Rpc_entrypoint::is_myself() const
|
||||
{
|
||||
return (Thread::myself() == this);
|
||||
@@ -219,8 +196,7 @@ bool Rpc_entrypoint::is_myself() const
|
||||
|
||||
|
||||
Rpc_entrypoint::Rpc_entrypoint(Pd_session *pd_session, size_t stack_size,
|
||||
const char *name, bool start_on_construction,
|
||||
Affinity::Location location)
|
||||
const char *name, Affinity::Location location)
|
||||
:
|
||||
Thread(Cpu_session::Weight::DEFAULT_WEIGHT, name, stack_size, location),
|
||||
_pd_session(*pd_session)
|
||||
@@ -246,9 +222,6 @@ Rpc_entrypoint::Rpc_entrypoint(Pd_session *pd_session, size_t stack_size,
|
||||
/* prepare portal receive window of new thread */
|
||||
if (!rcv_window.prepare_rcv_window(*(Nova::Utcb *)&_stack->utcb()))
|
||||
throw Cpu_session::Thread_creation_failed();
|
||||
|
||||
if (start_on_construction)
|
||||
activate();
|
||||
}
|
||||
|
||||
|
||||
@@ -269,8 +242,7 @@ Rpc_entrypoint::~Rpc_entrypoint()
|
||||
/* avoid any incoming IPC */
|
||||
Nova::revoke(Nova::Obj_crd(obj->cap().local_name(), 0), true);
|
||||
|
||||
cleanup_call(obj, reinterpret_cast<Nova::Utcb *>(this->utcb()), _cap,
|
||||
_delay_start);
|
||||
cleanup_call(obj, reinterpret_cast<Nova::Utcb *>(this->utcb()), _cap);
|
||||
});
|
||||
|
||||
if (!_cap.valid())
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/sleep.h>
|
||||
#include <base/lock.h>
|
||||
|
||||
/* base-internal includes */
|
||||
#include <base/internal/native_thread.h>
|
||||
|
||||
@@ -154,9 +154,7 @@ void Thread::start()
|
||||
try {
|
||||
Nova_native_cpu::Thread_type thread_type;
|
||||
|
||||
if (native_thread().vcpu)
|
||||
thread_type = Nova_native_cpu::Thread_type::VCPU;
|
||||
else if (global)
|
||||
if (global)
|
||||
thread_type = Nova_native_cpu::Thread_type::GLOBAL;
|
||||
else
|
||||
thread_type = Nova_native_cpu::Thread_type::LOCAL;
|
||||
@@ -187,23 +185,12 @@ void Thread::start()
|
||||
|
||||
using namespace Nova;
|
||||
|
||||
if (!native_thread().vcpu) {
|
||||
/* default: we don't accept any mappings or translations */
|
||||
Utcb * utcb_obj = reinterpret_cast<Utcb *>(utcb());
|
||||
utcb_obj->crd_rcv = Obj_crd();
|
||||
utcb_obj->crd_xlt = Obj_crd();
|
||||
}
|
||||
/* default: we don't accept any mappings or translations */
|
||||
Utcb * utcb_obj = reinterpret_cast<Utcb *>(utcb());
|
||||
utcb_obj->crd_rcv = Obj_crd();
|
||||
utcb_obj->crd_xlt = Obj_crd();
|
||||
|
||||
if (global)
|
||||
/* request creation of SC to let thread run*/
|
||||
cpu_thread.resume();
|
||||
}
|
||||
|
||||
|
||||
void Thread::cancel_blocking()
|
||||
{
|
||||
using namespace Nova;
|
||||
|
||||
if (sm_ctrl(native_thread().exc_pt_sel + SM_SEL_EC, SEMAPHORE_UP))
|
||||
nova_die();
|
||||
}
|
||||
|
||||
@@ -41,7 +41,8 @@ using namespace Genode;
|
||||
void test_translate(Genode::Env &env)
|
||||
{
|
||||
enum { STACK_SIZE = 4096 };
|
||||
static Rpc_entrypoint ep(&env.pd(), STACK_SIZE, "rpc_ep_translate");
|
||||
static Rpc_entrypoint ep(&env.pd(), STACK_SIZE, "rpc_ep_translate",
|
||||
Affinity::Location());
|
||||
|
||||
Test::Component component;
|
||||
Test::Capability session_cap = ep.manage(&component);
|
||||
@@ -136,7 +137,8 @@ void test_translate(Genode::Env &env)
|
||||
void test_revoke(Genode::Env &env)
|
||||
{
|
||||
enum { STACK_SIZE = 4096 };
|
||||
static Rpc_entrypoint ep(&env.pd(), STACK_SIZE, "rpc_ep_revoke");
|
||||
static Rpc_entrypoint ep(&env.pd(), STACK_SIZE, "rpc_ep_revoke",
|
||||
Affinity::Location());
|
||||
|
||||
Test::Component component;
|
||||
Test::Capability session_cap = ep.manage(&component);
|
||||
@@ -304,7 +306,8 @@ void test_pat(Genode::Env &env)
|
||||
|
||||
enum { STACK_SIZE = 4096 };
|
||||
|
||||
static Rpc_entrypoint ep(&env.pd(), STACK_SIZE, "rpc_ep_pat");
|
||||
static Rpc_entrypoint ep(&env.pd(), STACK_SIZE, "rpc_ep_pat",
|
||||
Affinity::Location());
|
||||
|
||||
Genode::Rm_connection rm(env);
|
||||
Genode::Region_map_client rm_free_area(rm.create(1 << (DS_ORDER + PAGE_4K)));
|
||||
@@ -381,7 +384,8 @@ void test_server_oom(Genode::Env &env)
|
||||
|
||||
enum { STACK_SIZE = 4096 };
|
||||
|
||||
static Rpc_entrypoint ep(&env.pd(), STACK_SIZE, "rpc_ep_oom");
|
||||
static Rpc_entrypoint ep(&env.pd(), STACK_SIZE, "rpc_ep_oom",
|
||||
Affinity::Location());
|
||||
|
||||
Test::Component component;
|
||||
Test::Capability session_cap = ep.manage(&component);
|
||||
|
||||
@@ -28,7 +28,7 @@ void Timer::Time_source::schedule_timeout(Microseconds duration,
|
||||
Threaded_time_source::handler(handler);
|
||||
|
||||
/* check whether to cancel last timeout */
|
||||
if (duration.value == 0 && _sem != ~0UL) {
|
||||
if (duration.value == 0 && _sem) {
|
||||
uint8_t res = Nova::sm_ctrl(_sem, Nova::SEMAPHORE_UP);
|
||||
if (res != Nova::NOVA_OK)
|
||||
nova_die();
|
||||
@@ -40,10 +40,14 @@ void Timer::Time_source::schedule_timeout(Microseconds duration,
|
||||
|
||||
void Timer::Time_source::_wait_for_irq()
|
||||
{
|
||||
if (_sem == ~0UL) {
|
||||
_sem = Thread::native_thread().exc_pt_sel + SM_SEL_EC; }
|
||||
if (!_sem) {
|
||||
/* initialize first time in context of running thread */
|
||||
auto const &exc_base = Thread::native_thread().exc_pt_sel;
|
||||
request_signal_sm_cap(exc_base + Nova::PT_SEL_PAGE_FAULT,
|
||||
exc_base + Nova::SM_SEL_SIGNAL);
|
||||
|
||||
addr_t sem = _sem;
|
||||
_sem = Thread::native_thread().exc_pt_sel + SM_SEL_SIGNAL;
|
||||
}
|
||||
|
||||
/* calculate absolute timeout */
|
||||
Trace::Timestamp now = Trace::timestamp();
|
||||
@@ -52,7 +56,7 @@ void Timer::Time_source::_wait_for_irq()
|
||||
if (_timeout_us == max_timeout().value) {
|
||||
|
||||
/* tsc_absolute == 0 means blocking without timeout */
|
||||
uint8_t res = sm_ctrl(sem, SEMAPHORE_DOWN, 0);
|
||||
uint8_t res = sm_ctrl(_sem, SEMAPHORE_DOWN, 0);
|
||||
if (res != Nova::NOVA_OK && res != Nova::NOVA_TIMEOUT) {
|
||||
nova_die(); }
|
||||
|
||||
@@ -60,7 +64,7 @@ void Timer::Time_source::_wait_for_irq()
|
||||
|
||||
/* block until timeout fires or it gets canceled */
|
||||
unsigned long long tsc_absolute = now + us_64 * (_tsc_khz / TSC_FACTOR);
|
||||
uint8_t res = sm_ctrl(sem, SEMAPHORE_DOWN, tsc_absolute);
|
||||
uint8_t res = sm_ctrl(_sem, SEMAPHORE_DOWN, tsc_absolute);
|
||||
if (res != Nova::NOVA_OK && res != Nova::NOVA_TIMEOUT) {
|
||||
nova_die(); }
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ class Timer::Time_source : public Threaded_time_source
|
||||
return 1000*1000;
|
||||
}
|
||||
|
||||
Genode::addr_t _sem { ~0UL };
|
||||
Genode::addr_t _sem { 0 };
|
||||
uint64_t _timeout_us { 0 };
|
||||
unsigned long const _tsc_khz;
|
||||
Duration _curr_time { Microseconds(0) };
|
||||
|
||||
@@ -1 +1 @@
|
||||
2020-05-26 e993f14464de8fbf6c323abd46a2bf5ae3293350
|
||||
2020-08-27 88c9dc62c2e6807949ef2a50579e816eb13b8b47
|
||||
|
||||
@@ -99,11 +99,6 @@ namespace Genode {
|
||||
*/
|
||||
void resume();
|
||||
|
||||
/**
|
||||
* Cancel currently blocking operation
|
||||
*/
|
||||
void cancel_blocking();
|
||||
|
||||
/**
|
||||
* This thread is about to be bound
|
||||
*
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
#define _CORE__INCLUDE__RPC_CAP_FACTORY_H_
|
||||
|
||||
#include <base/allocator.h>
|
||||
#include <base/lock.h>
|
||||
#include <base/capability.h>
|
||||
|
||||
namespace Genode { class Rpc_cap_factory; }
|
||||
|
||||
@@ -143,27 +143,6 @@ void Platform_thread::unbind()
|
||||
}
|
||||
|
||||
|
||||
void Platform_thread::cancel_blocking()
|
||||
{
|
||||
L4_Word_t dummy;
|
||||
L4_ThreadId_t dummy_tid;
|
||||
|
||||
/*
|
||||
* For more details, please refer to the corresponding implementation in
|
||||
* the 'base-pistachio' repository.
|
||||
*/
|
||||
|
||||
/* reset value for the thread's user-defined handle */
|
||||
enum { USER_DEFINED_HANDLE_ZERO = 0 };
|
||||
|
||||
L4_ExchangeRegisters(_l4_thread_id,
|
||||
L4_ExReg_Resume | L4_ExReg_AbortOperation | L4_ExReg_user,
|
||||
0, 0, 0, USER_DEFINED_HANDLE_ZERO, L4_nilthread,
|
||||
&dummy, &dummy, &dummy, &dummy, &dummy,
|
||||
&dummy_tid);
|
||||
}
|
||||
|
||||
|
||||
unsigned long Platform_thread::pager_object_badge() const
|
||||
{
|
||||
return native_thread_id().raw;
|
||||
|
||||
@@ -46,14 +46,6 @@ void Thread::start()
|
||||
}
|
||||
|
||||
|
||||
void Thread::cancel_blocking()
|
||||
{
|
||||
/*
|
||||
* Within core, we never need to unblock threads
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
void Thread::_deinit_platform_thread()
|
||||
{
|
||||
/* destruct platform thread */
|
||||
|
||||
@@ -1 +1 @@
|
||||
2020-05-26 400790ad40990b8e63d6c127fe101b1335745088
|
||||
2020-08-27 cfc53eb210b12066011577e91fb98c36c3321296
|
||||
|
||||
@@ -115,11 +115,6 @@ namespace Genode {
|
||||
*/
|
||||
void resume();
|
||||
|
||||
/**
|
||||
* Cancel currently blocking operation
|
||||
*/
|
||||
void cancel_blocking();
|
||||
|
||||
/**
|
||||
* This thread is about to be bound
|
||||
*
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
#define _CORE__INCLUDE__RPC_CAP_FACTORY_H_
|
||||
|
||||
#include <base/allocator.h>
|
||||
#include <base/lock.h>
|
||||
#include <base/capability.h>
|
||||
|
||||
namespace Genode { class Rpc_cap_factory; }
|
||||
|
||||
@@ -189,40 +189,6 @@ Thread_state Platform_thread::state()
|
||||
}
|
||||
|
||||
|
||||
void Platform_thread::cancel_blocking()
|
||||
{
|
||||
L4_Word_t dummy;
|
||||
L4_ThreadId_t dummy_tid;
|
||||
|
||||
/*
|
||||
* XXX: This implementation is not safe because it only cancels
|
||||
* a currently executed blocking operation but it has no
|
||||
* effect when the thread is executing user code and going
|
||||
* to block soon. To solve this issue, we would need signalling
|
||||
* semantics, which means that we flag the thread to being
|
||||
* canceled the next time it enters the kernel.
|
||||
*/
|
||||
|
||||
/* control flags for 'L4_ExchangeRegisters' */
|
||||
enum {
|
||||
CANCEL_SEND = 1 << 2,
|
||||
CANCEL_RECV = 1 << 1,
|
||||
CANCEL_IPC = CANCEL_SEND | CANCEL_RECV,
|
||||
USER_DEFINED_HANDLE = 1 << 6,
|
||||
RESUME = 1 << 8,
|
||||
};
|
||||
|
||||
/* reset value for the thread's user-defined handle */
|
||||
enum { USER_DEFINED_HANDLE_ZERO = 0 };
|
||||
|
||||
L4_ExchangeRegisters(_l4_thread_id,
|
||||
CANCEL_IPC | RESUME | USER_DEFINED_HANDLE,
|
||||
0, 0, 0, USER_DEFINED_HANDLE_ZERO, L4_nilthread,
|
||||
&dummy, &dummy, &dummy, &dummy, &dummy,
|
||||
&dummy_tid);
|
||||
}
|
||||
|
||||
|
||||
Platform_thread::~Platform_thread()
|
||||
{
|
||||
/*
|
||||
|
||||
@@ -49,14 +49,6 @@ void Thread::start()
|
||||
}
|
||||
|
||||
|
||||
void Thread::cancel_blocking()
|
||||
{
|
||||
/*
|
||||
* Within core, we never need to unblock threads
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
void Thread::_deinit_platform_thread()
|
||||
{
|
||||
/* destruct platform thread */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
PLAT := imx6
|
||||
CPU := cortex-a9
|
||||
BOARD := imx6q_sabrelite
|
||||
override BOARD := imx6q_sabrelite
|
||||
|
||||
-include $(REP_DIR)/lib/mk/spec/arm/kernel-sel4.inc
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
PLAT := imx7
|
||||
CPU := cortex-a7
|
||||
BOARD := imx7d_sabre
|
||||
override BOARD := imx7d_sabre
|
||||
|
||||
-include $(REP_DIR)/lib/mk/spec/arm/kernel-sel4.inc
|
||||
|
||||
@@ -1 +1 @@
|
||||
2020-05-26 4c7056512ae89ceeae21953885b41a4fb31a09fb
|
||||
2020-08-27 ba8102f78bf528ab88c9342706159ca00b646212
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user