physmem: zero entire array
As a convenience to callers, who might allocate the array on the stack. An empty/zero-valued range indicates the end of the physmap entries. Remove the now-redundant calls to bzero() at the call site. Reviewed by: andrew Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D45318
This commit is contained in:
@@ -1437,7 +1437,6 @@ pmap_bootstrap_san1(vm_offset_t va, int scale)
|
|||||||
* Rebuild physmap one more time, we may have excluded more regions from
|
* Rebuild physmap one more time, we may have excluded more regions from
|
||||||
* allocation since pmap_bootstrap().
|
* allocation since pmap_bootstrap().
|
||||||
*/
|
*/
|
||||||
bzero(physmap, sizeof(physmap));
|
|
||||||
physmap_idx = physmem_avail(physmap, nitems(physmap));
|
physmap_idx = physmem_avail(physmap, nitems(physmap));
|
||||||
physmap_idx /= 2;
|
physmap_idx /= 2;
|
||||||
|
|
||||||
|
|||||||
@@ -189,6 +189,8 @@ regions_to_avail(vm_paddr_t *avail, uint32_t exflags, size_t maxavail,
|
|||||||
const struct region *exp, *hwp;
|
const struct region *exp, *hwp;
|
||||||
uint64_t availsz;
|
uint64_t availsz;
|
||||||
|
|
||||||
|
bzero(avail, maxavail * sizeof(vm_paddr_t));
|
||||||
|
|
||||||
totalmem = 0;
|
totalmem = 0;
|
||||||
availmem = 0;
|
availmem = 0;
|
||||||
availsz = 0;
|
availsz = 0;
|
||||||
@@ -587,7 +589,6 @@ ram_attach(device_t dev)
|
|||||||
rid = 0;
|
rid = 0;
|
||||||
|
|
||||||
/* Get the avail list. */
|
/* Get the avail list. */
|
||||||
bzero(avail_list, sizeof(avail_list));
|
|
||||||
regions_to_avail(avail_list, EXFLAG_NOALLOC | EXFLAG_NODUMP,
|
regions_to_avail(avail_list, EXFLAG_NOALLOC | EXFLAG_NODUMP,
|
||||||
PHYS_AVAIL_COUNT, 0, NULL, NULL);
|
PHYS_AVAIL_COUNT, 0, NULL, NULL);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user