This example shows how to iterate the virtual hardware descriptors under Fiasco-UX.
This example shows how to iterate the virtual hardware descriptors under Fiasco-UX.
#include <l4/sys/ipc.h>
#include <l4/util/util.h>
#include <stdlib.h>
#include <stdio.h>
{
printf("type: %d mem start: %08lx end: %08lx\n"
"irq: %d pid %d\n",
}
int main(void)
{
int i;
if (!kip)
{
printf("KIP not available!\n");
return 1;
}
{
printf("This example is for Fiasco-UX only.\n");
return 1;
}
vhw = l4_vhw_get(kip);
printf("kip at %p, vhw at %p\n", kip, vhw);
printf("magic: %08x, version: %08x, count: %02d\n",
for (i = 0; i < vhw->
count; i++)
print_entry(l4_vhw_get_entry(vhw, i));
return 0;
}
l4_kernel_info_t const * l4re_kip(void) L4_NOTHROW
Get Kernel Info Page.
int l4util_kip_kernel_is_ux(l4_kernel_info_t const *k)
Return whether the kernel is running natively or under UX.
L4 Kernel Interface Page.
Virtual hardware devices description.
l4_uint8_t version
Version of the descriptor.
l4_uint8_t count
Number of entries.
l4_addr_t mem_size
Size of memory region.
l4_uint32_t provider_pid
Host PID of the VHW provider.
l4_uint32_t irq_no
IRQ number.
l4_addr_t mem_start
Start of memory region.
enum l4_vhw_entry_type type
Type of virtual hardware.
Descriptors for virtual hardware (under UX).