kernel: Allow mapping the framebuffer even if its size is not page-aligned
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
b4a9ea3857
commit
14f0c93175
@ -4,6 +4,7 @@
|
||||
#include "video/Framebuffer.h"
|
||||
#include <bits/ioctl-defs.h>
|
||||
#include <luna/CString.h>
|
||||
#include <luna/Alignment.h>
|
||||
|
||||
Result<void> FramebufferDevice::create()
|
||||
{
|
||||
@ -27,7 +28,7 @@ Result<usize> FramebufferDevice::write(const u8* buf, usize offset, usize length
|
||||
|
||||
Result<u64> FramebufferDevice::query_shared_memory(off_t offset, usize count)
|
||||
{
|
||||
if (offset + (count * ARCH_PAGE_SIZE) > Framebuffer::size()) return err(EINVAL);
|
||||
if (offset + (count * ARCH_PAGE_SIZE) > align_up<ARCH_PAGE_SIZE>((u64)Framebuffer::size())) return err(EINVAL);
|
||||
|
||||
if (!m_shmid.has_value())
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user