Path: blob/main/sys/dev/bhnd/nvram/bhnd_nvram_plistvar.h
39536 views
/*-1* Copyright (c) 2015-2016 Landon Fuller <[email protected]>2* All rights reserved.3*4* Redistribution and use in source and binary forms, with or without5* modification, are permitted provided that the following conditions6* are met:7* 1. Redistributions of source code must retain the above copyright8* notice, this list of conditions and the following disclaimer,9* without modification.10* 2. Redistributions in binary form must reproduce at minimum a disclaimer11* similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any12* redistribution must be conditioned upon including a substantially13* similar Disclaimer requirement for further binary redistribution.14*15* NO WARRANTY16* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS17* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT18* LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY19* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL20* THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,21* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF22* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS23* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER24* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)25* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF26* THE POSSIBILITY OF SUCH DAMAGES.27*28*/2930#ifndef _BHND_NVRAM_BHND_PLISTVAR_H_31#define _BHND_NVRAM_BHND_PLISTVAR_H_3233#include "bhnd_nvram_plist.h"34#include <sys/queue.h>3536LIST_HEAD(bhnd_nvram_plist_entry_list, bhnd_nvram_plist_entry);3738typedef struct bhnd_nvram_plist_entry bhnd_nvram_plist_entry;39typedef struct bhnd_nvram_plist_entry_list bhnd_nvram_plist_entry_list;4041/**42* NVRAM property.43*/44struct bhnd_nvram_prop {45volatile u_int refs; /**< refcount */4647char *name; /**< property name */48bhnd_nvram_val *val; /**< property value */49};5051/**52* NVRAM property list entry.53*/54struct bhnd_nvram_plist_entry {55bhnd_nvram_prop *prop;5657TAILQ_ENTRY(bhnd_nvram_plist_entry) pl_link;58LIST_ENTRY(bhnd_nvram_plist_entry) pl_hash_link;59};6061/**62* NVRAM property list.63*64* Provides an ordered list of property values.65*/66struct bhnd_nvram_plist {67volatile u_int refs; /**< refcount */68TAILQ_HEAD(,bhnd_nvram_plist_entry) entries; /**< all properties */69size_t num_entries; /**< entry count */70bhnd_nvram_plist_entry_list names[16]; /**< name-based hash table */71};7273#endif /* _BHND_NVRAM_BHND_PLISTVAR_H_ */747576