libgloss/or1k: Correct the IMMU SXE and UXE flags
PATCH 1/1 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.
--- libgloss/or1k/include/or1k-sprs.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
libgloss/or1k/include/or1k-sprs.h +10 -10
@@ -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
Signature · 1 line
2.31.1
PATCH 1/1 libgloss/or1k: Correct the IMMU SXE and UXE flags
Hi Stafford,
Please resend with the patch as an attachment.
Thanks,
-- Jeff J.
Quoted 53 lines · Stafford Horne
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.pdfSee section 8.4.8 Instruction Translation Lookaside Buffer Way y Translate Registers where these are defined.
Signed-off-by Stafford Horne <[email protected]>--- libgloss/or1k/include/or1k-sprs.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)libgloss/or1k/include/or1k-sprs.h +4
-10@@ -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))libgloss/or1k/include/or1k-sprs.h +6
-0+ +/* 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))
Quoted 6 lines
/* Physical Page Number */
#defineOR1K_SPR_IMMU_ITLBW_TR_PPN_LSB13
--
2.31.1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.librecores.org/pipermail/openrisc/attachments/20210705/581eba0d/attachment.htm>
PATCH 1/1 libgloss/or1k: Correct the IMMU SXE and UXE flags
Quoted 5 lines · Jeff Johnston
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
-------------- next part --------------
From f25c7124bc88627baf532d79c08130f1d2b61efb Mon Sep 17 00:00:00 2001
From: Stafford Horne <[email protected]>
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.
--- libgloss/or1k/include/or1k-sprs.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
libgloss/or1k/include/or1k-sprs.h +10 -10
@@ -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
Signature · 1 line
2.31.1
PATCH 1/1 libgloss/or1k: Correct the IMMU SXE and UXE flags
Hi Stafford,
It's not you, it's on my side with gmail.. It often distorts git patches unless they are attachments.
Anyway, patch applied and pushed to master.
Regards,
-- Jeff J.
Quoted 9 lines · Stafford Horne
Quoted 5 lines · Jeff Johnston
Hi Stafford,
Please resend with the patch as an attachment.
Thanks,
Alright,
Quoted 8 lines
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.librecores.org/pipermail/openrisc/attachments/20210705/6ea0df62/attachment.htm>