xref: /rk3399_ARM-atf/plat/qti/common/src/qti_stack_protector.c (revision 5bd9c17d023288e6b819fa3eecc01b7981399cfa)
1 /*
2  * Copyright (c) 2018-2019, 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 <qtiseclib_interface.h>
13 
14 u_register_t plat_get_stack_protector_canary(void)
15 {
16 	u_register_t random = 0x0;
17 
18 	/* get random data , the below API doesn't return random = 0 in success
19 	 * case */
20 	qtiseclib_prng_get_data((uint8_t *) &random, sizeof(random));
21 	assert(0x0 != random);
22 
23 	return random;
24 }
25