// SPDX-License-Identifier: GPL-2.0-or-later #pragma once // The kernel's side of LDLS, as the rest of the kernel sees it. The layer // itself is kernel/ldls/; this is the handful of places it is called from. struct trapframe; // kernel/arch/x86_64/vm.c -- the window in the top 2 GB. void ldls_vm_init(void); int kmap_page(uint64 va, addr_t pa); addr_t kmap_phys(uint64 va); addr_t kunmap_page(uint64 va); // kernel/ldls/core.c void ldls_init(void); int ldls_ioctl(uint64 request, uint64 argp); // A trap in kernel mode. Returns 1 if LDLS dealt with it -- a WARN() that was // reported and stepped over, or a hosted driver that faulted and has been // stopped -- and 0 if it is the kernel's own and should panic as before. int ldls_trap(struct trapframe *tf); // The name of an address in a hosted module, for a backtrace. 0 if `a` is not // in one. int ldls_symbolize(uint64 a, char *out, int cap);