1.1 --- a/pkg/devices/backlight/src/spi-ili8960/backlight-spi-ili8960.cc Wed Dec 30 22:48:28 2020 +0100 1.2 +++ b/pkg/devices/backlight/src/spi-ili8960/backlight-spi-ili8960.cc Wed Dec 30 22:51:48 2020 +0100 1.3 @@ -102,13 +102,7 @@ 1.4 server_BacklightObject obj; 1.5 l4_cap_idx_t server; 1.6 1.7 - long err = ipc_server_bind("backlight", (l4_umword_t) &obj, &server); 1.8 - 1.9 - if (err) 1.10 - { 1.11 - printf("Could not bind server: %s\n", l4sys_errtostr(err)); 1.12 - return 1; 1.13 - } 1.14 + if (ipc_server_bind("backlight", (l4_umword_t) &obj, &server)) return 1; 1.15 1.16 /* Enter the IPC server loop. */ 1.17
2.1 --- a/pkg/devices/display/src/qi_lb60/Makefile Wed Dec 30 22:48:28 2020 +0100 2.2 +++ b/pkg/devices/display/src/qi_lb60/Makefile Wed Dec 30 22:51:48 2020 +0100 2.3 @@ -18,15 +18,19 @@ 2.4 2.5 CLIENT_INTERFACES_CC = activation 2.6 2.7 +SERVER_INTERFACES_CC = activation 2.8 + 2.9 # Generated and plain source files. 2.10 2.11 CLIENT_INTERFACES_SRC_CC = $(call interfaces_to_client_cc,$(CLIENT_INTERFACES_CC)) 2.12 2.13 +SERVER_INTERFACES_SRC_CC = $(call interfaces_to_server_cc,$(SERVER_INTERFACES_CC)) 2.14 + 2.15 PLAIN_SRC_CC = display-qi_lb60.cc 2.16 2.17 # Normal definitions. 2.18 2.19 -SRC_CC = $(CLIENT_INTERFACES_SRC_CC) $(PLAIN_SRC_CC) 2.20 +SRC_CC = $(CLIENT_INTERFACES_SRC_CC) $(SERVER_INTERFACES_SRC_CC) $(PLAIN_SRC_CC) 2.21 2.22 REQUIRES_LIBS = l4re_c l4re_c-util libdrivers-lcd-jz4740 libdrivers-gpio libdevice-util libipc 2.23 2.24 @@ -35,4 +39,4 @@ 2.25 include $(L4DIR)/mk/prog.mk 2.26 include $(IDL_MK_DIR)/interface_rules.mk 2.27 2.28 -$(PLAIN_SRC_CC): $(CLIENT_INTERFACES_SRC_CC) 2.29 +$(PLAIN_SRC_CC): $(CLIENT_INTERFACES_SRC_CC) $(SERVER_INTERFACES_SRC_CC)
3.1 --- a/pkg/devices/display/src/qi_lb60/display-qi_lb60.cc Wed Dec 30 22:48:28 2020 +0100 3.2 +++ b/pkg/devices/display/src/qi_lb60/display-qi_lb60.cc Wed Dec 30 22:51:48 2020 +0100 3.3 @@ -24,14 +24,11 @@ 3.4 #include <l4/devices/lcd-jz4740-panel.h> 3.5 #include <l4/devices/memory.h> 3.6 3.7 -#include <l4/cxx/ipc_server> 3.8 -#include <l4/re/env> 3.9 #include <l4/re/env.h> 3.10 -#include <l4/re/util/object_registry> 3.11 -#include <l4/sys/capability> 3.12 3.13 +#include <ipc/server.h> 3.14 #include "activation_client.h" 3.15 -#include "display-ops.h" 3.16 +#include "activation_server.h" 3.17 3.18 /* Virtual address for the GPIO register block. */ 3.19 3.20 @@ -69,9 +66,9 @@ 3.21 3.22 3.23 3.24 -/* Display device. */ 3.25 +/* Display device only implementing the activation interface. */ 3.26 3.27 -class Display_device_server : public L4::Server_object_t<L4::Kobject> 3.28 +class server_DisplayObject : public Activation 3.29 { 3.30 Pin_slice slcd8_mask = {.offset=0, .mask=(1 << Jz4740_lcd_gpio_cs) | (1 << Jz4740_lcd_gpio_rs) | 3.31 (1 << Jz4740_lcd_gpio_clk) | Jz4740_lcd_gpio_d0_d7}; 3.32 @@ -79,58 +76,34 @@ 3.33 Activation *_backlight; 3.34 3.35 public: 3.36 - explicit Display_device_server(Activation *backlight) 3.37 + explicit server_DisplayObject(Activation *backlight) 3.38 : _backlight(backlight) 3.39 { 3.40 } 3.41 3.42 - /* Dispatch incoming requests. */ 3.43 - 3.44 - int dispatch(l4_umword_t obj, L4::Ipc::Iostream &ios) 3.45 - { 3.46 - l4_msgtag_t tag; 3.47 - 3.48 - (void) obj; 3.49 - ios >> tag; 3.50 - 3.51 - switch (tag.label()) 3.52 - { 3.53 - case Display_op_disable: 3.54 - disable(); 3.55 - return L4_EOK; 3.56 - 3.57 - case Display_op_enable: 3.58 - enable(); 3.59 - return L4_EOK; 3.60 - 3.61 - default: 3.62 - return -L4_EBADPROTO; 3.63 - } 3.64 - } 3.65 - 3.66 /* Switch the display off. */ 3.67 3.68 - void disable(void) 3.69 + long disable(void) 3.70 { 3.71 /* Configure SLCD8 pins. */ 3.72 3.73 gpio_port_c->multi_setup(slcd8_mask, Hw::Gpio_chip::Input, 0); 3.74 _backlight->disable(); 3.75 + return L4_EOK; 3.76 } 3.77 3.78 /* Switch the display on. */ 3.79 3.80 - void enable(void) 3.81 + long enable(void) 3.82 { 3.83 /* Configure SLCD8 pins. */ 3.84 3.85 gpio_port_c->multi_config_pad(slcd8_mask, Hw::Gpio_chip::Function_alt, 0); 3.86 _backlight->enable(); 3.87 + return L4_EOK; 3.88 } 3.89 }; 3.90 3.91 -static L4Re::Util::Registry_server<> server; 3.92 - 3.93 3.94 3.95 int main(void) 3.96 @@ -154,11 +127,14 @@ 3.97 3.98 /* Initialise and register a new server object. */ 3.99 3.100 - Display_device_server server_obj(&backlight_obj); 3.101 - server.registry()->register_obj(&server_obj, "display"); 3.102 + server_DisplayObject obj(&backlight_obj); 3.103 + l4_cap_idx_t server; 3.104 + 3.105 + if (ipc_server_bind("display", (l4_umword_t) &obj, &server)) return 1; 3.106 3.107 /* Enter the IPC server loop. */ 3.108 3.109 - server.loop(); 3.110 + ipc_server_loop(Activation_expected_items, &obj, 3.111 + (ipc_server_handler_type) handle_Activation); 3.112 return 0; 3.113 }
4.1 --- a/pkg/devices/lcd/include/lcd-device.h Wed Dec 30 22:48:28 2020 +0100 4.2 +++ b/pkg/devices/lcd/include/lcd-device.h Wed Dec 30 22:51:48 2020 +0100 4.3 @@ -1,7 +1,7 @@ 4.4 /* 4.5 * LCD device support. 4.6 * 4.7 - * Copyright (C) 2018 Paul Boddie <paul@boddie.org.uk> 4.8 + * Copyright (C) 2018, 2020 Paul Boddie <paul@boddie.org.uk> 4.9 * 4.10 * This program is free software; you can redistribute it and/or 4.11 * modify it under the terms of the GNU General Public License as 4.12 @@ -21,7 +21,7 @@ 4.13 4.14 #pragma once 4.15 4.16 -#include <l4/devices/display-client.h> 4.17 +#include <l4/devices/activation/activation_interface.h> 4.18 #include <l4/devices/lcd.h> 4.19 4.20 #include <l4/re/c/video/view.h> 4.21 @@ -43,7 +43,7 @@ 4.22 4.23 /* Display server abstraction. */ 4.24 4.25 - L4::Cap<Display_device_interface> _display; 4.26 + Activation *_display; 4.27 4.28 /* Framebuffer virtual and physical addresses. */ 4.29 4.30 @@ -61,7 +61,7 @@ 4.31 public: 4.32 /* Initialise a device with a controller and display object reference. */ 4.33 4.34 - Lcd_device(Lcd_chip *chip, L4::Cap<Display_device_interface> display) 4.35 + Lcd_device(Lcd_chip *chip, Activation *display) 4.36 : _chip(chip), _display(display) 4.37 { 4.38 /* Subclasses must set up any memory. */
5.1 --- a/pkg/devices/lcd/include/lcd-jz4740-device.h Wed Dec 30 22:48:28 2020 +0100 5.2 +++ b/pkg/devices/lcd/include/lcd-jz4740-device.h Wed Dec 30 22:51:48 2020 +0100 5.3 @@ -47,7 +47,7 @@ 5.4 public: 5.5 /* Inherit constructor. */ 5.6 5.7 - Lcd_jz4740_device(Lcd_chip *chip, L4::Cap<Display_device_interface> display) 5.8 + Lcd_jz4740_device(Lcd_chip *chip, Activation *display) 5.9 : Lcd_device(chip, display) 5.10 { 5.11 _setup_memory();
6.1 --- a/pkg/devices/lcd/include/lcd-letux400.h Wed Dec 30 22:48:28 2020 +0100 6.2 +++ b/pkg/devices/lcd/include/lcd-letux400.h Wed Dec 30 22:51:48 2020 +0100 6.3 @@ -1,7 +1,7 @@ 6.4 /* 6.5 * LCD device support for the Letux 400 notebook computer. 6.6 * 6.7 - * Copyright (C) 2018 Paul Boddie <paul@boddie.org.uk> 6.8 + * Copyright (C) 2018, 2020 Paul Boddie <paul@boddie.org.uk> 6.9 * 6.10 * This program is free software; you can redistribute it and/or 6.11 * modify it under the terms of the GNU General Public License as 6.12 @@ -30,7 +30,7 @@ 6.13 public: 6.14 /* Inherit constructor. */ 6.15 6.16 - Lcd_letux400(Lcd_chip *chip, L4::Cap<Display_device_interface> display) 6.17 + Lcd_letux400(Lcd_chip *chip, Activation *display) 6.18 : Lcd_jz4740_device(chip, display) 6.19 { 6.20 }
7.1 --- a/pkg/devices/lcd/include/lcd-qi_lb60.h Wed Dec 30 22:48:28 2020 +0100 7.2 +++ b/pkg/devices/lcd/include/lcd-qi_lb60.h Wed Dec 30 22:51:48 2020 +0100 7.3 @@ -1,7 +1,7 @@ 7.4 /* 7.5 * LCD device support for the Ben NanoNote. 7.6 * 7.7 - * Copyright (C) 2018 Paul Boddie <paul@boddie.org.uk> 7.8 + * Copyright (C) 2018, 2020 Paul Boddie <paul@boddie.org.uk> 7.9 * 7.10 * This program is free software; you can redistribute it and/or 7.11 * modify it under the terms of the GNU General Public License as 7.12 @@ -30,7 +30,7 @@ 7.13 public: 7.14 /* Inherit constructor. */ 7.15 7.16 - Lcd_qi_lb60(Lcd_chip *chip, L4::Cap<Display_device_interface> display) 7.17 + Lcd_qi_lb60(Lcd_chip *chip, Activation *display) 7.18 : Lcd_jz4740_device(chip, display) 7.19 { 7.20 }
8.1 --- a/pkg/devices/lcd/src/common/Makefile Wed Dec 30 22:48:28 2020 +0100 8.2 +++ b/pkg/devices/lcd/src/common/Makefile Wed Dec 30 22:51:48 2020 +0100 8.3 @@ -2,12 +2,32 @@ 8.4 L4DIR ?= $(PKGDIR)/../.. 8.5 8.6 TARGET = liblcd_device.o.a liblcd_device.o.so 8.7 -PC_FILENAME := libdevice-lcd 8.8 +PC_FILENAME = libdevice-lcd 8.9 + 8.10 +# Locations for interface input and generated output. 8.11 8.12 -SRC_CC := lcd-device.cc 8.13 +IDL_DIR = $(PKGDIR)/idl 8.14 +IDL_MK_DIR = $(L4DIR)/idl4re/mk 8.15 +IDL_BUILD_DIR = . 8.16 +IDL_EXPORT_DIR = $(OBJ_BASE)/include/l4/devices/activation 8.17 + 8.18 +include $(IDL_MK_DIR)/idl.mk 8.19 8.20 -PRIVATE_INCDIR += $(PKGDIR)/lcd/include 8.21 +# Individual interfaces. 8.22 + 8.23 +CLIENT_INTERFACES_CC = activation 8.24 + 8.25 +EXPORTED_INTERFACES_H = $(call exported_interfaces_h,$(CLIENT_INTERFACES_CC)) 8.26 8.27 -REQUIRES_LIBS := l4re_c l4re_c-util libdevice-display-client libdrivers-lcd-headers 8.28 +# Normal definitions. 8.29 + 8.30 +SRC_CC = lcd-device.cc 8.31 + 8.32 +REQUIRES_LIBS = l4re_c l4re_c-util libdrivers-lcd-headers 8.33 + 8.34 +PRIVATE_INCDIR = $(PKGDIR)/lcd/include $(IDL_BUILD_DIR) $(IDL_EXPORT_DIR) 8.35 8.36 include $(L4DIR)/mk/lib.mk 8.37 +include $(IDL_MK_DIR)/interface_rules.mk 8.38 + 8.39 +$(SRC_CC): $(EXPORTED_INTERFACES_H)
9.1 --- a/pkg/devices/lcd/src/jz4740/Makefile Wed Dec 30 22:48:28 2020 +0100 9.2 +++ b/pkg/devices/lcd/src/jz4740/Makefile Wed Dec 30 22:51:48 2020 +0100 9.3 @@ -2,12 +2,40 @@ 9.4 L4DIR ?= $(PKGDIR)/../.. 9.5 9.6 TARGET = liblcd_dev_jz4740.o.a liblcd_dev_jz4740.o.so 9.7 -PC_FILENAME := libdevice-lcd-jz4740 9.8 +PC_FILENAME = libdevice-lcd-jz4740 9.9 + 9.10 +# Locations for interface input and generated output. 9.11 9.12 -SRC_CC := lcd-jz4740-device.cc 9.13 +IDL_DIR = $(PKGDIR)/idl 9.14 +IDL_MK_DIR = $(L4DIR)/idl4re/mk 9.15 +IDL_BUILD_DIR = . 9.16 +IDL_EXPORT_DIR = $(OBJ_BASE)/include/l4/devices/activation 9.17 + 9.18 +include $(IDL_MK_DIR)/idl.mk 9.19 + 9.20 +# Individual interfaces. 9.21 + 9.22 +CLIENT_INTERFACES_CC = activation 9.23 9.24 -PRIVATE_INCDIR += $(PKGDIR)/lcd/include 9.25 +# Generated and plain source files. 9.26 + 9.27 +CLIENT_INTERFACES_SRC_CC = $(call interfaces_to_client_cc,$(CLIENT_INTERFACES_CC)) 9.28 + 9.29 +PLAIN_SRC_CC = lcd-jz4740-device.cc 9.30 + 9.31 +# Normal definitions. 9.32 9.33 -REQUIRES_LIBS := l4re_c l4re_c-util libdevice-lcd libdrivers-lcd-jz4740 libdrivers-panel-loader libdevice-cpm-client libdevice-util 9.34 +SRC_CC = $(CLIENT_INTERFACES_SRC_CC) $(PLAIN_SRC_CC) 9.35 + 9.36 +REQUIRES_LIBS = \ 9.37 + l4re_c l4re_c-util \ 9.38 + libdevice-cpm-client \ 9.39 + libdevice-lcd libdrivers-lcd-jz4740 libdrivers-panel-loader \ 9.40 + libdevice-util libipc 9.41 + 9.42 +PRIVATE_INCDIR = $(PKGDIR)/lcd/include $(IDL_BUILD_DIR) $(IDL_EXPORT_DIR) 9.43 9.44 include $(L4DIR)/mk/lib.mk 9.45 +include $(IDL_MK_DIR)/interface_rules.mk 9.46 + 9.47 +$(PLAIN_SRC_CC): $(CLIENT_INTERFACES_SRC_CC)
10.1 --- a/pkg/devices/lcd/src/jz4740/lcd-jz4740-device.cc Wed Dec 30 22:48:28 2020 +0100 10.2 +++ b/pkg/devices/lcd/src/jz4740/lcd-jz4740-device.cc Wed Dec 30 22:51:48 2020 +0100 10.3 @@ -20,7 +20,6 @@ 10.4 */ 10.5 10.6 #include <l4/devices/cpm-client.h> 10.7 -#include <l4/devices/display-client.h> 10.8 #include <l4/devices/lcd-jz4740.h> 10.9 #include <l4/devices/lcd-jz4780.h> 10.10 #include <l4/devices/panel-loader.h> 10.11 @@ -29,6 +28,7 @@ 10.12 10.13 #include <l4/re/dataspace> 10.14 #include <l4/re/env> 10.15 +#include <l4/re/env.h> 10.16 #include <l4/re/mem_alloc> 10.17 #include <l4/re/rm> 10.18 #include <l4/re/util/cap_alloc> 10.19 @@ -36,6 +36,8 @@ 10.20 10.21 #include <stdint.h> 10.22 10.23 +#include "activation_client.h" 10.24 + 10.25 // Virtual addresses for the LCD register block. 10.26 10.27 static l4_addr_t lcd_virt_base = 0, lcd_virt_base_end = 0; 10.28 @@ -45,7 +47,7 @@ 10.29 static Lcd_jz4740_chip *lcd_chip = 0; 10.30 10.31 static L4::Cap<Cpm_device_interface> cpm_device; 10.32 -static L4::Cap<Display_device_interface> display_device; 10.33 +static Activation *display_device; 10.34 10.35 10.36 10.37 @@ -266,8 +268,11 @@ 10.38 cpm_device = L4Re::Env::env()->get_cap<Cpm_device_interface>("cpm"); 10.39 if (!cpm_device.is_valid()) return 1; 10.40 10.41 - display_device = L4Re::Env::env()->get_cap<Display_device_interface>("display"); 10.42 - if (!display_device.is_valid()) return 1; 10.43 + l4_cap_idx_t display = l4re_env_get_cap("display"); 10.44 + if (!l4_is_valid_cap(display)) return 1; 10.45 + 10.46 + static client_Activation display_obj(display); 10.47 + display_device = &display_obj; 10.48 10.49 // Load the panel data from the configured library. 10.50