From patchwork Sun Aug 13 08:41:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Karim Taha X-Patchwork-Id: 1820785 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=edDY1tzR; 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 4RP7SG5Wvpz1yYC for ; Mon, 14 Aug 2023 05:50:54 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qVGzW-0007l1-Pl; Sun, 13 Aug 2023 15:43:10 -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 1qVGzV-0007kQ-8U for qemu-devel@nongnu.org; Sun, 13 Aug 2023 15:43:09 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qVGzT-0002MY-CN for qemu-devel@nongnu.org; Sun, 13 Aug 2023 15:43:08 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-3fe4cdb727cso37658205e9.0 for ; Sun, 13 Aug 2023 12:43:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691955785; x=1692560585; 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=rihZrS1lXwvEqAtW/9cqI/d+KmpRY2H0KWTcRttsIkw=; b=edDY1tzRF+ZXqbuaWC3iPJoQ9/PanrXnol5IaD3n1aKokEyzkfUuMpBplBi+PR+laW Kssf0fFpkMaobcnv01Cs7T+XFnhvf/l5DBCvmAVBEvXaTgT++YrEwkw/9QM5p2j4hNvH UXXpKI01InOP46aPdXU5Way23++P7xj4O3bmqgHhkuZ6GE56Zb++QvCpyXheD6XdDagH y3AHw3Vnd7T3+ymZeljh8sx72GGsgkSu4ajDq+jBzx0/EpdMOUhuIMcgQiVgwjVq7BKj 0xgmk64fMxHr64FUHlOVu9/YMUC30aDy0cTxFt3qmA4IYRwikoWbRQeCt8RAMMOvNw+C RQjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691955785; x=1692560585; 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=rihZrS1lXwvEqAtW/9cqI/d+KmpRY2H0KWTcRttsIkw=; b=Rq5pNGPmg0rTGlNQEjfs6lz8QGn3Z+XN8vJyd4qXBpklH5pYFUnhsyu08Qfjz17EwQ kLULnhRrkL24cEEGp8RKiObi5ygcygOEnh+B0XMs6MZ6ABLw7oHG6xQuEMDqZMsXD7Qc 0gLn//gIz0RsupWtS0L1LfImAzEMt8Ic+O4tCAPSbWRoogx8/nTJkonQbDF7BzqyuECw AcxV+QmAAAj9+nOPqqQJe3VTgfkNaNBc84nOjOWVaa8n25Pm+HYmelmbjzlhMskCpZtT OlE/t04PdLEhcoCMiWjH9CIyER+XpgcehRrSWvgX8drNp5BmrzqGLH2NfExSjTijk61b 6PAg== X-Gm-Message-State: AOJu0YwG0dkSMHO/ni7l9H93ML4AQfh24joYGN1fjHxkDNFeN/r/z6xV T9CjhvQSi+MwezHkAr6B12XPCkDI9PE= X-Google-Smtp-Source: AGHT+IE1OewVvgflXoca6bRMzSnIsbZedwi+veqjKxk0eDv+iuMvCLMLqs85Ln4dHFC+DdIxzu8xpw== X-Received: by 2002:a05:600c:230f:b0:3fa:964e:e85 with SMTP id 15-20020a05600c230f00b003fa964e0e85mr6252865wmo.5.1691955785072; Sun, 13 Aug 2023 12:43:05 -0700 (PDT) Received: from karim.my.domain ([197.39.204.50]) by smtp.gmail.com with ESMTPSA id t20-20020a7bc3d4000000b003fe263dab33sm12234536wmj.9.2023.08.13.12.43.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Aug 2023 12:43:04 -0700 (PDT) From: Karim Taha To: qemu-devel@nongnu.org Cc: imp@bsdimp.com, Stacey Son , Michal Meloun , Karim Taha , Richard Henderson Subject: [PATCH v3 04/32] Declarations of h2t and t2h conversion functions. Date: Sun, 13 Aug 2023 10:41:25 +0200 Message-Id: <20230813084153.6510-5-kariem.taha2.7@gmail.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230813084153.6510-1-kariem.taha2.7@gmail.com> References: <20230813084153.6510-1-kariem.taha2.7@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=kariem.taha2.7@gmail.com; helo=mail-wm1-x333.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