00001 #include <l4/sys/vhw.h> 00002 #include <l4/util/macros.h> 00003 #include <l4/sigma0/kip.h> 00004 #include <l4/env/errno.h> 00005 #include <l4/log/l4log.h> 00006 00007 #include "io.h" 00008 #include "res.h" 00009 00010 00011 int io_ux_init() 00012 { 00013 l4_kernel_info_t *kip = l4sigma0_kip(); 00014 if (!kip) return -L4_EUNKNOWN; 00015 00016 struct l4_vhw_descriptor *vhw = l4_vhw_get(kip); 00017 if (!vhw) return -L4_EUNKNOWN; 00018 00019 struct vhw_type 00020 { 00021 unsigned id; 00022 const char *name; 00023 } ux_hw[] = 00024 { 00025 { L4_TYPE_VHW_NET, "netdev " }, 00026 { L4_TYPE_VHW_FRAMEBUFFER, "gfxdev " }, 00027 { L4_TYPE_VHW_INPUT, "inputdev" }, 00028 { L4_TYPE_VHW_NONE, "none" } 00029 }; 00030 00031 struct vhw_type *vhwt; 00032 for (vhwt = ux_hw; vhwt->id != L4_TYPE_VHW_NONE; vhwt++) { 00033 unsigned long base, size; 00034 unsigned prov, irq, fd; 00035 struct l4_vhw_entry *entry = l4_vhw_get_entry_type(vhw, vhwt->id); 00036 if (entry) { 00037 base = entry->mem_start; 00038 size = entry->mem_size; 00039 prov = entry->provider_pid; 00040 irq = entry->irq_no; 00041 fd = entry->fd; 00042 00043 LOG_printf("Fiasco-UX %s is ["l4_addr_fmt","l4_addr_fmt") (prov=%d,irq=%d,fd=%d)\n", 00044 vhwt->name, base, base + size, prov, irq, fd); 00045 00046 if (size) callback_announce_mem_region(base, size); 00047 } 00048 } 00049 00050 return 0; 00051 }