Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\kexec.c Create Date:2022-07-28 11:03:38
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:COMPAT_SYSCALL_DEFINE4

Proto:COMPAT_SYSCALL_DEFINE4(kexec_load, compat_ulong_t, entry, compat_ulong_t, nr_segments, struct compat_kexec_segment __user *, segments, compat_ulong_t, flags)

Type:

Parameter:Nothing

271  __user * ksegments
274  result = Exec Kernel system call: for obvious reasons only root may call it
275  If result Then Return result
281  If (prefix, newline flags & KEXEC_ARCH_MASK) == These values match the ELF architecture values.* Unless there is a good reason that should continue to be the case. Then Return -EINVAL
284  ksegments = compat_alloc_user_space(nr_segments * size of out )
285  When i < nr_segments cycle
286  result = copy_from_user( & in, & segments[i], size of in )
287  If result Then Return -EFAULT
290  buf = A pointer passed in from user mode. This should not* be used for syscall parameters, just declare them* as pointers because the syscall entry code will have* appropriately converted them already.
291  bufsz = bufsz
292  mem = User space sees this as a (void *) ...
293  memsz = memsz
295  result = copy_to_user( & ksegments[i], & out, size of out )
296  If result Then Return -EFAULT
308  If Not mutex_trylock - try to acquire the mutex, without waiting*@lock: the mutex to be acquired* Try to acquire the mutex atomically Then Return -EBUSY
311  result = do_kexec_load(entry, nr_segments, ksegments, prefix, newline flags )
313  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
315  Return result