/* __vxge_hw_device_toc_get This routine sets the swapper and reads the toc pointer and returns the memory mapped address of the toc  */
struct vxge_hw_toc_reg __iomem* __vxge_hw_device_toc_get(void __iomem *bar0)
/* __vxge_hw_device_toc_get This routine sets the swapper and reads the toc pointer and returns the memory mapped address of the toc  */
struct vxge_hw_toc_reg __iomem* __vxge_hw_device_toc_get(void __iomem *bar0)
{
	u64 val64;
	struct vxge_hw_toc_reg __iomem *toc = NULL;
	enum vxge_hw_status status;
	struct vxge_hw_legacy_reg __iomem *legacy_reg =
		(struct vxge_hw_legacy_reg __iomem *)bar0;
	status = __vxge_hw_legacy_swapper_set(legacy_reg);
	if (status != VXGE_HW_OK)
		goto exit;
	val64 =	readq(&legacy_reg->toc_first_pointer);
	toc = (struct vxge_hw_toc_reg __iomem *)(bar0+val64);
exit:
	return toc;
}