From patchwork Thu Oct 30 15:57:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Jones X-Patchwork-Id: 5198651 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 A15BC9F30B for ; Thu, 30 Oct 2014 15:57:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D8B7120117 for ; Thu, 30 Oct 2014 15:57:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DC59520172 for ; Thu, 30 Oct 2014 15:57:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161163AbaJ3P5T (ORCPT ); Thu, 30 Oct 2014 11:57:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35641 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161146AbaJ3P5S (ORCPT ); Thu, 30 Oct 2014 11:57:18 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s9UFvFeT001182 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 30 Oct 2014 11:57:16 -0400 Received: from hawk.usersys.redhat.com (dhcp-1-153.brq.redhat.com [10.34.1.153]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s9UFv9BQ027960; Thu, 30 Oct 2014 11:57:14 -0400 From: Andrew Jones To: kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org Cc: christoffer.dall@linaro.org, pbonzini@redhat.com Subject: [PATCH 3/6] lib: steal const.h from kernel Date: Thu, 30 Oct 2014 16:57:02 +0100 Message-Id: <1414684625-9445-4-git-send-email-drjones@redhat.com> In-Reply-To: <1414684625-9445-1-git-send-email-drjones@redhat.com> References: <1414684625-9445-1-git-send-email-drjones@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 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 And apply it to /lib files. This prepares for the import of kernel headers that make use of the const.h macros. Signed-off-by: Andrew Jones --- lib/asm-generic/page.h | 8 +++----- lib/const.h | 11 +++++++++++ 2 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 lib/const.h diff --git a/lib/asm-generic/page.h b/lib/asm-generic/page.h index 8602752002f71..66c72a62bb0f7 100644 --- a/lib/asm-generic/page.h +++ b/lib/asm-generic/page.h @@ -9,12 +9,10 @@ * This work is licensed under the terms of the GNU LGPL, version 2. */ +#include "const.h" + #define PAGE_SHIFT 12 -#ifndef __ASSEMBLY__ -#define PAGE_SIZE (1UL << PAGE_SHIFT) -#else -#define PAGE_SIZE (1 << PAGE_SHIFT) -#endif +#define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT) #define PAGE_MASK (~(PAGE_SIZE-1)) #ifndef __ASSEMBLY__ diff --git a/lib/const.h b/lib/const.h new file mode 100644 index 0000000000000..5cd94d7067541 --- /dev/null +++ b/lib/const.h @@ -0,0 +1,11 @@ +#ifndef _CONST_H_ +#define _CONST_H_ +#ifdef __ASSEMBLY__ +#define _AC(X,Y) X +#define _AT(T,X) X +#else +#define __AC(X,Y) (X##Y) +#define _AC(X,Y) __AC(X,Y) +#define _AT(T,X) ((T)(X)) +#endif +#endif