函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\ldt.c Create Date:2022-07-27 08:35:02
Last Modify:2022-05-18 16:20:29 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Called on fork from arch_dup_mmap(). Just copy the current LDT state,* the new task is not running, so nothing can be installed.

函数原型:int ldt_dup_context(struct mm_struct *old_mm, struct mm_struct *mm)

返回类型:int

参数:

类型参数名称
struct mm_struct *old_mm
struct mm_struct *mm
362  retval等于0
364  如果非old_mm则返回:0
367  mutex_lock( & lock)
368  如果非ldt则转到:out_unlock
371  new_ldt等于The caller must call finalize_ldt_struct on the result. LDT starts zeroed.
372  如果非new_ldt
373  retval等于负ENOMEM
374  转到:out_unlock
377  memcpy(entries, entries, nr_entries * The size of each LDT entry. )
379  After calling this, the LDT is immutable.
381  retval等于map_ldt_struct(mm, new_ldt, 0)
382  如果retval
383  free_ldt_pgtables(mm)
384  free_ldt_struct(new_ldt)
385  转到:out_unlock
387  ldt等于new_ldt
389  out_unlock :
390  mutex_unlock( & lock)
391  返回:retval