1203181Smarcel/*- 2203181Smarcel * Copyright (c) 2010 Marcel Moolenaar 3203181Smarcel * All rights reserved. 4203181Smarcel * 5203181Smarcel * Redistribution and use in source and binary forms, with or without 6203181Smarcel * modification, are permitted provided that the following conditions 7203181Smarcel * are met: 8203181Smarcel * 1. Redistributions of source code must retain the above copyright 9203181Smarcel * notice, this list of conditions and the following disclaimer. 10203181Smarcel * 2. Redistributions in binary form must reproduce the above copyright 11203181Smarcel * notice, this list of conditions and the following disclaimer in the 12203181Smarcel * documentation and/or other materials provided with the distribution. 13203181Smarcel * 14203181Smarcel * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15203181Smarcel * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16203181Smarcel * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17203181Smarcel * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18203181Smarcel * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19203181Smarcel * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20203181Smarcel * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21203181Smarcel * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22203181Smarcel * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23203181Smarcel * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24203181Smarcel * SUCH DAMAGE. 25203181Smarcel * 26203181Smarcel * $FreeBSD: releng/11.0/lib/libefi/libefi.h 203181 2010-01-30 04:24:03Z marcel $ 27203181Smarcel */ 28203181Smarcel 29203181Smarcel#ifndef _LIBEFI_H_ 30203181Smarcel#define _LIBEFI_H_ 31203181Smarcel 32203181Smarcel#include <sys/types.h> 33203181Smarcel#include <sys/uuid.h> 34203181Smarcel#include <stddef.h> 35203181Smarcel 36203181Smarcel/* Attributes. */ 37203181Smarcel#define EFI_ATTR_NV 0x0001 /* Variable stored in NVRAM. */ 38203181Smarcel#define EFI_ATTR_BS 0x0002 /* Boot services accessable. */ 39203181Smarcel#define EFI_ATTR_RT 0x0004 /* Runtime accessable. */ 40203181Smarcel#define EFI_ATTR_HR 0x0008 /* Hardware error record. */ 41203181Smarcel#define EFI_ATTR_WR 0x0010 /* Authenticated write access. */ 42203181Smarcel 43203181Smarcel/* Vendor for architecturally defined variables. */ 44203181Smarcel#define EFI_GLOBAL_VARIABLE \ 45203181Smarcel {0x8be4df61,0x93ca,0x11d2,0xaa,0x0d,{0x00,0xe0,0x98,0x03,0x2b,0x8c}} 46203181Smarcel 47203181Smarcel/* Vendor for FreeBSD-specific variables. */ 48203181Smarcel#define EFI_FREEBSD_VARIABLE \ 49203181Smarcel {0x13c32014,0x0c9c,0x11df,0xa2,0x38,{0x00,0x17,0xa4,0xab,0x91,0x2d}} 50203181Smarcel 51203181Smarcel__BEGIN_DECLS 52203181Smarcelint efi_getvar (char *, uuid_t *, uint32_t *, size_t *, void *); 53203181Smarcelint efi_nextvarname (size_t *, char *, uuid_t *); 54203181Smarcelint efi_setvar (char *, uuid_t *, uint32_t, size_t, void *); 55203181Smarcel__END_DECLS 56203181Smarcel 57203181Smarcel#endif /* _LIBEFI_H_ */ 58