From patchwork Sat Apr 30 13:29:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 568102 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:6886:0:0:0:0 with SMTP id m6csp7207580map; Sat, 30 Apr 2022 06:34:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyL/oQXFnU+kLy4jgfrK3El0lvL+kpoLOlfZ6YgnN8UJKrgpBchq22sfNK/HhPBVUnrpXT+ X-Received: by 2002:a05:620a:4148:b0:69f:8e5e:1aa6 with SMTP id k8-20020a05620a414800b0069f8e5e1aa6mr2701595qko.145.1651325641444; Sat, 30 Apr 2022 06:34:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651325641; cv=none; d=google.com; s=arc-20160816; b=J1HDNO7WRBr4KpRbk8FrQ30LMgbnwfdDGqe3CIicyBgvqDdTe8lr1NuFko/j2LiewD 9MqpkIrMYEkg5lOq0P4FwAgg5Xh1VX+YT5WmzlxQa2bnL7KvsrdP8SMJF6EGUbIHcWIk PKRM+xs6ASE3HlET9ECTYwHYHW3jQwD8EcFumSlaTSeGJKrd2CfuTcg2jtlyjDSGZJix NB28SEtZkz7wUNEJydqKiKIqtreEJMBLDvNzlGWCZ7wOsCdDt/9IE8Dxf93DD9rRFBgM bfA3lLvlRaqLoPmlXkvlxXy8/OkJ2DRiCP1TznaA8vQdv36+BmvBuRkWO1vxbsf/bq9s DQSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=sRa3I/Ez0AmhRV5BtAXtTCzSb0MQ7Gt+C1fZfKVXMvs=; b=sno2cpXAEPBRKluY2liaXmd/zMSe7Lnx0VLgdgqmo8MFHbFayRGBI+ylxiDtNS/9Dc rk2OdSbVkgAgRbeXOQhIPItbeOmEzvbdRWeNYWSt0xwJ4RQjkbi0qweEsIlj6dGMhEb0 j6rjpFDQDe5VkGjxlcGdkk7j7gy82gugh2A0w0FHI1Ek2b18iI4Cfuuccl1XkxmThLP4 jiTEHee4zj+5OW51xstXbf6Rm9MGIn5LqHi6DisqJ7mkBlv4DY+nq+U0L5WXCglCcgMH nynCme+IWs9tguZyxuy25NmBMvAhshR1RPCXmu4CsVU0x1BQHxq8MIHzQOvBzv+XBFJb waFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=RfzRtCxs; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id f19-20020a05622a105300b002f3a096b445si72480qte.582.2022.04.30.06.34.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 30 Apr 2022 06:34:01 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=RfzRtCxs; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:48346 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nknEX-0002WP-16 for patch@linaro.org; Sat, 30 Apr 2022 09:34:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55774) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nknAV-0004lz-PV for qemu-devel@nongnu.org; Sat, 30 Apr 2022 09:29:56 -0400 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]:40844) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nknAS-0006Fs-Cw for qemu-devel@nongnu.org; Sat, 30 Apr 2022 09:29:50 -0400 Received: by mail-pg1-x536.google.com with SMTP id x12so8498853pgj.7 for ; Sat, 30 Apr 2022 06:29:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=sRa3I/Ez0AmhRV5BtAXtTCzSb0MQ7Gt+C1fZfKVXMvs=; b=RfzRtCxsH4IeaViGLfCWF0KTgOoEuxAP7jHVJjcXz4dUV3sxHB33M427pKAzwQfSqU jWgkq+fO4hYsOkOld6pMdes03z1ZtdRZXPsNwPGcnnoFhgOvu29/U2gmCeujCassedda f+Cmp2QZ3Hps5hKZjYXC+TpN9ZwnM7+LSLnoA8f7uhavNKXGobDmkiwUZAtOoglUDd8Q rhCqa9OqoX+rkrguEXZaf4Y1O0r8+EZBH21BC7Bn0n+AJR4//uPa5ZJSHmQ3aOWgGTGB SsX8DMlN4hUuxn7JBXj92A1fOV56K8wgHfeE6jXfe69/Yi6Sd2h1ykbOqtvQf2EkiCyi uRgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=sRa3I/Ez0AmhRV5BtAXtTCzSb0MQ7Gt+C1fZfKVXMvs=; b=Gt6v3GkJ3LLwZIScbxuEwlFs168U96XUPql+ltKS4KrHvI+YsvHZ9kd5wl2RtoNIIE W1VRCduqsZjo2B2yb9fDAPTsiHN8xthBE+JMsCrENr/DPNVgW6qUouSHC7Gbvq4rkSWz toQ7idR5S+JLcBP2HhuDYSXknsKEDhDBo1TEwEhAq0Lmgr8Jgt+P6zns/RGUfLtheuJc inFToKIQ1eVyGK6djLku7n8BKyFPSHOlBc+g3c9s7fOlf6Igx2HPWRgKNb8xMPpih5nz r8L7+UcIVSIF3mwk33OgTl8kopDNOnQ29kfN119RgOCNGrmOuYFP6iPqnT44LNYxYBKY +p5A== X-Gm-Message-State: AOAM530qZFcKxb+6Q27Gfq4qCmbybHPrIivJtd4nvyoSEDEsqBiVbxsz W63YG1YQkb44EqwPg2VkSHDiPuI8EyDBsw== X-Received: by 2002:a63:2b45:0:b0:3ab:971b:be5e with SMTP id r66-20020a632b45000000b003ab971bbe5emr3074271pgr.265.1651325386172; Sat, 30 Apr 2022 06:29:46 -0700 (PDT) Received: from stoup.. ([71.212.142.129]) by smtp.gmail.com with ESMTPSA id x5-20020aa793a5000000b0050dc7628201sm1522606pff.219.2022.04.30.06.29.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Apr 2022 06:29:45 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 12/43] include/exec: Move gdb open flags to gdbstub.h Date: Sat, 30 Apr 2022 06:29:01 -0700 Message-Id: <20220430132932.324018-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220430132932.324018-1-richard.henderson@linaro.org> References: <20220430132932.324018-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::536; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x536.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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: , Cc: crwulff@gmail.com, alex.bennee@linaro.org, f4bug@amsat.org, laurent@vivier.eu Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" There were 3 copies of these flags. Place them in the file with gdb_do_syscall, with which they belong. Signed-off-by: Richard Henderson --- include/exec/gdbstub.h | 10 ++++++++++ semihosting/arm-compat-semi.c | 8 -------- target/m68k/m68k-semi.c | 8 -------- target/nios2/nios2-semi.c | 8 -------- 4 files changed, 10 insertions(+), 24 deletions(-) diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h index c35d7334b4..2aaba9c723 100644 --- a/include/exec/gdbstub.h +++ b/include/exec/gdbstub.h @@ -10,6 +10,16 @@ #define GDB_WATCHPOINT_READ 3 #define GDB_WATCHPOINT_ACCESS 4 +/* For gdb file i/o remote protocol open flags. */ +#define GDB_O_BINARY 0 +#define GDB_O_RDONLY 0 +#define GDB_O_WRONLY 1 +#define GDB_O_RDWR 2 +#define GDB_O_APPEND 8 +#define GDB_O_CREAT 0x200 +#define GDB_O_TRUNC 0x400 +#define GDB_O_EXCL 0x800 + #ifdef NEED_CPU_H #include "cpu.h" diff --git a/semihosting/arm-compat-semi.c b/semihosting/arm-compat-semi.c index 18664b1c47..a1fc4ea039 100644 --- a/semihosting/arm-compat-semi.c +++ b/semihosting/arm-compat-semi.c @@ -86,14 +86,6 @@ #define O_BINARY 0 #endif -#define GDB_O_RDONLY 0x000 -#define GDB_O_WRONLY 0x001 -#define GDB_O_RDWR 0x002 -#define GDB_O_APPEND 0x008 -#define GDB_O_CREAT 0x200 -#define GDB_O_TRUNC 0x400 -#define GDB_O_BINARY 0 - static int gdb_open_modeflags[12] = { GDB_O_RDONLY, GDB_O_RDONLY | GDB_O_BINARY, diff --git a/target/m68k/m68k-semi.c b/target/m68k/m68k-semi.c index a31db38fc3..475a6b13b7 100644 --- a/target/m68k/m68k-semi.c +++ b/target/m68k/m68k-semi.c @@ -69,14 +69,6 @@ struct gdb_timeval { uint64_t tv_usec; /* microsecond */ } QEMU_PACKED; -#define GDB_O_RDONLY 0x0 -#define GDB_O_WRONLY 0x1 -#define GDB_O_RDWR 0x2 -#define GDB_O_APPEND 0x8 -#define GDB_O_CREAT 0x200 -#define GDB_O_TRUNC 0x400 -#define GDB_O_EXCL 0x800 - static int translate_openflags(int flags) { int hf; diff --git a/target/nios2/nios2-semi.c b/target/nios2/nios2-semi.c index 373e6b9436..0eec1f9a1c 100644 --- a/target/nios2/nios2-semi.c +++ b/target/nios2/nios2-semi.c @@ -71,14 +71,6 @@ struct gdb_timeval { uint64_t tv_usec; /* microsecond */ } QEMU_PACKED; -#define GDB_O_RDONLY 0x0 -#define GDB_O_WRONLY 0x1 -#define GDB_O_RDWR 0x2 -#define GDB_O_APPEND 0x8 -#define GDB_O_CREAT 0x200 -#define GDB_O_TRUNC 0x400 -#define GDB_O_EXCL 0x800 - static int translate_openflags(int flags) { int hf;