1 /*
2  * Copyright (c) 2018 Travis Geiselbrecht
3  *
4  * Use of this source code is governed by a MIT-style
5  * license that can be found in the LICENSE file or at
6  * https://opensource.org/licenses/MIT
7  */
8 #pragma once
9 
10 #include <lk/compiler.h>
11 #include <stdbool.h>
12 #include <stdint.h>
13 #include <sys/types.h>
14 
15 __BEGIN_CDECLS
16 
17 // Called at early initialization time, generally platform_early_init.
18 // Arguments are base address of mapped registers, number of fixed irqs,
19 // and a special third argument.
20 //
21 // hart0_m_only is used to tell the PLIC to assume that hart0 only has machine
22 // mode, and occupies only one target on the PLIC. So far Sifive and other similar
23 // designs use this, whereas flatter designs do not. See plic.c for more details.
24 void plic_early_init(uintptr_t base, size_t num_irqs_, bool hart0_m_only);
25 
26 void plic_init(void);
27 
28 __END_CDECLS
29 
30