コード例 #1
0
static ofdn_t ofd_xen_props(void *m, struct domain *d, ulong shared_info)
{
    ofdn_t n;
    static const char path[] = "/xen";
    static const char console[] = "/xen/console";

    n = ofd_node_add(m, OFD_ROOT, path, sizeof (path));
    if (n > 0) {
        char xen[256];
        int xl;
        u64 val[2];
        s32 dom_id;

        dom_id = d->domain_id;

        ofd_prop_add(m, n, "reg", &dom_id, sizeof (dom_id));
        ofd_prop_add(m, n, "name", &path[1], sizeof (path) - 1);

        xl = snprintf(xen, sizeof (xen), "Xen-%d.%d%s",
                xen_major_version(), xen_minor_version(), xen_extra_version());
        ASSERT(xl < sizeof (xen));
        ofd_prop_add(m, n, "version", xen, xl + 1);

        /* convert xen pointer to guest physical */
        val[0] = shared_info;
        val[1] = PAGE_SIZE;
        ofd_prop_add(m, n, "shared-info", val, sizeof (val));

        /* reserve PAGE_SIZE @ addr shared info */
        ofd_prop_add(m, n, "reserved", val, sizeof (val));

        /* flags |= SIF_PROVILEDGED; */
        ofd_prop_add(m, n, "privileged", NULL, 0);

        /* flags |= SIF_INITDOMAIN; */
        ofd_prop_add(m, n, "initdomain", NULL, 0);

        /* tell dom0 that Xen depends on it to have power control */
        if (!rtas_entry)
            ofd_prop_add(m, n, "power-control", NULL, 0);

        /* tell dom0 where granted pages go in the linear map */
        val[0] = cpu_foreign_map_order();
        val[1] = d->arch.foreign_mfn_count;
        ofd_prop_add(m, n, "foreign-map", val, sizeof (val));

        n = ofd_node_add(m, n, console, sizeof (console));
        if (n > 0) {
            val[0] = 0;
            ofd_prop_add(m, n, "interrupts", &val[0], sizeof (val[0]));
        }
    }
    return n;
}
コード例 #2
0
ファイル: traps.c プロジェクト: toyandong/xen-4.4.0-2014
/* XXX could/should be common code */
static void print_xen_info(void)
{
    char taint_str[TAINT_STRING_MAX_LEN];

    printk("----[ Xen-%d.%d%s  %s  debug=%c  %s ]----\n",
           xen_major_version(), xen_minor_version(), xen_extra_version(),
#ifdef CONFIG_ARM_32
           "arm32",
#else
           "arm64",
#endif
           debug_build() ? 'y' : 'n', print_tainted(taint_str));
}
コード例 #3
0
ファイル: traps.c プロジェクト: Jeongseob/xen-coboost-sched
/* XXX could/should be common code */
static void print_xen_info(void)
{
    char taint_str[TAINT_STRING_MAX_LEN];
    char debug = 'n';

#ifndef NDEBUG
    debug = 'y';
#endif

    printk("----[ Xen-%d.%d%s  x86_64  debug=%c  %s ]----\n",
           xen_major_version(), xen_minor_version(), xen_extra_version(),
           debug, print_tainted(taint_str));
}
コード例 #4
0
ファイル: kexec.c プロジェクト: a2k2/xen-unstable
/* Set up the single Xen-specific-info crash note. */
crash_xen_info_t *kexec_crash_save_info(void)
{
    int cpu = smp_processor_id();
    crash_xen_info_t info;
    crash_xen_info_t *out = (crash_xen_info_t *)ELFNOTE_DESC(xen_crash_note);

    BUG_ON(!cpu_test_and_set(cpu, crash_saved_cpus));

    memset(&info, 0, sizeof(info));
    info.xen_major_version = xen_major_version();
    info.xen_minor_version = xen_minor_version();
    info.xen_extra_version = __pa(xen_extra_version());
    info.xen_changeset = __pa(xen_changeset());
    info.xen_compiler = __pa(xen_compiler());
    info.xen_compile_date = __pa(xen_compile_date());
    info.xen_compile_time = __pa(xen_compile_time());
    info.tainted = tainted;

    /* Copy from guaranteed-aligned local copy to possibly-unaligned dest. */
    memcpy(out, &info, sizeof(info));

    return out;
}