1 /* 2 * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 * Description: LOG BUFFER COMMON DEFINITIONS. 15 * Author: 16 * Create: 2018-10-15 17 */ 18 19 #ifndef NON_OS_LOG_BUFFER_COMMON_H 20 #define NON_OS_LOG_BUFFER_COMMON_H 21 #include "std_def.h" 22 23 /** 24 * @addtogroup connectivity_drivers_non_os_log 25 * @{ 26 */ 27 /** 28 * @brief Log message information header. 29 */ 30 typedef struct { 31 uint32_t time_us; /**< time when the logging was generated */ 32 uint16_t length; /**< log message length */ 33 34 #ifdef FEATURE_PLT_LB_CHECK 35 uint16_t _magic; 36 #endif 37 } __attribute__((packed)) log_buffer_header_t; 38 39 #ifdef FEATURE_PLT_LB_CHECK 40 #define lb_magic_set(h) (h)->_magic = 0x8F5C 41 #define lb_magic_check(h) (0x8F5C == (h)->_magic) 42 #else 43 #define lb_magic_set(h) 44 #define lb_magic_check(h) 1 45 #endif 46 47 /** 48 * @} 49 */ 50 #endif 51