mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 04:17:35 +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
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