From patchwork Thu Sep 14 14:55:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yann Sionneau X-Patchwork-Id: 1834276 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; secure) header.d=sionneau.net header.i=@sionneau.net header.a=rsa-sha256 header.s=selectormx4 header.b=gHMRu4Wa; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=uclibc-ng.org (client-ip=2a00:1828:2000:679::23; helo=helium.openadk.org; envelope-from=devel-bounces@uclibc-ng.org; receiver=patchwork.ozlabs.org) Received: from helium.openadk.org (helium.openadk.org [IPv6:2a00:1828:2000:679::23]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RmgR352XZz1yhZ for ; Fri, 15 Sep 2023 00:57:35 +1000 (AEST) Received: from helium.openadk.org (localhost [IPv6:::1]) by helium.openadk.org (Postfix) with ESMTP id 953C7353A91D; Thu, 14 Sep 2023 16:57:28 +0200 (CEST) Authentication-Results: helium.openadk.org; dkim=fail reason="signature verification failed" (1024-bit key; secure) header.d=sionneau.net header.i=@sionneau.net header.a=rsa-sha256 header.s=selectormx4 header.b=gHMRu4Wa; dkim-atps=neutral Received: from mx4.sionneau.net (mx4.sionneau.net [51.15.250.1]) by helium.openadk.org (Postfix) with ESMTPS id A529F352BD97 for ; Thu, 14 Sep 2023 16:55:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sionneau.net; s=selectormx4; t=1694703328; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=w0GsovkLsFsOlGsWno86Ob8oOubEKY4F2RWGRmGcBqQ=; b=gHMRu4WaexxWI8hHH9xpV4jWwnDFy4vhEEbdFkPioPjNX8LEosW6srktpfT7JWmB1ya0qh BulrGeWV/4s+5GqAVWupm6xCJOpD3/ITa0n/upF96Lff/+DF1KV8sc9sIbcVscNc0mOZlV Bt19AFXehlw1nY5O4XJsPBIpfu1R4HU= Received: from junon.lin.mbt.kalray.eu ( [217.181.231.53]) by mx4.sionneau.net (OpenSMTPD) with ESMTPSA id 6188d4e1 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 14 Sep 2023 14:55:28 +0000 (UTC) From: yann@sionneau.net To: devel@uclibc-ng.org Date: Thu, 14 Sep 2023 16:55:22 +0200 Message-ID: <20230914145524.19784-3-yann@sionneau.net> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230914145524.19784-1-yann@sionneau.net> References: <20230914145524.19784-1-yann@sionneau.net> MIME-Version: 1.0 Message-ID-Hash: HSCANJZJFJJHK4KHW5AULXTVYAJPUR7A X-Message-ID-Hash: HSCANJZJFJJHK4KHW5AULXTVYAJPUR7A X-MailFrom: yann@sionneau.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Julian Vetter , Jonathan Borne , Yann Sionneau X-Mailman-Version: 3.3.3 Precedence: list Subject: [uclibc-ng-devel] [PATCH 3/5] kvx: align specification of user regs List-Id: uClibc-ng Development Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Yann Sionneau Align the specification of the ptrace interface with how it is specified on RISC-V. Signed-off-by: Yann Sionneau --- libc/sysdeps/linux/kvx/sys/procfs.h | 13 ++++--------- libc/sysdeps/linux/kvx/sys/ucontext.h | 5 ++--- libc/sysdeps/linux/kvx/sys/user.h | 28 +-------------------------- 3 files changed, 7 insertions(+), 39 deletions(-) diff --git a/libc/sysdeps/linux/kvx/sys/procfs.h b/libc/sysdeps/linux/kvx/sys/procfs.h index bbbfb838e..b72322888 100644 --- a/libc/sysdeps/linux/kvx/sys/procfs.h +++ b/libc/sysdeps/linux/kvx/sys/procfs.h @@ -31,20 +31,15 @@ #include #include #include +#include -__BEGIN_DECLS +#define ELF_NGREG NGREG -/* Type for a general-purpose register. */ typedef unsigned long elf_greg_t; -/* No FP registers for kvx. */ +typedef elf_greg_t elf_gregset_t[ELF_NGREG]; typedef struct {} elf_fpregset_t; -/* And the whole bunch of them. We could have used `struct - pt_regs' directly in the typedef, but tradition says that - the register set is an array, which does have some peculiar - semantics, so leave it that way. */ -#define ELF_NGREG (sizeof (struct user_regs_struct) / sizeof(elf_greg_t)) -typedef elf_greg_t elf_gregset_t[ELF_NGREG]; +__BEGIN_DECLS /* Signal info. */ struct elf_siginfo diff --git a/libc/sysdeps/linux/kvx/sys/ucontext.h b/libc/sysdeps/linux/kvx/sys/ucontext.h index 548892389..a97b83cad 100644 --- a/libc/sysdeps/linux/kvx/sys/ucontext.h +++ b/libc/sysdeps/linux/kvx/sys/ucontext.h @@ -12,12 +12,11 @@ #include #include +#define NGREG 70 + /* Type for general register. */ typedef unsigned long greg_t; -/* Number of general registers. */ -#define NGREG 64 - typedef struct ucontext { unsigned long uc_flags; struct ucontext *uc_link; diff --git a/libc/sysdeps/linux/kvx/sys/user.h b/libc/sysdeps/linux/kvx/sys/user.h index 2e228ff19..c871f1a03 100644 --- a/libc/sysdeps/linux/kvx/sys/user.h +++ b/libc/sysdeps/linux/kvx/sys/user.h @@ -1,27 +1 @@ -/* - * This file is subject to the terms and conditions of the LGPL V2.1 - * License. See the file "COPYING" in the main directory of this archive - * for more details. - * - * Copyright (C) 2019 Kalray Inc. - */ - -#ifndef _SYS_USER_H -#define _SYS_USER_H 1 - -struct user_regs_struct -{ - /* GPR */ - unsigned long long gpr_regs[64]; - - /* SFR */ - unsigned long lc; - unsigned long le; - unsigned long ls; - unsigned long ra; - - unsigned long cs; - unsigned long spc; -}; - -#endif +/* This file is not needed, but in practice gdb might try to include it. */