blob: 572830f9ce144338d3cff1c36e5eef5e57b4ef7b [file] [log] [blame]
Saurabh Gorecha70389ca2020-04-22 21:31:24 +05301/*
Saurabh Gorecha87f47372020-07-09 02:20:08 +05302 * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
Saurabh Gorecha70389ca2020-04-22 21:31:24 +05303 *
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 Gorecha87f47372020-07-09 02:20:08 +053012#include <qti_rng.h>
Saurabh Gorecha70389ca2020-04-22 21:31:24 +053013#include <qtiseclib_interface.h>
14
15u_register_t plat_get_stack_protector_canary(void)
16{
17 u_register_t random = 0x0;
18
Saurabh Gorecha87f47372020-07-09 02:20:08 +053019 /*
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 Gorecha70389ca2020-04-22 21:31:24 +053024
25 return random;
26}