merlin16_pcieg3_usr_includes.h (3722B)
1 /************************************************************************************** 2 * File Name : merlin16_pcieg3_usr_includes.h * 3 * Created On : 05/07/2014 * 4 * Created By : Kiran Divakar * 5 * Description : Header file which includes all required std libraries and macros * 6 * Revision : * 7 * * 8 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 9 * 10 * Copyright 2007-2019 Broadcom Inc. All rights reserved. * 11 * No portions of this material may be reproduced in any form without * 12 * the written permission of: * 13 * Broadcom Corporation * 14 * 5300 California Avenue * 15 * Irvine, CA 92617 * 16 * * 17 * All information contained in this document is Broadcom Corporation * 18 * company private proprietary, and trade secret. * 19 */ 20 21 /** @file merlin16_pcieg3_usr_includes.h 22 * Header file which includes all required std libraries and macros 23 */ 24 25 /* The user is expected to replace the macro definitions with their required implementation */ 26 27 #ifndef MERLIN16_PCIEG3_API_USR_INCLUDES_H 28 #define MERLIN16_PCIEG3_API_USR_INCLUDES_H 29 30 /* Standard libraries that can be replaced by your custom libraries */ 31 #ifdef _MSC_VER 32 /* Enclose all standard headers in a pragma to remove warings for MS compiler */ 33 #pragma warning( push, 0 ) 34 #endif 35 #ifdef NON_SDK 36 #include <stdint.h> 37 #include <string.h> 38 #include <stdio.h> 39 #else 40 #include <shared/bsl.h> 41 #include <sal/core/libc.h> 42 43 #ifdef __KERNEL__ 44 typedef unsigned long int uintptr_t; 45 #endif 46 #endif 47 48 #ifdef _MSC_VER 49 #pragma warning( pop ) 50 #endif 51 52 /* Redefine macros according your compiler requirements */ 53 #define USR_PRINTF(paren_arg_list) bsl_printf paren_arg_list 54 #define USR_MEMSET(mem, val, num) sal_memset(mem, val, num) 55 #define USR_STRLEN(string) sal_strlen(string) 56 #define USR_STRNCAT(str1, str2, num) sal_strncat(str1, str2, num) 57 #define USR_STRCPY(str1, str2) sal_strcpy(str1, str2) 58 #define USR_STRCMP(str1, str2) sal_strcmp(str1, str2) 59 #define USR_STRNCMP(str1, str2, num) sal_strncmp(str1, str2, num) 60 #define USR_SPRINTF(paren_arg_list) ((void)sal_sprintf paren_arg_list) 61 #define USR_UINTPTR uintptr_t 62 63 #ifdef SERDES_API_FLOATING_POINT 64 #define USR_DOUBLE double 65 #else 66 #define USR_DOUBLE int 67 #define double undefined 68 #define float undefined 69 #endif 70 71 /* Implementation specific macros below */ 72 #ifdef SRDS_API_ALL_FUNCTIONS_HAVE_ACCESS_STRUCT 73 #define USR_DELAY_MS(stuff) merlin16_pcieg3_delay_ms(sa__,stuff) 74 #define USR_DELAY_US(stuff) merlin16_pcieg3_delay_us(sa__,stuff) 75 #define USR_DELAY_NS(stuff) merlin16_pcieg3_delay_ns(sa__,stuff) 76 #else 77 #define USR_DELAY_MS(stuff) merlin16_pcieg3_delay_ms(stuff) 78 #define USR_DELAY_US(stuff) merlin16_pcieg3_delay_us(stuff) 79 #define USR_DELAY_NS(stuff) merlin16_pcieg3_delay_ns(stuff) 80 #endif 81 82 #ifndef UINT16_MAX 83 #define UINT16_MAX 0xFFFFU 84 #endif 85 #ifndef UINT32_MAX 86 #define UINT32_MAX 0xFFFFFFFFU 87 #endif 88 89 #endif