Propagate 'Range_allocator::alloc_aligned' errors

This patch reflects eventual allocation errors in a more specific way to
the caller of 'alloc_aligned', in particular out-of-metadata and
out-of-memory are considered as different conditions.

Related to issue #526.
This commit is contained in:
Norman Feske
2012-11-28 22:50:08 +01:00
parent bd6d78b18e
commit 0dbb5e1696
39 changed files with 133 additions and 89 deletions

View File

@ -56,7 +56,7 @@ Irq_session_component::Irq_session_component(Cap_session *cap_session,
{
long irq_number = Arg_string::find_arg(args, "irq_number").long_value(-1);
if (!irq_alloc || (irq_number == -1)||
irq_alloc->alloc_addr(1, irq_number) != Range_allocator::ALLOC_OK) {
irq_alloc->alloc_addr(1, irq_number).is_error()) {
PERR("unavailable IRQ %lx requested", irq_number);
return;
}