Lines Matching defs:env

60 struct env env = {
116 caps[i] = vspace_get_cap(&env.vspace, vaddr);
121 cookies[i] = vspace_get_cookie(&env.vspace, vaddr);
125 vspace_unmap_pages(&env.vspace, addr, num_pages, BMK_PCPU_PAGE_SHIFT, VSPACE_PRESERVE);
130 res = vspace_reserve_range_at(&env.vspace, addr, len, rights, true);
133 error = vspace_map_pages_at_vaddr(&env.vspace, caps, cookies, addr, num_pages, BMK_PCPU_PAGE_SHIFT, res);
140 vspace_free_reservation(&env.vspace, res);
154 static void init_allocator(env_t env)
160 allocman_t *allocator = bootstrap_use_current_1level(simple_get_cnode(&env->simple),
161 simple_get_cnode_size_bits(&env->simple),
162 simple_last_valid_cap(&env->simple) + 1,
163 BIT(simple_get_cnode_size_bits(&env->simple)),
167 allocman_make_vka(&env->vka, allocator);
169 int num_regions = custom_get_num_regions(&env->custom_simple);
172 error = custom_get_region_list(&env->custom_simple, num_regions, regions);
174 allocman_add_simple_untypeds_with_regions(allocator, &env->simple, num_regions, regions);
177 error = custom_simple_vspace_bootstrap_frames(&env->custom_simple, &env->vspace, &alloc_data, &env->vka);
179 error = sel4utils_reserve_range_no_alloc(&env->vspace, &muslc_brk_reservation_memory, 1048576, seL4_AllRights, 1,
182 muslc_this_vspace = &env->vspace;
187 virtual_reservation = vspace_reserve_range(&env->vspace, ALLOCATOR_VIRTUAL_POOL_SIZE,
192 simple_get_pd(&env->simple));
196 static void provide_vmem(env_t env)
203 size_t rumprun_size = env->custom_simple.rumprun_memory_size;
209 env->rump_mapping_page_size_bits = page_size_bits;
210 env->rump_mapping_page_type = kobject_get_type(KOBJECT_FRAME, page_size_bits);
222 osend = vspace_new_pages_with_config(&env->vspace, &config, seL4_AllRights);
233 sync_bin_sem_wait(&env.spl_semaphore);
235 ZF_LOGF_IF(env.spldepth != 0, "spldepth should be 0. This thread should be blocked.");
236 if (env.should_wakeup != 0) {
237 seL4_Signal(env.custom_simple.timer_config.timer_ntfn);
240 env.mask_the_mask = 1;
243 sync_bin_sem_post(&env.spl_semaphore);
244 env.mask_the_mask = 0;
250 env.mask_the_mask = 0;
253 seL4_Wait(env.pci_notification.cptr, &sender_badge);
260 if (env.custom_simple.get_char_handler) {
261 env.custom_simple.get_char_handler();
271 seL4_Wait(env.custom_simple.stdio_ep[0], &sender_badge);
278 if (custom_simple != &env.custom_simple) {
279 env.custom_simple = *custom_simple;
281 if (&env.simple != env.custom_simple.simple) {
282 env.simple = *env.custom_simple.simple;
286 init_allocator(&env);
292 int res = sel4platsupport_new_io_ops(&env.vspace, &env.vka, &env.simple, &env.io_ops);
296 res = sel4platsupport_get_io_port_ops(&env.io_ops.io_port_ops, &env.simple, &env.vka);
301 sel4utils_rpc_ltimer_init(&custom_simple->timer_config.ltimer.ltimer, env.io_ops,
305 res = vka_alloc_notification(&env.vka, &env.pci_notification);
307 res = vka_alloc_notification(&env.vka, &env.spl_notification);
309 sync_bin_sem_init(&env.spl_semaphore, env.spl_notification.cptr, 1);
311 sel4utils_thread_config_t thread_config = thread_config_default(&env.simple,
312 simple_get_cnode(&env.simple), seL4_NilData, seL4_CapNull, custom_get_priority(&env.custom_simple));
314 res = sel4utils_configure_thread_config(&env.vka, &env.vspace, &env.vspace, thread_config, &env.pci_thread);
317 res = sel4utils_configure_thread_config(&env.vka, &env.vspace, &env.vspace, thread_config, &env.stdio_thread);
322 seL4_CPtr auth = simple_get_tcb(&env.simple);
323 res = seL4_TCB_SetPriority(simple_get_tcb(&env.simple), auth, custom_get_priority(&env.custom_simple) - 1);
326 NAME_THREAD(env.pci_thread.tcb.cptr, "pci thread");
327 res = sel4utils_start_thread(&env.pci_thread, wait_for_pci_interrupt, NULL, NULL,
333 seL4_CPtr io_space = simple_init_cap(&env.simple, seL4_CapIOSpace);
334 res = sel4utils_make_iommu_dma_alloc(&env.vka, &env.vspace, &env.io_ops.dma_manager, 1, &io_space);
337 res = sel4utils_new_page_dma_alloc(&env.vka, &env.vspace, &env.io_ops.dma_manager);
341 res = arch_init_clocks(&env);
344 provide_vmem(&env);
348 res = sel4utils_start_thread(&env.stdio_thread, wait_for_stdio_interrupt, NULL, NULL, 1);
351 struct rumprun_boot_config rumprun_config = {(char *)custom_get_cmdline(&env.custom_simple), CONFIG_RUMPRUN_TMPFS_NUM_MiB};