Commit Graph

665 Commits

Author SHA1 Message Date
Norman Feske
58f44d39c5 base: use 'Ram_quota' in 'Ram_session' args
This patch replaces the former use of size_t with the use of the
'Ram_quota' type to improve type safety (in particular to avoid
accidentally mixing up RAM quotas with cap quotas).

Issue #2398
2017-05-31 13:16:04 +02:00
Norman Feske
ff68d77c7d base: new 'Ram_allocator' interface
The 'Ram_allocator' interface contains the subset of the RAM session
interface that is needed to satisfy the needs of the 'Heap' and
'Sliced_heap'. Its small size makes it ideal for intercepting memory
allocations as done by the new 'Constrained_ram_allocator' wrapper
class, which is meant to replace the existing 'base/allocator_guard.h'
and 'os/ram_session_guard.h'.

Issue #2398
2017-05-31 13:16:04 +02:00
Norman Feske
5a468919bb base: new session-creation helper types
This patch augments the existing session/session.h with useful types for
the session creation:

* The new 'Insufficient_ram_quota' and 'Insufficient_cap_quota'
  exceptions are meant to supersede the old 'Quota_exceeded' exception
  of the 'Parent' and 'Root' interfaces.

* The 'Session::Resources' struct subsumes the information about the
  session quota provided by the client.

* The boolean 'Session::Diag' type will allow sessions to operate in a
  diagnostic mode.

* The existing 'Session_label' is not also available under the alias
  'Session::Label'.

* A few helper functions ease the extraction of typed session arguments
  from the session-argument string.

Issue #2398
2017-05-31 13:16:04 +02:00
Norman Feske
c1b981ede4 Annotate session interfaces with CAP_QUOTA
The new 'CAP_QUOTA' enum value denotes the capability quota to be
transferred from the client to the server at session-creation time.

Issue #2398
2017-05-31 13:16:04 +02:00
Emery Hemingway
f7d80a9bf9 drivers/ahci: clean exit when no controllers are found
Fix #2402
2017-05-31 13:16:02 +02:00
Christian Helmuth
1828f70037 Fix deprecated warnings in servers
Issue #1987
2017-05-31 13:16:02 +02:00
Emery Hemingway
24a9537a27 File_system: replace per-handle signals with notification packets
Replace registration and signaling of per-handle signal capabilities
with CONTENT_CHANGED notification packets.

Fix #2397
2017-05-31 13:16:01 +02:00
Emery Hemingway
29b3fff5eb app/rom_to_file: catch Node_already_exists and overwrite files
Ref #1934
2017-05-31 13:16:01 +02:00
Stefan Kalkowski
6106e64aac base: remove include/spec/* other than ISA
This commit moves the headers residing in `repos/base/include/spec/*/drivers`
to `repos/base/include/drivers/defs` or repos/base/include/drivers/uart`
respectively. The first one contains definitions about board-specific MMIO
iand RAM addresses, or IRQ lines. While the latter contains device driver
code for UART devices. Those definitions are used by driver implementations
in `repos/base-hw`, `repos/os`, and `repos/dde-linux`, which now need to
include them more explicitely.

This work is a step in the direction of reducing 'SPEC' identifiers overall.

Ref #2403
2017-05-31 13:16:01 +02:00
Christian Helmuth
1d99e7ede9 base: classify signals as I/O and application level
Fixes #2363
2017-05-31 13:15:58 +02:00
Alexander Boettcher
3f5c1b3626 top: fix replacement strategy
Issue #2307
2017-05-31 13:15:57 +02:00
Norman Feske
9a6c194432 init: fix constness-related warnings by gcc 6.3
Fixes #2374
2017-05-31 13:15:57 +02:00
Alexander Boettcher
1220a06c3b platform_drv: avoid gcc 6 warnings 2017-05-31 13:15:55 +02:00
Norman Feske
7729398105 ps2_drv: reset mouse at startup
This patch replaces the set-defaults command by a reset command, which
is needed to use the Lenovo x250 trackpoint. (original patch by
Christian Prochaska)
2017-05-31 13:15:54 +02:00
Christian Helmuth
7680d20686 Re-enable usb_block test 2017-05-31 13:15:54 +02:00
Alexander Boettcher
7005e54de2 nova: fix syscall bindings with GCC 6
Fixes #2377
2017-05-31 13:15:52 +02:00
Norman Feske
8e7aa54493 base: drop session states of vanished clients
For asynchronously provided sessions, the parent has to maintain the
session state as long as the server hasn't explicitly responded to a
close request. For this reason, the lifetime of such session states is
bound to the server, not the client.

When the server responds to a close request, the session state gets
freed. The 'session_response' implementation does not immediately
destroy the session state but delegates the destruction to a client-side
callback, which thereby also notifies the client. However, the code did
not consider the case where the client has completely vanished at
session-response time. In this case, we need to drop the session state
immediately.

Fixes #2391
2017-05-31 13:15:52 +02:00
Christian Helmuth
117a533828 rom_filter: fix compilation with GCC 6
Issue #2372
2017-05-31 13:15:52 +02:00
Martin Stein
64fb2865b0 nic_router: fix compile error "flexible array ..."
Fixes #2384
2017-05-31 13:15:51 +02:00
Christian Prochaska
d23dd0cdb4 init: workaround for GCC 6 compile errors
Issue #2374
2017-05-31 13:15:50 +02:00
Alexander Boettcher
e3e41e5ca0 ahci: avoid deprecated warnings
Issue #1987
2017-05-02 15:29:03 +02:00
Christian Helmuth
f9bb88cd2e Disable scan-code translation in PS/2 on ARM PL050
This enables to run the driver on recent Qemu versions.
2017-05-02 15:29:02 +02:00
Christian Helmuth
67f22a6c90 Fix key count in input test 2017-05-02 15:29:02 +02:00
Christian Helmuth
e49bb4943e Deprecate policy constructor with implicit config
because it uses the deprecated config library.

Issue #1987
2017-05-02 15:29:02 +02:00
Emery Hemingway
dde11de008 Unify client policy across File_system servers
File_system servers shall deny clients not matching a defined policy.
Servers shall also apply session root offset policy followed by a client
offset.

Fix #2365
2017-05-02 15:28:57 +02:00
Christian Helmuth
f96b5b89f2 Fix more deprecated warnings
Issue #1987
2017-05-02 15:28:55 +02:00
Norman Feske
539d976a9a init: fix routing to child with multiple services
Init's service forwarding functionality did not take the service type
into account when forwarding a session request. If a server provides
multiple services, e.g. fb_sdl that provides both "Input" and
"Framebuffer", the type of the forwarded session request did not always
correspond to the actually requested type.
2017-05-02 15:28:54 +02:00
Emery Hemingway
0d488925ee server/rom_filter: generate top-level attributes
Conditionally inject attributes on the output XML node with
``<attribute name="..." value="..."``

Fix #2348
2017-05-02 15:28:48 +02:00
Christian Helmuth
d18f976b15 nitpicker: strictly type command processing 2017-03-27 12:35:23 +02:00
Christian Helmuth
b35df4578b Check Registered base class provides virtual destructor
The base class of Registered must provide a virtual destructor to enable
safe deletion with just a base class pointer. This requirement can be
lifted by using Registered_no_delete in places where the deletion
property is not needed.

Fixes #2331
2017-03-24 16:20:04 +01:00
Christian Helmuth
cb43e04691 ldso: defer execution of static constructors
Ldso now does not automatically execute static constructors of the
binary and shared libraries the binary depends on. If static
construction is required (e.g., if a shared library with constructor is
used or a compilation unit contains global statics) the component needs
to execute the constructors explicitly in Component::construct() via
Genode::Env::exec_static_constructors().

In the case of libc components this is done by the libc startup code
(i.e., the Component::construct() implementation in the libc).

The loading of shared objects at runtime is not affected by this change
and constructors of those objects are executed immediately.

Fixes #2332
2017-03-24 16:20:04 +01:00
Christian Helmuth
88db3c0df7 Fix some deprecated warnings
Issue #1987
2017-03-24 16:20:03 +01:00
Christian Helmuth
19703e6617 Remove deprecated Attached_mmio constructor 2017-03-24 16:20:01 +01:00
Norman Feske
8d68d3d8ac Adapt resource-request test to changes of init
The test used to rely on init's formerly built-in policy of answering
resource requests with slack memory, if available. Since init no longer
responds to resource requests in an autonomous way, we use a dynamically
configured sub-init instance as runtime for the test. This instance, in
turn, is monitored and controlled such that resource requests are
result in quota upgrades. The monitoring component is implemented in
the same test-resource_request program as the test. Both roles are
distinguished by the "role" config attribute.

This is a follow-up to "init: explicit response to resource requests".
2017-03-24 16:20:00 +01:00
Norman Feske
892043ed76 init: trigger report update on version change
If the version attribute of init's <config> is changes, trigger the
generation of a new state report that includes the information of the
new version.
2017-03-24 16:19:58 +01:00
Norman Feske
1fde4d638c init: service forwarding
This patch equips init with the ability to act as a server that forwards
session requests to its children. Session requests can be routed
depending of the requested service type and the session label
originating from init's parent.

The feature is configured by one or multiple <service> nodes hosted in
init's <config> node. The routing policy is selected by via the regular
server-side policy-selection mechanism, for example:

<config>
  ...
  <service name="LOG">
    <policy label="noux">
      <child name="terminal_log" label="important"/>
    </policy>
    <default-policy> <child name="nitlog"/> </default-policy>
  </service>
  ...
</config>

Each policy node must have a <child> sub node, which denotes name of the
server with the 'name' attribute. The optional 'label' attribute defines
the session label presented to the server, analogous to how the
rewriting of session labels works in session routes. If not specified,
the client-provided label is presented to the server as is.

Fixes #2247
2017-03-24 16:19:57 +01:00
Norman Feske
1489791d5e init: explicit response to resource requests
This patch removes the formerly built-in policy of responding to
resource requests with handing out slack quota. Instead, resource
requests have to be answered by an update of the init configuration with
adjusted quota values.

Note that this patch may break run scripts that depend on init's
original policy. Those run scripts may be adjusted by increasing the
quota for the components that use to inflate their RAM usage during
runtime such that the specified quota suffices for the entire lifetime
of the component.
2017-03-24 16:19:57 +01:00
Norman Feske
29c4ed45cc init: use Prio_levels type instead of basic type 2017-03-24 16:19:57 +01:00
Norman Feske
06943f413d init: respond to RAM-quota changes in config
This patch improves init's dynamic reconfigurability with respect to
adjustments of the RAM quota assigned to the children.

If the RAM quota is decreased, init withdraws as much quota from the
child's RAM session as possible. If the child's RAM session does not
have enough available quota, a resource-yield request is issued to
the child. Cooparative children may respond to such a request by
releasing memory.

If the RAM quota is increased, the child's RAM session is upgraded.
If the configuration exceeds init's available RAM, init re-attempts
the upgrade whenever new slack memory becomes available (e.g., by
disappearing other children).
2017-03-24 16:19:57 +01:00
Norman Feske
1cf830497a init: refactoring into multiple files
This patch splits the implementation of init into several headers to
make the implementation easier to digest and to maintain.
2017-03-24 16:19:56 +01:00
Norman Feske
9dca1503a8 init: apply changes of <provides> nodes
This patch enables init to apply changes of any server's <provides>
declarations in a differential way. Servers can in principle be extended
by new services without re-starting them. Of course, changes of the
<provides> declarations may affect clients or would-be clients as this
information is taken into account for the session routing.
2017-03-24 16:19:56 +01:00
Josef Söntgen
031337f039 trace_fs: remove os/server.h usage
Issue #2310.
2017-03-24 16:19:55 +01:00
Josef Söntgen
3d0bde2147 test/iso: remove env deprecated warning
Issue #2310.
2017-03-24 16:19:54 +01:00
Josef Söntgen
a26b4e6bd4 nic_bridge: remove os/server.h usage
Issue #2310.
2017-03-24 16:19:54 +01:00
Martin Stein
078f28238f os: fix some more deprecated warnings
Ref #1987
2017-03-15 14:04:56 +01:00
Alexander Boettcher
3b977d4cf3 acpi: avoid warning about dangling allocations
like

Warning: XX dangling allocations at allocator destruction time

Fixes #2330
2017-03-15 13:12:48 +01:00
Norman Feske
ec007c0f27 input_filter.run: stabilize key-repeat test
Under certain timing conditions, the test would end up flushing the
input from the input filter in a nested way, which ultimately resulted
in lost input events of the outer nesting level. This patch eliminates
this corner case and thereby stabilizes the key-repeat test.
2017-03-15 12:32:27 +01:00
Christian Helmuth
b9834bc388 Rename Linux audio driver to linux_audio_drv
Related to #2190
Fixes #2278
2017-03-15 12:32:27 +01:00
Christian Helmuth
43e7cc56a3 Rename Linux NIC driver to linux_nic_drv
Related to #2190
Issue #2278
2017-03-15 12:32:27 +01:00
Josef Söntgen
bf96c7f16e platform/x86: fix quota for local ram session
Transfer quota to the session local RAM session to react to the
Quota_exceeded exception properly.

The platform driver keeps a session local RAM session for each of its
clients that is used to allocate DMA memory. A client needs to transfer
some of its quota to the platform driver, which in return transfers this
quota to the session local RAM session. As it happens allocating memory
from a RAM session involves book keeping and in this case, where the
available quota in the session did not suffice and the request was only
a few KiB, the platform driver handled the exception wrongly and did not
transfer the quota.

This problem did not surface up to now because all drivers allocate DMA
memory in larger chunks and the book keeping overhead was of no
consequence as the initial quota transfer probably covered the overhead.

Fixes #2316.
2017-03-15 12:32:27 +01:00