spapr.c (d25228e7befac33b665cd9250292de47ae6b78b5) | spapr.c (631b22ea206300f09b9d1bb9249169e0f0092639) |
---|---|
1/* 2 * QEMU PowerPC pSeries Logical Partition (aka sPAPR) hardware System Emulator 3 * 4 * Copyright (c) 2004-2007 Fabrice Bellard 5 * Copyright (c) 2007 Jocelyn Mayer 6 * Copyright (c) 2010 David Gibson, IBM Corporation. 7 * 8 * Permission is hereby granted, free of charge, to any person obtaining a copy --- 1015 unchanged lines hidden (view full) --- 1024 } 1025} 1026 1027static int spapr_post_load(void *opaque, int version_id) 1028{ 1029 sPAPREnvironment *spapr = (sPAPREnvironment *)opaque; 1030 int err = 0; 1031 | 1/* 2 * QEMU PowerPC pSeries Logical Partition (aka sPAPR) hardware System Emulator 3 * 4 * Copyright (c) 2004-2007 Fabrice Bellard 5 * Copyright (c) 2007 Jocelyn Mayer 6 * Copyright (c) 2010 David Gibson, IBM Corporation. 7 * 8 * Permission is hereby granted, free of charge, to any person obtaining a copy --- 1015 unchanged lines hidden (view full) --- 1024 } 1025} 1026 1027static int spapr_post_load(void *opaque, int version_id) 1028{ 1029 sPAPREnvironment *spapr = (sPAPREnvironment *)opaque; 1030 int err = 0; 1031 |
1032 /* In earlier versions, there was no seperate qdev for the PAPR | 1032 /* In earlier versions, there was no separate qdev for the PAPR |
1033 * RTC, so the RTC offset was stored directly in sPAPREnvironment. 1034 * So when migrating from those versions, poke the incoming offset 1035 * value into the RTC device */ 1036 if (version_id < 3) { 1037 err = spapr_rtc_import_offset(spapr->rtc, spapr->rtc_offset); 1038 } 1039 1040 return err; --- 779 unchanged lines hidden (view full) --- 1820 .driver = TYPE_SPAPR_PCI_HOST_BRIDGE,\ 1821 .property = "mem_win_size",\ 1822 .value = "0x20000000",\ 1823 } 1824 1825#define SPAPR_COMPAT_2_1 \ 1826 SPAPR_COMPAT_2_2 1827 | 1033 * RTC, so the RTC offset was stored directly in sPAPREnvironment. 1034 * So when migrating from those versions, poke the incoming offset 1035 * value into the RTC device */ 1036 if (version_id < 3) { 1037 err = spapr_rtc_import_offset(spapr->rtc, spapr->rtc_offset); 1038 } 1039 1040 return err; --- 779 unchanged lines hidden (view full) --- 1820 .driver = TYPE_SPAPR_PCI_HOST_BRIDGE,\ 1821 .property = "mem_win_size",\ 1822 .value = "0x20000000",\ 1823 } 1824 1825#define SPAPR_COMPAT_2_1 \ 1826 SPAPR_COMPAT_2_2 1827 |
1828static void spapr_compat_2_3(Object *obj) 1829{ 1830} 1831 1832static void spapr_compat_2_2(Object *obj) 1833{ 1834 spapr_compat_2_3(obj); 1835} 1836 1837static void spapr_compat_2_1(Object *obj) 1838{ 1839 spapr_compat_2_2(obj); 1840} 1841 1842static void spapr_machine_2_3_instance_init(Object *obj) 1843{ 1844 spapr_compat_2_3(obj); 1845 spapr_machine_initfn(obj); 1846} 1847 1848static void spapr_machine_2_2_instance_init(Object *obj) 1849{ 1850 spapr_compat_2_2(obj); 1851 spapr_machine_initfn(obj); 1852} 1853 1854static void spapr_machine_2_1_instance_init(Object *obj) 1855{ 1856 spapr_compat_2_1(obj); 1857 spapr_machine_initfn(obj); 1858} 1859 | |
1860static void spapr_machine_2_1_class_init(ObjectClass *oc, void *data) 1861{ 1862 MachineClass *mc = MACHINE_CLASS(oc); 1863 static GlobalProperty compat_props[] = { 1864 HW_COMPAT_2_1, 1865 SPAPR_COMPAT_2_1, 1866 { /* end of list */ } 1867 }; 1868 1869 mc->name = "pseries-2.1"; 1870 mc->desc = "pSeries Logical Partition (PAPR compliant) v2.1"; 1871 mc->compat_props = compat_props; 1872} 1873 1874static const TypeInfo spapr_machine_2_1_info = { 1875 .name = TYPE_SPAPR_MACHINE "2.1", 1876 .parent = TYPE_SPAPR_MACHINE, 1877 .class_init = spapr_machine_2_1_class_init, | 1828static void spapr_machine_2_1_class_init(ObjectClass *oc, void *data) 1829{ 1830 MachineClass *mc = MACHINE_CLASS(oc); 1831 static GlobalProperty compat_props[] = { 1832 HW_COMPAT_2_1, 1833 SPAPR_COMPAT_2_1, 1834 { /* end of list */ } 1835 }; 1836 1837 mc->name = "pseries-2.1"; 1838 mc->desc = "pSeries Logical Partition (PAPR compliant) v2.1"; 1839 mc->compat_props = compat_props; 1840} 1841 1842static const TypeInfo spapr_machine_2_1_info = { 1843 .name = TYPE_SPAPR_MACHINE "2.1", 1844 .parent = TYPE_SPAPR_MACHINE, 1845 .class_init = spapr_machine_2_1_class_init, |
1878 .instance_init = spapr_machine_2_1_instance_init, | |
1879}; 1880 1881static void spapr_machine_2_2_class_init(ObjectClass *oc, void *data) 1882{ 1883 static GlobalProperty compat_props[] = { 1884 SPAPR_COMPAT_2_2, 1885 { /* end of list */ } 1886 }; 1887 MachineClass *mc = MACHINE_CLASS(oc); 1888 1889 mc->name = "pseries-2.2"; 1890 mc->desc = "pSeries Logical Partition (PAPR compliant) v2.2"; 1891 mc->compat_props = compat_props; 1892} 1893 1894static const TypeInfo spapr_machine_2_2_info = { 1895 .name = TYPE_SPAPR_MACHINE "2.2", 1896 .parent = TYPE_SPAPR_MACHINE, 1897 .class_init = spapr_machine_2_2_class_init, | 1846}; 1847 1848static void spapr_machine_2_2_class_init(ObjectClass *oc, void *data) 1849{ 1850 static GlobalProperty compat_props[] = { 1851 SPAPR_COMPAT_2_2, 1852 { /* end of list */ } 1853 }; 1854 MachineClass *mc = MACHINE_CLASS(oc); 1855 1856 mc->name = "pseries-2.2"; 1857 mc->desc = "pSeries Logical Partition (PAPR compliant) v2.2"; 1858 mc->compat_props = compat_props; 1859} 1860 1861static const TypeInfo spapr_machine_2_2_info = { 1862 .name = TYPE_SPAPR_MACHINE "2.2", 1863 .parent = TYPE_SPAPR_MACHINE, 1864 .class_init = spapr_machine_2_2_class_init, |
1898 .instance_init = spapr_machine_2_2_instance_init, | |
1899}; 1900 1901static void spapr_machine_2_3_class_init(ObjectClass *oc, void *data) 1902{ 1903 MachineClass *mc = MACHINE_CLASS(oc); 1904 1905 mc->name = "pseries-2.3"; 1906 mc->desc = "pSeries Logical Partition (PAPR compliant) v2.3"; | 1865}; 1866 1867static void spapr_machine_2_3_class_init(ObjectClass *oc, void *data) 1868{ 1869 MachineClass *mc = MACHINE_CLASS(oc); 1870 1871 mc->name = "pseries-2.3"; 1872 mc->desc = "pSeries Logical Partition (PAPR compliant) v2.3"; |
1873 mc->alias = "pseries"; 1874 mc->is_default = 1; |
|
1907} 1908 1909static const TypeInfo spapr_machine_2_3_info = { 1910 .name = TYPE_SPAPR_MACHINE "2.3", 1911 .parent = TYPE_SPAPR_MACHINE, 1912 .class_init = spapr_machine_2_3_class_init, | 1875} 1876 1877static const TypeInfo spapr_machine_2_3_info = { 1878 .name = TYPE_SPAPR_MACHINE "2.3", 1879 .parent = TYPE_SPAPR_MACHINE, 1880 .class_init = spapr_machine_2_3_class_init, |
1913 .instance_init = spapr_machine_2_3_instance_init, | |
1914}; 1915 | 1881}; 1882 |
1916static void spapr_machine_2_4_class_init(ObjectClass *oc, void *data) 1917{ 1918 MachineClass *mc = MACHINE_CLASS(oc); 1919 1920 mc->name = "pseries-2.4"; 1921 mc->desc = "pSeries Logical Partition (PAPR compliant) v2.4"; 1922 mc->alias = "pseries"; 1923 mc->is_default = 1; 1924} 1925 1926static const TypeInfo spapr_machine_2_4_info = { 1927 .name = TYPE_SPAPR_MACHINE "2.4", 1928 .parent = TYPE_SPAPR_MACHINE, 1929 .class_init = spapr_machine_2_4_class_init, 1930}; 1931 | |
1932static void spapr_machine_register_types(void) 1933{ 1934 type_register_static(&spapr_machine_info); 1935 type_register_static(&spapr_machine_2_1_info); 1936 type_register_static(&spapr_machine_2_2_info); 1937 type_register_static(&spapr_machine_2_3_info); | 1883static void spapr_machine_register_types(void) 1884{ 1885 type_register_static(&spapr_machine_info); 1886 type_register_static(&spapr_machine_2_1_info); 1887 type_register_static(&spapr_machine_2_2_info); 1888 type_register_static(&spapr_machine_2_3_info); |
1938 type_register_static(&spapr_machine_2_4_info); | |
1939} 1940 1941type_init(spapr_machine_register_types) | 1889} 1890 1891type_init(spapr_machine_register_types) |