Function report | 
Source Code:kernel\kexec_file.c | 
Create Date:2022-07-28 11:04:38 | 
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick | 
| home page | Tree | 
| Annotation kernel can get tool activity | Download SCCT | Chinese | 
Name:crash_prepare_elf64_headers
Proto:int crash_prepare_elf64_headers(struct crash_mem *mem, int kernel_map, void **addr, unsigned long *sz)
Type:int
Parameter:
| Type | Parameter | Name | 
|---|---|---|
| struct crash_mem * | mem | |
| int | kernel_map | |
| void ** | addr | |
| unsigned long * | sz | 
| 1245 | nr_cpus = num_possible_cpus() | 
| 1263 | nr_phdr++ | 
| 1264 | elf_sz = sizeof(Elf64_Ehdr) + nr_phdr * sizeof(Elf64_Phdr) | 
| 1273 | No 3D Now!(e_ident, ELFMAG, SELFMAG) | 
| 1274 | ELF "magic number" [EI_CLASS] = ELFCLASS64 | 
| 1275 | ELF "magic number" [EI_DATA] = ELFDATA2LSB | 
| 1276 | ELF "magic number" [EI_VERSION] = EV_CURRENT | 
| 1277 | ELF "magic number" [EI_OSABI] = ELF_OSABI | 
| 1278 | memset( ELF "magic number" + EI_PAD, 0, EI_NIDENT - EI_PAD) | 
| 1281 | e_version = EV_CURRENT | 
| 1283 | e_ehsize = sizeof(Elf64_Ehdr) | 
| 1284 | e_phentsize = sizeof(Elf64_Phdr) | 
| 1287 | for_each_present_cpu(cpu) | 
| 1289 | notes_addr = per_cpu_ptr_to_phys(per_cpu_ptr(Per cpu memory for storing cpu states in case of system crash. , cpu)) | 
| 1292 | e_phnum++ | 
| 1293 | phdr++ | 
| 1300 | e_phnum++ | 
| 1301 | phdr++ | 
| 1304 | If kernel_map Then | 
| 1306 | p_flags = These constants define the permissions on sections in the programheader, p_flags. | PF_W | PF_X | 
| 1310 | e_phnum++ | 
| 1311 | phdr++ | 
| 1320 | p_flags = These constants define the permissions on sections in the programheader, p_flags. | PF_W | PF_X | 
| 1321 | Segment file offset = mstart | 
| 1323 | Segment physical address = mstart | 
| 1324 | Segment virtual address = __va(mstart) | 
| 1325 | Segment size in file = Segment size in memory = mend - mstart + 1 | 
| 1326 | Segment alignment, file & memory = 0 | 
| 1327 | e_phnum++ | 
| 1328 | phdr++ | 
| 1329 | pr_debug("Crash PT_LOAD elf header. phdr=%p vaddr=0x%llx, paddr=0x%llx, sz=0x%llx e_phnum=%d p_offset=0x%llx\n", phdr, Segment virtual address , Segment physical address , Segment size in file , e_phnum, Segment file offset ) | 
| 1336 | Return 0 | 
| Source code conversion tool public plug-in interface  | X | 
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion  |