Files
Warner Losh a3bdf33f3e stand: Introduce md_align
When we're loading metadata, we need to align it in a certain way. Right
now that way is hard-coded to be PAGE_SIZE. Rather than do the actual
physical thing in all these places, move this into a wrapper routine. We
may want to load a 16k kernel and align all these on 16k or a 4k kernel
and align on 4k on aarch64 (today you have to compile the loader with
the right page size). This will also reduce the number of places we
might have to touch to do that.

Sponsored by:		Netflix
Reviewed by:		tsoome, jhibbits
Differential Revision:	https://reviews.freebsd.org/D50585
2025-05-30 09:56:50 -06:00

22 lines
583 B
C

/*-
* Copyright (c) 2022, Netflix, Inc.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#ifndef COMMON_MODINFO_H
#define COMMON_MODINFO_H
extern const char md_modtype[];
extern const char md_kerntype[];
extern const char md_modtype_obj[];
extern const char md_kerntype_mb[];
int md_load(char *args, vm_offset_t *modulep, vm_offset_t *dtb);
int md_load64(char *args, vm_offset_t *modulep, vm_offset_t *dtb);
vm_offset_t md_copymodules(vm_offset_t addr, bool kern64);
vm_offset_t md_copyenv(vm_offset_t addr);
vm_offset_t md_align(vm_offset_t addr);
#endif /* COMMON_MODINFO_H */