Commit Graph

849 Commits

Author SHA1 Message Date
Christian Helmuth
97b015b8c7 virtio: fix MMIO build errors with -std=gnu++20
Issue #4827
2023-05-30 12:03:31 +02:00
Christian Prochaska
c4810c5db4 virtio_pci_nic: fix build errors with -std=gnu++20
Fixes #4888
2023-05-30 12:03:30 +02:00
Norman Feske
8e32e7a14e os: replace enum by static constexpr (C++20)
Fixes the build of the nic_router.

Issue #4869
2023-05-30 12:03:29 +02:00
Norman Feske
29079b2ac8 os: define CAP_QUOTA as constexpr (C++20)
Issue #4869
2023-05-30 12:03:29 +02:00
Norman Feske
604d6bf567 os: make nitpicker compatible to C++20
Avoid arithmetics on enum values, disambiguate '==' operator of
handle_registry.

Fixes #4875
2023-05-30 12:03:29 +02:00
Norman Feske
05e5ecca86 vfs: fix dangling allocation in dir_file_system
Issue #4855
2023-05-30 12:03:26 +02:00
Josef Söntgen
1d376717c1 net/netaddress: make copy member function const
As the function does not alter the internal state of the
object allow for using it in r/o contexts.

Issue #4813
2023-04-26 11:58:14 +02:00
Christian Helmuth
4b54520579 trace_buffer: fix check for empty buffer
Issue #4805
2023-04-17 14:48:30 +02:00
Christian Helmuth
7c84d73d67 Spend min. 4K on platform session upgrade for DMA buffer
Issue #4792
2023-04-17 14:48:24 +02:00
Christian Helmuth
3c45f5c7ab usb: support 32 in-flight packets
- move metadata specific to isochronous transfers from the descriptor
  into the content of USB-session packets
- restore support for 32 in-flight packets in the USB C API

Fixes #4749
2023-04-17 14:48:23 +02:00
Christian Helmuth
217d59ce68 usb: use buffer type in C API
Also, some reasonable sanity checks of client-passed parameters were
added and for-int loops replaced by for-range loops where applicable.

Issue #4749
2023-04-17 14:48:23 +02:00
Norman Feske
fd7001d020 os/vfs.h: don't truncate File_content
The 'File_content' utility throws an exception whenever a file happens
to get truncated during the reading process. But it silently truncates
the data against the specified limit. In practice, exceeding the limit
is usually an error case. This patch enhances the 'File_content' utility
by throwing 'Truncated_during_read' in the limit-exceeded case as well,
in order to ease the diagnosis of such cases.

Issue #4788
2023-03-15 17:05:35 +01:00
Norman Feske
36c00cc294 gems: remove use of format strings
Issue #2064
2023-03-13 14:32:52 +01:00
Norman Feske
9debad4e91 Remove format strings from connection types
Issue #2064
2023-03-13 14:32:37 +01:00
Stefan Kalkowski
adc594a7e6 os: remove conversion warnings/errors from virtio
The read_config and write_config functions in the generic virtio
headers used by all drivers lead to compiler warnings resp. errors
if effective-c++ switch is enabled. Moreover, the functions require
to define the access width as parameter. We can better turn them
into template functions using the value type to read resp. write to
derive the access width.

Ref genodelabs/genode#4344
2023-02-27 08:22:49 +01:00
Norman Feske
b0e52ba7d4 util/misc_math.h: remove abs function
Fixes #4766
2023-02-27 08:22:49 +01:00
Norman Feske
bdf47785b8 vfs: remove 'file_size' from read/write interfaces
The 'file_size' type denotes the size of files on disk in bytes. On
32-bit architectures it is larger than the size_t, which refers to
in-memory object sizes.

Whereas the use of 'file_size' is appropriate for ftruncate and seek, it
is not a suitable type for the parameters of read/write operations
because those operations refer to in-memory buffers.

This patch replaces the use of 'file_size' by size_t. However, since it
affects all sites where the read/write interface is uses, it takes the
opportunity to replace the C-style (pointer, size) arguments by
'Byte_range_ptr' and 'Const_byte_range_ptr'.

Issue #4706
2023-02-27 08:22:49 +01:00
Sebastian Sumpf
34b2a83b84 gpu_session: add notes to interface
Describe differences for Intel and Lima (Mali) based GPUs.

issue #4713
2023-02-27 08:22:48 +01:00
Sebastian Sumpf
f1bc791c22 gpu_session: rename Gpu::Virtual_address:va
rename 'va' into 'value' to stay consistent with other types.

issue #4713
2023-02-27 08:22:48 +01:00
Sebastian Sumpf
3260c86d15 gpu_session: VRAM interface
Change the abstraction from buffers to video RAM (VRAM). The notion of
buffers can be provided at the client side (e.g., Mesa) and multiple
buffers can be there be associated to one VRAM area, thus saving
resources (meta data overhead) when allocating many buffers. A VRAM area
can also be mapped to one single buffer as before for clients or drivers
that do not take advantage of this feature.

issue #4713
2023-02-27 08:22:48 +01:00
Norman Feske
61a7671de1 os/vfs.h: read loop in Readonly_file::read
This patch improves the Readonly_file::read method such that the
capacity of the specified buffer is used as upper bound for the read
operation instead of VFS-internal I/O buffer sizes. This relieves the
caller from implementing a read loop in most cases.

As a step away from C-ish use of the API, the patch deprecates the old
'read' method that takes the buffer as char *, size_t arguments.

Fixes #4745
2023-02-27 08:22:46 +01:00
Christian Helmuth
264ee999a1 acpi_event: generalize config for any key
Fixes #4748
2023-02-27 08:22:46 +01:00
Christian Helmuth
3403a91213 input: provide keycode-by-name lookup
The new utility returns a key code for a passed name and is implemented
by linear search, which is slow but sufficient in situations like config
updates.

Issue #4748
2023-02-27 08:22:45 +01:00
Martin Stein
eba22b7551 nic_router: rework updating of TCP/UDP links
* Update links from forward rules only with forward rules and links from
  transport-routing rules only with transport-routing rules. Besides raising
  the performance of the code, this also fixes a former bug that allowed
  forward-rule links to falsely stay active because of a transport-routing
  rule that matched the client destination ip and port.

* Don't use good-case exceptions for updating TCP/UDP links on re-configuration
  of the router.

* Make conditions when to dismiss a forward rule easier to read.
  * Introduces != operator to the public Port class in the net library.

* Fix unnecessary log message that a link was dismissed when only a potentially
  matching forward rule turned out to be not matching.

* Apply Genode coding style to if statements with a single body statement.

Fix #4728
2023-01-24 12:07:31 +01:00
Norman Feske
ddeaccf728 vfs: documentation of Vfs::Env::User
Issue #4706
2023-01-24 12:07:30 +01:00
Norman Feske
25e4bcefbf vfs: remove 'Io_response_handler' interface
The old 'Io_response_handler::io_progress_response' interface has been
replaced by the 'Vfs::Env::User::wakeup_vfs_user' (issue #4697). The
remaining 'read_ready_response' method is now hosted in the
appropriately named 'Read_ready_response_handler'.

Issue #4706
2023-01-24 12:07:30 +01:00
Norman Feske
9a2c03d2c6 vfs: remove Read_result::READ_ERR_INTERRUPT
The error condition was too vague and thereby remained unused in
practice.

Issue #4706
2023-01-24 12:07:30 +01:00
Norman Feske
ba78cf72ae vfs: remove Read_result::READ_ERR_AGAIN
The condition is covered by READ_ERR_WOULD_BLOCK.

Issue #4706
2023-01-24 12:07:30 +01:00
Norman Feske
1aba073e32 vfs: remove File_io_service::General_error
Issue #4706
2023-01-24 12:07:30 +01:00
Norman Feske
a1fb51e050 vfs: remove File_io_service::register_read_ready
Issue #4706
2023-01-24 12:07:30 +01:00
Norman Feske
0fefee804c vfs: remove File_io_service::ioctl interface
This interface has been obsoleted by the use of pseudo files,
implemented in the context of issue #3519.

Issue #4706
2023-01-24 12:07:29 +01:00
Norman Feske
ca0d3757cc vfs: make 'File_io_service::read_ready' const
... and replace pointer argument to const reference.

Issue #4706
2023-01-24 12:07:29 +01:00
Norman Feske
ff2176a586 vfs,libc: support write fds in select
By adding a 'write_ready' interface following the lines of the existing
'read_ready', VFS plugins become able to propagate the (de-)saturation
of I/O buffers to the VFS user. This information is important when using
a non-blocking file descriptor for writing into a TCP socket. Once the
application observes EAGAIN, it expects a subsequent 'select' call to
return as soon as new I/O buffer space becomes available.

Before this patch, the select call would always return under this
condition, causing an unnecessarily busy write loop.

Issue #4697
2023-01-24 12:07:28 +01:00
Norman Feske
5ad98f2b7c vfs,libc: introduce Vfs::Env::User interface
The new interface is meant to replace the 'Vfs::Io_response_handler'.
In contrast to the 'Io_response_handler', which had to be called
on a 'Vfs_handle', the new interface does not require any specific
'Vfs_handle'. It is merely meant to prompt the VFS user (like the libc)
to re-attempt stalled I/O operations but it does not provide any
immediate hint, about which of the handles have become ready for
reading/writing.

Issue #4697
2023-01-24 12:07:28 +01:00
Norman Feske
cf87b0fadb vfs: simplify File_io_service::write return values
This patch removes the 'Insufficient_buffer' exception by returning the
WRITE_ERR_WOULD_BLOCK result value instead. It also eliminates the
superfluous WRITE_ERR_AGAIN and WRITE_ERR_INTERRUPT codes.

Issue #4697
2023-01-24 12:07:28 +01:00
Norman Feske
8a9974b6f9 vfs/lwip: deferred wakeup of NIC server
This patch fosters the batching of network packets transferred by the
lwIP stack over the NIC connection. It replaces the eager submission of
the packet-stream's data-flow signals by explicit wakeup notifications.

The commit also increases the NIC session's buffer size from 128 to 1024
packets.

Issue #4697
2023-01-24 12:07:28 +01:00
Norman Feske
5fdacae88b vfs: remove obsolete mutexes
...and tighten constness in adjacent code parts.

The VFS-internal synchronization via mutexes is no longer needed because
the access to the VFS is serialized by the VFS client, i.e., the libc.

Issue #4697
2023-01-24 12:07:28 +01:00
Norman Feske
7d8d4f4532 vfs,libc: deferred wakeup of remote peers
This patch facilitates the batching of I/O operations in the VFS library
by replacing the implicit wakeup of remote peer (via the traditional
packet-stream interface like 'submit_packet') by explicit wakeup
signalling.

The wakeup signalling is triggered not before the VFS user settles down.
E.g., for libc-based applications, this is the case if the libc goes
idle, waiting for external I/O.
In the case of a busy writer to a non-blocking file descriptor or socket
(e.g., lighttpd), the remote peers are woken up once a write operation
yields an out-count of 0.

The deferring of wakeup signals is accommodated by the new 'Remote_io'
mechanism (vfs/remote_io.h) that is designated to be used by all VFS
plugins that interact with asynchronous Genode services for I/O.

Issue #4697
2023-01-24 12:07:27 +01:00
Norman Feske
a15c894385 file_system_session: increase TX_QUEUE_SIZE to 32
The change of the queue size from 16 to 32 has negligible costs (4 KiB
instead of 2 KiB for the packet-stream queues) while facilitating the
batching of many small consecutive write operations.

Issue #4697
2023-01-24 12:07:27 +01:00
Johannes Schlatow
132906c925 platform_drv: update ROM in device_by_type()
This is required for scenarios in which a device appears at a later
point in time. If the ROM is not updated, the device_by_type() method may
operate on an outdated dataspace and never find the device it is waiting for.
2022-11-29 12:29:57 +01:00
Stefan Kalkowski
9e61fb90c5 Remove legacy platform_drv, API, and platform.inc
Fix genodelabs/genode#4671
2022-11-29 12:29:57 +01:00
Sebastian Sumpf
2aa01e309c gpu/intel: GEN12+
* clock frequency
* topology
* exec lists
* IRQ handling
* improved resource management

issue #4664
2022-11-17 08:00:36 +01:00
Sebastian Sumpf
22460525a0 platform_session/dma_buffer: remove 'retry_with_upgrade'
'retry_with_upgrade' is called by 'platform_session/connection.h' ->
'alloc_dma_buffer' already.

issue #4667
2022-11-17 08:00:36 +01:00
Stefan Kalkowski
bc5663f1a3 os: remove obsolete i.MX framebuffer session
Ref genodelabs/genode#4661
2022-11-17 08:00:35 +01:00
Stefan Kalkowski
3082950e74 usb_session: align USB packet allocation correctly
To prevent caching side-effects of USB DMA memory taken from the packet stream
all allocations of USB packets need to be on separated cachelines at least.

Fix genodelabs/genode#4655
2022-11-17 08:00:35 +01:00
Norman Feske
49b4b8597d os/pin_driver: support for time-multiplexed in/out
This patch equips the pin-driver framework with support for the
time-multiplexed operation of a pin as output or input. This is needed
when implementing I2C communication via a bit-banging driver.

To operate pin in both directions, a driver obtains both a pin-state and
a pin-control session for the same pin. The pin-state session can be
used to sense the current pin state. The control session allows the
client to set the pin to high or low (using the 'state' method), or to
set it to high-impedance via the 'yield' method. Once switched to
high-impedance, the pin can be used as input.

Issue genodelabs/genode-allwinner#10
2022-11-17 08:00:35 +01:00
Stefan Kalkowski
11a6117da6 genode_c_api: add config update to block interface
Ref genodelabs/genode#4653
2022-11-17 08:00:35 +01:00
Stefan Kalkowski
bc1e231775 platform_drv: implement PCI powering and reset
Ref genodelabs/genode#4578
2022-10-12 12:09:37 +02:00
Christian Helmuth
e7ba0b7371 pci: initialize BAR config on demand only
On-demand initialization prevents read-write operations on BARs of
invalid devices at construction time, which may result in surprising
behavior later on, for example, when resetting X260 notebooks via ACPI
information.
2022-10-12 12:09:37 +02:00
Stefan Kalkowski
3841ee1d51 platform_drv: implement MSI-x support
Ref genodelabs/genode#4578
2022-10-12 12:09:36 +02:00
Christian Helmuth
b20cabb6e4 pci: fix PCIe extended capability definition
Also removed the warning about unhandled capability IDs.

Ref genodelabs/genode#4578
2022-10-12 12:09:34 +02:00
Stefan Kalkowski
6a7247ab44 platform: remove cache attribute from io_mem call
Instead of allowing the client to set a caching attribute
in the io_mem() call of the device interface, which was
only used to decide in between of the memory  being
write-combined or not, remove it from the API.
Instead use the information delivered by the devices ROM,
whether memory from a PCI BAR is prefetchable or not,
to decide whether it is mapped write-combined or not.

Ref genodelabs/genode#4578
2022-10-12 12:09:34 +02:00
Stefan Kalkowski
7334128a2e pci_decode: export prefetchable attribute of BARs
Memory descriptors in PCI BARs have a prefetchable bit, which can
be used to optimize memory access when setting, e.g. write-combined
in page-table entries.

Ref genodelabs/genode#4578
2022-10-12 12:09:34 +02:00
Stefan Kalkowski
ec6f89111e virtio_pci: use generic platform API
Ref genodelabs/genode#4578
2022-10-12 12:09:34 +02:00
Stefan Kalkowski
281785f6bd platform API: make MMIO dataspace cap accessible
In case of the GPU multiplexer, we need to delegate MMIO memory
to the framebuffer client in form of a managed dataspace. To be
able to attach a given Platform::Device::Mmio object to a region map
we need to access its capability.

Ref genodelabs/genode#4578
2022-10-12 11:59:08 +02:00
Stefan Kalkowski
c583446ade platform_drv: add HDAUDIO PCI quirks
Ref genodelabs/genode#4578
2022-10-12 11:59:08 +02:00
Stefan Kalkowski
dda168fc10 platform API: simplify _wait_for_device
Fix genodelabs/genode#4615
2022-09-21 12:19:10 +02:00
Sebastian Sumpf
e0c4d5068d audio_out_session: reset changes to 'pos = tail'
In case a driver is waiting for data, is should only investigate 'pos'.
It should not advance the ring in any way until there is data available.

issue #4609
2022-09-19 14:00:35 +02:00
Norman Feske
cc9368ccb4 os: add File_system_session::num_entries RPC
This patch splits the querying of the number of directory entries from
the directory's 'status' information. Subsuming the number of directory
entries as part of the status makes 'stat' calls too costly for some
file systems that need to read a directory for determining the number of
entries. So when stat'ing the entries of one directory that contains sub
directories, all entries of each sub directory are visited.

Thanks to Cedric Degea for pointing out this performance bottleneck!

With this change, the 'status' function returns a 'Status::size' value
of 0 when called for a directory handle.

Fixes #4603
2022-09-19 14:00:35 +02:00
Johannes Schlatow
7d143087c9 xml_node: change with_sub_node signature
The `with_sub_node` method is renamed to `with_optional_sub_node` to
better reflect that the non-existence of a sub node with the desired type is
ignored.
At the same time, the new `with_sub_node` now takes a second functor that is
called when no sub node of the desired type exists.

genodelabs/genode#4600
2022-09-19 14:00:33 +02:00
Stefan Kalkowski
3d26ce9f8d usb_host: acknowledge all requests asynchronously
Fix genodelabs/genode#4601
2022-09-19 14:00:33 +02:00
Johannes Schlatow
bc57e9e647 vfs: add Append_file class
This reverts commit cf904e0a5d and
introduces the Append_file class instead.

genodelabs/genode#4352
2022-09-19 13:59:27 +02:00
Christian Helmuth
6fbc953dbd Declare missing exception types thrown in USB session 2022-08-31 09:32:09 +02:00
Norman Feske
08279e6288 Create Point, Area, Rect via 'from_xml' functions
By using the new functions provided by the base API, this patch removes
the dependency of several components from include/decorator/xml_utils.h.

Issue #4584
2022-08-31 09:32:08 +02:00
Norman Feske
42edac8a34 util/geometry: support 'Rect::from_xml'
This patch eases the creation of 'Point', 'Area', and 'Rect' objects
from XML attribute values.

Fixes #4584
2022-08-17 14:28:12 +02:00
Roland Bär
8f228e3035 nic_router: no ICMP on unroutable IPv4 multicast
The NIC router used to send an ICMP "Destination Unreachable" packet as
response to every unroutable IPv4 packet. However, RFC 1812 section 4.3.2.7
defines certain properties that must be fullfilled by an incoming packet in
order to be answered with this type of ICMP. One requirement is that the packet
is no IPv4 multicast.

This commit prevents sending the mentioned ICMP response for unroutable IPv4
multicasts and instead drops them silently.

Fixes #4563
2022-08-17 12:26:01 +02:00
Johannes Schlatow
086f3efef2 trace: add trace_eth_packet event
genodelabs/genode#4352
2022-08-17 12:03:07 +02:00
Johannes Schlatow
73dad70356 trace: add checkpoint event
genodelabs/genode#4352
2022-08-17 11:54:19 +02:00
Johannes Schlatow
cf904e0a5d vfs: add append mode to New_file
genodelabs/genode#4352
2022-08-17 11:54:19 +02:00
Peter Krummenacher
11b964b759 audio_in_session: fix wrong buffer in content
Fixes #4573
2022-08-10 13:33:04 +02:00
Stefan Kalkowski
2cc6c1adef pci: export BAR indices, sub-vendor, -product, rev
The pci_decode has to extract the additional fields from the PCI configuration
space. The platform driver again has to parse and forward the knowledge too.
The PCI BAR indices are exported when info="yes" is set in the policy node for
the corresponding session.

Fix genodelabs/genode#4577
2022-08-10 13:33:03 +02:00
Stefan Kalkowski
5bf3e72d37 pci: return correct I/O port base from BAR
The base address of I/O ports has a different encoding than
those of I/O memory. This needs to be encountered in the PCI
config helper utilities.

Fix genodelabs/genode#4576
2022-08-10 13:33:03 +02:00
Martin Stein
e32157e21b nic_router: packet allocation w/o exceptions
In overload situations, i.e. when a sender fills up the entire buffer, we land
in situations where the sender receives an ack_avail signal, releases one
packet, allocates and sends a packet and fails to allocate a second packet.
This is especially relevant if the receiver does not batch ack_avail signals
(such as vfs_lwip). In those ping-pong scheduling scenarios, the overhead from
catching the Packet_alloc_failed exception becomes significant. In case of the
NIC router, we will land in an overload situation if the sender is faster than
the receiver. The packet buffer will be filled up at some point and the NIC
router starts to drop packets. For every dropped packet, we currently have to
catch the Packet_alloc_failed exception.

This commit adds a new method alloc_packet_attempt to Packet_stream_source that
has almost the same signature as the older alloc_packet method but returns
an Attempt<Packet_descriptor, Alloc_packet_error> object. As the method already
used the allocator back end exception-less, changes on lower levels were not
needed. Furthermore, the NIC router was modified to use the new exception-less
alloc_packet_attempt instead of alloc_packet.

Ref #4555
2022-08-10 13:33:03 +02:00
Martin Stein
9a37ccfe29 nic_router: incremental L4 checksum updates
The checksums for forwarded/routed UDP, TCP and ICMP, used to be always
re-calculated from scratch in the NIC router although the router changes only
a few packet fields. This commit replaces the old approach whereever sensible
with an algorithm for incremental checksum updates suggested in RFC 1071.
The goal is to improve router performance.

Ref #4555
2022-08-10 13:33:02 +02:00
Martin Stein
b6d15fa3ab nic_router: incremental IPv4 checksum updates
The checksums for forwarded/routed IPv4, used to be always re-calculated from
scratch in the NIC router although the router changes only a few packet fields.
This commit replaces the old approach whereever sensible with an algorithm for
incremental checksum updates suggested in RFC 1071. The goal is to improve
router performance.

Ref #4555
2022-08-10 13:33:02 +02:00
Martin Stein
6b3ed6c75b internet checksum: no default arg value
Prevent public reflection of the only internally used 'init_sum' argument in
'uint16_t internet_checksum(...)' that, in addition, added a default value to
the function interface.

Ref #4555
2022-08-10 13:33:02 +02:00
Johannes Schlatow
3ea910bf83 packet_stream: reset wakeup_needed on wakeup()
The wakeup call only emits a single signal as it assumed both are
handled by the same signal handler. However, the original implementation
did not reset the wakeup_needed variable properly.

genodelabs/genode#4555
2022-08-10 13:33:02 +02:00
Johannes Schlatow
6a308dacd7 packet_stream: always emit ack_avail
When using signal batching, ack_avail and packet_avail should always
be emitted and preferred over ready_to_submit and ready_to_ack.
A signal receiver might decide to not register the ready_to_* signals when it
handles congestion by dropping packets. The Nic router is an example of
such a signal receiver.

genodelabs/genode#4555
2022-08-10 13:33:02 +02:00
Josef Söntgen
9183870b9e gpu: add information for lima driver
Issue #4559.
2022-08-10 13:33:00 +02:00
Josef Söntgen
b6cfb5a8fe gpu_session: add PPGTT address query function
Using the 'query_buffer_ppgtt()' function allows for retrieving the
virtual address of the buffer in the PPGTT.

This is for components that manage the GPU virtual addresses rather than
the client as is the case with the lima driver.

Issue #4559.
2022-08-10 13:33:00 +02:00
Christian Helmuth
4550ec4716 genode_c_api: key-press/release and relative-motion events
Issue #4543
2022-08-10 13:33:00 +02:00
Christian Helmuth
393766a931 legacy_platform_drv: ACPI devices in configuration
Known ACPI device resources can be statically configured on startup like
follows.

  <config>
    <policy label_prefix="driver">
      <device name="ACPI0000"/>
    </policy>
    <device name="ACPI0000" typee="acpi">
      <irq number="99" mode="level" polarity="low"/>
      <io_mem        address="0xfc000000" size="0x100000"/>
      <io_port_range address="0x4000"     size="4"/>
    </device>
  </config>

Fixes #4545
2022-08-10 13:33:00 +02:00
Stefan Kalkowski
0b5ad90bde usb_host: handle control URBs asynchronously
In the Genode C API and the DDE Linux USB host driver, turn control
URBs into asynchronously handled ones.

Fix genodelabs/genode#4535
2022-08-10 13:32:58 +02:00
Josef Söntgen
0ffc55a20a Remove unneeded session_size check
As accommodating the session component object is already taken care of
be the root component implementation, remove the remaining redundant
checks.

Fixes #4521.
2022-08-10 13:32:57 +02:00
Johannes Schlatow
c38b71146b trace_buffer: only iterate after initialization
There is a race between the trace subject doing the buffer
initialization and the monitor trying to iterate the buffer entries. If
the monitor tries to iterate entries of an uninitialized buffer, it will
read the very first entry twice. The monitor should therefore only start
iteration when the buffer has been initialised.

genodelabs/genode#4513
2022-05-25 12:23:04 +02:00
Martin Stein
bd501404db net: add methods required for WireGuard port
* Adds methods for copying raw data to the data field of Ethernet frames and
  UDP packets. This is used in the port to wrap the higher-layer packet data
  prepared by the contrib code with the additionally required headers before
  sending it at a network session.
* Adds a method to cast raw data to an IPv4 packet. This is required in the
  port in order to check values in stand-alone IP packets produced by the
  contrib code before sending them at a network session.
* Adds methods for setting UDP ports given big endian port values without
  having to convert to little endian in the app and then back to big endian in
  the net lib.

Ref #4397
2022-05-25 12:23:02 +02:00
Martin Stein
679be47def net: fix conversion compiler errors
Ref #4397
2022-05-25 12:23:02 +02:00
Stefan Kalkowski
f9a29f291e pci: extend Pci utilities for bridge drivers 2022-05-25 12:22:10 +02:00
Stefan Kalkowski
de7fdd3e1a platform_drv: wait for device's availability
Instead of returning an invalid device capability when a device
is (not yet) available, e.g. a PCI device is requested before the
PCI bus got parsed accordingly, we check the device capability
within the Platform::Connection utilities, and register temporarily
an Io_signal_handler to wait for changes of the devices ROM, and
try the device aquisition again. Thereby, simple drivers so not have
to take the burden to do so.

To enable this feature for all drivers, we always have to export a
devices ROM, but limit the information about physical resources
(I/O memory addresses, IRQ numbers, I/O port ranges) to clients with
'info=yes' in their policy description.

Fix genodelabs/genode#4496
2022-05-25 12:19:32 +02:00
Stefan Kalkowski
cacb6136fa app/pci_decode: prepare pci device information
To discharge the generic platform driver from certain PCI bus scanning,
and ACPI + kernel specifics, this commit introduces a new component,
which consumes the acpi drivers report and the platform_info from core
to prepare a devices ROM for the platform driver that contains all
PCI devices and its resources.

Fix genodelabs/genode#4495
2022-05-25 12:19:32 +02:00
Christian Helmuth
65d7b3e652 Remove unused Nic::Root implementation (nic/root.h)
Issue #3961
2022-05-25 12:19:31 +02:00
Stefan Kalkowski
18dcf8af68 Remove NIC server role from drivers
* Remove "mode" attribute utility and XML description
* Remove unused nic/stat.h header

Fix genodelabs/genode#3961
2022-05-25 12:19:31 +02:00
Stefan Kalkowski
8ca2c597e0 os: extend USB C-API with claim/release
To signal that a device gets used and released by a session
introduce claim, release, and release all callbacks in the
USB interface of the C-API.

Ref genodelabs/genode#4483
2022-04-28 08:02:33 +02:00
Norman Feske
d815322efe os: simplify split block operations
This patch changes the meaning of the 'offset' parameter of the
'produce_write_content' and 'consume_read_result' hook functions.
The value used to reflect the absolute byte position but in practice,
a job-relative byte offset is desired.

Issue #4474
2022-04-13 14:08:15 +02:00
Norman Feske
f7270c44cb trace_logger: omit inactive subjects by default
This patch reduces repetitive log output by omitting inactive trace
subjects from the log output. The information about all subjects can
still be dumped by setting 'verbose="yes"'.

Issue #4448
2022-04-13 08:07:58 +02:00
Norman Feske
232a45bc14 os: add util/formatted_output.h utilities
The utilities of the new util/formatted_output.h header complement the
existing base/output.h with the text-formatting support needed to
produce tabular output.

Fixes #4449
2022-04-13 08:07:57 +02:00
Norman Feske
b4aa0a20dd os: refine default USB session quota
This commit adjusts the value such that USB sessions requested by
VirtualBox6 on Sculpt OS can get established on the first try without
invoking the session-retry mechanism. This reduces the number of
diagnostic log messages like:

 Error: Insufficient 'ram_quota',got 6296372 need 6297928
2022-04-13 08:07:57 +02:00
Johannes Schlatow
c763890f04 trace_buffer: partition trace buffer
Split the trace buffer into two partitions in order to prevent overwriting
of entries when the consumer is too slow. See file comment in buffer.h.

genodelabs/genode#4434
2022-03-21 13:42:16 +01:00
Johannes Schlatow
edc46d15f8 trace_buffer: revise trace buffer implementation
This commit simplifies the current implementation by overloading the
length field with a padding indicator in addition to the zero-length
head entry. This simplifies the iteration semantics as it eliminates
the need for determining whether a zero-length entries is the actual
head of the buffer or a padding at the buffer end.

genodelabs/genode#4434
2022-03-09 12:08:02 +01:00
Stefan Kalkowski
d473bed4b7 platform api: export dma buffer capability
Ref #4443
2022-03-09 10:55:16 +01:00