]> git.proxmox.com Git - mirror_qemu.git/blame - hw/core/fw-path-provider.c
target-arm: Add virt class and machine types
[mirror_qemu.git] / hw / core / fw-path-provider.c
CommitLineData
6b1566cb
PB
1/*
2 * Firmware patch provider class and helpers.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
20c50a95
AK
6 * the Free Software Foundation; either version 2 of the License,
7 * or (at your option) any later version.
6b1566cb
PB
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, see <http://www.gnu.org/licenses/>.
16 */
17
18#include "hw/fw-path-provider.h"
19
20char *fw_path_provider_get_dev_path(FWPathProvider *p, BusState *bus,
21 DeviceState *dev)
22{
23 FWPathProviderClass *k = FW_PATH_PROVIDER_GET_CLASS(p);
24
25 return k->get_dev_path(p, bus, dev);
26}
27
28char *fw_path_provider_try_get_dev_path(Object *o, BusState *bus,
29 DeviceState *dev)
30{
31 FWPathProvider *p = (FWPathProvider *)
32 object_dynamic_cast(o, TYPE_FW_PATH_PROVIDER);
33
34 if (p) {
35 return fw_path_provider_get_dev_path(p, bus, dev);
36 }
37
38 return NULL;
39}
40
41static const TypeInfo fw_path_provider_info = {
42 .name = TYPE_FW_PATH_PROVIDER,
43 .parent = TYPE_INTERFACE,
44 .class_size = sizeof(FWPathProviderClass),
45};
46
47static void fw_path_provider_register_types(void)
48{
49 type_register_static(&fw_path_provider_info);
50}
51
52type_init(fw_path_provider_register_types)