5 * (c) 2008-2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
6 * Alexander Warg <warg@os.inf.tu-dresden.de>
7 * economic rights: Technische Universität Dresden (Germany)
9 * This file is part of TUD:OS and distributed under the terms of the
10 * GNU General Public License 2.
11 * Please see the COPYING-GPL-2 file for details.
16 #include <l4/sys/kip.h>
17 #include <l4/util/l4_macros.h>
26 using L4::Kip::Mem_desc;
29 * setup Kernel Info Page
32 init_kip_f(void *_l4i, boot_info_t *bi, l4util_mb_info_t *mbi,
33 Region_list *ram, Region_list *regions)
35 l4_kernel_info_t *l4i = (l4_kernel_info_t *)_l4i;
37 unsigned char l4_api = l4i->version >> 24;
39 if (l4_api != 0x87 /*VERSION_FIASCO*/)
40 panic("cannot load kernels other than Fiasco");
42 Mem_desc *md = Mem_desc::first(_l4i);
43 for (Region const* c = ram->begin(); c != ram->end(); ++c)
44 (md++)->set(c->begin(), c->end(), Mem_desc::Conventional);
46 for (Region const *c = regions->begin(); c != regions->end(); ++c)
48 Mem_desc::Mem_type type = Mem_desc::Reserved;
49 unsigned char sub_type = 0;
57 type = Mem_desc::Reserved;
60 type = Mem_desc::Dedicated;
63 type = Mem_desc::Bootloader;
66 type = Mem_desc::Arch;
67 sub_type = c->sub_type();
70 type = Mem_desc::Info;
71 sub_type = c->sub_type();
74 (md++)->set(c->begin(), c->end() - 1, type, sub_type);
77 l4i->user_ptr = (unsigned long)mbi;
79 /* set up sigma0 info */
80 l4i->sigma0_eip = bi->sigma0_start;
81 printf(" Sigma0 config ip:" l4_addr_fmt " sp:" l4_addr_fmt "\n",
82 l4i->sigma0_eip, l4i->sigma0_esp);
84 /* set up roottask info */
85 l4i->root_eip = bi->roottask_start;
86 printf(" Roottask config ip:" l4_addr_fmt " sp:" l4_addr_fmt "\n",
87 l4i->root_eip, l4i->root_esp);
90 strncpy(l4i->platform_info.name, PLATFORM_TYPE,
91 sizeof(l4i->platform_info.name));
92 l4i->platform_info.name[sizeof(l4i->platform_info.name) - 1] = 0;