As per discussion with lawyers[tm], it's not a good idea to shorten the license header too much - not for legal reasons but because there are tools that look for them, and giving them a standard pattern simplifies things. However, we got confirmation that we don't have to update every file ever added to coreboot whenever the FSF gets a new lease, but can drop the address instead. util/kconfig is excluded because that's imported code that we may want to synchronize every now and then. $ find * -type f -exec sed -i "s:Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *MA[, ]*02110-1301[, ]*USA:Foundation, Inc.:" {} + $ find * -type f -exec sed -i "s:Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA:Foundation, Inc.:" {} + $ find * -type f -exec sed -i "s:Foundation, Inc., 59 Temple Place[-, ]*Suite 330, Boston, MA *02111-1307[, ]*USA:Foundation, Inc.:" {} + $ find * -type f -exec sed -i "s:Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.:Foundation, Inc.:" {} + $ find * -type f -a \! -name \*.patch \ -a \! -name \*_shipped \ -a \! -name LICENSE_GPL \ -a \! -name LGPL.txt \ -a \! -name COPYING \ -a \! -name DISCLAIMER \ -exec sed -i "/Foundation, Inc./ N;s:Foundation, Inc.* USA\.* *:Foundation, Inc. :;s:Foundation, Inc. $:Foundation, Inc.:" {} + Change-Id: Icc968a5a5f3a5df8d32b940f9cdb35350654bef9 Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-on: http://review.coreboot.org/9233 Tested-by: build bot (Jenkins) Reviewed-by: Vladimir Serbinenko <phcoder@gmail.com>
49 lines
2.1 KiB
C
49 lines
2.1 KiB
C
/*
|
|
* This file is part of the coreboot project.
|
|
*
|
|
* Copyright 2014 Google Inc.
|
|
*
|
|
* This program 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.
|
|
*
|
|
* This program 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 this program; if not, write to the Free Software
|
|
* Foundation, Inc.
|
|
*/
|
|
|
|
#ifndef __SRC_INCLUDE_BASE3_H__
|
|
#define __SRC_INCLUDE_BASE3_H__
|
|
|
|
/* We translate a floating pin (Z) as the ternary digit 2. */
|
|
#define Z 2
|
|
|
|
/*
|
|
* This provides a variadic macro BASE3() that can be used to translate a set of
|
|
* pin states into its base-3 integer representation, even in the context of a
|
|
* static initializer. You can call it with any number of up to 6 arguments,
|
|
* e.g. BASE3(1, Z) -> 5 or BASE3(0, Z, 1, 0) -> 21. Just don't look too closely
|
|
* at how the sausage is made. (Pay extra attention to typos when expanding it!)
|
|
*/
|
|
#define _BASE3_IMPL_1(arg0, arg1, arg2, arg3, arg4, arg5) arg0
|
|
#define _BASE3_IMPL_2(arg0, arg1, arg2, arg3, arg4, arg5) \
|
|
(arg1 + (3 * _BASE3_IMPL_1(arg0, arg1, arg2, arg3, arg4, arg5)))
|
|
#define _BASE3_IMPL_3(arg0, arg1, arg2, arg3, arg4, arg5) \
|
|
(arg2 + (3 * _BASE3_IMPL_2(arg0, arg1, arg2, arg3, arg4, arg5)))
|
|
#define _BASE3_IMPL_4(arg0, arg1, arg2, arg3, arg4, arg5) \
|
|
(arg3 + (3 * _BASE3_IMPL_3(arg0, arg1, arg2, arg3, arg4, arg5)))
|
|
#define _BASE3_IMPL_5(arg0, arg1, arg2, arg3, arg4, arg5) \
|
|
(arg4 + (3 * _BASE3_IMPL_4(arg0, arg1, arg2, arg3, arg4, arg5)))
|
|
#define _BASE3_IMPL_6(arg0, arg1, arg2, arg3, arg4, arg5) \
|
|
(arg5 + (3 * _BASE3_IMPL_5(arg0, arg1, arg2, arg3, arg4, arg5)))
|
|
#define _BASE3_IMPL(arg0, arg1, arg2, arg3, arg4, arg5, NARGS, ...) \
|
|
_BASE3_IMPL##NARGS(arg0, arg1, arg2, arg3, arg4, arg5)
|
|
#define BASE3(...) _BASE3_IMPL(__VA_ARGS__, _6, _5, _4, _3, _2, _1)
|
|
|
|
#endif /* __SRC_INCLUDE_BASE3_H__ */
|