xref: /openbsd/sys/arch/riscv64/dev/plic.h (revision 380aa7b9)
1 /*	$OpenBSD: plic.h,v 1.3 2021/05/12 01:20:52 jsg Exp $	*/
2 
3 /*
4  * Copyright (c) 2020, Mars Li <mengshi.li.mars@gmail.com>
5  * Copyright (c) 2020, Brian Bamsch <bbamsch@google.com>
6  *
7  * Permission to use, copy, modify, and distribute this software for any
8  * purpose with or without fee is hereby granted, provided that the above
9  * copyright notice and this permission notice appear in all copies.
10  *
11  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 #ifndef _RISCV_PLIC_H_
21 #define _RISCV_PLIC_H_
22 
23 #ifndef _LOCORE
24 
25 void	plic_splx(int);
26 int	plic_spllower(int);
27 int	plic_splraise(int);
28 void	plic_setipl(int);
29 
30 void	*plic_intr_establish(int, int, int (*)(void *),
31 		void *, char *);
32 void	*plic_intr_establish_fdt(void *, int *, int,
33 		int (*)(void *), void *, char *);
34 void	plic_intr_disestablish(void *);
35 
36 #endif /* ! _LOCORE */
37 
38 #endif /* _RISCV_PLIC_H_*/
39