diff options
| author | Ilya Smirnov <ismirno@us.ibm.com> | 2018-12-12 11:33:38 -0600 |
|---|---|---|
| committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2019-01-10 14:52:34 -0600 |
| commit | 21f75b9e4475b92665e4dd8ca182108dab53045f (patch) | |
| tree | 5534008afd3766285c4da672f3082a03d056fb88 /src/include | |
| parent | 1ba78c4580b6067882d62909c2ce2941ad36008d (diff) | |
| download | talos-hostboot-21f75b9e4475b92665e4dd8ca182108dab53045f.tar.gz talos-hostboot-21f75b9e4475b92665e4dd8ca182108dab53045f.zip | |
SMF: NVRAM Reading and Mem Distribution end-to-end Changes
This commit introduces the changes to read out the SMF secure
memory amount value from NVRAM and to distribute the secure
memory amount based on the value read. strtou64 was copied
from runtime code to convert the value read from NVRAM (as a
string) to uint64_t.
Change-Id: I83e41f0aaff9b4035d20a517cf866f348acedd59
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/69728
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/stdlib.h | 15 | ||||
| -rw-r--r-- | src/include/usr/nvram/nvram_interface.H | 3 |
2 files changed, 16 insertions, 2 deletions
diff --git a/src/include/stdlib.h b/src/include/stdlib.h index e0a8fcf6b..ed46d1bef 100644 --- a/src/include/stdlib.h +++ b/src/include/stdlib.h @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2010,2014 */ +/* Contributors Listed Below - COPYRIGHT 2010,2019 */ +/* [+] International Business Machines Corp. */ +/* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ /* you may not use this file except in compliance with the License. */ @@ -35,6 +37,17 @@ void free(void*); void* realloc(void*, size_t); void* calloc(size_t, size_t) __attribute__((malloc)); +/** + * @brief converts a given char string to uint64_t + * + * @param[in] nptr input string in the form of pointer to char + * @param[in] endptr UNUSED + * @param[in] base UNUSED (always base 16) + * @return the uint64_t representation of the input string or 0 + * if the function failed to convert + */ +uint64_t strtoul(const char *nptr, char **endptr, int base); + #ifdef __cplusplus }; #endif diff --git a/src/include/usr/nvram/nvram_interface.H b/src/include/usr/nvram/nvram_interface.H index d5730e86b..1df96b412 100644 --- a/src/include/usr/nvram/nvram_interface.H +++ b/src/include/usr/nvram/nvram_interface.H @@ -35,7 +35,8 @@ namespace NVRAM_TRACE namespace NVRAM { -const char TEST_KEY[] = "test"; +extern const char TEST_KEY[]; +extern const char SMF_MEM_AMT_KEY[]; /** * @brief Utility function to read the i_key from the NVRAM PNOR partition. |

