+u32 sun4v_vdev_devhandle;
+int sun4v_vdev_root;
+struct linux_prom_pci_intmap *sun4v_vdev_intmap;
+int sun4v_vdev_num_intmap;
+struct linux_prom_pci_intmap sun4v_vdev_intmask;
+
+static void __init sun4v_virtual_device_probe(void)
+{
+ struct linux_prom64_registers regs;
+ struct linux_prom_pci_intmap *ip;
+ int node, sz, err;
+
+ if (tlb_type != hypervisor)
+ return;
+
+ node = prom_getchild(prom_root_node);
+ node = prom_searchsiblings(node, "virtual-devices");
+ if (!node) {
+ prom_printf("SUN4V: Fatal error, no virtual-devices node.\n");
+ prom_halt();
+ }
+
+ sun4v_vdev_root = node;
+
+ prom_getproperty(node, "reg", (char *)®s, sizeof(regs));
+ sun4v_vdev_devhandle = (regs.phys_addr >> 32UL) & 0x0fffffff;
+
+ sz = sizeof(*ip) * 64;
+ sun4v_vdev_intmap = ip = alloc_bootmem_low_pages(sz);
+ if (!sun4v_vdev_intmap) {
+ prom_printf("SUN4V: Error, cannot allocate vdev intmap.\n");
+ prom_halt();
+ }
+
+ err = prom_getproperty(node, "interrupt-map", (char *) ip, sz);
+ if (err == -1) {
+ prom_printf("SUN4V: Fatal error, no vdev interrupt-map.\n");
+ prom_halt();
+ }
+
+ sun4v_vdev_num_intmap = err / sizeof(*ip);
+
+ err = prom_getproperty(node, "interrupt-map-mask",
+ (char *) &sun4v_vdev_intmask,
+ sizeof(sun4v_vdev_intmask));
+ if (err == -1) {
+ prom_printf("SUN4V: Fatal error, no vdev "
+ "interrupt-map-mask.\n");
+ prom_halt();
+ }
+
+ printk("SUN4V: virtual-devices devhandle[%x]\n",
+ sun4v_vdev_devhandle);
+}
+