int main(int argc, char *argv[]) { assert(argc >= 2); errval_t err = SYS_ERR_OK; oct_init(); size_t wait_for = atoi(argv[1]); char* record = NULL; debug_printf("Barrier test with: %lu processes:\n", wait_for); err = oct_barrier_enter("my_barrier", &record, wait_for); if(err_is_ok(err)) { debug_printf("Execute Barrier code section\n"); debug_printf("Barrier record is: %s\n", record); } else { DEBUG_ERR(err, "Barrier enter fail."); abort(); } err = oct_barrier_leave(record); ASSERT_ERR_OK(err); debug_printf("Process no longer inside barrier.\n"); free(record); return EXIT_SUCCESS; }
int main(int argc, char *argv[]) { oct_init(); set_records(); get_records(); printf("d2getset SUCESS!\n"); return EXIT_SUCCESS; }
int main(int argc, char** argv) { vfs_init(); init_environ(); errval_t err; my_core_id = disp_get_core_id(); parse_arguments(argc, argv); err = oct_init(); if (err_is_fail(err)) { USER_PANIC_ERR(err, "Initialize octopus service."); } KALUGA_DEBUG("Kaluga: parse boot modules...\n"); err = init_boot_modules(); if (err_is_fail(err)) { USER_PANIC_ERR(err, "Parse boot modules."); } add_start_function_overrides(); #ifdef __x86__ // We need to run on core 0 // (we are responsible for booting all the other cores) assert(my_core_id == BSP_CORE_ID); KALUGA_DEBUG("Kaluga running on x86.\n"); err = skb_client_connect(); if (err_is_fail(err)) { USER_PANIC_ERR(err, "Connect to SKB."); } // Make sure the driver db is loaded err = skb_execute("[device_db]."); if (err_is_fail(err)) { USER_PANIC_ERR(err, "Device DB not loaded."); } // The current boot protocol needs us to have // knowledge about how many CPUs are available at boot // time in order to start-up properly. char* record = NULL; err = oct_barrier_enter("barrier.acpi", &record, 2); KALUGA_DEBUG("Kaluga: watch_for_cores\n"); err = watch_for_cores(); if (err_is_fail(err)) { USER_PANIC_ERR(err, "Watching cores."); } KALUGA_DEBUG("Kaluga: pci_root_bridge\n"); err = watch_for_pci_root_bridge(); if (err_is_fail(err)) { USER_PANIC_ERR(err, "Watching PCI root bridges."); } KALUGA_DEBUG("Kaluga: pci_devices\n"); err = watch_for_pci_devices(); if (err_is_fail(err)) { USER_PANIC_ERR(err, "Watching PCI devices."); } KALUGA_DEBUG("Kaluga: wait_for_all_spawnds\n"); err = wait_for_all_spawnds(); if (err_is_fail(err)) { USER_PANIC_ERR(err, "Unable to wait for spawnds failed."); } #elif __pandaboard__ debug_printf("Kaluga running on Pandaboard.\n"); err = init_cap_manager(); assert(err_is_ok(err)); err = oct_set("all_spawnds_up { iref: 0 }"); assert(err_is_ok(err)); struct module_info* mi = find_module("fdif"); if (mi != NULL) { err = mi->start_function(0, mi, "hw.arm.omap44xx.fdif {}"); assert(err_is_ok(err)); } mi = find_module("mmchs"); if (mi != NULL) { err = mi->start_function(0, mi, "hw.arm.omap44xx.mmchs {}"); assert(err_is_ok(err)); } mi = find_module("mmchs2"); if (mi != NULL) { err = mi->start_function(0, mi, "hw.arm.omap44xx.mmchs {}"); assert(err_is_ok(err)); } mi = find_module("prcm"); if (mi != NULL) { err = mi->start_function(0, mi, "hw.arm.omap44xx.prcm {}"); assert(err_is_ok(err)); } mi = find_module("serial"); if (mi != NULL) { err = mi->start_function(0, mi, "hw.arm.omap44xx.uart {}"); assert(err_is_ok(err)); } mi = find_module("sdma"); if (mi != NULL) { err = mi->start_function(0, mi, "hw.arm.omap44xx.sdma {}"); assert(err_is_ok(err)); } mi = find_module("usb_manager"); if (mi != NULL) { #define USB_ARM_EHCI_IRQ 109 char *buf = malloc(255); uint8_t offset = 0; mi->cmdargs = buf; mi->argc = 3; mi->argv[0] = mi->cmdargs + 0; snprintf(buf + offset, 255 - offset, "ehci\0"); offset += strlen(mi->argv[0]) + 1; mi->argv[1] = mi->cmdargs + offset; snprintf(buf + offset, 255 - offset, "%u\0", 0xC00); offset += strlen(mi->argv[1]) + 1; mi->argv[2] = mi->cmdargs + offset; snprintf(buf+offset, 255-offset, "%u\0", USB_ARM_EHCI_IRQ); // XXX Use customized start function or add to module info err = mi->start_function(0, mi, "hw.arm.omap44xx.usb {}"); assert(err_is_ok(err)); } #elif __gem5__ printf("Kaluga running on GEM5 armv8.\n"); err = init_cap_manager(); assert(err_is_ok(err)); err = oct_set("all_spawnds_up { iref: 0 }"); assert(err_is_ok(err)); struct module_info* mi = find_module("serial"); if (mi != NULL) { err = mi->start_function(0, mi, "hw.arm.gem5.uart {}"); assert(err_is_ok(err)); } #endif THCFinish(); return EXIT_SUCCESS; }
/* * Class: org_sosy_lab_cpachecker_util_octagon_OctWrapper * Method: J_init * Signature: ()Z */ JNIEXPORT jboolean JNICALL Java_org_sosy_1lab_cpachecker_util_octagon_OctWrapper_J_1init (JNIEnv *env, jobject obj){ return (jboolean) oct_init(); }
int main(int argc, char *argv[]) { oct_init(); errval_t err = SYS_ERR_OK; octopus_trigger_id_t tid; size_t received = 0; err = oct_set("obj1 { attr: 1 }"); ASSERT_ERR_OK(err); err = oct_set("obj2 { attr: 2 }"); ASSERT_ERR_OK(err); err = oct_set("obj3 { attr: 3 }"); ASSERT_ERR_OK(err); struct octopus_thc_client_binding_t* c = oct_get_thc_client(); octopus_trigger_t record_deleted = oct_mktrigger(SYS_ERR_OK, octopus_BINDING_EVENT, OCT_ON_DEL, trigger_handler, &received); errval_t error_code = SYS_ERR_OK; char* output = NULL; err = c->call_seq.get(c, "r'^obj.$' { attr: 3 } ", record_deleted, &output, &tid, &error_code); ASSERT_ERR_OK(err); ASSERT_ERR_OK(error_code); ASSERT_STRING(output, "obj3 { attr: 3 }"); debug_printf("tid is: %lu\n", tid); free(output); oct_del("obj3"); while (received != 1) { messages_wait_and_handle_next(); } received = 0; tid = 0; octopus_mode_t m = OCT_ON_SET | OCT_ON_DEL | OCT_PERSIST; octopus_trigger_t ptrigger = oct_mktrigger(SYS_ERR_OK, octopus_BINDING_EVENT, m, persistent_trigger, &received); output = NULL; err = c->call_seq.get(c, "obj2", ptrigger, &output, &tid, &error_code); ASSERT_ERR_OK(err); ASSERT_ERR_OK(error_code); debug_printf("tid is: %lu\n", tid); ASSERT_STRING(output, "obj2 { attr: 2 }"); oct_del("obj2"); while (received != 1) { messages_wait_and_handle_next(); } received = 0; oct_set("obj2 { attr: 'asdf' }"); while (received != 1) { messages_wait_and_handle_next(); } received = 0; err = oct_remove_trigger(tid); DEBUG_ERR(err, "remove trigger"); ASSERT_ERR_OK(err); while (received != 1) { messages_wait_and_handle_next(); } printf("d2trigger SUCCESS!\n"); return EXIT_SUCCESS; }
int main(int argc, char *argv[]) { errval_t err; // Parse CMD Arguments bool got_apic_id = false; bool do_video_init = false; vtd_force_off = false; for (int i = 1; i < argc; i++) { if(sscanf(argv[i], "apicid=%" PRIuPTR, &my_apic_id) == 1) { got_apic_id = true; } if (strcmp(argv[i], "video_init") == 0) { do_video_init = true; } else if (strncmp(argv[i], "vtd_force_off", strlen("vtd_force_off")) == 0) { vtd_force_off = true; } } if(got_apic_id == false) { fprintf(stderr, "Usage: %s APIC_ID\n", argv[0]); fprintf(stderr, "Wrong monitor version?\n"); return EXIT_FAILURE; } err = oct_init(); if (err_is_fail(err)) { USER_PANIC_ERR(err, "Initialize dist"); } //connect to the SKB ACPI_DEBUG("acpi: connecting to the SKB...\n"); skb_client_connect(); skb_execute("[pci_queries]."); err = setup_skb_info(); if (err_is_fail(err)) { USER_PANIC_ERR(err, "Populating SKB failed."); } err = init_allocators(); if (err_is_fail(err)) { USER_PANIC_ERR(err, "Init memory allocator"); } err = copy_bios_mem(); if (err_is_fail(err)) { USER_PANIC_ERR(err, "Copy BIOS Memory"); } int r = init_acpi(); assert(r == 0); buttons_init(); if (do_video_init) { video_init(); } start_service(); messages_handler_loop(); }