From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by sourceware.org (Postfix) with ESMTPS id 86BF8385E008 for ; Mon, 5 Jul 2021 21:21:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 86BF8385E008 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-x430.google.com with SMTP id d12so17686438pfj.2 for ; Mon, 05 Jul 2021 14:21:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=lZAZiGQ8yM2IQ6WgZx9hkNdsMQpfZ9RTTHCSXLg+XLA=; b=KPRNb6m+mNuF2aTlF0Hd7evhVnPqSPkTNLgcYegWb5NIgppX0YrKsxcIN7DAPFPMZq M+Fg7sWh+E/KWOnrFlAQXd9ytL40N4YFVnvtrnjpyZlelFdcvJgeEm7w0/dq7K81Sjic lkoj7k5fYNBmDwt6fMG6plEmUosw8UOFuwdgz+oeCNISGgBvk0wY6NfQwuHAoFQmShXu re7m+yy4TjCX22mglSAfpKkkMB6zVEWHC0/Q9tShcxVBFqrPOf26wyPgLa9+9fYXqUXp 8AffEtIUDd9r9wCwgl8fkhPZhGw8kYnbh0D7z402YYWfksJHbDjLYBWYggmpaUg6OT8v aBTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=lZAZiGQ8yM2IQ6WgZx9hkNdsMQpfZ9RTTHCSXLg+XLA=; b=JzNjyVLLUz/55qbeQUEEebwi8FxvLr8KyvNt0yXf4Ggtz2ju7lFYQunOu3asCE9PO9 JXknVUv5Nh0X0vUMYChDqzOfnV1sm/kDUg3SChUz4loa0/Wt6HyWZcxYe1+ZmgP5tIv9 LsrS2qMQPMMP2wVpA2cNo1Kc307SYFU45+qaH7s96TFTW19fZ6wNRBJ+UY9KWowUWim/ 7H/ph8Ce/z7BCIK9tfIfm1W9Sgr+nEbFvlHdVmH4om/a0wMmsn6Z3JUmM3C+SU6ZOJBd Fn8uI32NAnBQuCvMcgiDLj6U5pl9Gg/AYpN//xyev7rTVlDJ5VI5bvK1ALVAzspOMudZ BeRw== X-Gm-Message-State: AOAM533SH13eIv3svC6YPKHbK6aeMd9+7fAmVrGp5f3C4IVSYP9VgO76 7RmplH8jV59knCYHS0TtpZ2MlkpyQIM= X-Google-Smtp-Source: ABdhPJyGK1ssXb4D88qVNjiLiUp8l+0nqXlIAyqsVaTWRNnzpiAuOphF6XPbEMBJ2J8JSEQ4EcnxCA== X-Received: by 2002:a63:e948:: with SMTP id q8mr17809617pgj.52.1625520071638; Mon, 05 Jul 2021 14:21:11 -0700 (PDT) Received: from localhost (g164.115-65-218.ppp.wakwak.ne.jp. [115.65.218.164]) by smtp.gmail.com with ESMTPSA id n56sm9909956pfv.65.2021.07.05.14.21.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Jul 2021 14:21:10 -0700 (PDT) Date: Tue, 6 Jul 2021 06:21:03 +0900 From: Stafford Horne To: Jeff Johnston Cc: Newlib , Openrisc Subject: Re: [PATCH] libgloss/or1k: Correct the IMMU SXE and UXE flags Message-ID: References: <20210701231748.1098623-1-shorne@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="UY3USK03gWlID6SC" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Jul 2021 21:21:14 -0000 --UY3USK03gWlID6SC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Jul 05, 2021 at 04:59:27PM -0400, Jeff Johnston wrote: > Hi Stafford, > > Please resend with the patch as an attachment. > > Thanks, Alright, I hope it't OK in a reply here. I usually send patches using git send-email, is this something new for newlib? Please find attached -Stafford --UY3USK03gWlID6SC Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="0001-libgloss-or1k-Correct-the-IMMU-SXE-and-UXE-flags.patch" >From f25c7124bc88627baf532d79c08130f1d2b61efb Mon Sep 17 00:00:00 2001 From: Stafford Horne Date: Fri, 2 Jul 2021 06:24:57 +0900 Subject: [PATCH] libgloss/or1k: Correct the IMMU SXE and UXE flags These have been defined incorrectly, as per specification and CPU implementations SXE is bit 6 and UXE is bit 7. This was noticed when tracking down our test suite mmu test failures. Test Suite: https://github.com/openrisc/or1k-tests/blob/master/native/or1k/or1k-mmu.c#L68-L72 Spec: https://raw.githubusercontent.com/openrisc/doc/master/openrisc-arch-1.3-rev1.pdf See section 8.4.8 Instruction Translation Lookaside Buffer Way y Translate Registers where these are defined. Signed-off-by: Stafford Horne --- libgloss/or1k/include/or1k-sprs.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/libgloss/or1k/include/or1k-sprs.h b/libgloss/or1k/include/or1k-sprs.h index 8d1fe5ed9..d545fb1d3 100644 --- a/libgloss/or1k/include/or1k-sprs.h +++ b/libgloss/or1k/include/or1k-sprs.h @@ -1797,17 +1797,17 @@ #define OR1K_SPR_IMMU_ITLBW_TR_D_GET(X) (((X) >> 5) & 0x1) #define OR1K_SPR_IMMU_ITLBW_TR_D_SET(X, Y) (((X) & OR1K_UNSIGNED(0xffffffdf)) | ((!!(Y)) << 5)) -/* User Execute Enable */ -#define OR1K_SPR_IMMU_ITLBW_TR_UXE_OFFSET 6 -#define OR1K_SPR_IMMU_ITLBW_TR_UXE_MASK 0x00000040 -#define OR1K_SPR_IMMU_ITLBW_TR_UXE_GET(X) (((X) >> 6) & 0x1) -#define OR1K_SPR_IMMU_ITLBW_TR_UXE_SET(X, Y) (((X) & OR1K_UNSIGNED(0xffffffbf)) | ((!!(Y)) << 6)) - /* Supervisor Execute Enable */ -#define OR1K_SPR_IMMU_ITLBW_TR_SXE_OFFSET 7 -#define OR1K_SPR_IMMU_ITLBW_TR_SXE_MASK 0x00000080 -#define OR1K_SPR_IMMU_ITLBW_TR_SXE_GET(X) (((X) >> 7) & 0x1) -#define OR1K_SPR_IMMU_ITLBW_TR_SXE_SET(X, Y) (((X) & OR1K_UNSIGNED(0xffffff7f)) | ((!!(Y)) << 7)) +#define OR1K_SPR_IMMU_ITLBW_TR_SXE_OFFSET 6 +#define OR1K_SPR_IMMU_ITLBW_TR_SXE_MASK 0x00000040 +#define OR1K_SPR_IMMU_ITLBW_TR_SXE_GET(X) (((X) >> 6) & 0x1) +#define OR1K_SPR_IMMU_ITLBW_TR_SXE_SET(X, Y) (((X) & OR1K_UNSIGNED(0xffffffbf)) | ((!!(Y)) << 6)) + +/* User Execute Enable */ +#define OR1K_SPR_IMMU_ITLBW_TR_UXE_OFFSET 7 +#define OR1K_SPR_IMMU_ITLBW_TR_UXE_MASK 0x00000080 +#define OR1K_SPR_IMMU_ITLBW_TR_UXE_GET(X) (((X) >> 7) & 0x1) +#define OR1K_SPR_IMMU_ITLBW_TR_UXE_SET(X, Y) (((X) & OR1K_UNSIGNED(0xffffff7f)) | ((!!(Y)) << 7)) /* Physical Page Number */ #define OR1K_SPR_IMMU_ITLBW_TR_PPN_LSB 13 -- 2.31.1 --UY3USK03gWlID6SC--