1 /* 2 * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 */ 6 7 #include <assert.h> 8 #include <stdint.h> 9 10 #include <platform.h> 11 #include <platform_def.h> 12 #include <qti_rng.h> 13 #include <qtiseclib_interface.h> 14 plat_get_stack_protector_canary(void)15u_register_t plat_get_stack_protector_canary(void) 16 { 17 u_register_t random = 0x0; 18 19 /* 20 * get random data , the below API doesn't return random = 0 on success 21 */ 22 qti_rng_get_data((uint8_t *) &random, sizeof(random)); 23 assert(random != 0x0); 24 25 return random; 26 } 27