예제 #1
0
파일: mp_tables.c 프로젝트: amodj/Utopia
/* create_mp_tables - creates MP tables for the guest based upon config data */
void create_mp_tables(void)
{
    void *mp_table_base;
    char *p;
    int vcpu_nr, i, length;

    vcpu_nr = hvm_info->nr_vcpus;

    printf("Creating MP tables ...\n");

    /* Find the 'safe' place in ROMBIOS for the MP tables. */
    mp_table_base = get_mp_table_start();
    if ( mp_table_base == NULL )
    {
        printf("Couldn't find start point for MP tables\n");
        return;
    }

    p = mp_table_base + sizeof(struct mp_config_table);

    for ( i = 0; i < vcpu_nr; i++ )
    {
        fill_mp_proc_entry((struct mp_proc_entry *)p, i);
        p += sizeof(struct mp_proc_entry);
    }

    fill_mp_bus_entry((struct mp_bus_entry *)p, BUS_ID_ISA, BUS_TYPE_STR_ISA);
    p += sizeof(struct mp_bus_entry);

    fill_mp_ioapic_entry((struct mp_ioapic_entry *)p);
    p += sizeof(struct mp_ioapic_entry);

    for ( i = 0; i < 16; i++ )
    {
        if ( i == 2 ) continue; /* skip the slave PIC connection */
        fill_mp_io_intr_entry((struct mp_io_intr_entry *)p,
                              BUS_ID_ISA, i, IOAPIC_ID, (i == 0) ? 2 : i);
        p += sizeof(struct mp_io_intr_entry);
    }

    length = p - (char *)mp_table_base;

    /* find the next 16-byte boundary to place the mp floating pointer */
    while ( (unsigned long)p & 0xF )
        p++;

    fill_mpfps((struct mp_floating_pointer_struct *)p,
               (uint32_t)mp_table_base);

    fill_mp_config_table((struct mp_config_table *)mp_table_base, length);
    reset_bios_checksum();
}
예제 #2
0
파일: rombios.c 프로젝트: CPFL/gxen
static void rombios_create_mp_tables(void)
{
    /* Find the 'safe' place in ROMBIOS for the MP tables. */
    void *table = get_mp_table_start();

    if ( table == NULL )
    {
        printf("Couldn't find start point for MP tables\n");
        return;
    }

    create_mp_tables(table);

    reset_bios_checksum();
}