diff options
author | Andreas Kling <awesomekling@gmail.com> | 2020-01-12 02:17:30 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2020-01-12 02:18:30 +0100 |
commit | 017b34e1adf23b698589035f97f4c9dcd6a83006 (patch) | |
tree | 3dc29eae98d71375cca646f11d2bb982e4bfd05c /Kernel/Devices/MBVGADevice.cpp | |
parent | bb6b9d905912ca38ce64a4b77c7b003ed108db14 (diff) | |
download | serenity-017b34e1adf23b698589035f97f4c9dcd6a83006.zip |
Kernel: Add "video" pledge for accessing framebuffer devices
WindowServer becomes the only user.
Diffstat (limited to 'Kernel/Devices/MBVGADevice.cpp')
-rw-r--r-- | Kernel/Devices/MBVGADevice.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Kernel/Devices/MBVGADevice.cpp b/Kernel/Devices/MBVGADevice.cpp index 0c86eccbdd..39a16a8795 100644 --- a/Kernel/Devices/MBVGADevice.cpp +++ b/Kernel/Devices/MBVGADevice.cpp @@ -25,6 +25,7 @@ MBVGADevice::MBVGADevice(PhysicalAddress addr, int pitch, int width, int height) KResultOr<Region*> MBVGADevice::mmap(Process& process, FileDescription&, VirtualAddress preferred_vaddr, size_t offset, size_t size, int prot) { + REQUIRE_PROMISE(video); ASSERT(offset == 0); ASSERT(size == framebuffer_size_in_bytes()); auto vmobject = AnonymousVMObject::create_for_physical_range(m_framebuffer_address, framebuffer_size_in_bytes()); @@ -44,6 +45,7 @@ KResultOr<Region*> MBVGADevice::mmap(Process& process, FileDescription&, Virtual int MBVGADevice::ioctl(FileDescription&, unsigned request, unsigned arg) { + REQUIRE_PROMISE(video); switch (request) { case FB_IOCTL_GET_SIZE_IN_BYTES: { auto* out = (size_t*)arg; |