iPXE
Data Structures | Macros | Functions | Variables
lkrn.h File Reference

Linux kernel images. More...

#include <stdint.h>
#include <bits/lkrn.h>

Go to the source code of this file.

Data Structures

struct  lkrn_header
 Kernel image header. More...
 
struct  lkrn_context
 Kernel image context. More...
 
struct  zimg_header
 Compressed kernel image header. More...
 
struct  zimg_context
 Compressed kernel image context. More...
 

Macros

#define LKRN_MAGIC(a, b, c, d)   ( ( (a) << 0 ) | ( (b) << 8 ) | ( (c) << 16 ) | ( (d) << 24 ) )
 Kernel magic value. More...
 
#define LKRN_MAGIC_AARCH64   LKRN_MAGIC ( 'A', 'R', 'M', 0x64 )
 Kernel magic value for AArch64. More...
 
#define LKRN_MAGIC_RISCV   LKRN_MAGIC ( 'R', 'S', 'C', 0x05 )
 Kernel magic value for RISC-V. More...
 
#define ZIMG_MAGIC   LKRN_MAGIC ( 'z', 'i', 'm', 'g' )
 Compressed kernel image magic value. More...
 

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 
struct lkrn_header __attribute__ ((packed))
 
void lkrn_jump (physaddr_t entry, physaddr_t fdt)
 Jump to kernel entry point. More...
 

Variables

uint32_t code [2]
 Executable code. More...
 
uint64_t text_offset
 Image load offset. More...
 
uint64_t image_size
 Image size. More...
 
uint64_t flags
 Flags. More...
 
uint8_t reserved_a [24]
 Reserved. More...
 
uint32_t magic
 Magic. More...
 
uint8_t reserved_b [4]
 Reserved. More...
 
struct lkrn_context __attribute__
 
uint32_t offset
 Offset to payload. More...
 
uint32_t len
 Length of payload. More...
 
uint32_t type
 Compression type. More...
 

Detailed Description

Linux kernel images.

Definition in file lkrn.h.

Macro Definition Documentation

◆ LKRN_MAGIC

#define LKRN_MAGIC (   a,
  b,
  c,
 
)    ( ( (a) << 0 ) | ( (b) << 8 ) | ( (c) << 16 ) | ( (d) << 24 ) )

Kernel magic value.

Definition at line 33 of file lkrn.h.

◆ LKRN_MAGIC_AARCH64

#define LKRN_MAGIC_AARCH64   LKRN_MAGIC ( 'A', 'R', 'M', 0x64 )

Kernel magic value for AArch64.

Definition at line 37 of file lkrn.h.

◆ LKRN_MAGIC_RISCV

#define LKRN_MAGIC_RISCV   LKRN_MAGIC ( 'R', 'S', 'C', 0x05 )

Kernel magic value for RISC-V.

Definition at line 40 of file lkrn.h.

◆ ZIMG_MAGIC

#define ZIMG_MAGIC   LKRN_MAGIC ( 'z', 'i', 'm', 'g' )

Compressed kernel image magic value.

Definition at line 78 of file lkrn.h.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )

◆ __attribute__()

struct lkrn_header __attribute__ ( (packed)  )

◆ lkrn_jump()

void lkrn_jump ( physaddr_t  entry,
physaddr_t  fdt 
)

Jump to kernel entry point.

Parameters
entryKernel entry point
fdtDevice tree

Referenced by lkrn_exec().

Variable Documentation

◆ code

uint32_t code[2]

Executable code.

Definition at line 12 of file lkrn.h.

◆ text_offset

uint64_t text_offset

Image load offset.

Definition at line 14 of file lkrn.h.

◆ image_size

uint64_t image_size

Image size.

Definition at line 16 of file lkrn.h.

◆ flags

uint64_t flags

Flags.

Definition at line 18 of file lkrn.h.

◆ reserved_a

uint8_t reserved_a[4]

Reserved.

Definition at line 20 of file lkrn.h.

◆ magic

uint32_t magic

Magic.

Definition at line 22 of file lkrn.h.

◆ reserved_b

uint8_t reserved_b[8]

Reserved.

Definition at line 24 of file lkrn.h.

◆ __attribute__

◆ offset

uint32_t offset

Offset to payload.

Definition at line 16 of file lkrn.h.

◆ len

uint32_t len

Length of payload.

Definition at line 18 of file lkrn.h.

◆ type

uint32_t type

Compression type.

Definition at line 22 of file lkrn.h.