1288522Sgrehan/*- 2288522Sgrehan * Copyright (c) 2015 Peter Grehan <grehan@freebsd.org> 3288522Sgrehan * All rights reserved. 4288522Sgrehan * 5288522Sgrehan * Redistribution and use in source and binary forms, with or without 6288522Sgrehan * modification, are permitted provided that the following conditions 7288522Sgrehan * are met: 8288522Sgrehan * 1. Redistributions of source code must retain the above copyright 9288522Sgrehan * notice, this list of conditions and the following disclaimer. 10288522Sgrehan * 2. Redistributions in binary form must reproduce the above copyright 11288522Sgrehan * notice, this list of conditions and the following disclaimer in the 12288522Sgrehan * documentation and/or other materials provided with the distribution. 13288522Sgrehan * 14288522Sgrehan * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND 15288522Sgrehan * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16288522Sgrehan * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17288522Sgrehan * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18288522Sgrehan * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19288522Sgrehan * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20288522Sgrehan * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21288522Sgrehan * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22288522Sgrehan * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23288522Sgrehan * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24288522Sgrehan * SUCH DAMAGE. 25288522Sgrehan * 26288522Sgrehan * $FreeBSD$ 27288522Sgrehan */ 28288522Sgrehan 29288522Sgrehan#ifndef _FWCTL_H_ 30288522Sgrehan#define _FWCTL_H_ 31288522Sgrehan 32288522Sgrehan#include <sys/linker_set.h> 33288522Sgrehan 34288522Sgrehan/* 35288522Sgrehan * Linker set api for export of information to guest firmware via 36288522Sgrehan * a sysctl-like OID interface 37288522Sgrehan */ 38288522Sgrehanstruct ctl { 39288522Sgrehan const char *c_oid; 40288522Sgrehan const void *c_data; 41288522Sgrehan const int c_len; 42288522Sgrehan}; 43288522Sgrehan 44288522Sgrehan#define CTL_NODE(oid, data, len) \ 45288522Sgrehan static struct ctl __CONCAT(__ctl, __LINE__) = { \ 46288522Sgrehan oid, \ 47288522Sgrehan (data), \ 48288522Sgrehan (len), \ 49288522Sgrehan }; \ 50288522Sgrehan DATA_SET(ctl_set, __CONCAT(__ctl, __LINE__)) 51288522Sgrehan 52288522Sgrehanvoid fwctl_init(void); 53288522Sgrehan 54288522Sgrehan#endif /* _FWCTL_H_ */ 55