1.1 --- a/pkg/devices/input/src/keypad/input-keypad-client.cc Tue Sep 27 23:21:50 2022 +0200 1.2 +++ b/pkg/devices/input/src/keypad/input-keypad-client.cc Sun May 28 22:35:09 2023 +0200 1.3 @@ -1,7 +1,7 @@ 1.4 /* 1.5 * Common keypad client functionality for input event generation. 1.6 * 1.7 - * Copyright (C) 2018 Paul Boddie <paul@boddie.org.uk> 1.8 + * Copyright (C) 2018, 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 @@ -70,7 +70,7 @@ 1.13 /* Attach the keypad data to a region in this task. */ 1.14 1.15 if (L4Re::Env::env()->rm()->attach(&_keymem, _mem->size(), 1.16 - L4Re::Rm::Search_addr, 1.17 + L4Re::Rm::F::Search_addr, 1.18 L4::Ipc::make_cap_rw(_mem))) 1.19 return; 1.20
2.1 --- a/pkg/devices/lcd/include/lcd-device.h Tue Sep 27 23:21:50 2022 +0200 2.2 +++ b/pkg/devices/lcd/include/lcd-device.h Sun May 28 22:35:09 2023 +0200 2.3 @@ -1,7 +1,7 @@ 2.4 /* 2.5 * LCD device support. 2.6 * 2.7 - * Copyright (C) 2018 Paul Boddie <paul@boddie.org.uk> 2.8 + * Copyright (C) 2018, 2023 Paul Boddie <paul@boddie.org.uk> 2.9 * 2.10 * This program is free software; you can redistribute it and/or 2.11 * modify it under the terms of the GNU General Public License as 2.12 @@ -32,6 +32,7 @@ 2.13 #ifdef __cplusplus 2.14 2.15 #include <l4/re/dataspace> 2.16 +#include <l4/re/dma_space> 2.17 #include <l4/sys/capability> 2.18 2.19 class Lcd_device 2.20 @@ -47,7 +48,8 @@ 2.21 2.22 /* Framebuffer virtual and physical addresses. */ 2.23 2.24 - l4_addr_t fb_vaddr, fb_paddr; 2.25 + l4_addr_t fb_vaddr; 2.26 + L4Re::Dma_space::Dma_addr fb_paddr; 2.27 2.28 /* Memory capability for the framebuffer. */ 2.29
3.1 --- a/pkg/devices/lcd/include/lcd-jz4740-device.h Tue Sep 27 23:21:50 2022 +0200 3.2 +++ b/pkg/devices/lcd/include/lcd-jz4740-device.h Sun May 28 22:35:09 2023 +0200 3.3 @@ -1,7 +1,7 @@ 3.4 /* 3.5 * LCD device support for the JZ4740 and related SoCs. 3.6 * 3.7 - * Copyright (C) 2018 Paul Boddie <paul@boddie.org.uk> 3.8 + * Copyright (C) 2018, 2023 Paul Boddie <paul@boddie.org.uk> 3.9 * 3.10 * This program is free software; you can redistribute it and/or 3.11 * modify it under the terms of the GNU General Public License as 3.12 @@ -22,8 +22,10 @@ 3.13 #pragma once 3.14 3.15 #include <l4/devices/lcd.h> 3.16 + 3.17 #include "lcd-device.h" 3.18 3.19 +#include <l4/re/dma_space> 3.20 #include <l4/re/c/video/view.h> 3.21 #include <l4/sys/types.h> 3.22 3.23 @@ -37,7 +39,8 @@ 3.24 { 3.25 /* DMA descriptor virtual and physical addresses. */ 3.26 3.27 - l4_addr_t desc_vaddr, desc_paddr; 3.28 + l4_addr_t desc_vaddr; 3.29 + L4Re::Dma_space::Dma_addr desc_paddr; 3.30 3.31 protected: 3.32 /* Device-specific memory allocation. */
4.1 --- a/pkg/devices/lcd/src/jz4740/lcd-jz4740-device.cc Tue Sep 27 23:21:50 2022 +0200 4.2 +++ b/pkg/devices/lcd/src/jz4740/lcd-jz4740-device.cc Sun May 28 22:35:09 2023 +0200 4.3 @@ -1,7 +1,7 @@ 4.4 /* 4.5 * Common LCD device support for the JZ4740 and related SoCs. 4.6 * 4.7 - * Copyright (C) 2018, 2020 Paul Boddie <paul@boddie.org.uk> 4.8 + * Copyright (C) 2018, 2020, 2023 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 @@ -28,11 +28,14 @@ 4.13 #include "lcd-jz4740-device.h" 4.14 4.15 #include <l4/re/dataspace> 4.16 +#include <l4/re/dma_space> 4.17 #include <l4/re/env> 4.18 #include <l4/re/mem_alloc> 4.19 #include <l4/re/rm> 4.20 #include <l4/re/util/cap_alloc> 4.21 +#include <l4/sys/factory> 4.22 #include <l4/sys/types.h> 4.23 +#include <l4/vbus/vbus> 4.24 4.25 #include <stdint.h> 4.26 4.27 @@ -124,9 +127,10 @@ 4.28 4.29 l4_size_t fb_size_out, desc_size_out; 4.30 4.31 - // Memory allocation capability. 4.32 + // Memory allocation capabilities. 4.33 4.34 L4::Cap<L4Re::Dataspace> descmem; 4.35 + L4::Cap<L4Re::Dma_space> dma; 4.36 4.37 // Test for existing setup. 4.38 4.39 @@ -141,6 +145,28 @@ 4.40 descmem = L4Re::Util::cap_alloc.alloc<L4Re::Dataspace>(); 4.41 if (!descmem.is_valid()) return 1; 4.42 4.43 + dma = L4Re::Util::cap_alloc.alloc<L4Re::Dma_space>(); 4.44 + if (!dma.is_valid()) return 1; 4.45 + 4.46 + // Create the DMA space. 4.47 + 4.48 + L4::Cap<L4vbus::Vbus> vbus = L4Re::Env::env()->get_cap<L4vbus::Vbus>("vbus"); 4.49 + if (!vbus.is_valid()) return 1; 4.50 + 4.51 + if (l4_error(L4Re::Env::env()->user_factory()->create(dma))) 4.52 + return 1; 4.53 + 4.54 + l4vbus_device_handle_t device = L4VBUS_NULL; 4.55 + l4vbus_resource_t dma_resource; 4.56 + 4.57 + if (!find_resource(&device, &dma_resource, L4VBUS_RESOURCE_DMA_DOMAIN)) 4.58 + return 1; 4.59 + 4.60 + if (vbus->assign_dma_domain(dma_resource.start, 4.61 + L4VBUS_DMAD_BIND | L4VBUS_DMAD_L4RE_DMA_SPACE, 4.62 + dma)) 4.63 + return 1; 4.64 + 4.65 // Obtain the memory requirements. 4.66 4.67 Lcd_jz4740_chip *chip = static_cast<Lcd_jz4740_chip *>(_chip); 4.68 @@ -161,13 +187,15 @@ 4.69 4.70 // Map the allocated memory, obtaining virtual addresses. 4.71 4.72 - const l4_size_t attach_flags = L4Re::Rm::Search_addr | L4Re::Rm::Eager_map; 4.73 + const L4Re::Rm::F::Flags flags = L4Re::Rm::F::Search_addr | 4.74 + L4Re::Rm::F::Eager_map | 4.75 + L4Re::Rm::F::RW; 4.76 4.77 fb_vaddr = 0; 4.78 desc_vaddr = 0; 4.79 4.80 - if (L4Re::Env::env()->rm()->attach(&fb_vaddr, fb_size, attach_flags, _fbmem, 0) || 4.81 - L4Re::Env::env()->rm()->attach(&desc_vaddr, desc_size, attach_flags, descmem, 0)) 4.82 + if (L4Re::Env::env()->rm()->attach(&fb_vaddr, fb_size, flags, _fbmem, 0) || 4.83 + L4Re::Env::env()->rm()->attach(&desc_vaddr, desc_size, flags, descmem, 0)) 4.84 return 1; 4.85 4.86 // Obtain physical addresses for the framebuffer and descriptors. 4.87 @@ -178,8 +206,16 @@ 4.88 fb_size_out = fb_size; 4.89 desc_size_out = desc_size; 4.90 4.91 - if (_fbmem->phys(0, fb_paddr, fb_size_out) || 4.92 - descmem->phys(0, desc_paddr, desc_size_out)) 4.93 + if (dma->map(L4::Ipc::make_cap_rw(_fbmem), 0, &fb_size_out, 4.94 + L4Re::Dma_space::Attributes::None, 4.95 + L4Re::Dma_space::Direction::To_device, 4.96 + &fb_paddr)) 4.97 + return 1; 4.98 + 4.99 + if (dma->map(L4::Ipc::make_cap_rw(descmem), 0, &desc_size_out, 4.100 + L4Re::Dma_space::Attributes::None, 4.101 + L4Re::Dma_space::Direction::To_device, 4.102 + &desc_paddr)) 4.103 return 1; 4.104 4.105 // Test the mapped region sizes.
5.1 --- a/pkg/devices/lib/panel/src/loader/panel-loader.cc Tue Sep 27 23:21:50 2022 +0200 5.2 +++ b/pkg/devices/lib/panel/src/loader/panel-loader.cc Sun May 28 22:35:09 2023 +0200 5.3 @@ -21,6 +21,7 @@ 5.4 5.5 #include <l4/devices/dl.h> 5.6 #include "panel-loader.h" 5.7 +#include <stdio.h> 5.8 5.9 void *load_panel() 5.10 {
6.1 --- a/pkg/devices/util/include/memory.h Tue Sep 27 23:21:50 2022 +0200 6.2 +++ b/pkg/devices/util/include/memory.h Sun May 28 22:35:09 2023 +0200 6.3 @@ -1,7 +1,7 @@ 6.4 /* 6.5 * Memory and resource allocation utility functions. 6.6 * 6.7 - * Copyright (C) 2018, 2019 Paul Boddie <paul@boddie.org.uk> 6.8 + * Copyright (C) 2018, 2019, 2023 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 @@ -27,13 +27,16 @@ 6.13 6.14 EXTERN_C_BEGIN 6.15 6.16 +int find_resource(l4vbus_device_handle_t *device, l4vbus_resource_t *resource, 6.17 + enum l4vbus_resource_type_t type); 6.18 + 6.19 int get_device(char const *hid, l4io_device_handle_t *dh, 6.20 l4io_resource_handle_t *rh); 6.21 6.22 int get_irq(char const *hid, l4_uint32_t *start, l4_uint32_t *end); 6.23 6.24 int get_resource(l4io_device_handle_t dh, l4io_resource_t *res, 6.25 - enum l4io_resource_types_t type); 6.26 + enum l4vbus_resource_type_t type); 6.27 6.28 int get_memory(char const *hid, l4_addr_t *start, l4_addr_t *end); 6.29
7.1 --- a/pkg/devices/util/src/dataspace.cc Tue Sep 27 23:21:50 2022 +0200 7.2 +++ b/pkg/devices/util/src/dataspace.cc Sun May 28 22:35:09 2023 +0200 7.3 @@ -1,7 +1,7 @@ 7.4 /* 7.5 * Data space allocation utility functions. 7.6 * 7.7 - * Copyright (C) 2018 Paul Boddie <paul@boddie.org.uk> 7.8 + * Copyright (C) 2018, 2023 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 @@ -52,7 +52,7 @@ 7.13 7.14 /* Map the memory to a virtual address. */ 7.15 7.16 - if (L4Re::Env::env()->rm()->attach(allocated, mem->size(), L4Re::Rm::Search_addr, 7.17 + if (L4Re::Env::env()->rm()->attach(allocated, mem->size(), L4Re::Rm::F::Search_addr, 7.18 L4::Ipc::make_cap_rw(mem))) 7.19 { 7.20 L4Re::Util::cap_alloc.free(mem);
8.1 --- a/pkg/devices/util/src/memory.cc Tue Sep 27 23:21:50 2022 +0200 8.2 +++ b/pkg/devices/util/src/memory.cc Sun May 28 22:35:09 2023 +0200 8.3 @@ -1,7 +1,7 @@ 8.4 /* 8.5 * Memory and resource allocation utility functions. 8.6 * 8.7 - * Copyright (C) 2018, 2019 Paul Boddie <paul@boddie.org.uk> 8.8 + * Copyright (C) 2018, 2019, 2023 Paul Boddie <paul@boddie.org.uk> 8.9 * 8.10 * This program is free software; you can redistribute it and/or 8.11 * modify it under the terms of the GNU General Public License as 8.12 @@ -45,7 +45,7 @@ 8.13 if (result < 0) 8.14 return result; 8.15 8.16 - result = get_resource(dh, &res, L4IO_RESOURCE_IRQ); 8.17 + result = get_resource(dh, &res, L4VBUS_RESOURCE_IRQ); 8.18 8.19 if (result) 8.20 return result; 8.21 @@ -57,7 +57,7 @@ 8.22 } 8.23 8.24 int get_resource(l4io_device_handle_t dh, l4io_resource_t *res, 8.25 - enum l4io_resource_types_t type) 8.26 + enum l4vbus_resource_type_t type) 8.27 { 8.28 int current = 0, result = 0; 8.29 l4_cap_idx_t vbus = l4re_env_get_cap("vbus"); 8.30 @@ -84,7 +84,7 @@ 8.31 if (result < 0) 8.32 return result; 8.33 8.34 - result = get_resource(dh, &res, L4IO_RESOURCE_MEM); 8.35 + result = get_resource(dh, &res, L4VBUS_RESOURCE_MEM); 8.36 8.37 if (result) 8.38 return result; 8.39 @@ -99,3 +99,39 @@ 8.40 8.41 return 0; 8.42 } 8.43 + 8.44 +static int _find_resource(l4vbus_device_handle_t device, 8.45 + l4vbus_resource_t *resource, 8.46 + enum l4vbus_resource_type_t type, 8.47 + l4vbus_device_t info) 8.48 +{ 8.49 + l4_cap_idx_t vbus = l4re_env_get_cap("vbus"); 8.50 + 8.51 + for (unsigned int i = 0; i < info.num_resources; i++) 8.52 + { 8.53 + int result = l4vbus_get_resource(vbus, device, i, resource); 8.54 + 8.55 + if (!result && (resource->type == type)) 8.56 + return 1; 8.57 + } 8.58 + 8.59 + return 0; 8.60 +} 8.61 + 8.62 +int find_resource(l4vbus_device_handle_t *device, l4vbus_resource_t *resource, 8.63 + enum l4vbus_resource_type_t type) 8.64 +{ 8.65 + l4_cap_idx_t vbus = l4re_env_get_cap("vbus"); 8.66 + l4vbus_device_t info; 8.67 + 8.68 + /* Search within devices only, not within the top-level of the bus itself. */ 8.69 + 8.70 + while (!l4vbus_get_next_device(vbus, L4VBUS_ROOT_BUS, device, 8.71 + L4VBUS_MAX_DEPTH, &info)) 8.72 + { 8.73 + if (_find_resource(*device, resource, type, info)) 8.74 + return 1; 8.75 + } 8.76 + 8.77 + return 0; 8.78 +}
9.1 --- a/pkg/landfall-examples/ci20_hdmi_i2c/ci20_hdmi_i2c.c Tue Sep 27 23:21:50 2022 +0200 9.2 +++ b/pkg/landfall-examples/ci20_hdmi_i2c/ci20_hdmi_i2c.c Sun May 28 22:35:09 2023 +0200 9.3 @@ -1,7 +1,7 @@ 9.4 /* 9.5 * Access the HDMI I2C peripheral on the MIPS Creator CI20 board. 9.6 * 9.7 - * Copyright (C) 2020 Paul Boddie <paul@boddie.org.uk> 9.8 + * Copyright (C) 2020, 2023 Paul Boddie <paul@boddie.org.uk> 9.9 * 9.10 * This program is free software; you can redistribute it and/or 9.11 * modify it under the terms of the GNU General Public License as 9.12 @@ -30,12 +30,15 @@ 9.13 #include <l4/devices/memory.h> 9.14 9.15 #include <l4/re/c/dataspace.h> 9.16 +#include <l4/re/c/dma_space.h> 9.17 #include <l4/re/c/mem_alloc.h> 9.18 #include <l4/re/c/rm.h> 9.19 #include <l4/re/c/util/cap_alloc.h> 9.20 #include <l4/re/env.h> 9.21 +#include <l4/re/protocols.h> 9.22 9.23 #include <l4/sys/cache.h> 9.24 +#include <l4/sys/err.h> 9.25 #include <l4/sys/factory.h> 9.26 #include <l4/sys/icu.h> 9.27 #include <l4/sys/ipc.h> 9.28 @@ -146,9 +149,10 @@ 9.29 9.30 /* Allocated memory. */ 9.31 9.32 - l4_cap_idx_t desc_mem, fb_mem; 9.33 + l4_cap_idx_t desc_mem, fb_mem, dma, vbus; 9.34 l4_size_t desc_size, desc_psize, fb_size, fb_psize; 9.35 - l4_addr_t desc_addr, desc_paddr, fb_addr, fb_paddr; 9.36 + l4_addr_t desc_addr, fb_addr; 9.37 + l4re_dma_space_dma_addr_t desc_paddr, fb_paddr; 9.38 unsigned char *picture; 9.39 unsigned char *fb_picture, *fb_picture_row; 9.40 unsigned int x, y; 9.41 @@ -157,17 +161,19 @@ 9.42 9.43 l4_uint32_t hdmi_irq_start = 0, hdmi_irq_end = 0; 9.44 l4_uint32_t lcd_irq_start = 0, lcd_irq_end = 0; 9.45 - l4_cap_idx_t icucap, hdmi_irq, lcd_irq; 9.46 + l4_cap_idx_t icu, hdmi_irq, lcd_irq; 9.47 9.48 /* Capability allocation. */ 9.49 9.50 desc_mem = l4re_util_cap_alloc(); 9.51 fb_mem = l4re_util_cap_alloc(); 9.52 + dma = l4re_util_cap_alloc(); 9.53 hdmi_irq = l4re_util_cap_alloc(); 9.54 lcd_irq = l4re_util_cap_alloc(); 9.55 - icucap = l4re_env_get_cap("icu"); 9.56 + icu = l4re_env_get_cap("icu"); 9.57 + vbus = l4re_env_get_cap("vbus"); 9.58 9.59 - if (l4_is_invalid_cap(icucap)) 9.60 + if (l4_is_invalid_cap(icu)) 9.61 { 9.62 printf("No 'icu' capability available in the virtual bus.\n"); 9.63 return 1; 9.64 @@ -208,10 +214,10 @@ 9.65 /* Bind interrupt objects to IRQ numbers. Here, the first HDMI interrupt is 9.66 bound, this being the general HDMI interrupt. */ 9.67 9.68 - err = l4_error(l4_icu_bind(icucap, 9.69 + err = l4_error(l4_icu_bind(icu, 9.70 item_in_range(hdmi_irq_start, hdmi_irq_end, 0), 9.71 hdmi_irq)) || 9.72 - l4_error(l4_icu_bind(icucap, 9.73 + l4_error(l4_icu_bind(icu, 9.74 item_in_range(lcd_irq_start, lcd_irq_end, 0), 9.75 lcd_irq)); 9.76 9.77 @@ -353,38 +359,75 @@ 9.78 9.79 jz4780_hdmi_enable(hdmi, jz4780_cpm_get_lcd_pixel_frequency(cpm)); 9.80 9.81 + /* Create the DMA space. */ 9.82 + 9.83 + err = l4_error(l4_factory_create(l4re_env()->mem_alloc, L4RE_PROTO_DMA_SPACE, dma)); 9.84 + 9.85 + if (err) 9.86 + { 9.87 + printf("Could not create DMA space: %s\n", l4sys_errtostr(err)); 9.88 + return 1; 9.89 + } 9.90 + 9.91 + l4vbus_device_handle_t device = L4VBUS_NULL; 9.92 + l4vbus_resource_t dma_resource; 9.93 + 9.94 + if (!find_resource(&device, &dma_resource, L4VBUS_RESOURCE_DMA_DOMAIN)) 9.95 + { 9.96 + printf("Could not find DMA domain.\n"); 9.97 + return 1; 9.98 + } 9.99 + 9.100 + err = l4vbus_assign_dma_domain(vbus, dma_resource.start, 9.101 + L4VBUS_DMAD_BIND | L4VBUS_DMAD_L4RE_DMA_SPACE, 9.102 + dma); 9.103 + 9.104 + if (err) 9.105 + { 9.106 + printf("Could not assign DMA space: %s\n", l4sys_errtostr(err)); 9.107 + return 1; 9.108 + } 9.109 + 9.110 /* Allocate descriptors and framebuffer at 2**8 == 256 byte == 64 word alignment. */ 9.111 9.112 desc_size = jz4740_lcd_get_descriptors_size(lcd); 9.113 fb_size = jz4740_lcd_get_screen_size(lcd); 9.114 9.115 - if (l4re_ma_alloc_align(desc_size, desc_mem, L4RE_MA_CONTINUOUS | L4RE_MA_PINNED, 8) || 9.116 - l4re_ma_alloc_align(fb_size, fb_mem, L4RE_MA_CONTINUOUS | L4RE_MA_PINNED, 8)) 9.117 + err = l4re_ma_alloc_align(desc_size, desc_mem, L4RE_MA_CONTINUOUS | L4RE_MA_PINNED, 8) || 9.118 + l4re_ma_alloc_align(fb_size, fb_mem, L4RE_MA_CONTINUOUS | L4RE_MA_PINNED, 8); 9.119 + 9.120 + if (err) 9.121 { 9.122 - printf("Could not allocate memory.\n"); 9.123 + printf("Could not allocate memory: %s\n", l4sys_errtostr(err)); 9.124 return 1; 9.125 } 9.126 9.127 - if (l4re_rm_attach((void **) &desc_addr, desc_size, 9.128 - L4RE_RM_SEARCH_ADDR | L4RE_RM_EAGER_MAP, 9.129 - desc_mem, 0, L4_PAGESHIFT) || 9.130 - l4re_rm_attach((void **) &fb_addr, fb_size, 9.131 - L4RE_RM_SEARCH_ADDR | L4RE_RM_EAGER_MAP, 9.132 - fb_mem, 0, L4_PAGESHIFT)) 9.133 + err = l4re_rm_attach((void **) &desc_addr, desc_size, 9.134 + L4RE_RM_F_SEARCH_ADDR | L4RE_RM_F_EAGER_MAP | L4RE_RM_F_RW, 9.135 + desc_mem, 0, L4_PAGESHIFT) || 9.136 + l4re_rm_attach((void **) &fb_addr, fb_size, 9.137 + L4RE_RM_F_SEARCH_ADDR | L4RE_RM_F_EAGER_MAP | L4RE_RM_F_RW, 9.138 + fb_mem, 0, L4_PAGESHIFT); 9.139 + 9.140 + if (err) 9.141 { 9.142 - printf("Could not map memory.\n"); 9.143 + printf("Could not map memory: %s\n", l4sys_errtostr(err)); 9.144 return 1; 9.145 } 9.146 9.147 - if (l4re_ds_phys(desc_mem, 0, &desc_paddr, &desc_psize) || 9.148 - l4re_ds_phys(fb_mem, 0, &fb_paddr, &fb_psize)) 9.149 + err = l4re_dma_space_map(dma, desc_mem | L4_CAP_FPAGE_RW, 0, &desc_psize, 0, 9.150 + L4RE_DMA_SPACE_TO_DEVICE, &desc_paddr) || 9.151 + l4re_dma_space_map(dma, fb_mem | L4_CAP_FPAGE_RW, 0, &fb_psize, 0, 9.152 + L4RE_DMA_SPACE_TO_DEVICE, &fb_paddr); 9.153 + 9.154 + if (err) 9.155 { 9.156 - printf("Could not get physical addresses for memory.\n"); 9.157 + printf("Could not get physical addresses for memory: %s\n", l4sys_errtostr(err)); 9.158 return 1; 9.159 } 9.160 9.161 - printf("Descriptors at %lx/%lx, size %d/%d.\n", desc_addr, desc_paddr, desc_size, desc_psize); 9.162 - printf("Framebuffer at %lx/%lx, size %d/%d.\n", fb_addr, fb_paddr, fb_size, fb_psize); 9.163 + printf("Descriptors at %lx/%llx, size %d/%d.\n", desc_addr, desc_paddr, desc_size, desc_psize); 9.164 + printf("Framebuffer at %lx/%llx, size %d/%d.\n", fb_addr, fb_paddr, fb_size, fb_psize); 9.165 9.166 //memset((void *) fb_addr, 0x7f, fb_size); 9.167
10.1 --- a/pkg/landfall-examples/ci20_leds/ci20_leds.c Tue Sep 27 23:21:50 2022 +0200 10.2 +++ b/pkg/landfall-examples/ci20_leds/ci20_leds.c Sun May 28 22:35:09 2023 +0200 10.3 @@ -1,7 +1,7 @@ 10.4 /* 10.5 * (c) 2008-2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de> 10.6 * economic rights: Technische Universität Dresden (Germany) 10.7 - * Copyright (C) 2017, 2018 Paul Boddie <paul@boddie.org.uk> 10.8 + * Copyright (C) 2017, 2018, 2023 Paul Boddie <paul@boddie.org.uk> 10.9 * 10.10 * This file is part of TUD:OS and distributed under the terms of the 10.11 * GNU General Public License 2. 10.12 @@ -23,6 +23,7 @@ 10.13 #include <l4/sys/icu.h> 10.14 #include <l4/sys/ipc.h> 10.15 #include <l4/sys/irq.h> 10.16 +#include <l4/sys/rcv_endpoint.h> 10.17 #include <l4/vbus/vbus.h> 10.18 #include <stdio.h> 10.19 #include <unistd.h> 10.20 @@ -224,7 +225,7 @@ 10.21 10.22 /* Attach ourselves to the interrupt handler. */ 10.23 10.24 - tag = l4_irq_attach(irqcap, 0xDEAD, l4re_env()->main_thread); 10.25 + tag = l4_rcv_ep_bind_thread(irqcap, l4re_env()->main_thread, 0xDEAD); 10.26 10.27 if ((err = l4_error(tag))) 10.28 {
11.1 --- a/pkg/landfall-examples/input_event_client/input_event_client.cc Tue Sep 27 23:21:50 2022 +0200 11.2 +++ b/pkg/landfall-examples/input_event_client/input_event_client.cc Sun May 28 22:35:09 2023 +0200 11.3 @@ -1,7 +1,7 @@ 11.4 /* 11.5 * Access an input device via a capability. 11.6 * 11.7 - * Copyright (C) 2018 Paul Boddie <paul@boddie.org.uk> 11.8 + * Copyright (C) 2018, 2023 Paul Boddie <paul@boddie.org.uk> 11.9 * 11.10 * This program is free software; you can redistribute it and/or 11.11 * modify it under the terms of the GNU General Public License as 11.12 @@ -273,7 +273,7 @@ 11.13 11.14 void *evmem = 0; 11.15 11.16 - if (L4Re::Env::env()->rm()->attach(&evmem, mem->size(), L4Re::Rm::Search_addr, 11.17 + if (L4Re::Env::env()->rm()->attach(&evmem, mem->size(), L4Re::Rm::F::Search_addr, 11.18 L4::Ipc::make_cap_rw(mem))) 11.19 return 1; 11.20
12.1 --- a/pkg/landfall-examples/keypad_ds_client/keypad_ds_client.cc Tue Sep 27 23:21:50 2022 +0200 12.2 +++ b/pkg/landfall-examples/keypad_ds_client/keypad_ds_client.cc Sun May 28 22:35:09 2023 +0200 12.3 @@ -1,7 +1,7 @@ 12.4 /* 12.5 * Display the keypad matrix using the specified dimensions. 12.6 * 12.7 - * Copyright (C) 2018 Paul Boddie <paul@boddie.org.uk> 12.8 + * Copyright (C) 2018, 2023 Paul Boddie <paul@boddie.org.uk> 12.9 * 12.10 * This program is free software; you can redistribute it and/or 12.11 * modify it under the terms of the GNU General Public License as 12.12 @@ -156,7 +156,7 @@ 12.13 12.14 /* Attach the keypad data to a region in this task. */ 12.15 12.16 - if (L4Re::Env::env()->rm()->attach(&keymem, mem->size(), L4Re::Rm::Search_addr, 12.17 + if (L4Re::Env::env()->rm()->attach(&keymem, mem->size(), L4Re::Rm::F::Search_addr, 12.18 L4::Ipc::make_cap_rw(mem))) 12.19 return 1; 12.20
13.1 --- a/pkg/landfall-examples/keypad_ds_client/keypad_ds_client_c.c Tue Sep 27 23:21:50 2022 +0200 13.2 +++ b/pkg/landfall-examples/keypad_ds_client/keypad_ds_client_c.c Sun May 28 22:35:09 2023 +0200 13.3 @@ -1,7 +1,7 @@ 13.4 /* 13.5 * Display the keypad matrix using the specified dimensions. 13.6 * 13.7 - * Copyright (C) 2018 Paul Boddie <paul@boddie.org.uk> 13.8 + * Copyright (C) 2018, 2023 Paul Boddie <paul@boddie.org.uk> 13.9 * 13.10 * This program is free software; you can redistribute it and/or 13.11 * modify it under the terms of the GNU General Public License as 13.12 @@ -163,7 +163,7 @@ 13.13 13.14 /* Attach the keypad data to a region in this task. */ 13.15 13.16 - if (l4re_rm_attach(&keymem, l4re_ds_size(mem), L4RE_RM_SEARCH_ADDR, mem, 0, 13.17 + if (l4re_rm_attach(&keymem, l4re_ds_size(mem), L4RE_RM_F_SEARCH_ADDR, mem, 0, 13.18 L4_PAGESHIFT)) 13.19 return 1; 13.20
14.1 --- a/pkg/landfall-examples/letux400_keypad_physical/letux400_keypad_physical.c Tue Sep 27 23:21:50 2022 +0200 14.2 +++ b/pkg/landfall-examples/letux400_keypad_physical/letux400_keypad_physical.c Sun May 28 22:35:09 2023 +0200 14.3 @@ -2,7 +2,7 @@ 14.4 * Display the physical keypad matrix layout for the Letux 400 notebook 14.5 * computer. 14.6 * 14.7 - * Copyright (C) 2018 Paul Boddie <paul@boddie.org.uk> 14.8 + * Copyright (C) 2018, 2023 Paul Boddie <paul@boddie.org.uk> 14.9 * 14.10 * This program is free software; you can redistribute it and/or 14.11 * modify it under the terms of the GNU General Public License as 14.12 @@ -300,7 +300,7 @@ 14.13 14.14 /* Attach the keypad data to a region in this task. */ 14.15 14.16 - if (l4re_rm_attach(&keymem, l4re_ds_size(mem), L4RE_RM_SEARCH_ADDR, mem, 0, 14.17 + if (l4re_rm_attach(&keymem, l4re_ds_size(mem), L4RE_RM_F_SEARCH_ADDR, mem, 0, 14.18 L4_PAGESHIFT)) 14.19 return 1; 14.20
15.1 --- a/pkg/landfall-examples/qi_lb60_keypad_physical/qi_lb60_keypad_physical.c Tue Sep 27 23:21:50 2022 +0200 15.2 +++ b/pkg/landfall-examples/qi_lb60_keypad_physical/qi_lb60_keypad_physical.c Sun May 28 22:35:09 2023 +0200 15.3 @@ -1,7 +1,7 @@ 15.4 /* 15.5 * Display the physical keypad matrix layout for the Ben NanoNote. 15.6 * 15.7 - * Copyright (C) 2018 Paul Boddie <paul@boddie.org.uk> 15.8 + * Copyright (C) 2018, 2023 Paul Boddie <paul@boddie.org.uk> 15.9 * 15.10 * This program is free software; you can redistribute it and/or 15.11 * modify it under the terms of the GNU General Public License as 15.12 @@ -294,7 +294,7 @@ 15.13 15.14 /* Attach the keypad data to a region in this task. */ 15.15 15.16 - if (l4re_rm_attach(&keymem, l4re_ds_size(mem), L4RE_RM_SEARCH_ADDR, mem, 0, 15.17 + if (l4re_rm_attach(&keymem, l4re_ds_size(mem), L4RE_RM_F_SEARCH_ADDR, mem, 0, 15.18 L4_PAGESHIFT)) 15.19 return 1; 15.20