2015-05-25 23:10:30 +08:00
|
|
|
/* kernel version support */
|
2015-04-11 07:44:37 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright (c) 2015 Wind River Systems, Inc.
|
|
|
|
*
|
2015-10-07 00:00:37 +08:00
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
2015-04-11 07:44:37 +08:00
|
|
|
*
|
2015-10-07 00:00:37 +08:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2015-04-11 07:44:37 +08:00
|
|
|
*
|
2015-10-07 00:00:37 +08:00
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
2015-04-11 07:44:37 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _kernel_version__h_
|
|
|
|
#define _kernel_version__h_
|
|
|
|
|
2016-01-23 01:38:49 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2015-04-11 07:44:37 +08:00
|
|
|
/*
|
|
|
|
* The kernel version has been converted from a string to a four-byte
|
2015-06-24 06:52:06 +08:00
|
|
|
* quantity that is divided into two parts.
|
2015-04-11 07:44:37 +08:00
|
|
|
*
|
2015-06-24 06:52:06 +08:00
|
|
|
* Part 1: The three most significant bytes represent the kernel's
|
|
|
|
* numeric version, x.y.z. These fields denote:
|
2015-04-11 07:44:37 +08:00
|
|
|
* x -- major release
|
|
|
|
* y -- minor release
|
2015-06-24 06:52:06 +08:00
|
|
|
* z -- patchlevel release
|
|
|
|
* Each of these elements must therefore be in the range 0 to 256, inclusive.
|
2015-04-11 07:44:37 +08:00
|
|
|
*
|
2015-06-24 06:52:06 +08:00
|
|
|
* Part 2: The least significant byte is reserved for future use.
|
2015-04-11 07:44:37 +08:00
|
|
|
*/
|
2015-05-25 23:19:11 +08:00
|
|
|
#define SYS_KERNEL_VER_MAJOR(ver) ((ver >> 24) & 0x0F)
|
2015-06-24 06:52:06 +08:00
|
|
|
#define SYS_KERNEL_VER_MINOR(ver) ((ver >> 16) & 0x0F)
|
|
|
|
#define SYS_KERNEL_VER_PATCHLEVEL(ver) ((ver >> 8) & 0x0F)
|
2015-04-11 07:44:37 +08:00
|
|
|
|
2015-05-25 23:10:30 +08:00
|
|
|
/* kernel version routines */
|
|
|
|
|
2015-05-25 23:19:11 +08:00
|
|
|
extern uint32_t sys_kernel_version_get(void);
|
2015-05-25 23:10:30 +08:00
|
|
|
|
2016-01-23 01:38:49 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2015-04-11 07:44:37 +08:00
|
|
|
#endif /* _kernel_version__h_ */
|