mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-24 18:28:57 +00:00
Kernel: Turn Thread::current and Process::current into functions
This allows us to query the current thread and process on a per processor basis
This commit is contained in:
parent
cdc78515b6
commit
16783bd14d
Notes:
sideshowbarker
2024-07-19 05:17:59 +09:00
Author: https://github.com/tomuta
Commit: 16783bd14d
Pull-request: https://github.com/SerenityOS/serenity/pull/2513
39 changed files with 518 additions and 369 deletions
|
@ -79,21 +79,21 @@ int MBVGADevice::ioctl(FileDescription&, unsigned request, FlatPtr arg)
|
|||
switch (request) {
|
||||
case FB_IOCTL_GET_SIZE_IN_BYTES: {
|
||||
auto* out = (size_t*)arg;
|
||||
if (!Process::current->validate_write_typed(out))
|
||||
if (!Process::current()->validate_write_typed(out))
|
||||
return -EFAULT;
|
||||
*out = framebuffer_size_in_bytes();
|
||||
return 0;
|
||||
}
|
||||
case FB_IOCTL_GET_BUFFER: {
|
||||
auto* index = (int*)arg;
|
||||
if (!Process::current->validate_write_typed(index))
|
||||
if (!Process::current()->validate_write_typed(index))
|
||||
return -EFAULT;
|
||||
*index = 0;
|
||||
return 0;
|
||||
}
|
||||
case FB_IOCTL_GET_RESOLUTION: {
|
||||
auto* resolution = (FBResolution*)arg;
|
||||
if (!Process::current->validate_write_typed(resolution))
|
||||
if (!Process::current()->validate_write_typed(resolution))
|
||||
return -EFAULT;
|
||||
resolution->pitch = m_framebuffer_pitch;
|
||||
resolution->width = m_framebuffer_width;
|
||||
|
@ -102,7 +102,7 @@ int MBVGADevice::ioctl(FileDescription&, unsigned request, FlatPtr arg)
|
|||
}
|
||||
case FB_IOCTL_SET_RESOLUTION: {
|
||||
auto* resolution = (FBResolution*)arg;
|
||||
if (!Process::current->validate_read_typed(resolution) || !Process::current->validate_write_typed(resolution))
|
||||
if (!Process::current()->validate_read_typed(resolution) || !Process::current()->validate_write_typed(resolution))
|
||||
return -EFAULT;
|
||||
resolution->pitch = m_framebuffer_pitch;
|
||||
resolution->width = m_framebuffer_width;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue