1
- /* $NetBSD: i386_mainbus.c,v 1.7 2024/04/22 22:47:00 andvar Exp $ */
1
+ /* $NetBSD: i386_mainbus.c,v 1.8 2025/01/07 14:37:09 imil Exp $ */
2
2
/* NetBSD: mainbus.c,v 1.104 2018/12/02 08:19:44 cherry Exp */
3
3
4
4
/*
32
32
*/
33
33
34
34
#include <sys/cdefs.h>
35
- __KERNEL_RCSID (0 , "$NetBSD: i386_mainbus.c,v 1.7 2024/04/22 22:47:00 andvar Exp $" );
35
+ __KERNEL_RCSID (0 , "$NetBSD: i386_mainbus.c,v 1.8 2025/01/07 14:37:09 imil Exp $" );
36
36
37
37
#include <sys/param.h>
38
38
#include <sys/systm.h>
@@ -54,6 +54,7 @@ __KERNEL_RCSID(0, "$NetBSD: i386_mainbus.c,v 1.7 2024/04/22 22:47:00 andvar Exp
54
54
#include "pnpbios.h"
55
55
#include "acpica.h"
56
56
#include "ipmi.h"
57
+ #include "pvbus.h"
57
58
58
59
#include "opt_acpi.h"
59
60
#include "opt_mpbios.h"
@@ -90,6 +91,9 @@ __KERNEL_RCSID(0, "$NetBSD: i386_mainbus.c,v 1.7 2024/04/22 22:47:00 andvar Exp
90
91
#endif /* PCI_ADDR_FIXUP */
91
92
#endif /* PCI_BUS_FIXUP */
92
93
#endif /* NPCI > 0 */
94
+ #if NPVBUS > 0
95
+ #include <arch/x86/pv/pvvar.h>
96
+ #endif
93
97
94
98
void i386_mainbus_childdetached (device_t , device_t );
95
99
int i386_mainbus_match (device_t , cfdata_t , void * );
@@ -115,6 +119,9 @@ union i386_mainbus_attach_args {
115
119
#if NIPMI > 0
116
120
struct ipmi_attach_args mba_ipmi ;
117
121
#endif
122
+ #if NPVBUS > 0
123
+ struct pvbus_attach_args mba_pvba ;
124
+ #endif
118
125
};
119
126
120
127
/*
@@ -240,6 +247,20 @@ i386_mainbus_attach(device_t parent, device_t self, void *aux)
240
247
}
241
248
#endif
242
249
250
+ #if NPVBUS > 0
251
+ /* add here more VM guests types that would benefit from a pv bus */
252
+ switch (vm_guest ) {
253
+ /* FALLTHROUGH */
254
+ case VM_GUEST_GENPVH :
255
+ case VM_GUEST_KVM :
256
+ mba .mba_pvba .pvba_busname = "pvbus" ;
257
+ config_found (self , & mba .mba_pvba .pvba_busname , NULL ,
258
+ CFARGS (.iattr = "pvbus" ));
259
+ break ;
260
+ default :
261
+ break ;
262
+ }
263
+ #endif
243
264
if (!pmf_device_register (self , NULL , NULL ))
244
265
aprint_error_dev (self , "couldn't establish power handler\n" );
245
266
}
0 commit comments