[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.
This commit is contained in:
Justin C. Miller
2023-07-10 01:37:31 -07:00
parent 4bceac3d56
commit 4bf03266a9

View File

@@ -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);