[PATCH] use vtophys instead of pmap_kextract

Giovanni Trematerra gianni at freebsd.org
Wed Oct 31 22:04:17 UTC 2012


On Wed, Oct 31, 2012 at 11:25 AM, Olivier Houchard <cognet at ci0.org> wrote:
>
> Hi Giovanni,
>
> On Tue, Oct 30, 2012 at 11:12:20PM +0100, Giovanni Trematerra wrote:
> > Hi,
> > could you please review and commit the patch below?
> >
> > The patch changes the calls to pmap_kextract in vtophys macro.
> > This also fixes a compiler warning when SMP is enabled to Marvel
> > ARMADA XP boards.
> >
>
> I'm not sure there's a point in doing this, the uses of pmap_kextract()
are
> legit, and using vtophys() instead would just hide potential type bugs.
I'd
> rather just explicitely add a cast in the Marvel code, as your original
patch
> for the TI code did.

Well, I'd prefer to not see casts here and there in the kernel and vtophys
seems
a good way to go. So I can understand to not make changes in
busdma_machdep[-v6].c
where no casts are needed and my changes were only for uniformity but I
still think that
to silent the compiler warning we should use vtophys rather than
pmap_kextract directly.
Anyway I'm not going to argue on that.
Here it is the patch to fix the compiler warning for Marvel ARMADA XP board.

Thank you

--
Gianni

Index: sys/arm/mv/armadaxp/armadaxp_mp.c
===================================================================
--- sys/arm/mv/armadaxp/armadaxp_mp.c (revision 242212)
+++ sys/arm/mv/armadaxp/armadaxp_mp.c (working copy)
@@ -179,7 +179,7 @@ platform_mp_start_ap(void)

  for (cpu_num = 1; cpu_num < mp_ncpus; cpu_num++ )
  bus_space_write_4(fdtbus_bs_tag, CPU_PMU(cpu_num), CPU_PMU_BOOT,
-    pmap_kextract(mpentry));
+    pmap_kextract((vm_offset_t)mpentry));

  cpu_idcache_wbinv_all();


More information about the freebsd-arm mailing list