From patchwork Sun Sep 29 16:36:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 1990621 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=L9PCRObJ; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XGqcn4zHmz1xt9 for ; Mon, 30 Sep 2024 02:37:45 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5BF67385EC27 for ; Sun, 29 Sep 2024 16:37:43 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id 5B435385EC22 for ; Sun, 29 Sep 2024 16:36:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5B435385EC22 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5B435385EC22 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727627804; cv=none; b=pFtO3PebGbH02hOx3HT14GT4R122XBuu7/LTlDg6DV+vzNWHhNrlhtvdbBqzHqhgHsDVcMRnpFy+vt0mxlz3wyQTbGSyw0Q7kcEagcHkY7lVjYuofQ8uPNARicQm1Vl5q/FfLzw7nzvJjbSQ+z/vSrPyc0AxPMA9cZSfKrlSpoA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727627804; c=relaxed/simple; bh=BRr2UWFCXObhlfSIcqjjsy/fqChrOSxdd21G17HtOF4=; h=DKIM-Signature:From:To:Subject:Message-ID:Date:MIME-Version; b=q60YdbkpBwO3cMxI0UzVn3BLj8v1Y5sDvTfhwJF6NTYf34ufaqZjqsHhlzSVT11UUepPrU0dZ34wLQWdBU7qQFFqd0D/5r5KInF0nWBMg1ckuoH4Gkt4az5mWGtGY6sfCzPOPaEei9gd+aP95V7FoadxggJocYAuw8hW6eFZckg= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1727627803; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=E5idQQZ8fjo5r63YzhEm8VYOKJ7CIcJDkpZzSQy+YKg=; b=L9PCRObJxivfsKxGZ2YcvFyxiGrSmXHVKmxHmQ7nMkZYuMY6y4InRJ92ARZqqTXT4BkCPV CSzycsASBSC05f83rFulP2sSEmudaTI9pxDdR0h0T85h2fNLZCBaUyM9XIJsNZ46vwRWuz GpJoMRXeDasqzO3nN9g5LhNJqKCmVls= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-571-2ca3FcdBNRiwt8Kay-vNmw-1; Sun, 29 Sep 2024 12:36:41 -0400 X-MC-Unique: 2ca3FcdBNRiwt8Kay-vNmw-1 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (unknown [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id EB30319792DA for ; Sun, 29 Sep 2024 16:36:40 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.45.224.151]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 063CD19373D7 for ; Sun, 29 Sep 2024 16:36:39 +0000 (UTC) From: Florian Weimer To: libc-alpha@sourceware.org Subject: [PATCH v3 25/29] Install the header file In-Reply-To: Message-ID: References: X-From-Line: cce1fcc9785e01c0c4c7198dae073d9d434ca92f Mon Sep 17 00:00:00 2001 Date: Sun, 29 Sep 2024 18:36:37 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~incoming=patchwork.ozlabs.org@sourceware.org --- NEWS | 5 +++++ manual/resource.texi | 31 +++++++++++++++++++++++++++++++ misc/Makefile | 2 ++ 3 files changed, 38 insertions(+) diff --git a/NEWS b/NEWS index b1ae1c31ca..d7b522e869 100644 --- a/NEWS +++ b/NEWS @@ -31,6 +31,11 @@ Major new features: * The iconv program now supports converting files in place. The program automatically uses a temporary file if required. +* The header file is now available. It contains macros + PAGE_SIZE_MIN, PAGE_SIZE_MAX, PAGE_SHIFT_MIN, PAGE_SHIFT_MAX, + reflecting the possible range of page sizes for the target + architecture. + Deprecated and removed features, and other changes affecting compatibility: * The big-endian ARC port (arceb-linux-gnu) has been removed. diff --git a/manual/resource.texi b/manual/resource.texi index 612520d4d9..32142dc103 100644 --- a/manual/resource.texi +++ b/manual/resource.texi @@ -1620,6 +1620,37 @@ different runs of the application. The function is declared in @file{unistd.h}. @end deftypefun +The header file @file{sys/pagesize.h} provides information about the +possible page sizes an architecture can support. + +@deftypevar {unsigned long int} PAGE_SIZE_MIN +@standards{GNU, sys/pagesize.h} +The smallest value that @code{getpagesize} can return on this +architecture. The pointers returned by @code{mmap} are +always a multiple of this constant (once cast to @code{uintptr_t}). +@xref{Memory-mapped I/O}. +@end deftypevar + +@deftypevar {unsigned long int} PAGE_SIZE_MAX +@standards{GNU, sys/pagesize.h} +The largest value that @code{getpagesize} can return on this +architecture. It is guaranteed that @code{mmap} can create +mappings at file offsets that are multiples of this constants. +@xref{Memory-mapped I/O}. +@end deftypevar + +@deftypevar int PAGE_SHIFT_MIN +@standards{GNU, sys/pagesize.h} +Base-2 logarithm of @code{PAGE_SIZE_MIN}. +The @code{PAGE_SHIFT_MIN} lowest bits of pointers +returned by @code{mmap} are always zero. +@end deftypevar + +@deftypevar int PAGE_SHIFT_MAX +@standards{GNU, sys/pagesize.h} +Base-2 logarithm of @code{PAGE_SIZE_MAX}. +@end deftypevar + Widely available on @w{System V} derived systems is a method to get information about the physical memory the system has. The call diff --git a/misc/Makefile b/misc/Makefile index 4250b789d1..ff10b3763e 100644 --- a/misc/Makefile +++ b/misc/Makefile @@ -79,6 +79,8 @@ headers := \ bits/err-ldbl.h \ bits/error-ldbl.h \ sys/single_threaded.h \ + bits/pagesize.h \ + sys/pagesize.h \ # headers routines := \