From patchwork Wed Jul 22 16:44:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 51368 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by patches.linaro.org (Postfix) with ESMTPS id 35FC9228EF for ; Wed, 22 Jul 2015 16:44:30 +0000 (UTC) Received: by lbvb1 with SMTP id b1sf59072988lbv.3 for ; Wed, 22 Jul 2015 09:44:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=ThtrS/16e0JX7WqZb3RIOXarR0uT7fjEgxhhcSbG+8s=; b=FwyV0pXQU6Xw/lLwaT3VzA8+ZAWWrxRVoNi9OB9QZt8PIe7tgKD8p1a6L3FTtYIL/L ZJVSIuBTIdvTAkHeTQDVlwYbkedTA5XIAf0yMqcbB2Q0IOrrlzPrEUhEKTzbFjFgLNg0 Zt5PM0AYsvvTCyc1dh4EnLH0uZLHw3rktH05F5AxfACstDCyaHIJD9dzFIJl+oEbBEn7 fLlZwcR08eG6g6zK7lmNXQ3aU9PUcc4/90uHv5YcJU2/s4eBrEXlD/kj4kwqloT6UDXB Lvjlw09qZ5x6AmS3cnLLCZwzcSzFysl5GBf4jOh/bJQOdRSVgPAO4EBes5AqDR889BSA jb2A== X-Gm-Message-State: ALoCoQnGRKNpD3iplvQxnqd6DImyR2PVnNqTsckb9KPqn0Iku6vPTJ+j2gHBCtyJ9HCcqLClEERm X-Received: by 10.180.182.110 with SMTP id ed14mr2058192wic.5.1437583469212; Wed, 22 Jul 2015 09:44:29 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.23.74 with SMTP id k10ls123304laf.30.gmail; Wed, 22 Jul 2015 09:44:29 -0700 (PDT) X-Received: by 10.152.37.102 with SMTP id x6mr3214748laj.69.1437583468980; Wed, 22 Jul 2015 09:44:28 -0700 (PDT) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com. [209.85.215.53]) by mx.google.com with ESMTPS id cy4si1652028lac.57.2015.07.22.09.44.28 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Jul 2015 09:44:28 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by lahe2 with SMTP id e2so79174422lah.1 for ; Wed, 22 Jul 2015 09:44:28 -0700 (PDT) X-Received: by 10.112.131.98 with SMTP id ol2mr3330055lbb.56.1437583468598; Wed, 22 Jul 2015 09:44:28 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.7.198 with SMTP id l6csp46294lba; Wed, 22 Jul 2015 09:44:27 -0700 (PDT) X-Received: by 10.66.65.229 with SMTP id a5mr7829444pat.11.1437583458397; Wed, 22 Jul 2015 09:44:18 -0700 (PDT) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id bx2si5050287pab.141.2015.07.22.09.44.16 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 22 Jul 2015 09:44:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::1 as permitted sender) client-ip=2001:8b0:1d0::1; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1ZHx7r-0002Wv-MO; Wed, 22 Jul 2015 17:44:11 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org Subject: [PATCH 06/12] osdep.h: Move some OS header includes and fixups from qemu-common.h Date: Wed, 22 Jul 2015 17:44:05 +0100 Message-Id: <1437583451-9677-7-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1437583451-9677-1-git-send-email-peter.maydell@linaro.org> References: <1437583451-9677-1-git-send-email-peter.maydell@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , qemu-common.h has some system header includes and fixups for things that might be missing. This is really an OS dependency and belongs in osdep.h, so move it across. Signed-off-by: Peter Maydell --- include/qemu-common.h | 55 +-------------------------------------------------- include/qemu/osdep.h | 49 ++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 49 insertions(+), 55 deletions(-) diff --git a/include/qemu-common.h b/include/qemu-common.h index 9e622a5..de4ae53 100644 --- a/include/qemu-common.h +++ b/include/qemu-common.h @@ -12,8 +12,7 @@ #ifndef QEMU_COMMON_H #define QEMU_COMMON_H -#include "qemu/compiler.h" -#include "config-host.h" +#include "qemu/osdep.h" #include "qemu/typedefs.h" #include "qemu/fprintf-fn.h" @@ -23,60 +22,9 @@ #define TFR(expr) do { if ((expr) != -1) break; } while (errno == EINTR) -/* we put basic includes here to avoid repeating them in device drivers */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include "glib-compat.h" #include "qemu/option.h" -#ifdef _WIN32 -#include "sysemu/os-win32.h" -#endif - -#ifdef CONFIG_POSIX -#include "sysemu/os-posix.h" -#endif - -#ifndef O_LARGEFILE -#define O_LARGEFILE 0 -#endif -#ifndef O_BINARY -#define O_BINARY 0 -#endif -#ifndef MAP_ANONYMOUS -#define MAP_ANONYMOUS MAP_ANON -#endif -#ifndef ENOMEDIUM -#define ENOMEDIUM ENODEV -#endif -#if !defined(ENOTSUP) -#define ENOTSUP 4096 -#endif -#if !defined(ECANCELED) -#define ECANCELED 4097 -#endif -#if !defined(EMEDIUMTYPE) -#define EMEDIUMTYPE 4098 -#endif -#ifndef TIME_MAX -#define TIME_MAX LONG_MAX -#endif - /* HOST_LONG_BITS is the size of a native pointer in bits. */ #if UINTPTR_MAX == UINT32_MAX # define HOST_LONG_BITS 32 @@ -97,7 +45,6 @@ extern int64_t max_delay; extern int64_t max_advance; void dump_drift_info(FILE *f, fprintf_function cpu_fprintf); -#include "qemu/osdep.h" #include "qemu/bswap.h" /* FIXME: Remove NEED_CPU_H. */ diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 4ae2c64..60ac27d 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -8,6 +8,22 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #ifdef __OpenBSD__ #include #endif @@ -19,7 +35,13 @@ #define WEXITSTATUS(x) (x) #endif -#include +#ifdef _WIN32 +#include "sysemu/os-win32.h" +#endif + +#ifdef CONFIG_POSIX +#include "sysemu/os-posix.h" +#endif #if defined(CONFIG_SOLARIS) && CONFIG_SOLARIS_VERSION < 10 /* [u]int_fast*_t not in */ @@ -28,6 +50,31 @@ typedef unsigned int uint_fast16_t; typedef signed int int_fast16_t; #endif +#ifndef O_LARGEFILE +#define O_LARGEFILE 0 +#endif +#ifndef O_BINARY +#define O_BINARY 0 +#endif +#ifndef MAP_ANONYMOUS +#define MAP_ANONYMOUS MAP_ANON +#endif +#ifndef ENOMEDIUM +#define ENOMEDIUM ENODEV +#endif +#if !defined(ENOTSUP) +#define ENOTSUP 4096 +#endif +#if !defined(ECANCELED) +#define ECANCELED 4097 +#endif +#if !defined(EMEDIUMTYPE) +#define EMEDIUMTYPE 4098 +#endif +#ifndef TIME_MAX +#define TIME_MAX LONG_MAX +#endif + #ifndef MIN #define MIN(a, b) (((a) < (b)) ? (a) : (b)) #endif