pmap_avail_setup() is the only place physmem is calculated, delete a bunch
authorderaadt <deraadt@openbsd.org>
Wed, 10 Mar 2021 07:28:19 +0000 (07:28 +0000)
committerderaadt <deraadt@openbsd.org>
Wed, 10 Mar 2021 07:28:19 +0000 (07:28 +0000)
of code which thinks it could be done elsewhere.
ok kurt

sys/arch/powerpc/powerpc/pmap.c

index 2534bfd..2ed7832 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: pmap.c,v 1.172 2020/04/15 08:09:00 mpi Exp $ */
+/*     $OpenBSD: pmap.c,v 1.173 2021/03/10 07:28:19 deraadt Exp $ */
 
 /*
  * Copyright (c) 2015 Martin Pieuchot
@@ -1232,22 +1232,15 @@ void
 pmap_avail_setup(void)
 {
        struct mem_region *mp;
-       int pmap_physmem;
 
        ppc_mem_regions(&pmap_mem, &pmap_avail);
-       pmap_cnt_avail = 0;
-       pmap_physmem = 0;
 
-       ndumpmem = 0;
        for (mp = pmap_mem; mp->size !=0; mp++, ndumpmem++) {
-               pmap_physmem += atop(mp->size);
+               physmem += atop(mp->size);
                dumpmem[ndumpmem].start = atop(mp->start);
                dumpmem[ndumpmem].end = atop(mp->start + mp->size);
        }
 
-       if (physmem == 0)
-               physmem = pmap_physmem;
-
        for (mp = pmap_avail; mp->size !=0 ; mp++) {
                if (physmaxaddr <  mp->start + mp->size)
                        physmaxaddr = mp->start + mp->size;