From patchwork Fri Jul 11 08:19:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jones X-Patchwork-Id: 4531531 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7221B9F36A for ; Fri, 11 Jul 2014 08:20:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8D59D201EC for ; Fri, 11 Jul 2014 08:20:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8B6AB201C7 for ; Fri, 11 Jul 2014 08:20:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752260AbaGKIUU (ORCPT ); Fri, 11 Jul 2014 04:20:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:65114 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751785AbaGKIUQ (ORCPT ); Fri, 11 Jul 2014 04:20:16 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s6B8KENu019839 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 11 Jul 2014 04:20:14 -0400 Received: from hawk.usersys.redhat.com (ovpn-116-34.ams2.redhat.com [10.36.116.34]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s6B8Jmis010067; Fri, 11 Jul 2014 04:20:12 -0400 From: Andrew Jones To: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org Cc: christoffer.dall@linaro.org, pbonzini@redhat.com Subject: [PATCH v6 11/17] libcflat: clean up libcflat.h Date: Fri, 11 Jul 2014 10:19:41 +0200 Message-Id: <1405066787-5793-12-git-send-email-drjones@redhat.com> In-Reply-To: <1405066787-5793-1-git-send-email-drjones@redhat.com> References: <1405066787-5793-1-git-send-email-drjones@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use libgcc's stddef.h and stdint.h, and then remove the redundant defines from libcflat.h. These changes have no affect on code including libcflat.h, but are needed in order to compile an unmodified libfdt for kvm-unit-tests using an arm cross-compiler. Signed-off-by: Andrew Jones Acked-by: Christoffer Dall --- v6: squashed string.h changes into "libfdt: get libfdt to build" [Paolo Bonzini] --- lib/libcflat.h | 41 +++++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/lib/libcflat.h b/lib/libcflat.h index 57bdb92a3e1b4..a43eba0329f8e 100644 --- a/lib/libcflat.h +++ b/lib/libcflat.h @@ -21,6 +21,8 @@ #define __LIBCFLAT_H #include +#include +#include #include #define __unused __attribute__((__unused__)) @@ -28,44 +30,39 @@ #define xstr(s) xxstr(s) #define xxstr(s) #s -typedef unsigned char u8; -typedef signed char s8; -typedef unsigned short u16; -typedef signed short s16; -typedef unsigned u32; -typedef signed s32; -typedef unsigned long ulong; -typedef unsigned long long u64; -typedef signed long long s64; -typedef unsigned long size_t; -typedef _Bool bool; +typedef uint8_t u8; +typedef int8_t s8; +typedef uint16_t u16; +typedef int16_t s16; +typedef uint32_t u32; +typedef int32_t s32; +typedef uint64_t u64; +typedef int64_t s64; +typedef unsigned long ulong; -#define true 1 +typedef _Bool bool; #define false 0 +#define true 1 +extern void puts(const char *s); extern void exit(int code); extern void abort(void); extern int printf(const char *fmt, ...); extern int snprintf(char *buf, int size, const char *fmt, ...); extern int vsnprintf(char *buf, int size, const char *fmt, va_list va); +extern long atol(const char *ptr); -extern void puts(const char *s); +void report(const char *msg_fmt, bool pass, ...); +void report_xfail(const char *msg_fmt, bool xfail, bool pass, ...); +int report_summary(void); -extern long atol(const char *ptr); -#define ARRAY_SIZE(_a) (sizeof(_a)/sizeof((_a)[0])) +#define ARRAY_SIZE(_a) (sizeof(_a)/sizeof((_a)[0])) -#define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER) #define container_of(ptr, type, member) ({ \ const typeof( ((type *)0)->member ) *__mptr = (ptr); \ (type *)( (char *)__mptr - offsetof(type,member) );}) -#define NULL ((void *)0UL) - -void report(const char *msg_fmt, bool pass, ...); -void report_xfail(const char *msg_fmt, bool xfail, bool pass, ...); -int report_summary(void); - #define assert(cond) \ do { \ if (!(cond)) \