lin
2025-08-21 57113df3a0e2be01232281fad9a5f2c060567981
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
/******************************************************************************
 *
 *  Copyright (C) 2020-2021 SeekWave Technology
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 *
 ******************************************************************************/
 
#ifndef __SKW_COMMON_H__
#define __SKW_COMMON_H__
 
#define SKW_UNUSED(x) (void)(x)
//#define SKW_UNUSED(x) (x = x)
 
#ifndef TRUE
#define TRUE 1
#endif
 
#ifndef FALSE
#define FALSE 0
#endif
 
 
#ifndef UINT8_TO_STREAM
#define UINT8_TO_STREAM(p, u8)   {*(p)++ = (uint8_t)(u8);}
#endif
 
 
#ifndef UINT16_TO_STREAM
#define UINT16_TO_STREAM(p, u16) {*(p)++ = (uint8_t)(u16); *(p)++ = (uint8_t)((u16) >> 8);}
#endif
 
#ifndef STREAM_TO_UINT16
#define STREAM_TO_UINT16(u16, p) {u16 = ((uint16_t)(*(p)) + (((uint16_t)(*((p) + 1))) << 8)); (p) += 2;}
#endif
 
 
#define RW_NO_INTR(func)  do {} while (((func) == -1) && (errno == EINTR))
 
 
extern char skwdriverlog_en;
#define SKWBT_LOG(fmt, args...)  do{if(skwdriverlog_en){ALOGD("[SKWBT]:" fmt, ## args);}}while(0)
 
#define SKW_LOG_DEFAULT_SIZE (100 * 1024 * 1024)//300M
 
 
#endif