Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/evbarm/rpi Use armreg_ttbr_read instead of local ve...



details:   https://anonhg.NetBSD.org/src/rev/e41dac824d43
branches:  trunk
changeset: 781834:e41dac824d43
user:      skrll <skrll%NetBSD.org@localhost>
date:      Wed Oct 03 13:13:38 2012 +0000

description:
Use armreg_ttbr_read instead of local version. No code change.

diffstat:

 sys/arch/evbarm/rpi/rpi_machdep.c |  18 ++++--------------
 1 files changed, 4 insertions(+), 14 deletions(-)

diffs (46 lines):

diff -r 378ac2fa9e74 -r e41dac824d43 sys/arch/evbarm/rpi/rpi_machdep.c
--- a/sys/arch/evbarm/rpi/rpi_machdep.c Wed Oct 03 13:06:06 2012 +0000
+++ b/sys/arch/evbarm/rpi/rpi_machdep.c Wed Oct 03 13:13:38 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rpi_machdep.c,v 1.10 2012/10/03 13:06:06 skrll Exp $   */
+/*     $NetBSD: rpi_machdep.c,v 1.11 2012/10/03 13:13:38 skrll Exp $   */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rpi_machdep.c,v 1.10 2012/10/03 13:06:06 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rpi_machdep.c,v 1.11 2012/10/03 13:13:38 skrll Exp $");
 
 #include "opt_evbarm_boardtype.h"
 
@@ -108,17 +108,6 @@
 /* Smallest amount of RAM start.elf could give us. */
 #define RPI_MINIMUM_ARM_RAM_SPLIT (128U * 1024 * 1024)
 
-static inline
-pd_entry_t *
-read_ttb(void)
-{
-       long ttb;
-
-       __asm volatile("mrc   p15, 0, %0, c2, c0, 0" : "=r" (ttb));
-
-       return (pd_entry_t *)(ttb & ~((1<<14)-1));
-}
-
 /*
  * Static device mappings. These peripheral registers are mapped at
  * fixed virtual addresses very early in initarm() so that we can use
@@ -231,7 +220,8 @@
                panic("cpu not recognized!");
 
        /* map some peripheral registers */
-       pmap_devmap_bootstrap((vaddr_t)read_ttb(), rpi_devmap);
+       pmap_devmap_bootstrap((vaddr_t)armreg_ttbr_read() & ~(L1_TABLE_SIZE - 1),
+           rpi_devmap);
 
        cpu_domains((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL*2)) | DOMAIN_CLIENT);
 



Home | Main Index | Thread Index | Old Index