From nobody Tue Jan 24 22:10:55 2023 X-Original-To: dev-commits-src-branches@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 4P1h4b3ysqz3bf0Z; Tue, 24 Jan 2023 22:10:55 +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 4P1h4b2xylz4LyV; Tue, 24 Jan 2023 22:10:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674598255; 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=mFSDCNYctQuUrNVv3MgfWhkc6IdUotCyYS2R8Fai2VQ=; b=W+pUo+k+8Mp5DCNFzcsT9eq1/hlPb2LAGoFvyTonH8QTmm39ivLYbG4PtudhFA4pQTGago mKJwl2LUoye4Z4WBbM27x7Om/XUCXmMQxW3OiaIZrFGftSD65O8PuFhqpax21GX4ZJEYFN v5HIlPt3xlcw2w6aKFMHPugVo0G0N9jO10jnQkfvqi/T88I1XyFvCdhyckssQOjF5h95DS t8s7D6GckmzcqPT4xB7IFE+YMKLMJ6DhObAoTeIzHyocW+K9OrYh909tiNwljRJmCA13cM f0PKxlmNiYJ7WP8e6qbX5eFWzcfe41zQ/zUUdlfHr42xaWyrEAVySxjdz++YFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674598255; 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=mFSDCNYctQuUrNVv3MgfWhkc6IdUotCyYS2R8Fai2VQ=; b=fot9/TEXIeUOHa5BYhh0MU/hTrD5n+KV3wjjCshGDfl7+TIWAy1c1Cawtz7ZRKjK20x7fJ l6OVtc/BUkO/PLLj1EmSY0d5eAkBwVDSHI46Pp8J5Fq2ojseTamzoUph8EeKEyFi6RTou3 g8B4TQgHS53AuRWdd/B4mPbnW81CZGdyzS3uz1X5Mm+yNEoPL56+P9dPU1GNzKva6IPJcP 1/HjLzffSyfOMGOiBgsVKsbBpXtbdN+2sFzMzHV3TDRS/T71jccO/+e4NQCotYUtJl0v/7 LYf/0SrnL7GqbCGzEiYkEl5ivcEFK/z4Sa8Jb6m4+J1zn15YwwfiUKSXztVNTA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674598255; a=rsa-sha256; cv=none; b=sKlKQuHI3TQSbxThUa1lwMJzndFIQLBZIkqwBB8Eds2/5/p2xB5hiWp+sWdW1fUQ8qBSXg S/FW8jahtXOm4xAAQ15wV2aUo5VDaoh7AsPT2lcRSB8VxX2h0AfCEzuW8UX3V2e/wF192u aR84Jj+oRyF7ettkei8wwqwVg5u0UWblW6+ibNs7INWbeXryOy7XMKsfG9+69s+FdTLJjR JqrYIOwWmEshyFFw1iwctLeF1fkSx4duwIznLBeX837NDd/FpDtkiHh90CxEGVuwPQ0nZN cn2wIvHcDxrNn5QpSBMp+vhShorUF9TO/FUNPX7XaYFHjBervqmZMHYYK/ogyA== 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 4P1h4b1BFNzQTW; Tue, 24 Jan 2023 22:10:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30OMAtGG083183; Tue, 24 Jan 2023 22:10:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30OMAtUJ083182; Tue, 24 Jan 2023 22:10:55 GMT (envelope-from git) Date: Tue, 24 Jan 2023 22:10:55 GMT Message-Id: <202301242210.30OMAtUJ083182@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: 952c48de876d - stable/13 - kboot: Add HOST_O_ constants for open, etc List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/13 X-Git-Reftype: branch X-Git-Commit: 952c48de876d666464dbc198e86cf7c61ea8ef08 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=952c48de876d666464dbc198e86cf7c61ea8ef08 commit 952c48de876d666464dbc198e86cf7c61ea8ef08 Author: Warner Losh AuthorDate: 2022-07-01 17:57:02 +0000 Commit: Warner Losh CommitDate: 2023-01-24 21:49:24 +0000 kboot: Add HOST_O_ constants for open, etc Add the common O_ constants for the open, fcntl, etc system calls. They are different than FreeBSD's. While they can differ based on architecture, they are constant for architectures we care about, and those architectures use the 'generic' version so future architectures will also work. Sponsored by: Netflix (cherry picked from commit ae366d5106844c26ecec54b6926c13064a224aa9) --- stand/kboot/host_syscall.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/stand/kboot/host_syscall.h b/stand/kboot/host_syscall.h index b13829e4d05b..24b966b34ed8 100644 --- a/stand/kboot/host_syscall.h +++ b/stand/kboot/host_syscall.h @@ -32,6 +32,27 @@ long host_syscall(int number, ...); +/* + * Constants for open, fcntl, etc + * + * Note: Some of these are arch dependent on Linux, but are the same for + * powerpc, x86, arm*, and riscv. We should be futureproof, though, since these + * are the 'generic' values and only older architectures (no longer supported by + * FreeBSD) vary. + * + * These are from tools/include/uapi/asm-generic/fcntl.h and use the octal + * notation. Beware, hex is used in other places creating potential confsion. + */ +#define HOST_O_RDONLY 0 +#define HOST_O_WRONLY 1 +#define HOST_O_RDWR 2 +#define HOST_O_CREAT 00100 +#define HOST_O_EXCL 00200 +#define HOST_O_NOCTTY 00400 +#define HOST_O_TRUNC 01000 +#define HOST_O_APPEND 02000 +#define HOST_O_NONBLOCK 04000 + /* * Data types */