summaryrefslogtreecommitdiff
path: root/Kernel/Syscalls
AgeCommit message (Collapse)Author
2023-06-04Kernel: Rename Syscall.cpp => Syscalls/SyscallHandler.cppLiav A
2023-06-04Kernel: Move InterruptDisabler to the Interrupts subdirectoryLiav A
2023-06-04Kernel: Move Performance-measurement code to the Tasks subdirectoryLiav A
2023-06-04Kernel: Move TimerQueue code to the Time subdirectoryLiav A
2023-06-04Kernel: Move all boot-related code to the new Boot subdirectoryLiav A
2023-06-04Everywhere: Move global Kernel pattern code to Kernel/Library directoryLiav A
This has KString, KBuffer, DoubleBuffer, KBufferBuilder, IOWindow, UserOrKernelBuffer and ScopedCritical classes being moved to the Kernel/Library subdirectory. Also, move the panic and assertions handling code to that directory.
2023-06-04Kernel: Move task-crash related code to the Tasks subdirectoryLiav A
2023-06-04Kernel: Move Random.{h,cpp} code to Security subdirectoryLiav A
2023-06-04Kernel: Move all tasks-related code to the Tasks subdirectoryLiav A
2023-06-04Kernel: Move Jail code to a new subdirectoryLiav A
2023-05-27Kernel: Mark sys$get_dir_entries as not needing the big lockLiav A
After examination of all overriden Inode::traverse_as_directory methods it seems like proper locking is already existing everywhere, so there's no need to take the big process lock anymore, as there's no access to shared process structures anyway.
2023-05-27Kernel: Mark sys$fork as not needing the big lockLiav A
All shared structures are already protected by "atomic" spinlocks for those structures, so there's no need to take the big process lock.
2023-05-27Kernel: Mark sys$umount as not needing the big lockLiav A
All accesses to the mount table are already serialized by the actual spinlock of that table.
2023-05-24Kernel: Use UnixDateTime wherever applicablekleines Filmröllchen
"Wherever applicable" = most places, actually :^), especially for networking and filesystem timestamps. This includes changes to unzip, which uses DOSPackedTime, since that is changed for the FAT file systems.
2023-05-24AK: Rename Time to Durationkleines Filmröllchen
That's what this class really is; in fact that's what the first line of the comment says it is. This commit does not rename the main files, since those will contain other time-related classes in a little bit.
2023-05-17Kernel+Userland: Split bind-mounting and re-mounting from mount syscallLiav A
These 2 are an actual separate types of syscalls, so let's stop using special flags for bind mounting or re-mounting and instead let userspace calling directly for this kind of actions.
2023-04-24Kernel: Allow configuring a Jail to not impose PID isolation restrictionLiav A
This is quite useful for userspace applications that can't cope with the restriction, but it's still useful to impose other non-configurable restrictions by using jails.
2023-04-23Kernel+LibC: Implement `pthread_create` for AArch64Daniel Bertalan
Instead of storing x86_64 register names in `SC_create_thread_params`, let the Kernel figure out how to pass the parameters to `pthread_create_helper`.
2023-04-17Kernel: Use purpose-sized buffers for holding readlink resultsTim Schumacher
2023-04-14Kernel: Also search the main program for stack size requestsTim Schumacher
2023-04-14Kernel: Pick the maximum out of the requested stack sizesTim Schumacher
2023-04-10Kernel: Add the futimens syscallLiav A
We have a problem with the original utimensat syscall because when we do call LibC futimens function, internally we provide an empty path, and the Kernel get_syscall_path_argument method will detect this as an invalid path. This happens to spit an error for example in the touch utility, so if a user is running "touch non_existing_file", it will create that file, but the user will still see an error coming from LibC futimens function. This new syscall gets an open file description and it provides the same functionality as utimensat, on the specified open file description. The new syscall will be used later by LibC to properly implement LibC futimens function so the situation described with relation to the "touch" utility could be fixed.
2023-04-09Kernel: Remove redundant HID name from all associated filesLiav A
2023-04-09Kernel: Check flags for MAP_FIXED instead of prot in sys$mmapIdan Horowitz
We were accidentally not enforcing the map_fixed pledge
2023-04-08Kernel: Don't reuse old master TLS region data in sys$execve()Andreas Kling
When switching to the new address space, we also have to switch the Process::m_master_tls_* variables as they may refer to a region in the old address space. This was causing `su` to not run correctly. Regression from 65641187ffb15e3512fcf9c260c02287f83b5d09.
2023-04-06Kernel: Store FPU state when dispatching signal on aarch64Timon Kruiper
And make sure to also restore it in sys$sigreturn.
2023-04-06Kernel: Store a pointer to the owner process in PageDirectoryIdan Horowitz
This replaces the previous owning address space pointer. This commit should not change any of the existing functionality, but it lays down the groundwork needed to let us properly access the region table under the address space spinlock during page fault handling.
2023-04-06Kernel: Restructure execve to ensure Process::m_space is always in useIdan Horowitz
Instead of setting up the new address space on it's own, and only swap to the new address space at the end, we now immediately swap to the new address space (while still keeping the old one alive) and only revert back to the old one if we fail at any point. This is done to ensure that the process' active address space (aka the contents of m_space) always matches actual address space in use by it. That should allow us to eventually make the page fault handler process- aware, which will let us properly lock the process address space lock.
2023-04-06Kernel: Mark sys$msync as not needing the big lockIdan Horowitz
All accesses to shared mutable data are already serialized behind the process address space spinlock.
2023-04-06Kernel: Mark sys$mremap as not needing the big lockIdan Horowitz
All accesses to shared mutable data are already serialized behind the process address space spinlock.
2023-04-06Kernel: Mark sys$munmap as not needing the big lockIdan Horowitz
All accesses to shared mutable data are already serialized behind the process address space spinlock.
2023-04-06Kernel: Mark sys$set_mmap_name as not needing the big lockIdan Horowitz
All accesses to shared mutable data are already serialized behind the process address space spinlock.
2023-04-06Kernel: Mark sys$mprotect as not needing the big lockIdan Horowitz
All accesses to shared mutable data are already serialized behind the process address space spinlock.
2023-04-06Kernel: Mark sys$mmap as not needing the big lockIdan Horowitz
All accesses to shared mutable data are already serialized behind the process address space spinlock.
2023-04-06Kernel: Remove unused credentials() call in validate_inode_mmap_protIdan Horowitz
For some reason GCC did not complain about this.
2023-04-06Kernel: Mark sys$map_time_page as not needing the big lockIdan Horowitz
All accesses to shared mutable data are already serialized behind the process address space spinlock.
2023-04-06Kernel: Mark sys$madvise as not needing the big lockIdan Horowitz
All accesses to shared mutable data are already serialized behind the process address space spinlock.
2023-04-05Kernel: Mark sys$setpgid as not needing the big lockAndreas Kling
This function is already serialized by access to process protected data.
2023-04-05Kernel: Make Credentials the authority on process SIDAndreas Kling
The SID was duplicated between the process credentials and protected data. And to make matters worse, the credentials SID was not updated in sys$setsid. This patch fixes this by removing the SID from protected data and updating the credentials SID everywhere.
2023-04-05Kernel: Mark sys$setsid as not needing the big lockAndreas Kling
This function is now serialized by access to the process group list, and to the current process's protected data.
2023-04-05Kernel: Make ProcessGroup a ListedRefCounted and fix two racesAndreas Kling
This closes two race windows: - ProcessGroup removed itself from the "all process groups" list in its destructor. It was possible to walk the list between the last unref() and the destructor invocation, and grab a pointer to a ProcessGroup that was about to get deleted. - sys$setsid() could end up creating a process group that already existed, as there was a race window between checking if the PGID is used, and actually creating a ProcessGroup with that PGID.
2023-04-05Kernel: Move Process's TTY pointer into protected dataAndreas Kling
2023-04-05Kernel: Move Process's process group pointer into protected dataAndreas Kling
Now that it's no longer using LockRefPtr, we can actually move it into protected data. (LockRefPtr couldn't be stored there because protected data is immutable at times, and LockRefPtr uses some of its own bits for locking.)
2023-04-05Kernel: Stop using *LockRefPtr for TTYAndreas Kling
TTY was only stored in Process::m_tty, so make that a SpinlockProtected.
2023-04-05Kernel: Remove ancient InterruptDisabler in sys$setsidAndreas Kling
This was some pre-SMP historical artifact.
2023-04-05Kernel: Mark sys$faccessat as not needing the big lockAndreas Kling
2023-04-04Kernel: Mark inode watcher syscalls as not needing the big lockAndreas Kling
These syscalls are already protected by existing locking mechanisms, including the mutex inside InodeWatcher.
2023-04-04Kernel: Mark sys$killpg as not needing the big lockAndreas Kling
Same as sys$kill, nothing here that isn't already protected by existing locks.
2023-04-04Kernel: Mark sys$kill as not needing the big lockAndreas Kling
This syscall sends a signal to other threads or itself. This mechanism is already guarded by locking mechanisms, and widely used within the kernel without help from the big lock.
2023-04-04Kernel: Remove ancient InterruptDisablers in the kill/killpg syscallsAndreas Kling
These are artifacts from the pre-SMP times.