mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 23:09:08 +00:00
Kernel: Use Process::require_promise() instead of REQUIRE_PROMISE()
This change lays the foundation for making the require_promise return an error hand handling the process abort outside of the syscall implementations, to avoid cases where we would leak resources. It also has the advantage that it makes removes a gs pointer read to look up the current thread, then process for every syscall. We can instead go through the Process this pointer in most cases.
This commit is contained in:
parent
c4f60844c5
commit
bad6d50b86
Notes:
sideshowbarker
2024-07-17 21:58:41 +09:00
Author: https://github.com/bgianfo
Commit: bad6d50b86
Pull-request: https://github.com/SerenityOS/serenity/pull/11476
61 changed files with 133 additions and 132 deletions
|
@ -29,8 +29,8 @@ NonnullRefPtr<FramebufferDevice> FramebufferDevice::create(const GenericGraphics
|
|||
|
||||
ErrorOr<Memory::Region*> FramebufferDevice::mmap(Process& process, OpenFileDescription&, Memory::VirtualRange const& range, u64 offset, int prot, bool shared)
|
||||
{
|
||||
process.require_promise(Pledge::video);
|
||||
SpinlockLocker lock(m_activation_lock);
|
||||
REQUIRE_PROMISE(video);
|
||||
if (!shared)
|
||||
return ENODEV;
|
||||
if (offset != 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue