From nobody Tue Apr 16 02:34:43 2024 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 4VJSmh10fZz5HZpd; Tue, 16 Apr 2024 02:34:44 +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 4VJSmh03yhz4HdF; Tue, 16 Apr 2024 02:34:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713234884; 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=5SVI7YvFfOp/uI1BEVhxdsPDuBZ/XyKpIdn77dS5yCo=; b=jlbO1PqU2hLgkZmfNWT0fh4p/VjmgIPAmuHXFHPLiBrtUZha47mZtS3gxV41ywLIqzdoah Ma7Zx4GsAGSuriiPvs0RVwj5NMV4xtEWVbef7o4DXNInqyxCFS/b+ccz+APtXVHDtgAfqg AHgrqpFGtuAQai2N/J7QQBeFaYAkzeODdrI1O0NjIvPl5rU3sWysnzXJRczyaAtDVXuZhd c6Ykuhc1u1ErCeqhXFsmZsvgdwI0gdlRuf+kKasHvrlrV1r6dLM8edAVPc5imxmpVYUqHv 6bvRleKBvSo5iEQVg1i6aZVh3uorEivVJxP9k0XEsc+45Tl7jx9nJYNBG+XlrQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713234884; a=rsa-sha256; cv=none; b=lAyJDctc8rTBU1ICTMwtBW1LmXCioz8clBqYKRh6I8y5B1OauyIYypVOlbjLyYpaFV3qKk IZjk3PtTIJjKJz29wXS4q+iJKyCqoMumTP0huswFUXzY5QE1/Ux4irauhMWku7Yvx5EuGb JF17rvIsAwFYNS2E8AsgE2/zOXuy8rCrDnxrhIHoSXVCUOSwyUMHRI9Rz+IBHypviMg8Ik ScqIuwzm1biZPNqwkY0p6mCcYyuSr50Ka2OZ6z/iWWifhxLZEA9hRyb/xdjK5Xg9iqUmy4 ZQSmkjU7AnsiglPgw2wue5JF8j7e5XFlWKQ0q+w+cHJa3WxDTK5qyW9+2He4JA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713234884; 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=5SVI7YvFfOp/uI1BEVhxdsPDuBZ/XyKpIdn77dS5yCo=; b=vLFHRQU1J61HxJT/QwUP9xlHdY5aVkA81SY7Dw/a8rzIfj1XgpdAO35ew8jDAJOQ73FhgO y6+iCmyh+rgKE7tvHBS0rmhjk+uT5rQbg9msUGcHTyE4RK+jxHEpamPJojr/LBsEdI9TIV +cI/1WjPojF5AxA0bnDGlJITeUYA1hme9dm+I2X/l5tdIV1U1TqsvnayAgAf15Wii/sudg HBNcciDXSevmUVJKThqsW76Umu7EraTW+w5pFygFfFAzgEcVplT59I77AbQzTwi7qo4Qou 2zZs4QbXwZHDxCFrdAkj0sxwBWimaABIzqIayJ/Y+w/Aq8TZ0qxg9+g/Wg+wVg== 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 4VJSmg6VYmzPpk; Tue, 16 Apr 2024 02:34:43 +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 43G2Yh8R037582; Tue, 16 Apr 2024 02:34:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43G2Yh3w037579; Tue, 16 Apr 2024 02:34:43 GMT (envelope-from git) Date: Tue, 16 Apr 2024 02:34:43 GMT Message-Id: <202404160234.43G2Yh3w037579@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: ac0776ecf4f1 - stable/14 - 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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/stable/14 X-Git-Reftype: branch X-Git-Commit: ac0776ecf4f185a8ade56d1f8d40fce4b72f9543 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=ac0776ecf4f185a8ade56d1f8d40fce4b72f9543 commit ac0776ecf4f185a8ade56d1f8d40fce4b72f9543 Author: Warner Losh AuthorDate: 2023-11-22 02:58:20 +0000 Commit: Warner Losh CommitDate: 2024-04-16 02:32:04 +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 (cherry picked from commit 7a1bc422d109a7cee56dcfbac616eda613c1c43e) --- 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 9b691ce9ae98..4100c0680b7f 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