1.1 --- a/pkg/devices/display/src/qi_lb60/display-qi_lb60.cc Sat Jun 10 23:59:44 2023 +0200
1.2 +++ b/pkg/devices/display/src/qi_lb60/display-qi_lb60.cc Sun Jun 11 15:42:11 2023 +0200
1.3 @@ -1,7 +1,7 @@
1.4 /*
1.5 * Export Ben NanoNote display operations as a server.
1.6 *
1.7 - * Copyright (C) 2018, 2020 Paul Boddie <paul@boddie.org.uk>
1.8 + * Copyright (C) 2018, 2020, 2023 Paul Boddie <paul@boddie.org.uk>
1.9 *
1.10 * This program is free software; you can redistribute it and/or
1.11 * modify it under the terms of the GNU General Public License as
1.12 @@ -27,9 +27,12 @@
1.13 #include <l4/re/env.h>
1.14
1.15 #include <ipc/server.h>
1.16 +
1.17 #include "activation_client.h"
1.18 #include "activation_server.h"
1.19
1.20 +
1.21 +
1.22 /* Virtual address for the GPIO register block. */
1.23
1.24 static l4_addr_t gpio_virt_base = 0, gpio_virt_base_end = 0;
1.25 @@ -68,7 +71,7 @@
1.26
1.27 /* Display device only implementing the activation interface. */
1.28
1.29 -class server_DisplayObject : public Activation
1.30 +class DisplayObject_server : public Activation
1.31 {
1.32 Pin_slice slcd8_mask = {.offset=0, .mask=(1 << Jz4740_lcd_gpio_cs) | (1 << Jz4740_lcd_gpio_rs) |
1.33 (1 << Jz4740_lcd_gpio_clk) | Jz4740_lcd_gpio_d0_d7};
1.34 @@ -76,7 +79,7 @@
1.35 Activation *_backlight;
1.36
1.37 public:
1.38 - explicit server_DisplayObject(Activation *backlight)
1.39 + explicit DisplayObject_server(Activation *backlight)
1.40 : _backlight(backlight)
1.41 {
1.42 }
1.43 @@ -108,7 +111,8 @@
1.44
1.45 int main(void)
1.46 {
1.47 - if (setup_memory()) return 1;
1.48 + if (setup_memory())
1.49 + return 1;
1.50
1.51 /* Initialise the GPIO abstraction. */
1.52
1.53 @@ -119,7 +123,9 @@
1.54 /* Obtain a reference to the backlight device. */
1.55
1.56 l4_cap_idx_t backlight = l4re_env_get_cap("backlight");
1.57 - if (!l4_is_valid_cap(backlight)) return 1;
1.58 +
1.59 + if (!l4_is_valid_cap(backlight))
1.60 + return 1;
1.61
1.62 /* Use the activation interface with the backlight. */
1.63
1.64 @@ -127,14 +133,12 @@
1.65
1.66 /* Initialise and register a new server object. */
1.67
1.68 - server_DisplayObject obj(&backlight_obj);
1.69 - l4_cap_idx_t server;
1.70 + DisplayObject_server obj(&backlight_obj);
1.71
1.72 - if (ipc_server_bind("display", (l4_umword_t) &obj, &server)) return 1;
1.73 + /* Bind and start the IPC server loop. */
1.74
1.75 - /* Enter the IPC server loop. */
1.76 + if (ipc_server_loop_for(Activation, &obj, "display"))
1.77 + return 1;
1.78
1.79 - ipc_server_loop(Activation_expected_items, &obj,
1.80 - (ipc_server_handler_type) handle_Activation);
1.81 return 0;
1.82 }