296 Commits

Author SHA1 Message Date
4086d4ce85 core: re-factor io_mem_session implementation
Replace _map_local and _unmap_local in the I/O mem session component
by _acquire and _release. The _acquire and _release must be implemented
per base-<kernel>.

The commit is a preparation commit for seL4, so that it can implement
_acquire differently in a subsequent commit to solve #5597 actually.

Issue #5597
2025-06-12 15:56:59 +02:00
6a9d2bd1d5 depot: update recipe hashes 2025-05-28 08:23:47 +02:00
eecafa0459 core: remove 'new' from CPU service
Issue #5245
2025-05-27 08:33:22 +02:00
4a6c5bd00a base-fiasco: adapt to GCC 14
Issue #5540
2025-05-27 08:32:06 +02:00
b73d407ed3 core: remove Core_virtual_memory_exhausted
Issue #5245
2025-05-27 08:32:05 +02:00
bb94c2b3b1 root/component.h: support errors as return values
The '_create_session' method returns now a 'Create_result' instead
of a pointer. This result can either be a reference to the new
session object or an 'Create_error' code.

The '_upgrade_session' and '_destroy_session' method now take a
reference instead of a pointer as argument.

Fixes #5562
2025-05-27 08:32:05 +02:00
214d6b5061 core: remove signal_receiver.cc
This part of the signal API is not used by because core never receives
signals.
2025-05-27 08:32:04 +02:00
dd3bb97c84 Unify handling of buffer-exceeded error conditions
- Introduce common Buffer_error type.
- Enforce the handling of buffer-exceeded errors.
- Unify interface of Reporter and Expanding_reporter,
  using Byte_range_ptr instead of basic types.
- Simplify the Xml_generator API by providing the plain
  class function Xml_generator::generate.
- Use Expanding_reporter where appropriate.

Fixes #5561
2025-05-27 08:32:04 +02:00
7d74277ee5 base: remove diagnostic throws from base lib
Replace try/catch/throw by guard objects.
In panic situations, print an error and sleep forever.
Infinitely block invalid IPC calls.
Weasel out of cap ref count overflows by clamping count to max.
Accept ID-space ambiguities but be verbose about it.
Skip Duration::add when detecting an integer overflow.

Issue #5245
2025-05-27 08:32:03 +02:00
bab2abd7ae base: distinguish alloc errors in rpc_cap_factory
Issue #5057
2025-05-27 08:32:02 +02:00
29b89df1c6 base/thread.h: avoid pointers for stack allocation
This has become possible by the added support of reference types for
'Unique_attempt'.

Issue #5539
2025-05-27 08:32:02 +02:00
3090bed4a0 core: rework IRQ-number allocation
Replace use of deallocate=false by keeping the IRQ number as guard
object. Don't throw 'Service_denied'. Remove superfluous debug messages.

Issue #5502
Issue #5251
2025-05-27 08:32:02 +02:00
a128bbd6b8 depot: update recipe hashes 2025-04-29 11:23:22 +02:00
016d63703d depot: update recipe hashes 2025-04-10 14:55:59 +02:00
1ef80e86e2 base: introduce Local_rm for local Region_map
The new 'Local_rm' type offers a narrow interface for the interaction
with the component-local address space, managing the lifetime of
attachments by using the 'Allocation' API.

Fixes #5516
2025-04-10 14:55:57 +02:00
84eb264786 util/attempt.h: mark 'Attempt' types as nodiscard
This catches bugs early on. E.g., when leaving an 'Allocation'
unused, it gets immediately deallocated, which is most probably not
intended. For regular 'Attempt' objects, this change encourages
the proper propagation of errors, or at least the logging of unexpected
conditions.

Fixes #5513
2025-04-10 14:55:21 +02:00
e380d0da95 base: use 'Allocation' interface for mem alloc
This patch converts the memory-allocator interfaces ('Allocator',
'Range_allocator') and their implementations ('Heap', 'Sliced heap',
'Slab', 'Allocator_avl', 'Synced_allocator') to the new 'Allocation'
utility. The new interface resides at base/memory.h whereas the
traditional allocators implement the new interface.

Down the road, the traditional allocators can successively be decoupled
from the traditional 'Allocator' and 'Range_allocator' interfaces.

Issue #5502
Issue #5245
2025-04-10 14:55:21 +02:00
7e420a68a6 Remove C++ exceptions from 'Thread' API
After constructed, a 'Thread' object may remain in a dysfunctional state
should the stack allocation have failed. This condition is no longer
reflected as a C++ exception but as result value of 'Thread::info()'.

Keep 'Thread::name' as public constant because the stack is not always
available for storing the name.

The 'stack_top' accessor has been removed because this information is
already provided by 'Thread::info()'.

Issue #5245
2025-04-10 14:27:21 +02:00
aa9ff3894c base: scoped access of Native_thread
With planned removal of Thread:: exceptions, we need to consider that a
'Thread' object may exist without a valid 'Stack' and therefore without
a valid 'Native_thread', which is hosted as part of the 'Stack'.

This patch reworks the code that accesses the 'Native_thread' to use the
new 'Thread::with_native_thread' interface. Within the local scope,
the native thread is referred to as 'nt'.

The _init_platform_thread and _deinit_platform_thread() have been
replaced by _init_native_thread and _deinit_native_thread, which take
a 'Stack &' as argument.

As a safety caution, 'Native_thread' objects can no longer be copied.

Issue #5245
2025-04-10 14:24:11 +02:00
2d89b53b0c depot: update recipe hashes 2025-02-27 12:53:40 +01:00
5076554f20 depot: update recipe hashes 2025-01-30 16:32:35 +01:00
0d81a104ad base: use Map_local_result in io_mem _map_local(...)
Issue #5406
2025-01-30 16:30:13 +01:00
43d7c3bd11 core: don't rely on Core_env in platform.cc
Replace the use of the global 'core_env()' accessor by the explicit
delegation of interfaces.

- For allocating UTCBs in base-hw, 'Platform_thread' requires
  a way to allocate dataspaces ('Ram_allocator') accounted to the
  corresponding CPU session, a way to locally map the allocated
  dataspaces (core's 'Region_map'), and a way to determine the
  physical address (via 'Rpc_entrypoint') used for the initial
  UTCB mapping of main threads. Hence those interfaces must be
  passed to 'Platform_thread'.

- NOVA's pager code needs to look up 'Cpu_thread_component'
  objects using a map item as key. The lookup requires the
  'Rpc_entrypoint' that hold the 'Cpu_thread_component' objects.
  To make this 'Rpc_entrypoint' available, this patch adds
  the 'init_page_fault_handing' function.

- The 'Region_map_mmap' for Linux requires a way to look up
  'Linux_dataspace' objects for given dataspace capabilities.
  This lookup requires the 'Rpc_entrypoint' holding the dataspaces,
  which is now passed to 'platform.cc' via the new Linux-specific
  'Core_region_map::init' function.

Issue #5408
2025-01-30 16:24:35 +01:00
cd6701c483 depot: update recipe hashes 2024-12-11 08:35:22 +01:00
011b44c282 depot: update recipe hashes 2024-11-20 08:58:39 +01:00
61c9706353 depot: update recipe hashes 2024-10-08 11:30:26 +02:00
26002a5482 depot: update recipe hashes 2024-08-29 12:32:25 +02:00
19c13877ca Replace use of 'typedef' by 'using'
Issue #5227
2024-07-02 12:00:11 +02:00
361557e1f0 base-*: omit () for lambas w/o argument
Issue #5227
2024-07-02 12:00:11 +02:00
d44ec53cd3 core: tie Platform_thread to Platform_pd
This patch tightens the coupling of the 'Platform_thread' objects
with their corresponding 'Platform_pd' objects by specifying the
'Platform_pd' as constructor argument, keeping the relationship
as a reference (instead of a pointer), and constraining the
lifetime of 'Platform_pd' objects to the lifetime of the PD.

It thereby clears the way to simplify the thread creation since all
PD-related information (like quota budgets) are now known at the
construction time of the 'Platform_thread'.

The return value of 'Platform_thread::start' has been removed because it
is not evaluated by 'Cpu_thread_component'.

Related to #5256
2024-07-02 11:59:16 +02:00
d866b6b053 Remove exceptions from Cpu_session interface
The 'Thread_creation_failed' error is now reflected as
'Thread::Start_result' return value. This change also removes the
use of 'Invalid_thread' within core as this exception is an alias
of Cpu_session::Thread_creation_failed.

Issue #5245
2024-07-02 11:59:16 +02:00
299951ced5 depot: update recipe hashes 2024-06-20 12:59:00 +02:00
14d3c4cb5e Remove Cpu_session::State_access_failed exception
This patch removes the exception formerly thrown by 'Cpu_thread::state'
and turns the 'Thread_state' structure into a plain compound type w/o a
constructor.

Issue #5245
Fixes #5250
2024-06-20 12:56:20 +02:00
08066269ba fiasco: update to new timer scheme
Issue #5138
2024-06-20 12:56:19 +02:00
8943a3e949 Remove '_drv' suffix
Issue #4420
2024-06-20 12:54:30 +02:00
6ba0574950 fiasco: move source code to genode.org
Complete migration from Sourceforge to GitHub.
2024-06-20 12:54:29 +02:00
4b9f4d8c38 depot: update recipe hashes 2024-05-30 08:20:21 +02:00
59b85cc672 depot: update recipe hashes 2024-04-26 09:59:36 +02:00
dc0e78cdf8 depot: update recipe hashes 2024-04-12 15:08:01 +02:00
9c7a303caf depot: update recipe hashes 2024-02-29 11:08:28 +01:00
c4679e7af6 depot: update recipe hashes 2023-12-13 12:33:05 +01:00
8baf19022c depot: update recipe hashes 2023-11-30 15:11:36 +01:00
eefaa07024 base: add irq_type session argument
By adding the `irq_type` argument, one can explicitly specify whether to
use LEGACY, MSI or MSI-X interrupts. We formerly used the
`device_phys_config` to implicitly select MSI, however, with the
addition of IOMMU support to the platform driver there is at least one
instance where we need an MSI for a non-PCI device.

Yet, by adding another session argument to the Irq session, we exceed
the character limit for session args. Since not all arguments are
relevant for LEGACY interrupts resp. MSI, we can split the Irq_connection
constructor to handle the two cases separately and omit unneeded
arguments.

genodelabs/genode#5002
2023-11-28 19:35:16 +01:00
b634549722 depot: update recipe hashes 2023-10-25 14:01:40 +02:00
07c4b92335 depot: update recipe hashes 2023-10-04 13:22:08 +02:00
134a785fe0 depot: update recipe hashes 2023-08-24 11:01:40 +02:00
7aa301361d depot: update recipe hashes 2023-07-14 12:06:32 +02:00
de99945af0 base: pass 'Platform &' to 'bootstrap_component'
This eliminates the need of component.cc to pull the platform resources
out of thin air (calling 'env_deprecated()').

Issue #4784
2023-07-14 12:06:31 +02:00
7093258649 base: move 'prepare_init_main_thread' to Genode::
Issue #4784
2023-07-14 12:06:31 +02:00
3a8c3dcc2d base: unify platform.cc between base, base-linux
This is a preparatory step for merging 'init_platform()' with
'bootstrap_component()'.

Issue #4784
2023-07-14 12:06:31 +02:00