From 4bf03266a9acdf8793755721e8b727c17e05dfcf Mon Sep 17 00:00:00 2001 From: "Justin C. Miller" Date: Mon, 10 Jul 2023 01:37:31 -0700 Subject: [PATCH] [libj6] Account for double-mapped ring buffers in j6::channel When keeping track of addresses to give to the kernel for channel shared memory, double the channel's size since the kernel will double-map the area as a ring buffer. --- src/libraries/j6/channel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/j6/channel.cpp b/src/libraries/j6/channel.cpp index 17bc607..b6f1858 100644 --- a/src/libraries/j6/channel.cpp +++ b/src/libraries/j6/channel.cpp @@ -54,7 +54,7 @@ channel::create(size_t size) util::scoped_lock lock {addr_spinlock}; uintptr_t addr = channel_addr; - channel_addr += size; + channel_addr += size * 2; // account for ring buffer virtual space doubling lock.release(); result = j6_vma_create_map(&vma, size, addr, j6_vm_flag_write|j6_vm_flag_ring);