From patchwork Sun Aug 13 03:09:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Karim Taha X-Patchwork-Id: 1820705 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20221208 header.b=VkF+1GVj; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RP05T4SR5z1yf2 for ; Mon, 14 Aug 2023 00:19:09 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qVBpL-00084p-J4; Sun, 13 Aug 2023 10:12:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qVBpJ-00082G-Qb for qemu-devel@nongnu.org; Sun, 13 Aug 2023 10:12:17 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qVBpH-0000nN-V0 for qemu-devel@nongnu.org; Sun, 13 Aug 2023 10:12:17 -0400 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-31965c94001so1339301f8f.3 for ; Sun, 13 Aug 2023 07:12:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691935934; x=1692540734; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rkgWqRz4geLx9aemdUjq4n01eDTu0bv8Yaoroe/JYUY=; b=VkF+1GVjdWixf2fMZw1MZ/wNnBVF5lQf23ISJ+HmwDS5dLtDwDWlpq9sd5JQkUydiS kSWf61nTM3eei+yEqIaffWwgSyQeD1DjKEq+7ran2mCbYe9gyy1zAxWKFt1BH0iH00y+ 6LNLvYYG7Aw9c5p/6Xzyi8CUsLO8xonLUZAx+Xmcy4EuqUz5tdQJ866xs4ZU5FF9HTq9 pq70uXjW+9zxoIfRdLiNZTMCErGKLrbZR9T/9bN1jkXrlL0BKsErHsux+ICVdIKJes47 Jwy0Jj35Hi8DGCGsS4cyKYoR0fJ2deWkG6oTKe82jT/MUPJUqwMILq98Bi/2y6lfKKvN Kxtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691935934; x=1692540734; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rkgWqRz4geLx9aemdUjq4n01eDTu0bv8Yaoroe/JYUY=; b=FKejyskWCEAFaTFVkssUQk6UEmdC/G8X9IP3PMlr1Zo4kSik5RtNTBK4ckSJ49uOgB eGCcogjZIq0Sm6GyWS4LRSswSHgTo3cYqMBt8lS7GMcjnGGX1WXHBKnON66Cx7oSIpYB 6Q1YekFFEEfDU667LSwqnA2p/lt8CiYdqUd7I+ntNr9BaFKvs/eswrQyRvb0PWlBIo0w /zIFAfVZvAQOo3vBR2W3pcxT5x7sP2rggRLcRzYN0+b62iMQj40T0e1NKObEdLxCVG0O N6aM9dVoMqz7WJwIt4ZrR8UqgF8pqR0DFL33F7oIT2AikvLeayDBF6SAGdWAvK0NEIll uHQw== X-Gm-Message-State: AOJu0YwNBRY6FXMdypYtr0lvccXWLEddE1WjOyzUFgZOFhxNTU96qXLf rUEbbSP3D1o0RVuTgV28HA4QfTnl6IM= X-Google-Smtp-Source: AGHT+IHBSzDD4LaGZ3Lao4GnkO1FyYFXq/8t+fZbmB6o6M6IkEptKpKGfeCyoWhb2nPoXnxOe+PXoA== X-Received: by 2002:a05:6000:136d:b0:317:7eec:5e9d with SMTP id q13-20020a056000136d00b003177eec5e9dmr5719951wrz.16.1691935933868; Sun, 13 Aug 2023 07:12:13 -0700 (PDT) Received: from karim.my.domain ([197.39.204.50]) by smtp.gmail.com with ESMTPSA id l18-20020a5d4112000000b003144b95e1ecsm11409101wrp.93.2023.08.13.07.12.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Aug 2023 07:12:13 -0700 (PDT) From: Karim Taha To: qemu-devel@nongnu.org Cc: imp@bsdimp.com, Stacey Son , Michal Meloun , Karim Taha Subject: [PATCH v2 04/32] Declarations of h2t and t2h conversion functions. Date: Sun, 13 Aug 2023 05:09:45 +0200 Message-Id: <20230813031013.1743-5-kariem.taha2.7@gmail.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230813031013.1743-1-kariem.taha2.7@gmail.com> References: <20230813031013.1743-1-kariem.taha2.7@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=kariem.taha2.7@gmail.com; helo=mail-wr1-x42c.google.com X-Spam_score_int: -2 X-Spam_score: -0.3 X-Spam_bar: / X-Spam_report: (-0.3 / 5.0 requ) BAYES_00=-1.9, DATE_IN_PAST_06_12=1.543, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Stacey Son Declarations of functions that convert between host and target structs. Co-authored-by: Michal Meloun Signed-off-by: Stacey Son Signed-off-by: Karim Taha Reviewed-by: Richard Henderson --- bsd-user/freebsd/qemu-os.h | 50 ++++++++++++++++++++++++++++++++++++++ bsd-user/qemu.h | 1 + 2 files changed, 51 insertions(+) create mode 100644 bsd-user/freebsd/qemu-os.h diff --git a/bsd-user/freebsd/qemu-os.h b/bsd-user/freebsd/qemu-os.h new file mode 100644 index 0000000000..12adc50928 --- /dev/null +++ b/bsd-user/freebsd/qemu-os.h @@ -0,0 +1,50 @@ +/* + * FreeBSD conversion extern declarations + * + * Copyright (c) 2013 Stacey D. Son + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ + +#ifndef QEMU_OS_H +#define QEMU_OS_H + +/* qemu/osdep.h pulls in the rest */ + +#include +#include +#include +#include +#include +#include +#include + +struct freebsd11_stat; + +/* os-stat.c */ +abi_long h2t_freebsd11_stat(abi_ulong target_addr, + struct freebsd11_stat *host_st); +abi_long h2t_freebsd11_nstat(abi_ulong target_addr, + struct freebsd11_stat *host_st); +abi_long t2h_freebsd_fhandle(fhandle_t *host_fh, abi_ulong target_addr); +abi_long h2t_freebsd_fhandle(abi_ulong target_addr, fhandle_t *host_fh); +abi_long h2t_freebsd11_statfs(abi_ulong target_addr, + struct freebsd11_statfs *host_statfs); +abi_long target_to_host_fcntl_cmd(int cmd); +abi_long h2t_freebsd_stat(abi_ulong target_addr, + struct stat *host_st); +abi_long h2t_freebsd_statfs(abi_ulong target_addr, + struct statfs *host_statfs); + +#endif /* QEMU_OS_H */ diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h index 656f38db56..2725fdd7ac 100644 --- a/bsd-user/qemu.h +++ b/bsd-user/qemu.h @@ -38,6 +38,7 @@ extern char **environ; #include "exec/gdbstub.h" #include "qemu/clang-tsa.h" +#include "qemu-os.h" /* * This struct is used to hold certain information about the image. Basically, * it replicates in user space what would be certain task_struct fields in the