1 /* 2 * (c) 2008-2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>, 3 * Alexander Warg <warg@os.inf.tu-dresden.de> 4 * economic rights: Technische Universität Dresden (Germany) 5 * 6 * This file is part of TUD:OS and distributed under the terms of the 7 * GNU General Public License 2. 8 * Please see the COPYING-GPL-2 file for details. 9 */ 10 #pragma once 11 12 #include <l4/sys/types.h> 13 #include <l4/re/mem_alloc> 14 #include <l4/re/util/bitmap_cap_alloc> 15 #include <l4/re/env> 16 #include <l4/re/l4aux.h> 17 #include <l4/cxx/static_container> 18 19 class Region_map; 20 21 namespace Global 22 { 23 enum 24 { 25 Max_local_rm_caps = 1024, 26 Local_task_cap = 0, 27 }; 28 typedef L4Re::Util::Cap_alloc<Max_local_rm_caps> Cap_alloc; 29 extern L4::Cap<L4Re::Mem_alloc> allocator; 30 extern cxx::Static_container<Region_map> local_rm; 31 extern cxx::Static_container<Cap_alloc> cap_alloc; 32 extern char const *const *argv; 33 extern char const *const *envp; 34 extern int argc; 35 extern l4re_aux_t *l4re_aux; 36 37 struct Init_globals 38 { 39 static bool _initialized; 40 static void init(); Init_globalsInit_globals41 Init_globals() 42 { 43 if (_initialized) 44 return; 45 46 _initialized = true; 47 init(); 48 } 49 }; 50 51 static Init_globals _globals_init; 52 }; 53