From nobody Wed Nov 22 03:02:33 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SZmJB1c37z51d8w; Wed, 22 Nov 2023 03:02:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SZmJB1RH9z3SmZ; Wed, 22 Nov 2023 03:02:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700622154; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yz2ast5E2j0rWr4RXNPP8qHI3Of9ob2L5P5ofo/sxxU=; b=BAQaocOVofidfdU0KMSrejRAYDpa5zt4F83syeNeVoskvLaBOveOi7d4NtCpOTtLU5Yke2 b/Sm4H94hZjty4Q/nDrBZQzoCob9Rf8UNThC8tDQ6wpeziXc+rEg7Cyoo3wIVkE6/f4YVJ 5K9BxO2PHnxM6DKPTZdAla9FodY33QNT7cmBa6qWUPAtVMUZA7nj+5Cy3XX2l5g/HMRgpV xq8e6DguKe50XmGNPEcQYcsm0ma49pSHY15XecsEx32wSFrPG8UN/AqlLK4QkAyPfm0e/9 S/bAWelnw7nKZujMnihS7+ZE4ftpDBb3hDOI0IsUi+AsUm610OtG3b8GXK6UYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1700622154; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yz2ast5E2j0rWr4RXNPP8qHI3Of9ob2L5P5ofo/sxxU=; b=Pfs58ct1oXUhTD5ThBOp4NAwNyKSVwYt96zmC/D2d8brrMmt2s4V8CgEPxoSy3ra9iJc0y bnBPGfsrGCL/MnvKX8tisd2PalQb95JFgl0Itex7TB83CS0jP8pJ0RmuqxeIYztPzI1z+c NnYl46DVPycGrtzYpHaH9TjHoploGSF+jZQkMD8XIALpOx8+UWfCZkjEWlJpfkF4c4ZVDn E3Hbu4CrgrHqabHRmjNqztYu9zUmgKv46fVscs25+d0DuTisJ8sMld5J7qU1oIKC5nIXjc R7+1Ngl8iS9Lwn/YEtY/GZsGh8znbxr5MXkHClGdC3CqOTRdRcnPFB/9ZBgzgQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1700622154; a=rsa-sha256; cv=none; b=iExi9j6qcHBJF7fj73BIBmascPdjUSXEVK+aeanN5bQtotz69BhTKJ4QZgulBpbI+7kcFb 09geJycaPGqBjI21fvmn/hS32zJUQQpvrnXSIugP+NkHcM4D23Ys3Dr+zaIm3hfPnt4/rg ay/6iS4yrvDbPLuMIG7BxzoGKEy6jirNHo8QcszW+6slZOPHg7BQyD0kePnkFrR2iR3Scz R1/aQO/4ydN1yBrO6PqZEMXb7HVPrLTqN/GBWu9Z19YzXX0QZwhhQoaUPELDqRiSeUav/c jChoRpxPXbfPmZS/1sRT6uB1GZIuaYeR4Razb4bZKDjTaVCeg05uCTiNwrDl8Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SZmJB0TX2z11cc; Wed, 22 Nov 2023 03:02:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3AM32Xwo099815; Wed, 22 Nov 2023 03:02:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3AM32XiN099812; Wed, 22 Nov 2023 03:02:33 GMT (envelope-from git) Date: Wed, 22 Nov 2023 03:02:33 GMT Message-Id: <202311220302.3AM32XiN099812@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 7a1bc422d109 - main - stand/efi: Consolidate integer types List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7a1bc422d109a7cee56dcfbac616eda613c1c43e Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=7a1bc422d109a7cee56dcfbac616eda613c1c43e commit 7a1bc422d109a7cee56dcfbac616eda613c1c43e Author: Warner Losh AuthorDate: 2023-11-22 02:58:20 +0000 Commit: Warner Losh CommitDate: 2023-11-22 02:58:20 +0000 stand/efi: Consolidate integer types We have no need for 5 different copies of these. Sponsored by: Netflix Reviewed by: rcm, kevans, andrew Differential Revision: https://reviews.freebsd.org/D42699 --- stand/efi/include/amd64/efibind.h | 83 --------------------------------------- stand/efi/include/arm/efibind.h | 35 ----------------- stand/efi/include/arm64/efibind.h | 76 ----------------------------------- stand/efi/include/efi.h | 31 +++++++++++++++ stand/efi/include/i386/efibind.h | 83 --------------------------------------- stand/efi/include/riscv/efibind.h | 76 ----------------------------------- stand/efi/loader/main.c | 1 - 7 files changed, 31 insertions(+), 354 deletions(-) diff --git a/stand/efi/include/amd64/efibind.h b/stand/efi/include/amd64/efibind.h index 2f900786fb9d..d005ade221c4 100644 --- a/stand/efi/include/amd64/efibind.h +++ b/stand/efi/include/amd64/efibind.h @@ -26,89 +26,6 @@ Revision History #pragma pack() - -#ifdef __FreeBSD__ -#include -#else -// -// Basic int types of various widths -// - -#if (__STDC_VERSION__ < 199901L ) - - // No ANSI C 1999/2000 stdint.h integer width declarations - - #ifdef _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; - #else - #ifdef UNIX_LP64 - - // Use LP64 programming model from C_FLAGS for integer width declarations - - typedef unsigned long uint64_t; - typedef long int64_t; - typedef unsigned int uint32_t; - typedef int int32_t; - typedef unsigned short uint16_t; - typedef short int16_t; - typedef unsigned char uint8_t; - typedef char int8_t; - #else - - // Assume P64 programming model from C_FLAGS for integer width declarations - - typedef unsigned long long uint64_t; - typedef long long int64_t; - typedef unsigned int uint32_t; - typedef int int32_t; - typedef unsigned short uint16_t; - typedef short int16_t; - typedef unsigned char uint8_t; - typedef char int8_t; - #endif - #endif -#endif -#endif /* __FreeBSD__ */ - -// -// Basic EFI types of various widths -// - -#ifndef ACPI_THREAD_ID /* ACPI's definitions are fine */ -#define ACPI_USE_SYSTEM_INTTYPES 1 /* Tell ACPI we've defined types */ - -typedef uint64_t UINT64; -typedef int64_t INT64; - -#ifndef _BASETSD_H_ - typedef uint32_t UINT32; - typedef int32_t INT32; -#endif - -typedef uint16_t UINT16; -typedef int16_t INT16; -typedef uint8_t UINT8; -typedef int8_t INT8; - -#endif - -#undef VOID -#define VOID void - - -typedef int64_t INTN; -typedef uint64_t UINTN; - #ifdef EFI_NT_EMULATOR #define POST_CODE(_Data) #else diff --git a/stand/efi/include/arm/efibind.h b/stand/efi/include/arm/efibind.h index 8bc9f4b56eb2..a08d26ac84c4 100644 --- a/stand/efi/include/arm/efibind.h +++ b/stand/efi/include/arm/efibind.h @@ -40,41 +40,6 @@ Abstract: #endif -#ifdef __FreeBSD__ -#include -#else -// -// Assume standard IA-32 alignment. -// BugBug: Need to check portability of long long -// -typedef unsigned long long uint64_t; -typedef long long int64_t; -typedef unsigned int uint32_t; -typedef int int32_t; -typedef unsigned short uint16_t; -typedef short int16_t; -typedef unsigned char uint8_t; -typedef signed char int8_t; -#endif - -typedef uint64_t UINT64; -typedef int64_t INT64; -typedef uint32_t UINT32; -typedef int32_t INT32; -typedef uint16_t UINT16; -typedef int16_t INT16; -typedef uint8_t UINT8; -typedef int8_t INT8; - -#undef VOID -#define VOID void - -// -// Native integer size in stdint.h -// -typedef uint32_t UINTN; -typedef int32_t INTN; - #define EFIERR(a) (0x80000000 | a) #define EFI_ERROR_MASK 0x80000000 #define EFIERR_OEM(a) (0xc0000000 | a) diff --git a/stand/efi/include/arm64/efibind.h b/stand/efi/include/arm64/efibind.h index 4fdfd9f21386..417da1b4d4ff 100644 --- a/stand/efi/include/arm64/efibind.h +++ b/stand/efi/include/arm64/efibind.h @@ -26,82 +26,6 @@ Revision History #pragma pack() - -#ifdef __FreeBSD__ -#include -#else -// -// Basic int types of various widths -// - -#if (__STDC_VERSION__ < 199901L ) - - // No ANSI C 1999/2000 stdint.h integer width declarations - - #ifdef _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 __int16 uint16_t; - typedef __int16 int16_t; - typedef unsigned __int8 uint8_t; - typedef __int8 int8_t; - #else - #ifdef UNIX_LP64 - - // Use LP64 programming model from C_FLAGS for integer width declarations - - typedef unsigned long uint64_t; - typedef long int64_t; - typedef unsigned int uint32_t; - typedef int int32_t; - typedef unsigned short uint16_t; - typedef short int16_t; - typedef unsigned char uint8_t; - typedef char int8_t; - #else - - // Assume P64 programming model from C_FLAGS for integer width declarations - - typedef unsigned long long uint64_t; - typedef long long int64_t; - typedef unsigned int uint32_t; - typedef int int32_t; - typedef unsigned short uint16_t; - typedef short int16_t; - typedef unsigned char uint8_t; - typedef char int8_t; - #endif - #endif -#endif -#endif /* __FreeBSD__ */ - -// -// Basic EFI types of various widths -// - - -typedef uint64_t UINT64; -typedef int64_t INT64; -typedef uint32_t UINT32; -typedef int32_t INT32; -typedef uint16_t UINT16; -typedef int16_t INT16; -typedef uint8_t UINT8; -typedef int8_t INT8; - - -#undef VOID -#define VOID void - - -typedef int64_t INTN; -typedef uint64_t UINTN; - //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // BugBug: Code to debug // diff --git a/stand/efi/include/efi.h b/stand/efi/include/efi.h index 20776dcee2fc..b603c3a78205 100644 --- a/stand/efi/include/efi.h +++ b/stand/efi/include/efi.h @@ -39,6 +39,37 @@ Revision History #define EFI_FIRMWARE_MINOR_REVISION 62 #define EFI_FIRMWARE_REVISION ((EFI_FIRMWARE_MAJOR_REVISION <<16) | (EFI_FIRMWARE_MINOR_REVISION)) +// +// Basic EFI types of various widths. +// + +#include +#ifndef ACPI_THREAD_ID /* ACPI's definitions are fine */ +#define ACPI_USE_SYSTEM_INTTYPES 1 /* Tell ACPI we've defined types */ + +typedef uint64_t UINT64; +typedef int64_t INT64; +typedef uint32_t UINT32; +typedef int32_t INT32; +typedef uint16_t UINT16; +typedef int16_t INT16; +typedef uint8_t UINT8; +typedef int8_t INT8; + +#ifdef __LP64__ +typedef int64_t INTN; +typedef uint64_t UINTN; +#else +typedef int32_t INTN; +typedef uint32_t UINTN; +#endif + +#endif + +#undef VOID +#define VOID void + + #include "efibind.h" #include "efidef.h" #include "efidevp.h" diff --git a/stand/efi/include/i386/efibind.h b/stand/efi/include/i386/efibind.h index 6123a98d1b9b..e4cbceae8216 100644 --- a/stand/efi/include/i386/efibind.h +++ b/stand/efi/include/i386/efibind.h @@ -26,89 +26,6 @@ Revision History #pragma pack() - -#ifdef __FreeBSD__ -#include -#else -// -// Basic int types of various widths -// - -#if (__STDC_VERSION__ < 199901L ) - - // No ANSI C 1999/2000 stdint.h integer width declarations - - #ifdef _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; - #else - #ifdef UNIX_LP64 - - // Use LP64 programming model from C_FLAGS for integer width declarations - - typedef unsigned long uint64_t; - typedef long int64_t; - typedef unsigned int uint32_t; - typedef int int32_t; - typedef unsigned short uint16_t; - typedef short int16_t; - typedef unsigned char uint8_t; - typedef char int8_t; - #else - - // Assume P64 programming model from C_FLAGS for integer width declarations - - typedef unsigned long long uint64_t; - typedef long long int64_t; - typedef unsigned int uint32_t; - typedef int int32_t; - typedef unsigned short uint16_t; - typedef short int16_t; - typedef unsigned char uint8_t; - typedef char int8_t; - #endif - #endif -#endif -#endif /* __FreeBSD__ */ - -// -// Basic EFI types of various widths -// - -#ifndef ACPI_THREAD_ID /* ACPI's definitions are fine, use those */ -#define ACPI_USE_SYSTEM_INTTYPES 1 /* Tell ACPI we've defined types */ - -typedef uint64_t UINT64; -typedef int64_t INT64; - -#ifndef _BASETSD_H_ - typedef uint32_t UINT32; - typedef int32_t INT32; -#endif - -typedef uint16_t UINT16; -typedef int16_t INT16; -typedef uint8_t UINT8; -typedef int8_t INT8; - -#endif - -#undef VOID -#define VOID void - - -typedef int32_t INTN; -typedef uint32_t UINTN; - #ifdef EFI_NT_EMULATOR #define POST_CODE(_Data) #else diff --git a/stand/efi/include/riscv/efibind.h b/stand/efi/include/riscv/efibind.h index 4fdfd9f21386..417da1b4d4ff 100644 --- a/stand/efi/include/riscv/efibind.h +++ b/stand/efi/include/riscv/efibind.h @@ -26,82 +26,6 @@ Revision History #pragma pack() - -#ifdef __FreeBSD__ -#include -#else -// -// Basic int types of various widths -// - -#if (__STDC_VERSION__ < 199901L ) - - // No ANSI C 1999/2000 stdint.h integer width declarations - - #ifdef _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 __int16 uint16_t; - typedef __int16 int16_t; - typedef unsigned __int8 uint8_t; - typedef __int8 int8_t; - #else - #ifdef UNIX_LP64 - - // Use LP64 programming model from C_FLAGS for integer width declarations - - typedef unsigned long uint64_t; - typedef long int64_t; - typedef unsigned int uint32_t; - typedef int int32_t; - typedef unsigned short uint16_t; - typedef short int16_t; - typedef unsigned char uint8_t; - typedef char int8_t; - #else - - // Assume P64 programming model from C_FLAGS for integer width declarations - - typedef unsigned long long uint64_t; - typedef long long int64_t; - typedef unsigned int uint32_t; - typedef int int32_t; - typedef unsigned short uint16_t; - typedef short int16_t; - typedef unsigned char uint8_t; - typedef char int8_t; - #endif - #endif -#endif -#endif /* __FreeBSD__ */ - -// -// Basic EFI types of various widths -// - - -typedef uint64_t UINT64; -typedef int64_t INT64; -typedef uint32_t UINT32; -typedef int32_t INT32; -typedef uint16_t UINT16; -typedef int16_t INT16; -typedef uint8_t UINT8; -typedef int8_t INT8; - - -#undef VOID -#define VOID void - - -typedef int64_t INTN; -typedef uint64_t UINTN; - //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // BugBug: Code to debug // diff --git a/stand/efi/loader/main.c b/stand/efi/loader/main.c index a650abb3b68c..d6ba7ec3da44 100644 --- a/stand/efi/loader/main.c +++ b/stand/efi/loader/main.c @@ -60,7 +60,6 @@ #include "efizfs.h" #include "framebuffer.h" -#define ACPI_USE_SYSTEM_INTTYPES 1 #include "platform/acfreebsd.h" #include "acconfig.h" #define ACPI_SYSTEM_XFACE