Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:bzImage64_probe

Proto:static int bzImage64_probe(const char *buf, unsigned long len)

Type:int

Parameter:

TypeParameterName
const char *buf
unsigned longlen
274  ret = -ENOEXEC
278  If len < 2 * 512 Then
279  pr_err("File is too short to be a bzImage\n")
280  Return ret
283  header = buf + offsetof(structboot_params, hdr)
284  If memcmp((char * ) & header, "HdrS", 4) != 0 Then
285  pr_err("Not a bzImage\n")
286  Return ret
289  If boot_flag != 0xAA55 Then
290  pr_err("No x86 boot sector present\n")
291  Return ret
294  If version < 0x020C Then
295  pr_err("Must be at least protocol version 2.12\n")
296  Return ret
299  If Not (loadflags & loadflags ) Then
300  pr_err("zImage not a bzImage\n")
301  Return ret
304  If Not (xloadflags & xloadflags ) Then
305  pr_err("Not a bzImage64. XLF_KERNEL_64 is not set.\n")
306  Return ret
309  If Not (xloadflags & XLF_CAN_BE_LOADED_ABOVE_4G) Then
310  pr_err("XLF_CAN_BE_LOADED_ABOVE_4G is not set.\n")
311  Return ret
318  If efi_enabled(Can we use runtime services? ) && Not efi_enabled(Is the firmware 64-bit? ) Then
319  pr_debug("EFI is 32 bit. Can't load kernel above 4G.\n")
320  Return ret
323  If Not (xloadflags & XLF_5LEVEL) && pgtable_l5_enabled() Then
324  pr_err("bzImage cannot handle 5-level paging mode.\n")
325  Return ret
329  pr_debug("It's a relocatable bzImage64\n")
330  ret = 0
332  Return ret