Zephyr API Documentation 4.0.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Version APIs

The kernel version has been converted from a string to a four-byte quantity that is divided into two parts. More...

Macros

#define SYS_KERNEL_VER_MAJOR(ver)
 
#define SYS_KERNEL_VER_MINOR(ver)
 
#define SYS_KERNEL_VER_PATCHLEVEL(ver)
 

Functions

uint32_t sys_kernel_version_get (void)
 Return the kernel version of the present build.
 

Detailed Description

The kernel version has been converted from a string to a four-byte quantity that is divided into two parts.

Part 1: The three most significant bytes represent the kernel's numeric version, x.y.z. These fields denote: x – major release y – minor release z – patchlevel release Each of these elements must therefore be in the range 0 to 255, inclusive.

Part 2: The least significant byte is reserved for future use.

Macro Definition Documentation

◆ SYS_KERNEL_VER_MAJOR

#define SYS_KERNEL_VER_MAJOR ( ver)

#include <zephyr/kernel_version.h>

Value:
(((ver) >> 24) & 0xFF)

◆ SYS_KERNEL_VER_MINOR

#define SYS_KERNEL_VER_MINOR ( ver)

#include <zephyr/kernel_version.h>

Value:
(((ver) >> 16) & 0xFF)

◆ SYS_KERNEL_VER_PATCHLEVEL

#define SYS_KERNEL_VER_PATCHLEVEL ( ver)

#include <zephyr/kernel_version.h>

Value:
(((ver) >> 8) & 0xFF)

Function Documentation

◆ sys_kernel_version_get()

uint32_t sys_kernel_version_get ( void )

#include <zephyr/kernel_version.h>

Return the kernel version of the present build.

The kernel version is a four-byte value, whose format is described in the file "kernel_version.h".

Returns
kernel version