void __init __setup_vga(void) { #ifdef CONFIG_IGUANA char* vga_obj; envitem_t *ig_ref; if ((ig_ref = (envitem_t *)iguana_getenv("vga")) == NULL) L4_KDB_Enter("didn't find the iguana ref to vga"); if ((vga_obj = env_memsection_base(ig_ref)) == NULL) L4_KDB_Enter("vga_obj returned is 0"); VGA_offset = (unsigned long)vga_obj - video_ram_resource.start; request_resource(&iomem_resource, &video_ram_resource); #endif }
void abort(void) { #if !defined(NANOKERNEL) L4_KDB_Enter("L4_Rootserver abort()ed"); #endif while (1); /* We don't return after this */ }
void abort(void) { #if defined(IGUANA_DEBUG) L4_KDB_Enter("Iguana abort()ed"); #endif while (1); /* We don't return after this */ }
void _Exit(int status) { #if !defined(NANOKERNEL) L4_KDB_Enter("L4 Rootserver exit"); #endif while (1); }
void __assert(const char *msg, const char *file, const char* function, int line) { char abuf[256]; printk( "\n\nAssertion failed: %s, function %s, " "file %s, line %d.\n", msg, function, file, line); snprintf(abuf, sizeof(abuf), "Assertion failed: %s, function %s, " "file %s, line %d.\n", msg, function, file, line); #ifdef __i386__ /* Can only pass a static string on x86 */ L4_KDB_Enter("Assertion failed"); #else L4_KDB_Enter(abuf); #endif }
static void pager (void) { L4_ThreadId_t tid; L4_MsgTag_t tag; L4_Msg_t msg; L4_Send(master_tid); for (;;) { tag = L4_Wait(&tid); for (;;) { L4_Word_t faddr, fip; L4_MsgStore(tag, &msg); if (L4_UntypedWords (tag) != 2 || !L4_IpcSucceeded (tag)) { printf ("Malformed pagefault IPC from %p (tag=%p)\n", (void *) tid.raw, (void *) tag.raw); L4_KDB_Enter ("malformed pf"); break; } faddr = L4_MsgWord(&msg, 0); fip = L4_MsgWord (&msg, 1); L4_MsgClear(&msg); { L4_MapItem_t map; L4_SpaceId_t space; L4_Word_t seg, offset, cache, rwx, size; int r; seg = get_seg(KBENCH_SPACE, faddr, &offset, &cache, &rwx); assert(seg != ~0UL); size = L4_GetMinPageBits(); faddr &= ~((1ul << size)-1); offset &= ~((1ul << size)-1); space.raw = __L4_TCR_SenderSpace(); L4_MapItem_Map(&map, seg, offset, faddr, size, cache, rwx); r = L4_ProcessMapItem(space, map); assert(r == 1); } L4_MsgLoad(&msg); // tag = L4_ReplyWait (tid, &tid); tag = L4_MsgTag(); L4_Set_SendBlock(&tag); L4_Set_ReceiveBlock(&tag); tag = L4_Ipc(tid, L4_anythread, tag, &tid); } } }
/* * Called when Linux startup fails / exit server * XXX: Send status to iguana/loader? */ void _Exit(int status) { #ifndef NDEBUG printk("Linux exit status: %d\n", status); L4_KDB_Enter("Linux exit"); #endif assert(!"Can't exit -- shouldn't reach here"); L4_WaitForever(); while(1); }
int prefetcher_init(void) { BUG(); L4_KDB_Enter("Implement me"); #if 0 uint64_t source, target; FILE *pdata; PEntry *entry; dprintk(0,"Initializing prefetch cache "); if( (prefetch_cache = lhmap_create(2097169)) == NULL) return -1; /* load prefetch data from file into cache */ if( (pdata=fopen("prefetch.data", "rb")) == NULL) { ERROR_PRINT("cannot open prefetch.data"); return -1; } while(fscanf(pdata, "%llu -> %llu\n", &source, &target ) != EOF) { if(lhmap_lookup(prefetch_cache, source) != NULL) { ERROR_PRINT("invalid prefetcher data"); return -1; } if( (entry = (PEntry*)qemu_malloc(sizeof(PEntry))) == NULL) { ERROR_PRINT("malloc failed"); return -1; } entry->next = target; if( lhmap_insert(prefetch_cache, source, entry)) { ERROR_PRINT("insert failed"); return -1; } } fclose(pdata); #endif dprintk(0,"done.\n"); return 0; }
int main(void) { int r; DEBUG_PRINT(banner); #if defined(ARCH_ARM) && ARCH_VER <= 5 /* Place iguana in L4 ARM vspace #1 */ (void)L4_SpaceControl(IGUANA_SPACE, L4_SpaceCtrl_resources, IGUANA_CLIST, L4_Nilpage, (1 << 16), NULL); /* Cache Flush */ (void)L4_CacheFlushAll(); #endif INIT_PRINT("Processing Boot Info: %p\n", __okl4_bootinfo); utcb_init(); mutex_init(); space_init(); pd_init(); objtable_init(); thread_init(); r = bi_execute(__okl4_bootinfo); if (r != 0) { #if defined(IGUANA_DEBUG) L4_KDB_Enter("PANIC: Bootinfo did not initialise correctly"); #endif while (1); } extensions_init(); /* * TODO: We could reclaim memory here is we need to */ /* Now that we are ready to roll, lets start the server */ INIT_PRINT("iguana_server\n"); iguana_server_loop(); assert(!"Should never reach here"); return 0; }
int main(void) { main_tid = thread_l4tid(env_thread(iguana_getenv("MAIN"))); printf("\nKernel counter example\n"); printf("----------\n"); test01(); test02(); test03(); printf("Kernel counter example finished\n"); L4_KDB_Enter("done"); return 0; }
static int do_rx_work(struct c8250_serial *device) { uint8_t data; struct stream_interface *si = &device->rx; struct stream_pkt *packet = stream_get_head(si); while (rx_ready()) { data = rbr_get_data(); /* 11 or 0xb is Ctrl-k */ if ((data & 0xff) == 0xb){ L4_KDB_Enter("breakin"); // Dont want to pass the C-k to the client continue; } if(!packet) continue; packet->data[packet->xferred] = (data & 0xFF); packet->xferred++; while(rx_ready()) rbr_get_data(); if (packet->xferred == packet->length) { if ((packet = stream_switch_head(si)) == NULL) { break; } } } if (packet){ if (packet->xferred) packet = stream_switch_head(si); } return 0; }
static void pager (void) { L4_ThreadId_t tid; L4_MsgTag_t tag; L4_Msg_t msg; int count = 0; for (;;) { tag = L4_Wait(&tid); for (;;) { L4_Word_t faddr, fip; L4_MsgStore(tag, &msg); if (L4_Label(tag) == START_LABEL) { // Startup notification, start ping and pong thread void (*start_addr)(void); void (*pong_start_addr)(void); L4_Word_t *pong_stack_addr = pong_stack; if (pagertimer) { start_addr = ping_thread_pager; } else if (pagertimer_simulated) { start_addr = ping_thread_simulated; } else if (fass_buffer) { start_addr = ping_thread_buffer; } else if (fault_test) { count = 0; start_addr = NULL; } else if (intra_close) { start_addr = ping_thread_close; } else if (intra_open) { start_addr = ping_thread_open; } else if (intra_rpc) { start_addr = ping_thread_rpc_server; } else if (intra_ovh) { start_addr = ping_thread_ovh; } else if (intra_async) { start_addr = ping_thread_async; } else if (intra_async_ovh) { start_addr = ping_thread_async_ovh; } else { start_addr = ping_thread; } if (start_addr != NULL) { /*printf("ping_start_addr: %lx ping_stack_addr: %lx\n", START_ADDR (start_addr), (L4_Word_t) ping_stack);*/ send_startup_ipc (ping_tid, START_ADDR(start_addr), (L4_Word_t) ping_stack + sizeof (ping_stack) - 32); L4_ThreadSwitch(ping_tid); } if (fass_buffer) { pong_start_addr = pong_thread_buffer; pong_stack_addr = pong_stack_fass; } else if (fass) { pong_start_addr = pong_thread_fass; pong_stack_addr = pong_stack_fass; } else if (fault_test) { pong_stack_addr = pong_stack_fass; pong_start_addr = pong_thread_faulter; } else if (intra_close) { pong_start_addr = pong_thread_close; } else if (intra_open) { pong_start_addr = pong_thread_open; } else if (intra_rpc) { pong_start_addr = pong_thread_close; } else if (intra_ovh) { pong_start_addr = pong_thread_ovh; } else if (intra_async) { pong_start_addr = pong_thread_async; } else if (intra_async_ovh) { pong_start_addr = pong_thread_async_ovh; } else { pong_start_addr = pong_thread; } if (!pagertimer) { /*printf("pong_start_addr: %lx pong_stack_addr: %lx\n", START_ADDR (pong_start_addr), (L4_Word_t) pong_stack_addr);*/ L4_Set_Priority(ping_tid, 100); L4_Set_Priority(pong_tid, 99); send_startup_ipc (pong_tid, START_ADDR (pong_start_addr), (L4_Word_t) pong_stack_addr + sizeof (ping_stack) - 32); } break; } if (L4_UntypedWords (tag) != 2 || !L4_IpcSucceeded (tag)) { printf ("pingpong: malformed pagefault IPC from %p (tag=%p)\n", (void *) tid.raw, (void *) tag.raw); L4_KDB_Enter ("malformed pf"); break; } faddr = L4_MsgWord(&msg, 0); fip = L4_MsgWord (&msg, 1); L4_MsgClear(&msg); if (fault_test && (faddr == (uintptr_t) fault_area)) { if (count < num_iterations) { count++; } else { /* Tell master that we're finished */ L4_Set_MsgTag (L4_Niltag); L4_Send (master_tid); break; } } else { L4_MapItem_t map; L4_SpaceId_t space; L4_Word_t seg, offset, cache, rwx, size; int r; seg = get_seg(KBENCH_SPACE, faddr, &offset, &cache, &rwx); //if can not find mapping, must be page fault test, //just map any valid address, since fault address is dummy. if (seg == ~0UL) seg = get_seg(KBENCH_SPACE, (L4_Word_t) fault_area, &offset, &cache, &rwx); if (tid.raw == ping_th.raw) space = ping_space; else if (tid.raw == pong_th.raw) { if (pong_space.raw != L4_nilspace.raw) space = pong_space; else //pong_space is not created, only ping_space is used. space = ping_space; } else space = KBENCH_SPACE; size = L4_GetMinPageBits(); faddr &= ~((1ul << size)-1); offset &= ~((1ul << size)-1); L4_MapItem_Map(&map, seg, offset, faddr, size, cache, rwx); r = L4_ProcessMapItem(space, map); assert(r == 1); } L4_MsgLoad(&msg); tag = L4_ReplyWait (tid, &tid); } } }
void abort(void) { L4_KDB_Enter("L4_Rootserver abort()ed"); while(1); /* We don't return after this */ }
void abort(void) { L4_KDB_Enter("sos abort()ed"); while(1); /* We don't return after this */ }
// Pure virtual support void __cxa_pure_virtual() { L4_KDB_Enter("Pure virtual function has been called."); }