1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:37:46 +00:00

Kernel: Replace "current" with Thread::current and Process::current

Suggested by Sergey. The currently running Thread and Process are now
Thread::current and Process::current respectively. :^)
This commit is contained in:
Andreas Kling 2020-02-17 15:04:27 +01:00
parent 4f4af24b9d
commit 48f7c28a5c
37 changed files with 257 additions and 252 deletions

View file

@ -77,21 +77,21 @@ int MBVGADevice::ioctl(FileDescription&, unsigned request, unsigned arg)
switch (request) {
case FB_IOCTL_GET_SIZE_IN_BYTES: {
auto* out = (size_t*)arg;
if (!current->process().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 (!current->process().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 (!current->process().validate_write_typed(resolution))
if (!Process::current->validate_write_typed(resolution))
return -EFAULT;
resolution->pitch = m_framebuffer_pitch;
resolution->width = m_framebuffer_width;
@ -100,7 +100,7 @@ int MBVGADevice::ioctl(FileDescription&, unsigned request, unsigned arg)
}
case FB_IOCTL_SET_RESOLUTION: {
auto* resolution = (FBResolution*)arg;
if (!current->process().validate_read_typed(resolution) || !current->process().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;