1 /* SPDX-License-Identifier: BSD-3-Clause */ 2 /* Copyright(c) 2007-2025 Intel Corporation */ 3 4 /** 5 *************************************************************************** 6 * @file lac_sym_compile_check.c 7 * 8 * @ingroup LacSym 9 * 10 * This file checks at compile time that some assumptions about the layout 11 * of key structures are as expected. 12 * 13 * 14 ***************************************************************************/ 15 16 #include "cpa.h" 17 18 #include "lac_common.h" 19 #include "icp_accel_devices.h" 20 #include "icp_adf_debug.h" 21 #include "lac_sym.h" 22 #include "cpa_cy_sym_dp.h" 23 24 #define COMPILE_TIME_ASSERT(pred) \ 25 switch (0) { \ 26 case 0: \ 27 case pred:; \ 28 } 29 30 void LacSym_CompileTimeAssertions(void)31LacSym_CompileTimeAssertions(void) 32 { 33 /* ************************************************************* 34 * Check sessionCtx is at the same location in bulk cookie and 35 * CpaCySymDpOpData. 36 * This is required for the callbacks to work as expected - 37 * see LacSymCb_ProcessCallback 38 * ************************************************************* */ 39 40 COMPILE_TIME_ASSERT(offsetof(lac_sym_bulk_cookie_t, sessionCtx) == 41 offsetof(CpaCySymDpOpData, sessionCtx)); 42 } 43