1181430Sstas/*-
2181430Sstas * Copyright (c) 2008 Stanislav Sedov <stas@FreeBSD.org>.
3181430Sstas * All rights reserved.
4181430Sstas *
5181430Sstas * Redistribution and use in source and binary forms, with or without
6181430Sstas * modification, are permitted provided that the following conditions
7181430Sstas * are met:
8181430Sstas * 1. Redistributions of source code must retain the above copyright
9181430Sstas *    notice, this list of conditions and the following disclaimer.
10181430Sstas * 2. Redistributions in binary form must reproduce the above copyright
11181430Sstas *    notice, this list of conditions and the following disclaimer in the
12181430Sstas *    documentation and/or other materials provided with the distribution.
13181430Sstas *
14181430Sstas * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
15181430Sstas * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16181430Sstas * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17181430Sstas * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18181430Sstas * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19181430Sstas * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20181430Sstas * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21181430Sstas * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22181430Sstas * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23181430Sstas * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24181430Sstas *
25181430Sstas * $FreeBSD: releng/11.0/usr.sbin/cpucontrol/cpucontrol.h 181430 2008-08-08 16:26:53Z stas $
26181430Sstas */
27181430Sstas
28181430Sstas#ifndef CPUCONTROL_H
29181430Sstas#define	CPUCONTROL_H
30181430Sstas
31181430Sstastypedef int ucode_probe_t(int fd);
32181430Sstastypedef void ucode_update_t(const char *dev, const char *image);
33181430Sstas
34181430Sstasextern int verbosity_level;
35181430Sstas
36181430Sstas#ifdef DEBUG
37181430Sstas# define WARNX(level, ...)					\
38181430Sstas	if ((level) <= verbosity_level) {			\
39181430Sstas		fprintf(stderr, "%s:%d ", __FILE__, __LINE__);	\
40181430Sstas		warnx(__VA_ARGS__);				\
41181430Sstas	}
42181430Sstas# define WARN(level, ...)					\
43181430Sstas	if ((level) <= verbosity_level) {			\
44181430Sstas		fprintf(stderr, "%s:%d ", __FILE__, __LINE__);	\
45181430Sstas		warn(__VA_ARGS__);				\
46181430Sstas	}
47181430Sstas#else
48181430Sstas# define WARNX(level, ...)					\
49181430Sstas	if ((level) <= verbosity_level)				\
50181430Sstas		warnx(__VA_ARGS__);
51181430Sstas# define WARN(level, ...)					\
52181430Sstas	if ((level) <= verbosity_level)				\
53181430Sstas		warn(__VA_ARGS__);
54181430Sstas#endif
55181430Sstas
56181430Sstas#endif /* !CPUCONTROL_H */
57