Example #1
0
// TODO: Every subfunction have a return value.
hvmm_status_t khypervisor_init()
{
    hvmm_status_t status;

    __malloc_init();
    memory_init();
    if ((status = interrupt_init()) == HVMM_STATUS_UNKNOWN_ERROR) {
        printf("[%s] interrupt initialization failed\n", __func__);
        return status;
    }

    setup_timer();
    if ((status = timer_init(_timer_irq)) == HVMM_STATUS_UNKNOWN_ERROR) {
        printf("[%s] timer initialization failed\n", __func__);
        return status;
    }

    if ((status = vdev_init()) == HVMM_STATUS_UNKNOWN_ERROR) {
        printf("[%s] vdev initialization failed\n", __func__);
        return status;
    }

    // FIXME: Currently, testing routines for vdev are failed
    if ((status = basic_tests_run(PLATFORM_BASIC_TESTS)) == HVMM_STATUS_UNKNOWN_ERROR) {
        printf("[%s] basic testing failed\n", __func__);
        //return status;
        status = HVMM_STATUS_SUCCESS;
    }

    return status;
}
Example #2
0
int poseidon_fm_init(struct poseidon *p)
{
    struct video_device *fm_dev;

    fm_dev = vdev_init(p, &poseidon_fm_template);
    if (fm_dev == NULL)
        return -1;

    if (video_register_device(fm_dev, VFL_TYPE_RADIO, -1) < 0) {
        video_device_release(fm_dev);
        return -1;
    }
    p->radio_data.fm_dev = fm_dev;
    return 0;
}
Example #3
0
void init_system()
{
    uint8_t cpuid = smp_processor_id();

    setup_vector();

    setup_httbr((uint32_t) &__HYP_PGTABLE);

    setup_mem_attr();

    if (cpuid == 0) {
        // TODO(wonseok) console init will be moved dev_init().
        console_init();

        libc_init();
    }

    irq_init();

    //enable_traps();

    if (cpuid == 0) {
        paging_create((addr_t) &__HYP_PGTABLE);

        platform_init();

        dev_init(); /* we don't have */

        vdev_init(); /* Already we have */

        timer_hw_init(NS_PL2_PTIMER_IRQ);

        setup_vm_mmap();

#ifdef CONFIG_SMP
        printf("wake up...other CPUs\n");
        secondary_smp_pen = 1;
#endif
    }
    printf("%s[%d]: CPU[%d]\n", __func__, __LINE__, cpuid);

    enable_mmu();

    start_hypervisor();
}
Example #4
0
/*
 * Update all disk labels, generate a fresh config based on the current
 * in-core state, and sync the global config cache (do not sync the config
 * cache if this is a booting rootpool).
 */
void
spa_config_update_common(spa_t *spa, int what, boolean_t isroot)
{
    vdev_t *rvd = spa->spa_root_vdev;
    uint64_t txg;
    int c;

    ASSERT(MUTEX_HELD(&spa_namespace_lock));

    spa_config_enter(spa, RW_WRITER, FTAG);
    txg = spa_last_synced_txg(spa) + 1;
    if (what == SPA_CONFIG_UPDATE_POOL) {
        vdev_config_dirty(rvd);
    } else {
        /*
         * If we have top-level vdevs that were added but have
         * not yet been prepared for allocation, do that now.
         * (It's safe now because the config cache is up to date,
         * so it will be able to translate the new DVAs.)
         * See comments in spa_vdev_add() for full details.
         */
        for (c = 0; c < rvd->vdev_children; c++) {
            vdev_t *tvd = rvd->vdev_child[c];
            if (tvd->vdev_ms_array == 0) {
                vdev_init(tvd, txg);
                vdev_config_dirty(tvd);
            }
        }
    }
    spa_config_exit(spa, FTAG);

    /*
     * Wait for the mosconfig to be regenerated and synced.
     */
    txg_wait_synced(spa->spa_dsl_pool, txg);

    /*
     * Update the global config cache to reflect the new mosconfig.
     */
    if (!isroot)
        spa_config_sync(spa, B_FALSE, what != SPA_CONFIG_UPDATE_POOL);

    if (what == SPA_CONFIG_UPDATE_POOL)
        spa_config_update_common(spa, SPA_CONFIG_UPDATE_VDEVS, isroot);
}
Example #5
0
void up_initialize(void)
{
    extern pidhash_t g_pidhash[];
    extern void vdev_init(void);
    extern void nuttx_arch_init(void);

    // initialize the current_task to g_idletcb
    current_task = g_pidhash[PIDHASH(0)].tcb;

    // OS memory alloc system is ready
    use_os_kmalloc = 1;

    // rgmp vdev init
    vdev_init();

    nuttx_arch_init();

    // enable interrupt
    local_irq_enable();
}