I am writing a new syscall where I want to send a kill(pid, SIGSTOP) signal to a process that I just created in order to move it from the runqueue to the waitqueue. Then, I can wake it up again using kill(pid, SIGCONT).
The problem is that the kill is only used from the userspace, how can I send a signal from inside the kernel itself? is there an equivalent function to use that can do so? I found kill_pid, but I don't know how its headers should be included.