/* * Copyright (C) 2014-2015 Tobias Klauser * Copyright (C) 2009-2012 Daniel Borkmann * * This file is part of llmnrd. * * llmnrd is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 2 of the License. * * llmnrd is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with llmnrd. If not, see . */ #ifndef UTIL_H #define UTIL_H #include #include #include #include #include "compiler.h" #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) /* * min()/max() macros with strict type-checking. * Taken from linux/kernel.h */ #undef min #define min(x, y) ({ \ typeof(x) _min1 = (x); \ typeof(y) _min2 = (y); \ (void) (&_min1 == &_min2); \ _min1 < _min2 ? _min1 : _min2; }) #undef max #define max(x, y) ({ \ typeof(x) _max1 = (x); \ typeof(y) _max2 = (y); \ (void) (&_max1 == &_max2); \ _max1 > _max2 ? _max1 : _max2; }) static inline void __noreturn panic(const char *fmt, ...) { va_list vl; va_start(vl, fmt); vfprintf(stderr, fmt, vl); va_end(vl); exit(EXIT_FAILURE); } void *xmalloc(size_t size) __warn_unused_result; void *xzalloc(size_t size) __warn_unused_result; void *xrealloc(void *ptr, size_t size) __warn_unused_result; char *xstrdup(const char *s) __warn_unused_result; static inline bool xstreq(const char *str1, const char *str2) { size_t n = strlen(str1); if (n != strlen(str2)) return false; if (strncmp(str1, str2, n) != 0) return false; return true; } #endif /* UTIL_H */ f='/cgit.cgi/linux/net-next.git/tree/Documentation/devicetree?h=nds-private-remove&id=d1992996753132e2dafe955cccb2fb0714d3cfc4'>treecommitdiff
diff options
context:
space:
mode:
authorEmanuel Czirai <icanrealizeum@gmail.com>2016-09-02 07:35:50 +0200
committerThomas Gleixner <tglx@linutronix.de>2016-09-02 20:42:28 +0200
commitd1992996753132e2dafe955cccb2fb0714d3cfc4 (patch)
tree92a0102f68353c85730b99faf1f83e08451f12c6 /Documentation/devicetree
parent3eab887a55424fc2c27553b7bfe32330df83f7b8 (diff)
x86/AMD: Apply erratum 665 on machines without a BIOS fix
AMD F12h machines have an erratum which can cause DIV/IDIV to behave unpredictably. The workaround is to set MSRC001_1029[31] but sometimes there is no BIOS update containing that workaround so let's do it ourselves unconditionally. It is simple enough. [ Borislav: Wrote commit message. ] Signed-off-by: Emanuel Czirai <icanrealizeum@gmail.com> Signed-off-by: Borislav Petkov <bp@suse.de> Cc: Yaowu Xu <yaowu@google.com> Cc: stable@vger.kernel.org Link: http://lkml.kernel.org/r/20160902053550.18097-1-bp@alien8.de Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'Documentation/devicetree')