staticint __init virt_platform_init(void)
{ conststruct resource goldfish_tty_res[] = {
DEFINE_RES_MEM(virt_bi_data.tty.mmio, 1),
DEFINE_RES_IRQ(virt_bi_data.tty.irq),
}; /* this is the second gf-rtc, the first one is used by the scheduler */ conststruct resource goldfish_rtc_res[] = {
DEFINE_RES_MEM(virt_bi_data.rtc.mmio + 0x1000, 0x1000),
DEFINE_RES_IRQ(virt_bi_data.rtc.irq + 1),
}; struct platform_device *pdev1, *pdev2; struct platform_device *pdevs[VIRTIO_BUS_NB]; unsignedint i; int ret = 0;
if (!MACH_IS_VIRT) return -ENODEV;
/* We need this to have DMA'able memory provided to goldfish-tty */
min_low_pfn = 0;
pdev1 = platform_device_register_simple("goldfish_tty",
PLATFORM_DEVID_NONE,
goldfish_tty_res,
ARRAY_SIZE(goldfish_tty_res)); if (IS_ERR(pdev1)) return PTR_ERR(pdev1);
pdev2 = platform_device_register_simple("goldfish_rtc",
PLATFORM_DEVID_NONE,
goldfish_rtc_res,
ARRAY_SIZE(goldfish_rtc_res)); if (IS_ERR(pdev2)) {
ret = PTR_ERR(pdev2); goto err_unregister_tty;
}
for (i = 0; i < VIRTIO_BUS_NB; i++) {
pdevs[i] = virt_virtio_init(i); if (IS_ERR(pdevs[i])) {
ret = PTR_ERR(pdevs[i]); goto err_unregister_rtc_virtio;
}
}
return 0;
err_unregister_rtc_virtio: while (i > 0)
platform_device_unregister(pdevs[--i]);
platform_device_unregister(pdev2);
err_unregister_tty:
platform_device_unregister(pdev1);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.