Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\crash_dump_32.c Create Date:2022-07-28 08:37:57
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:py_oldmem_page - copy one page from "oldmem"*@pfn: page frame number to be copied*@buf: target memory address for the copy; this can be in kernel address* space or user address space (see @userbuf)*@csize: number of bytes to copy*@offset: offset in bytes

Proto:ssize_t copy_oldmem_page(unsigned long pfn, char *buf, size_t csize, unsigned long offset, int userbuf)

Type:ssize_t

Parameter:

TypeParameterName
unsigned longpfn
char *buf
size_tcsize
unsigned longoffset
intuserbuf
56  If Not csize Then Return 0
59  If Not is_crashed_pfn_valid(pfn) Then Return -EFAULT
62  vaddr = kmap_atomic_pfn(pfn)
64  If Not userbuf Then
65  memcpy(buf, (vaddr + offset), csize)
66  Prevent people trying to call kunmap_atomic() as if it were kunmap()* kunmap_atomic() should get the return value of kmap_atomic, not the page.(vaddr)
67  Else
68  If Not kdump_buf_page Then
69  printk(warning conditions "Kdump: Kdump buffer page not allocated\n")
72  Return -EFAULT
74  copy_page(kdump_buf_page, vaddr)
75  Prevent people trying to call kunmap_atomic() as if it were kunmap()* kunmap_atomic() should get the return value of kmap_atomic, not the page.(vaddr)
76  If copy_to_user(buf, (kdump_buf_page + offset), csize) Then Return -EFAULT
80  Return csize