Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/aarch64/aarch64 avoid hardcode. don't depend that A...



details:   https://anonhg.NetBSD.org/src/rev/999fb0876974
branches:  trunk
changeset: 433661:999fb0876974
user:      ryo <ryo%NetBSD.org@localhost>
date:      Wed Sep 26 16:55:34 2018 +0000

description:
avoid hardcode. don't depend that AARCH64_KSEG_START is 0xffff000000000000.

diffstat:

 sys/arch/aarch64/aarch64/pmap_page.S |  29 ++++++++++++++++++++++-------
 1 files changed, 22 insertions(+), 7 deletions(-)

diffs (53 lines):

diff -r 1044815b40a5 -r 999fb0876974 sys/arch/aarch64/aarch64/pmap_page.S
--- a/sys/arch/aarch64/aarch64/pmap_page.S      Wed Sep 26 15:07:24 2018 +0000
+++ b/sys/arch/aarch64/aarch64/pmap_page.S      Wed Sep 26 16:55:34 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap_page.S,v 1.3 2018/08/15 11:12:38 ryo Exp $ */
+/* $NetBSD: pmap_page.S,v 1.4 2018/09/26 16:55:34 ryo Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -33,12 +33,19 @@
 
 #include "assym.h"
 
-RCSID("$NetBSD: pmap_page.S,v 1.3 2018/08/15 11:12:38 ryo Exp $");
+RCSID("$NetBSD: pmap_page.S,v 1.4 2018/09/26 16:55:34 ryo Exp $");
 
 /* LINTSTUB: void pmap_zero_page(paddr_t pa); */
 ENTRY(pmap_zero_page)
-       movk    x0, #0xffff, lsl #48    /* convert to direct mapped */
-        add    x4, x0, #(PAGE_SIZE >> 12), lsl #12
+       /* convert to direct mapped */
+#if ((AARCH64_KSEG_MASK & 0x0000ffffffffffff) == 0)
+       movk    x0, #(AARCH64_KSEG_START >> 48), lsl #48
+#else
+       mov     x1, #AARCH64_KSEG_START
+       orr     x0, x0, x1
+#endif
+
+       add     x4, x0, #PAGE_SIZE
        mrs     x2, dczid_el0
        tbnz    x2, #4, 2f
 
@@ -63,9 +70,17 @@
 
 /* LINTSTUB: void pmap_copy_page(paddr_t src_pa, paddr_t dst_pa); */
 ENTRY(pmap_copy_page)
-       movk    x0, #0xffff, lsl #48    /* convert to direct mapped */
-       movk    x1, #0xffff, lsl #48    /* convert to direct mapped */
-        add    x10, x0, #(PAGE_SIZE >> 12), lsl #12
+       /* convert to direct mapped */
+#if ((AARCH64_KSEG_MASK & 0x0000ffffffffffff) == 0)
+       movk    x0, #(AARCH64_KSEG_START >> 48), lsl #48
+       movk    x1, #(AARCH64_KSEG_START >> 48), lsl #48
+#else
+       mov     x2, #AARCH64_KSEG_START
+       orr     x0, x0, x2
+       orr     x1, x1, x2
+#endif
+
+       add     x10, x0, #PAGE_SIZE
 
 1:     ldnp    x2, x3, [x0, #0]
        ldnp    x4, x5, [x0, #16]



Home | Main Index | Thread Index | Old Index