# HG changeset patch # User Paul Boddie # Date 1687186732 -7200 # Node ID 04b175ff12cf59a89bde0f7fefc569e1abddfa44 # Parent 3e41a1f2ddaad9dc1dea25f2cd2edf75887d0107 Tidied and simplified examples. diff -r 3e41a1f2ddaa -r 04b175ff12cf pkg/landfall-examples/input_event_client/input_event_client.cc --- a/pkg/landfall-examples/input_event_client/input_event_client.cc Mon Jun 19 16:55:47 2023 +0200 +++ b/pkg/landfall-examples/input_event_client/input_event_client.cc Mon Jun 19 16:58:52 2023 +0200 @@ -49,7 +49,6 @@ #include #include #include -#include #include #include @@ -61,7 +60,7 @@ #include #include -#include +#include #include #include @@ -272,15 +271,11 @@ if (l4_is_invalid_cap(event_cap)) return 1; - /* Obtain a capability for the event buffer. */ - - l4re_ds_t mem = ipc_cap_alloc(); - - if (l4_is_invalid_cap(mem)) - return 1; + /* Obtain the event buffer. */ client_Event event_obj(event_cap); client_ICU icu_obj(event_cap); + l4re_ds_t mem; if (event_obj.get_buffer(&mem)) return 1; @@ -297,16 +292,11 @@ L4Re::Event_buffer event_buffer(evmem, l4re_ds_size(mem)); - /* Obtain an interrupt capability. */ - - l4_cap_idx_t irq = ipc_cap_alloc(); - - if (l4_is_invalid_cap(irq)) - return 1; - /* Create an interrupt object. */ - if (l4_error(l4_factory_create_irq(l4re_env()->factory, irq))) + l4_cap_idx_t irq; + + if (ipc_create_irq(&irq)) return 1; /* Bind the interrupt to the event capability. */ diff -r 3e41a1f2ddaa -r 04b175ff12cf pkg/landfall-examples/keypad_ds_client/keypad_ds_client.cc --- a/pkg/landfall-examples/keypad_ds_client/keypad_ds_client.cc Mon Jun 19 16:55:47 2023 +0200 +++ b/pkg/landfall-examples/keypad_ds_client/keypad_ds_client.cc Mon Jun 19 16:58:52 2023 +0200 @@ -26,8 +26,6 @@ #include #include -#include - #include #include #include @@ -147,13 +145,6 @@ if (l4_is_invalid_cap(keypad_cap)) return 1; - /* Obtain a capability for the keypad data. */ - - mem = ipc_cap_alloc(); - - if (l4_is_invalid_cap(mem)) - return 1; - /* Obtain a reference to the keypad data. */ client_Keypad keypad(keypad_cap); diff -r 3e41a1f2ddaa -r 04b175ff12cf pkg/landfall-examples/qi_lb60_keypad/qi_lb60_keypad.c --- a/pkg/landfall-examples/qi_lb60_keypad/qi_lb60_keypad.c Mon Jun 19 16:55:47 2023 +0200 +++ b/pkg/landfall-examples/qi_lb60_keypad/qi_lb60_keypad.c Mon Jun 19 16:58:52 2023 +0200 @@ -24,7 +24,6 @@ #include #include -#include #include #include