xref: /openbmc/linux/arch/x86/include/asm/io_bitmap.h (revision 55fd7e02)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_X86_IOBITMAP_H
3 #define _ASM_X86_IOBITMAP_H
4 
5 #include <linux/refcount.h>
6 #include <asm/processor.h>
7 
8 struct io_bitmap {
9 	u64		sequence;
10 	refcount_t	refcnt;
11 	/* The maximum number of bytes to copy so all zero bits are covered */
12 	unsigned int	max;
13 	unsigned long	bitmap[IO_BITMAP_LONGS];
14 };
15 
16 struct task_struct;
17 
18 #ifdef CONFIG_X86_IOPL_IOPERM
19 void io_bitmap_share(struct task_struct *tsk);
20 void io_bitmap_exit(struct task_struct *tsk);
21 
22 void native_tss_update_io_bitmap(void);
23 
24 #ifdef CONFIG_PARAVIRT_XXL
25 #include <asm/paravirt.h>
26 #else
27 #define tss_update_io_bitmap native_tss_update_io_bitmap
28 #endif
29 
30 #else
31 static inline void io_bitmap_share(struct task_struct *tsk) { }
32 static inline void io_bitmap_exit(struct task_struct *tsk) { }
33 static inline void tss_update_io_bitmap(void) { }
34 #endif
35 
36 #endif
37