From patchwork Tue Oct 6 09:44:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hajime Tazaki X-Patchwork-Id: 1377322 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=etXwtIUm; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=kgjAWyI6; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (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) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4C5CJQ35qDz9sS8 for ; Tue, 6 Oct 2020 20:45:42 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Ev13io4BoF4mfWDVVWgJkh+r+Ekl97MOI/ZzFe2QKKQ=; b=etXwtIUmPTgtnyCkyjUbxekHU KB3va9NaE3ASONuK4ofBwftZA2pVfE23muZBOYadWjqDBQZovijsn3HEWkfYRf3Iwbd2qZGO6BYcy mSRNcPMlDJ5/cpPZOx8HxbYiAPZXZuTWkch39MoMxVegSROBjsqLm7cWGDKAJBncnzG++PTntZRpO 8YxUa5ONJJfaMmI2UbzZhEQN1hmdbijZLZ5Mr+Rp87tA3BQwBkltG4PM7rEQGD6RfdUEDPLxy8MuO lBPTRMKvpdHOsa9DUu2Y4NQNTjJcBZ8baT0SURuiP1xkLLylous86fFyyHPefTVBvc6zxzipRuJnP e+BSxvY2A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kPjXP-0008S7-4G; Tue, 06 Oct 2020 09:45:39 +0000 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kPjXM-0008Qg-01 for linux-um@lists.infradead.org; Tue, 06 Oct 2020 09:45:36 +0000 Received: by mail-pf1-x444.google.com with SMTP id 144so8703091pfb.4 for ; Tue, 06 Oct 2020 02:45:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QwdAwomAk2ltg1grbV+9NQkaDdoDFru+sqVSXHRR9r4=; b=kgjAWyI6FUwUz01E/9QVA5hIQtvgdFDHlwlWvx5VJ8xw/559ybcznHn4ypwe8gZSZE dRSzPHSdcpzmxefchXkcEspNS4Wd3Fe2kEcJV5rGFSZt/Azzq9zcVlndM7vYIRBFHaoz vp/l0/HHTtetQNyF+A+4hOL5JvM/tNHUtZZnddzK0wH3WocdxSISVJvm68YFe70rvlQc ImYyyzn7Nf/sLQO5hrX70Tx0VurqyRzb/jOVDzR0gSKM4A5aZ25Z+cZE4oWO6tinhA06 y5almCMeS0vb77ylHc+NtrXY85PVGQqwRoGT4vXITs6Qr1ARlkTpT9PDXMCBmEXgXpoA JPxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QwdAwomAk2ltg1grbV+9NQkaDdoDFru+sqVSXHRR9r4=; b=lW2xO0cWEO4vnqnf6TL/Y7J4Q08HpCqqXLzNIXFTaqfEWPU7q+vuzWLmJPUxQVn9CN yldxGdV6XqIYOeAbVrNb6VVUZjdqdQEbycA4/Z7eDvld3p7sUA0LZVUTypWN5WigwEuI 6PtmU/0lxIqp4cUu8P4TX/4AFF22SeaRKS5bFMSdU0HZxDsHennKygIQ3IOXK3FNEzxS wm4c6cmb/djeAAlsk/iXC0G+LCmv5ld+Bm/ZYuWcbwtlf1pq+ANcfXtZnCSgUxy/fZ9K n0RQaLWLyzCPK6FWl/SU6B3Lo87Yw9lSXsz4fQqo8Qrf8HM4jLpGUJYtLlFuSMhmYx5/ JO9A== X-Gm-Message-State: AOAM532FgXmGfJrjVDKsb423GjQ1NLVEz4U70oqidgNIn3oBXOEI43oB z4Xf7nauss/RgcdNX9irWzM= X-Google-Smtp-Source: ABdhPJwceWBY4lmDdVvqBTBK6OrWYNJx5gwvpgPLkXNoN+BCKrDdt9O3YSCxdgx04o0Q5aYWgzwf+A== X-Received: by 2002:a62:7744:0:b029:152:4223:1b4e with SMTP id s65-20020a6277440000b029015242231b4emr3699925pfc.60.1601977533642; Tue, 06 Oct 2020 02:45:33 -0700 (PDT) Received: from earth-mac.local (219x123x138x129.ap219.ftth.ucom.ne.jp. [219.123.138.129]) by smtp.gmail.com with ESMTPSA id c12sm2990346pfj.164.2020.10.06.02.45.31 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 06 Oct 2020 02:45:33 -0700 (PDT) Received: by earth-mac.local (Postfix, from userid 501) id D50A920390F4C1; Tue, 6 Oct 2020 18:45:29 +0900 (JST) From: Hajime Tazaki To: linux-um@lists.infradead.org, jdike@addtoit.com, richard@nod.at, anton.ivanov@cambridgegreys.com Subject: [RFC v7 09/21] um: nommu: host interface Date: Tue, 6 Oct 2020 18:44:18 +0900 Message-Id: <9494c2558406a8fd2938fef0c470dd640b7835ed.1601960644.git.thehajime@gmail.com> X-Mailer: git-send-email 2.20.1 (Apple Git-117) In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201006_054536_117123_0BA5AFD4 X-CRM114-Status: GOOD ( 14.42 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:444 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [thehajime[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-um@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: tavi.purdila@gmail.com, linux-kernel-library@freelists.org, linux-arch@vger.kernel.org, Hajime Tazaki , retrage01@gmail.com Sender: "linux-um" Errors-To: linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org This patch introduces the host operations that define the interface between the LKL and the host. These operations must be provided either by a host library or by the application itself. Signed-off-by: Hajime Tazaki --- arch/um/include/asm/host_ops.h | 9 ++++++++ arch/um/nommu/include/uapi/asm/host_ops.h | 25 +++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 arch/um/include/asm/host_ops.h create mode 100644 arch/um/nommu/include/uapi/asm/host_ops.h diff --git a/arch/um/include/asm/host_ops.h b/arch/um/include/asm/host_ops.h new file mode 100644 index 000000000000..f52423cc4ced --- /dev/null +++ b/arch/um/include/asm/host_ops.h @@ -0,0 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _ASM_LKL_HOST_OPS_H +#define _ASM_LKL_HOST_OPS_H + +#include + +extern struct lkl_host_operations *lkl_ops; + +#endif diff --git a/arch/um/nommu/include/uapi/asm/host_ops.h b/arch/um/nommu/include/uapi/asm/host_ops.h new file mode 100644 index 000000000000..d3dad11b459e --- /dev/null +++ b/arch/um/nommu/include/uapi/asm/host_ops.h @@ -0,0 +1,25 @@ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ +#ifndef __UM_NOMMU_UAPI_HOST_OPS_H +#define __UM_NOMMU_UAPI_HOST_OPS_H + +/* Defined in {posix,nt}-host.c */ +struct lkl_mutex; +struct lkl_sem; +typedef unsigned long lkl_thread_t; +struct lkl_jmp_buf { + unsigned long buf[128]; +}; + +/** + * lkl_host_operations - host operations used by the Linux kernel + * + * These operations must be provided by a host library or by the application + * itself. + * + */ +struct lkl_host_operations { +}; + +void lkl_bug(const char *fmt, ...); + +#endif