| // 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 | |
| #ifndef ZIRCON_KERNEL_INCLUDE_DEV_INIT_H_ | |
| #define ZIRCON_KERNEL_INCLUDE_DEV_INIT_H_ | |
| #include <lib/uart/all.h> | |
| #include <zircon/compiler.h> | |
| // Forward-declared; fully declared in <phys/handoff/handoff.h> | |
| struct PhysHandoff; | |
| // Forward-declared; fully declared in <phys/handoff/arch-handoff.h>. | |
| struct ArchPhysHandoff; | |
| __BEGIN_CDECLS | |
| // These routines initialize the kernel's drivers, as a function of the | |
| // configurations described in the physboot hand-off, at two stages: | |
| // * "early" refers to immediately after early platform initialization, before | |
| // the VM and heap are set up; | |
| // * "post vm" refers to immediately after the main virtual memory system is | |
| // initialized, so drivers can use the VM to map physical memory. | |
| // * "late" refers to immediately after the main platform initialization, once | |
| // the VM, the heap, threading, and general kernel facilities are available. | |
| // | |
| // Defined in //zircon/kernel/dev/init.rs. | |
| void DriverHandoffEarly(const PhysHandoff& handoff); | |
| void DriverHandoffPostVm(const PhysHandoff& handoff); | |
| void DriverHandoffLate(const PhysHandoff& handoff); | |
| // Uart initialization routines. | |
| void UartDriverHandoffEarly(const uart::all::Driver& serial); | |
| void UartDriverHandoffPostVm(const uart::all::Driver& serial); | |
| void UartDriverHandoffLate(const uart::all::Driver& serial); | |
| // Platform-specific subroutines of the above functions, respectively. | |
| // | |
| // Defined in //zircon/kernel/platform/*/dev-init.cc. | |
| void PlatformDriverHandoffEarly(const ArchPhysHandoff& arch_handoff); | |
| void PlatformDriverHandoffPostVm(const ArchPhysHandoff& arch_handoff); | |
| void PlatformDriverHandoffLate(const ArchPhysHandoff& arch_handoff); | |
| __END_CDECLS | |
| #endif // ZIRCON_KERNEL_INCLUDE_DEV_INIT_H_ |