summaryrefslogtreecommitdiffstats
path: root/src/interface/efi/efi_snp_hii.c
diff options
context:
space:
mode:
authorMichael Brown2013-12-03 17:48:56 +0100
committerMichael Brown2013-12-05 01:37:02 +0100
commit22001cb206c1320aee27f679a63d2171d35e99c5 (patch)
treea972bb914371a68d4925dcc007238dcb836546ba /src/interface/efi/efi_snp_hii.c
parent[fbcon] Add support for displaying a cursor (diff)
downloadipxe-22001cb206c1320aee27f679a63d2171d35e99c5.tar.gz
ipxe-22001cb206c1320aee27f679a63d2171d35e99c5.tar.xz
ipxe-22001cb206c1320aee27f679a63d2171d35e99c5.zip
[settings] Explicitly separate the concept of a completed fetched setting
The fetch_setting() family of functions may currently modify the definition of the specified setting (e.g. to add missing type information). Clean up this interface by requiring callers to provide an explicit buffer to contain the completed definition of the fetched setting, if required. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/interface/efi/efi_snp_hii.c')
-rw-r--r--src/interface/efi/efi_snp_hii.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/interface/efi/efi_snp_hii.c b/src/interface/efi/efi_snp_hii.c
index 9ea15a62..61954b63 100644
--- a/src/interface/efi/efi_snp_hii.c
+++ b/src/interface/efi/efi_snp_hii.c
@@ -276,7 +276,9 @@ static int efi_snp_hii_fetch ( struct efi_snp_device *snpdev,
const char *key, const char *value,
wchar_t **results, int *have_setting ) {
struct settings *settings = efi_snp_hii_settings ( snpdev );
+ struct settings *origin;
struct setting *setting;
+ struct setting fetched;
int len;
char *buf;
char *encoded;
@@ -311,7 +313,8 @@ static int efi_snp_hii_fetch ( struct efi_snp_device *snpdev,
if ( setting_exists ( settings, setting ) ) {
/* Calculate formatted length */
- len = fetchf_setting ( settings, setting, NULL, 0 );
+ len = fetchf_setting ( settings, setting, &origin, &fetched,
+ NULL, 0 );
if ( len < 0 ) {
rc = len;
DBGC ( snpdev, "SNPDEV %p could not fetch %s: %s\n",
@@ -328,7 +331,8 @@ static int efi_snp_hii_fetch ( struct efi_snp_device *snpdev,
encoded = ( buf + len + 1 /* NUL */ );
/* Format value */
- fetchf_setting ( settings, setting, buf, ( len + 1 /* NUL */ ));
+ fetchf_setting ( origin, &fetched, NULL, NULL, buf,
+ ( len + 1 /* NUL */ ) );
for ( i = 0 ; i < len ; i++ ) {
sprintf ( ( encoded + ( 4 * i ) ), "%04x",
*( ( uint8_t * ) buf + i ) );