forked from zephyrproject-rtos/zephyr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkernel_version.h
41 lines (33 loc) · 1012 Bytes
/
kernel_version.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/* kernel version support */
/*
* Copyright (c) 2015 Wind River Systems, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef _kernel_version__h_
#define _kernel_version__h_
#ifdef __cplusplus
extern "C" {
#endif
/*
* 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.
*/
#define SYS_KERNEL_VER_MAJOR(ver) (((ver) >> 24) & 0xFF)
#define SYS_KERNEL_VER_MINOR(ver) (((ver) >> 16) & 0xFF)
#define SYS_KERNEL_VER_PATCHLEVEL(ver) (((ver) >> 8) & 0xFF)
/* kernel version routines */
extern u32_t sys_kernel_version_get(void);
#ifdef __cplusplus
}
#endif
#endif /* _kernel_version__h_ */