blob: 896093ceee68d05408ac06a894ed07e4deb9bbff [file] [log] [blame]
// Copyright 2021 The Fuchsia Authors
//
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file or at
// https://opensource.org/licenses/MIT
#include <lib/boot-options/boot-options.h>
#include <lk/init.h>
#include <vm/physical_page_borrowing_config.h>
#include <vm/pmm.h>
static void ppb_init_func(uint level) {
// One option per potential borrowing site.
pmm_physical_page_borrowing_config()->set_borrowing_enabled(
gBootOptions->ppb_borrow_in_supplypages);
// One option for whether decommit on contiguous VMO can work or returns ZX_ERR_NOT_SUPPORTED.
pmm_physical_page_borrowing_config()->set_loaning_enabled(gBootOptions->ppb_loan);
}
LK_INIT_HOOK(ppb_init, &ppb_init_func, LK_INIT_LEVEL_VM)