-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathown_defs.h
68 lines (50 loc) · 1.71 KB
/
own_defs.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*******************************************************************************
* Copyright (C) 2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
******************************************************************************/
#ifndef QPL_SOURCES_C_API_OWN_DEFS_H
#define QPL_SOURCES_C_API_OWN_DEFS_H
#ifdef __cplusplus
extern "C" {
#endif
#include <igzip_lib.h>
#include "qpl/c_api/defs.h"
#include "own_checkers.h"
#if defined(__INTEL_COMPILER) || defined(_MSC_VER)
#define QPL_INLINE static __inline
#elif defined(__GNUC__)
#define QPL_INLINE static __inline__
#else
#define QPL_INLINE static
#endif
#ifndef QPL_UNREFERENCED_PARAMETER
#define QPL_UNREFERENCED_PARAMETER(p) (p) = (p)
#endif
QPL_INLINE int64_t QPL_INT_PTR(const void* ptr) {
union {
void* ptr;
int64_t int_value;
} dd;
dd.ptr = (void*)ptr;
return dd.int_value;
}
#define OWN_BYTE_BIT_LEN 8U
#define OWN_HIGH_BIT_MASK 0x80U
#define OWN_LOW_BIT_MASK 1U
#define OWN_MAX_BIT_IDX 7U
#define OWN_64U_BITS 64U
#define QPL_BYTES_TO_ALIGN(ptr, align) ((-(QPL_INT_PTR(ptr) & ((align)-1))) & ((align)-1))
#define QPL_ALIGNED_PTR(ptr, align) (void*)((uint8_t*)(ptr) + (QPL_BYTES_TO_ALIGN(ptr, align)))
#define QPL_ALIGNED_SIZE(size, align) (((size) + (align)-1) & ~((align)-1))
#define QPL_DEFAULT_ALIGNMENT 64U
#define QPL_FUN(type, name, arg) extern type name arg
#define OWN_FUN(type, name, arg) extern type name arg
#define OWN_MAX_16U 0xFFFF /**< Max value for uint16_t */
#define OWN_MAX_32U 0xFFFFFFFF /**< Max value for uint32_t */
#define OWN_BYTE_WIDTH 8U /**< Byte width in bits */
#define HUFF_LOOK_UP_TABLE_SIZE UINT16_MAX
#ifdef __cplusplus
}
#endif
#endif //QPL_SOURCES_C_API_OWN_DEFS_H