env.c revision 300081
1300081Simp/*
2300081Simp * Copyright (c) 2015 Netflix, Inc. All Rights Reserved.
3300081Simp *
4300081Simp * Redistribution and use in source and binary forms, with or without
5300081Simp * modification, are permitted provided that the following conditions
6300081Simp * are met:
7300081Simp * 1. Redistributions of source code must retain the above copyright
8300081Simp *    notice, this list of conditions and the following disclaimer.
9300081Simp * 2. Redistributions in binary form must reproduce the above copyright
10300081Simp *    notice, this list of conditions and the following disclaimer in the
11300081Simp *    documentation and/or other materials provided with the distribution.
12300081Simp *
13300081Simp * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14300081Simp * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15300081Simp * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16300081Simp * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17300081Simp * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18300081Simp * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19300081Simp * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20300081Simp * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21300081Simp * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22300081Simp * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23300081Simp * SUCH DAMAGE.
24300081Simp */
25300081Simp
26300081Simp#include <sys/cdefs.h>
27300081Simp__FBSDID("$FreeBSD: head/sys/boot/efi/libefi/env.c 300081 2016-05-17 21:25:20Z imp $");
28300081Simp
29300081Simp#include <efi.h>
30300081Simp#include <efilib.h>
31300081Simp
32300081Simp/*
33300081Simp * Simple wrappers to the underlying UEFI functions.
34300081Simp * See http://wiki.phoenix.com/wiki/index.php/EFI_RUNTIME_SERVICES
35300081Simp * for details.
36300081Simp */
37300081SimpEFI_STATUS
38300081Simpefi_get_next_variable_name(UINTN *variable_name_size, CHAR16 *variable_name, EFI_GUID *vendor_guid)
39300081Simp{
40300081Simp	return RS->GetNextVariableName(variable_name_size, variable_name, vendor_guid);
41300081Simp}
42300081Simp
43300081SimpEFI_STATUS
44300081Simpefi_get_variable(CHAR16 *variable_name, EFI_GUID *vendor_guid, UINT32 *attributes, UINTN *data_size,
45300081Simp    void *data)
46300081Simp{
47300081Simp	return RS->GetVariable(variable_name, vendor_guid, attributes, data_size, data);
48300081Simp}
49300081Simp
50300081SimpEFI_STATUS
51300081Simpefi_set_variable(CHAR16 *variable_name, EFI_GUID *vendor_guid, UINT32 attributes, UINTN data_size,
52300081Simp    void *data)
53300081Simp{
54300081Simp	return RS->SetVariable(variable_name, vendor_guid, attributes, data_size, data);
55300081Simp}
56