Describe the process by which the kernel returns control to user mode after setting up the child process context during `fork()`. What specific adjustments are made?
After setting up the CPU context and other necessary information, the kernel prepares to return control to user mode for both the parent and child processes. The return_to_user_mode function sets the appropriate return values and switches the CPU back to user mode. The adjustments that are made are architecture specific to the CPU state that ensure the child process can start execution correctly. This includes handling special registers or additional state that needs to be managed.