From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2134) id A22F4385E008; Mon, 5 Jul 2021 22:00:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A22F4385E008 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Jeff Johnston To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] libgloss/or1k: Correct the IMMU SXE and UXE flags X-Act-Checkin: newlib-cygwin X-Git-Author: Stafford Horne X-Git-Refname: refs/heads/master X-Git-Oldrev: 5c9c31c52bfbf41e903eff136cdf894572704e31 X-Git-Newrev: 43999b660faefa11118ad81bf5958b5523313f0e Message-Id: <20210705220052.A22F4385E008@sourceware.org> Date: Mon, 5 Jul 2021 22:00:52 +0000 (GMT) X-BeenThere: newlib-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib GIT logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Jul 2021 22:00:52 -0000 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=43999b660faefa11118ad81bf5958b5523313f0e commit 43999b660faefa11118ad81bf5958b5523313f0e Author: Stafford Horne Date: Fri Jul 2 06:24:57 2021 +0900 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 Diff: --- 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