From patchwork Sat Jun 28 01:25:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roy Franz X-Patchwork-Id: 32654 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f197.google.com (mail-qc0-f197.google.com [209.85.216.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C5DB4200B9 for ; Sat, 28 Jun 2014 01:27:44 +0000 (UTC) Received: by mail-qc0-f197.google.com with SMTP id i8sf10920168qcq.4 for ; Fri, 27 Jun 2014 18:27:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:cc:subject:precedence:list-id:list-unsubscribe:list-post :list-help:list-subscribe:mime-version:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list :list-archive:content-type:content-transfer-encoding; bh=VXOmO1RnfnE8SHWrMgiu+LtgdAG/nAeO9RWr/OCXyh8=; b=EUX86WQKdfInx3fJux4CsO0IrHlizCXAb1DbJKZ0MB/uv5g7k4b8vaZsW3kkyeuGTD CPGqT2aUYxlLF3MhCapbM+XwS0xOhc5FyRRjnU2yknwNsROHtsyBb3O2woFtYrCaW+5B G+PHP5E+VpF/lPhM0AmnFuVY218BXm6oPmyxMAIJ4JWLkCY8RCb7yXNPJXJdeuDY+Ls+ plnb4OlmJeuPtOzzZShupGYlmeSzDjlNSF0ufN5dNwoSKHiKKxIkEmmE6/Q3XaYuBdY1 TzI1z6dIHIPVvd5SxLo1R5pY8eOMhG9LbfPj+ur5ZrrC9OBYCEHbH3xetNkAYropUSiw 919w== X-Gm-Message-State: ALoCoQntd7KnWflDaNIpTFLy1ABcTQYM9eJrGYtRwaSIFmmD6PfDnfZALWk2ooEz31PdUh23FKKe X-Received: by 10.224.64.198 with SMTP id f6mr13845240qai.3.1403918864676; Fri, 27 Jun 2014 18:27:44 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.83.50 with SMTP id i47ls802335qgd.38.gmail; Fri, 27 Jun 2014 18:27:44 -0700 (PDT) X-Received: by 10.58.210.168 with SMTP id mv8mr20119052vec.12.1403918864617; Fri, 27 Jun 2014 18:27:44 -0700 (PDT) Received: from mail-ve0-f169.google.com (mail-ve0-f169.google.com [209.85.128.169]) by mx.google.com with ESMTPS id yq14si1486081vdb.90.2014.06.27.18.27.44 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 27 Jun 2014 18:27:44 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.169 as permitted sender) client-ip=209.85.128.169; Received: by mail-ve0-f169.google.com with SMTP id pa12so6119755veb.14 for ; Fri, 27 Jun 2014 18:27:44 -0700 (PDT) X-Received: by 10.220.105.136 with SMTP id t8mr22987298vco.13.1403918864460; Fri, 27 Jun 2014 18:27:44 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp147857vcb; Fri, 27 Jun 2014 18:27:44 -0700 (PDT) X-Received: by 10.50.97.104 with SMTP id dz8mr16409117igb.3.1403918863666; Fri, 27 Jun 2014 18:27:43 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id on4si909192igb.14.2014.06.27.18.27.42 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 27 Jun 2014 18:27:43 -0700 (PDT) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1X0hP8-0007Tl-PL; Sat, 28 Jun 2014 01:26:10 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1X0hP7-0007RS-Ce for xen-devel@lists.xen.org; Sat, 28 Jun 2014 01:26:09 +0000 Received: from [193.109.254.147:41026] by server-13.bemta-14.messagelabs.com id 02/5D-23211-0B91EA35; Sat, 28 Jun 2014 01:26:08 +0000 X-Env-Sender: roy.franz@linaro.org X-Msg-Ref: server-2.tower-27.messagelabs.com!1403918765!14205682!1 X-Originating-IP: [209.85.192.177] X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50 X-StarScan-Received: X-StarScan-Version: 6.11.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 4196 invoked from network); 28 Jun 2014 01:26:07 -0000 Received: from mail-pd0-f177.google.com (HELO mail-pd0-f177.google.com) (209.85.192.177) by server-2.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 28 Jun 2014 01:26:07 -0000 Received: by mail-pd0-f177.google.com with SMTP id y10so5119698pdj.22 for ; Fri, 27 Jun 2014 18:26:05 -0700 (PDT) X-Received: by 10.68.139.137 with SMTP id qy9mr34907936pbb.11.1403918765671; Fri, 27 Jun 2014 18:26:05 -0700 (PDT) Received: from rfranz-t520.local (c-24-10-97-91.hsd1.ca.comcast.net. [24.10.97.91]) by mx.google.com with ESMTPSA id eh4sm16637918pbc.79.2014.06.27.18.26.04 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 27 Jun 2014 18:26:05 -0700 (PDT) From: Roy Franz To: xen-devel@lists.xen.org, ian.campbell@citrix.com, stefano.stabellini@citrix.com, tim@xen.org, jbeulich@suse.com, keir@xen.org Date: Sat, 28 Jun 2014 02:25:33 +0100 Message-Id: <1403918735-30027-18-git-send-email-roy.franz@linaro.org> X-Mailer: git-send-email 2.0.0 In-Reply-To: <1403918735-30027-1-git-send-email-roy.franz@linaro.org> References: <1403918735-30027-1-git-send-email-roy.franz@linaro.org> Cc: Roy Franz , fu.wei@linaro.org, linaro-uefi@lists.linaro.org Subject: [Xen-devel] [PATCH RFC 17/19] Remove x86 specific defintions from efibind.h X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: roy.franz@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.128.169 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: Clean up arm64 efibind.h to not include x86 specific definitions. Signed-off-by: Roy Franz --- xen/include/asm-arm/arm64/efibind.h | 125 ++++++------------------------------ 1 file changed, 18 insertions(+), 107 deletions(-) diff --git a/xen/include/asm-arm/arm64/efibind.h b/xen/include/asm-arm/arm64/efibind.h index 2db3568..fe53a3b 100644 --- a/xen/include/asm-arm/arm64/efibind.h +++ b/xen/include/asm-arm/arm64/efibind.h @@ -29,19 +29,7 @@ Revision History // No ANSI C 1999/2000 stdint.h integer width declarations - #if defined(_MSC_EXTENSIONS) - - // Use Microsoft C compiler integer width declarations - - typedef unsigned __int64 uint64_t; - typedef __int64 int64_t; - typedef unsigned __int32 uint32_t; - typedef __int32 int32_t; - typedef unsigned short uint16_t; - typedef short int16_t; - typedef unsigned char uint8_t; - typedef char int8_t; - #elif defined(__GNUC__) + #if defined(__GNUC__) typedef unsigned long long uint64_t __attribute__((aligned (8))); typedef long long int64_t __attribute__((aligned (8))); typedef unsigned int uint32_t; @@ -106,15 +94,7 @@ typedef __WCHAR_TYPE__ WCHAR; typedef int64_t INTN; typedef uint64_t UINTN; -#ifdef EFI_NT_EMULATOR - #define POST_CODE(_Data) -#else - #ifdef EFI_DEBUG -#define POST_CODE(_Data) __asm mov eax,(_Data) __asm out 0x80,al - #else - #define POST_CODE(_Data) - #endif -#endif +#define POST_CODE(_Data) #define EFIERR(a) (0x8000000000000000 | a) #define EFI_ERROR_MASK 0x8000000000000000 @@ -124,11 +104,7 @@ typedef uint64_t UINTN; #define BAD_POINTER 0xFBFBFBFBFBFBFBFB #define MAX_ADDRESS 0xFFFFFFFFFFFFFFFF -#ifdef EFI_NT_EMULATOR - #define BREAKPOINT() __asm { int 3 } -#else - #define BREAKPOINT() while (TRUE); // Make it hang on Bios[Dbg]32 -#endif +#define BREAKPOINT() while (TRUE); // Make it hang on Bios[Dbg]32 // // Pointers must be aligned to these address to function @@ -150,15 +126,8 @@ typedef uint64_t UINTN; #define EFI_SIGNATURE_16(A,B) ((A) | (B<<8)) #define EFI_SIGNATURE_32(A,B,C,D) (EFI_SIGNATURE_16(A,B) | (EFI_SIGNATURE_16(C,D) << 16)) #define EFI_SIGNATURE_64(A,B,C,D,E,F,G,H) (EFI_SIGNATURE_32(A,B,C,D) | ((UINT64)(EFI_SIGNATURE_32(E,F,G,H)) << 32)) -// -// To export & import functions in the EFI emulator environment -// -#ifdef EFI_NT_EMULATOR - #define EXPORTAPI __declspec( dllexport ) -#else - #define EXPORTAPI -#endif +#define EXPORTAPI // @@ -170,13 +139,7 @@ typedef uint64_t UINTN; // #ifndef EFIAPI // Forces EFI calling conventions reguardless of compiler options - #ifdef _MSC_EXTENSIONS - #define EFIAPI __cdecl // Force C calling convention for Microsoft C compiler - #elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) - #define EFIAPI __attribute__((__ms_abi__)) // Force Microsoft ABI - #else #define EFIAPI // Substitute expresion to force C calling convention - #endif #endif #define BOOTSERVICE @@ -194,69 +157,32 @@ typedef uint64_t UINTN; #define MEMORY_FENCE() -#ifdef EFI_NT_EMULATOR // -// To help ensure proper coding of integrated drivers, they are -// compiled as DLLs. In NT they require a dll init entry pointer. -// The macro puts a stub entry point into the DLL so it will load. +// When build similiar to FW, then link everything together as +// one big module. // #define EFI_DRIVER_ENTRY_POINT(InitFunction) \ UINTN \ - __stdcall \ - _DllMainCRTStartup ( \ - UINTN Inst, \ - UINTN reason_for_call, \ - VOID *rserved \ + InitializeDriver ( \ + VOID *ImageHandle, \ + VOID *SystemTable \ ) \ { \ - return 1; \ + return InitFunction(ImageHandle, \ + SystemTable); \ } \ \ - int \ - EXPORTAPI \ - __cdecl \ - InitializeDriver ( \ - void *ImageHandle, \ - void *SystemTable \ - ) \ - { \ - return InitFunction(ImageHandle, SystemTable); \ - } + EFI_STATUS efi_main( \ + EFI_HANDLE image, \ + EFI_SYSTEM_TABLE *systab \ + ) __attribute__((weak, \ + alias ("InitializeDriver"))); +#define LOAD_INTERNAL_DRIVER(_if, type, name, entry) \ + (_if)->LoadInternal(type, name, entry) - #define LOAD_INTERNAL_DRIVER(_if, type, name, entry) \ - (_if)->LoadInternal(type, name, NULL) - -#else // EFI_NT_EMULATOR - -// -// When build similiar to FW, then link everything together as -// one big module. -// - - #define EFI_DRIVER_ENTRY_POINT(InitFunction) \ - UINTN \ - InitializeDriver ( \ - VOID *ImageHandle, \ - VOID *SystemTable \ - ) \ - { \ - return InitFunction(ImageHandle, \ - SystemTable); \ - } \ - \ - EFI_STATUS efi_main( \ - EFI_HANDLE image, \ - EFI_SYSTEM_TABLE *systab \ - ) __attribute__((weak, \ - alias ("InitializeDriver"))); - - #define LOAD_INTERNAL_DRIVER(_if, type, name, entry) \ - (_if)->LoadInternal(type, name, entry) - -#endif // EFI_FW_NT // // Some compilers don't support the forward reference construct: @@ -274,18 +200,3 @@ typedef uint64_t UINTN; #endif #endif -#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) -#define uefi_call_wrapper(func, va_num, ...) func(__VA_ARGS__) -#else -/* for x86_64, EFI_FUNCTION_WRAPPER must be defined */ -#ifdef EFI_FUNCTION_WRAPPER -UINTN uefi_call_wrapper(void *func, unsigned long va_num, ...); -#else -#error "EFI_FUNCTION_WRAPPER must be defined for x86_64 architecture" -#endif -#endif - -#ifdef _MSC_EXTENSIONS -#pragma warning ( disable : 4731 ) // Suppress warnings about modification of EBP -#endif -