From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 05D68C433F5 for ; Fri, 7 Jan 2022 13:51:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=sqTKgZ3QuaV3nFjh7TyYiHwsjrN3jTFvJicu4FvB3gw=; b=jDxJz4e7dl/x8u NH7Z0vcXomuB/125w2fEljesEP6XUHmVDtTdHptjIcpjqIquAxatyxXzX50HAiB3RHnhHIK5c3tZT Q3K9+/uvDXtzfqRsbsCqL6FbJdvbJSG37WnLnWH/ifzptHK1GFy4MPlBd6UyHsgFBbMsftddvgJu/ Mpr09OSwAG9uC6BHlI0ypJjj+xNAWEZHPPHWG/UEHhd9Wcp9kAdZ+XyWaMqrawMBg7moiRt8FqDyI IUDqDnGX51HNxqiQ7MRHGSATEZqF7umnLGCid3VjJ4G4UIRYXWi/elQVctgoIApp2GIHUM2GV0cIa vUxNx3uilGo9rKifUGRA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n5pcv-0042yn-DR; Fri, 07 Jan 2022 13:49:53 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n5pcr-0042xf-A1 for linux-arm-kernel@lists.infradead.org; Fri, 07 Jan 2022 13:49:50 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 20B3113A1; Fri, 7 Jan 2022 05:49:47 -0800 (PST) Received: from FVFF77S0Q05N (unknown [10.57.7.134]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6396C3F774; Fri, 7 Jan 2022 05:49:46 -0800 (PST) Date: Fri, 7 Jan 2022 13:49:43 +0000 From: Mark Rutland To: Andre Przywara Cc: linux-arm-kernel@lists.infradead.org, Jaxson Han Subject: Re: [boot-wrapper PATCH v2 2/9] Add standard headers Message-ID: References: <20211222181607.1203191-1-andre.przywara@arm.com> <20211222181607.1203191-3-andre.przywara@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20211222181607.1203191-3-andre.przywara@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220107_054949_471152_70905587 X-CRM114-Status: GOOD ( 24.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Dec 22, 2021 at 06:16:00PM +0000, Andre Przywara wrote: > So far we were relying on some standard C headers to be provided by the > toolchain. This applies for instance to stddef.h and stdint.h. > As a "bare-metal" application, we should not rely on external headers, > or even on a toolchain providing them in the first place. > > Define our own version of stddef.h and stdint.h, containing just the > types that we actually need. Even a freestanding compiler implementation is required to provide these headers, and using the compiler versions would avoid unexpected mismatches (e.g. for builtins). So I don't think the justification as written makes sense. Is this because the next patch removes the stdinc paths, and so we don't get the compiler's implementation of these headers? Thanks, Mark. > > Signed-off-by: Andre Przywara > --- > arch/aarch32/include/stdint.h | 19 +++++++++++++++++++ > arch/aarch64/include/stdint.h | 19 +++++++++++++++++++ > include/stddef.h | 15 +++++++++++++++ > 3 files changed, 53 insertions(+) > create mode 100644 arch/aarch32/include/stdint.h > create mode 100644 arch/aarch64/include/stdint.h > create mode 100644 include/stddef.h > > diff --git a/arch/aarch32/include/stdint.h b/arch/aarch32/include/stdint.h > new file mode 100644 > index 0000000..77546f0 > --- /dev/null > +++ b/arch/aarch32/include/stdint.h > @@ -0,0 +1,19 @@ > +/* > + * arch/aarch32/include/stdint.h > + * > + * Copyright (C) 2021 ARM Limited. All rights reserved. > + * > + * Use of this source code is governed by a BSD-style license that can be > + * found in the LICENSE.txt file. > + */ > +#ifndef STDINT_H__ > +#define STDINT_H__ > + > +typedef unsigned char uint8_t; > +typedef unsigned short int uint16_t; > +typedef unsigned int uint32_t; > +typedef unsigned long long int uint64_t; > + > +typedef unsigned int uintptr_t; > + > +#endif > diff --git a/arch/aarch64/include/stdint.h b/arch/aarch64/include/stdint.h > new file mode 100644 > index 0000000..92c2603 > --- /dev/null > +++ b/arch/aarch64/include/stdint.h > @@ -0,0 +1,19 @@ > +/* > + * arch/aarch64/include/stdint.h > + * > + * Copyright (C) 2021 ARM Limited. All rights reserved. > + * > + * Use of this source code is governed by a BSD-style license that can be > + * found in the LICENSE.txt file. > + */ > +#ifndef STDINT_H__ > +#define STDINT_H__ > + > +typedef unsigned char uint8_t; > +typedef unsigned short int uint16_t; > +typedef unsigned int uint32_t; > +typedef unsigned long int uint64_t; > + > +typedef unsigned long int uintptr_t; > + > +#endif > diff --git a/include/stddef.h b/include/stddef.h > new file mode 100644 > index 0000000..3208b10 > --- /dev/null > +++ b/include/stddef.h > @@ -0,0 +1,15 @@ > +/* > + * include/stddef.h - standard data type definitions > + * > + * Copyright (C) 2021 ARM Limited. All rights reserved. > + * > + * Use of this source code is governed by a BSD-style license that can be > + * found in the LICENSE.txt file. > + */ > +#ifndef STDDEF_H__ > +#define STDDEF_H__ > + > +typedef unsigned long int size_t; > +typedef signed long int ssize_t; > + > +#endif > -- > 2.25.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel