CVS commit: src/sys/external/bsd/libfdt/dist
Module Name:src Committed By: skrll Date: Sun Dec 22 12:41:33 UTC 2019 Modified Files: src/sys/external/bsd/libfdt/dist: fdt.c Log Message: Avoid shadowing global variable To generate a diff of this commit: cvs rdiff -u -r1.1.1.3 -r1.2 src/sys/external/bsd/libfdt/dist/fdt.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/libfdt/dist/fdt.c diff -u src/sys/external/bsd/libfdt/dist/fdt.c:1.1.1.3 src/sys/external/bsd/libfdt/dist/fdt.c:1.2 --- src/sys/external/bsd/libfdt/dist/fdt.c:1.1.1.3 Sun Dec 22 12:30:36 2019 +++ src/sys/external/bsd/libfdt/dist/fdt.c Sun Dec 22 12:41:33 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: fdt.c,v 1.1.1.3 2019/12/22 12:30:36 skrll Exp $ */ +/* $NetBSD: fdt.c,v 1.2 2019/12/22 12:41:33 skrll Exp $ */ // SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause) /* @@ -58,15 +58,15 @@ static int check_block_(uint32_t hdrsize return 1; } -size_t fdt_header_size_(uint32_t version) +size_t fdt_header_size_(uint32_t vers) { - if (version <= 1) + if (vers <= 1) return FDT_V1_SIZE; - else if (version <= 2) + else if (vers <= 2) return FDT_V2_SIZE; - else if (version <= 3) + else if (vers <= 3) return FDT_V3_SIZE; - else if (version <= 16) + else if (vers <= 16) return FDT_V16_SIZE; else return FDT_V17_SIZE;
CVS commit: src/sys/external/bsd/libfdt/dist
Module Name:src Committed By: skrll Date: Sun Dec 22 12:33:17 UTC 2019 Modified Files: src/sys/external/bsd/libfdt/dist: libfdt_env.h Log Message: Merge conflicts To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/external/bsd/libfdt/dist/libfdt_env.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/libfdt/dist/libfdt_env.h diff -u src/sys/external/bsd/libfdt/dist/libfdt_env.h:1.4 src/sys/external/bsd/libfdt/dist/libfdt_env.h:1.5 --- src/sys/external/bsd/libfdt/dist/libfdt_env.h:1.4 Thu Aug 23 01:25:22 2018 +++ src/sys/external/bsd/libfdt/dist/libfdt_env.h Sun Dec 22 12:33:17 2019 @@ -1,57 +1,12 @@ -/* $NetBSD: libfdt_env.h,v 1.4 2018/08/23 01:25:22 jmcneill Exp $ */ +/* $NetBSD: libfdt_env.h,v 1.5 2019/12/22 12:33:17 skrll Exp $ */ -#ifndef _LIBFDT_ENV_H -#define _LIBFDT_ENV_H +/* SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause) */ +#ifndef LIBFDT_ENV_H +#define LIBFDT_ENV_H /* * libfdt - Flat Device Tree manipulation * Copyright (C) 2006 David Gibson, IBM Corporation. * Copyright 2012 Kim Phillips, Freescale Semiconductor. - * - * libfdt is dual licensed: you can use it either under the terms of - * the GPL, or the BSD license, at your option. - * - * a) This library 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; either version 2 of the - * License, or (at your option) any later version. - * - * This library 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 library; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, - * MA 02110-1301 USA - * - * Alternatively, - * - * b) Redistribution and use in source and binary forms, with or - * without modification, are permitted provided that the following - * conditions are met: - * - * 1. Redistributions of source code must retain the above - *copyright notice, this list of conditions and the following - *disclaimer. - * 2. Redistributions in binary form must reproduce the above - *copyright notice, this list of conditions and the following - *disclaimer in the documentation and/or other materials - *provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, - * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #if defined(_KERNEL) || defined(_STANDALONE) @@ -59,10 +14,12 @@ #include #include #else +#include #include #include #include #include +#include #endif #ifdef __CHECKER__ @@ -117,4 +74,31 @@ static inline fdt64_t cpu_to_fdt64(uint6 #undef CPU_TO_FDT16 #undef EXTRACT_BYTE -#endif /* _LIBFDT_ENV_H */ +#ifdef __APPLE__ +#include + +/* strnlen() is not available on Mac OS < 10.7 */ +# if !defined(MAC_OS_X_VERSION_10_7) || (MAC_OS_X_VERSION_MAX_ALLOWED < \ + MAC_OS_X_VERSION_10_7) + +#define strnlen fdt_strnlen + +/* + * fdt_strnlen: returns the length of a string or max_count - which ever is + * smallest. + * Input 1 string: the string whose size is to be determined + * Input 2 max_count: the maximum value returned by this function + * Output: length of the string or max_count (the smallest of the two) + */ +static inline size_t fdt_strnlen(const char *string, size_t max_count) +{ +const char *p = memchr(string, 0, max_count); +return p ? p - string : max_count; +} + +#endif /* !defined(MAC_OS_X_VERSION_10_7) || (MAC_OS_X_VERSION_MAX_ALLOWED < + MAC_OS_X_VERSION_10_7) */ + +#endif /* __APPLE__ */ + +#endif /* LIBFDT_ENV_H */
CVS commit: src/sys/external/bsd/libfdt/dist
Module Name:src Committed By: jmcneill Date: Thu Aug 23 01:25:22 UTC 2018 Modified Files: src/sys/external/bsd/libfdt/dist: libfdt_env.h Log Message: Support building libfdt with _STANDALONE To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/external/bsd/libfdt/dist/libfdt_env.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/libfdt/dist/libfdt_env.h diff -u src/sys/external/bsd/libfdt/dist/libfdt_env.h:1.3 src/sys/external/bsd/libfdt/dist/libfdt_env.h:1.4 --- src/sys/external/bsd/libfdt/dist/libfdt_env.h:1.3 Thu Jun 8 15:54:32 2017 +++ src/sys/external/bsd/libfdt/dist/libfdt_env.h Thu Aug 23 01:25:22 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: libfdt_env.h,v 1.3 2017/06/08 15:54:32 skrll Exp $ */ +/* $NetBSD: libfdt_env.h,v 1.4 2018/08/23 01:25:22 jmcneill Exp $ */ #ifndef _LIBFDT_ENV_H #define _LIBFDT_ENV_H @@ -54,9 +54,10 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#if defined(_KERNEL) +#if defined(_KERNEL) || defined(_STANDALONE) #include #include +#include #else #include #include
CVS commit: src/sys/external/bsd/libfdt/dist
Module Name:src Committed By: skrll Date: Thu Jun 8 15:54:32 UTC 2017 Modified Files: src/sys/external/bsd/libfdt/dist: libfdt_env.h Log Message: Merge conflicts To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/external/bsd/libfdt/dist/libfdt_env.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/libfdt/dist/libfdt_env.h diff -u src/sys/external/bsd/libfdt/dist/libfdt_env.h:1.2 src/sys/external/bsd/libfdt/dist/libfdt_env.h:1.3 --- src/sys/external/bsd/libfdt/dist/libfdt_env.h:1.2 Sun Dec 13 17:06:14 2015 +++ src/sys/external/bsd/libfdt/dist/libfdt_env.h Thu Jun 8 15:54:32 2017 @@ -1,3 +1,5 @@ +/* $NetBSD: libfdt_env.h,v 1.3 2017/06/08 15:54:32 skrll Exp $ */ + #ifndef _LIBFDT_ENV_H #define _LIBFDT_ENV_H /* @@ -58,20 +60,21 @@ #else #include #include +#include #include #endif #ifdef __CHECKER__ -#define __force __attribute__((force)) -#define __bitwise __attribute__((bitwise)) +#define FDT_FORCE __attribute__((force)) +#define FDT_BITWISE __attribute__((bitwise)) #else -#define __force -#define __bitwise +#define FDT_FORCE +#define FDT_BITWISE #endif -typedef uint16_t __bitwise fdt16_t; -typedef uint32_t __bitwise fdt32_t; -typedef uint64_t __bitwise fdt64_t; +typedef uint16_t FDT_BITWISE fdt16_t; +typedef uint32_t FDT_BITWISE fdt32_t; +typedef uint64_t FDT_BITWISE fdt64_t; #define EXTRACT_BYTE(x, n) ((unsigned long long)((uint8_t *))[n]) #define CPU_TO_FDT16(x) ((EXTRACT_BYTE(x, 0) << 8) | EXTRACT_BYTE(x, 1)) @@ -84,29 +87,29 @@ typedef uint64_t __bitwise fdt64_t; static inline uint16_t fdt16_to_cpu(fdt16_t x) { - return (__force uint16_t)CPU_TO_FDT16(x); + return (FDT_FORCE uint16_t)CPU_TO_FDT16(x); } static inline fdt16_t cpu_to_fdt16(uint16_t x) { - return (__force fdt16_t)CPU_TO_FDT16(x); + return (FDT_FORCE fdt16_t)CPU_TO_FDT16(x); } static inline uint32_t fdt32_to_cpu(fdt32_t x) { - return (__force uint32_t)CPU_TO_FDT32(x); + return (FDT_FORCE uint32_t)CPU_TO_FDT32(x); } static inline fdt32_t cpu_to_fdt32(uint32_t x) { - return (__force fdt32_t)CPU_TO_FDT32(x); + return (FDT_FORCE fdt32_t)CPU_TO_FDT32(x); } static inline uint64_t fdt64_to_cpu(fdt64_t x) { - return (__force uint64_t)CPU_TO_FDT64(x); + return (FDT_FORCE uint64_t)CPU_TO_FDT64(x); } static inline fdt64_t cpu_to_fdt64(uint64_t x) { - return (__force fdt64_t)CPU_TO_FDT64(x); + return (FDT_FORCE fdt64_t)CPU_TO_FDT64(x); } #undef CPU_TO_FDT64 #undef CPU_TO_FDT32
CVS commit: src/sys/external/bsd/libfdt/dist
Module Name:src Committed By: jmcneill Date: Sun Dec 13 17:06:14 UTC 2015 Modified Files: src/sys/external/bsd/libfdt/dist: libfdt_env.h Log Message: Fix build To generate a diff of this commit: cvs rdiff -u -r1.1.1.1 -r1.2 src/sys/external/bsd/libfdt/dist/libfdt_env.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/libfdt/dist/libfdt_env.h diff -u src/sys/external/bsd/libfdt/dist/libfdt_env.h:1.1.1.1 src/sys/external/bsd/libfdt/dist/libfdt_env.h:1.2 --- src/sys/external/bsd/libfdt/dist/libfdt_env.h:1.1.1.1 Sun Dec 13 16:45:07 2015 +++ src/sys/external/bsd/libfdt/dist/libfdt_env.h Sun Dec 13 17:06:14 2015 @@ -52,9 +52,14 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#if defined(_KERNEL) +#include +#include +#else #include #include #include +#endif #ifdef __CHECKER__ #define __force __attribute__((force))