Saurabh Gorecha | 70389ca | 2020-04-22 21:31:24 +0530 | [diff] [blame] | 1 | /* |
Saurabh Gorecha | 87f4737 | 2020-07-09 02:20:08 +0530 | [diff] [blame] | 2 | * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. |
Saurabh Gorecha | 70389ca | 2020-04-22 21:31:24 +0530 | [diff] [blame] | 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> |
Saurabh Gorecha | 87f4737 | 2020-07-09 02:20:08 +0530 | [diff] [blame] | 12 | #include <qti_rng.h> |
Saurabh Gorecha | 70389ca | 2020-04-22 21:31:24 +0530 | [diff] [blame] | 13 | #include <qtiseclib_interface.h> |
| 14 | |
| 15 | u_register_t plat_get_stack_protector_canary(void) |
| 16 | { |
| 17 | u_register_t random = 0x0; |
| 18 | |
Saurabh Gorecha | 87f4737 | 2020-07-09 02:20:08 +0530 | [diff] [blame] | 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); |
Saurabh Gorecha | 70389ca | 2020-04-22 21:31:24 +0530 | [diff] [blame] | 24 | |
| 25 | return random; |
| 26 | } |