summaryrefslogtreecommitdiffstats
path: root/package/gdb
Commit message (Expand)AuthorAgeFilesLines
* gdb: use an updated 6.8a tarballFlorian Fainelli2012-02-141-3/+4
* package/gdb: disable expat properly, remove conditional dependency on libexpa...Nicolas Thill2011-10-091-4/+4
* gdb: add dependency to libexpat when presentJonas Gorski2011-08-011-2/+3
* gdb: There are dep issues with cconfig.h. Disable parallel build for now.Michael Büsch2010-10-261-1/+1
* gdb: Enable parallel buildMichael Büsch2010-10-091-1/+3
* cleanup Makefiles (#7212)Jo-Philipp Wich2010-04-231-0/+1
* this patch fixes gdb parallel build.Travis Kemen2010-03-141-12/+18
* gdb: not support on crisNicolas Thill2009-12-221-1/+1
* gdb: fix build failure with arm targetsNicolas Thill2009-12-201-1/+3
* gdb: don't build on avr32Nicolas Thill2009-10-051-0/+1
* gdb: have both gdb & gdbserver share defaultsNicolas Thill2009-10-051-7/+10
* get rid of $Id$ - it has never helped us and it has broken too many patches ;)Felix Fietkau2009-04-171-1/+0
* gdb: fix gdbserver subpackage, cleanupNicolas Thill2009-02-231-7/+6
* gdb: upgrade to 6.8, fixes libreadline compilation issuesAndy Boyett2009-01-162-325/+5
* replace the gdbserver package with a full gdb package that also includes gdbs...Felix Fietkau2009-01-132-0/+388
0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
#include <xen/config.h>
#include <xen/init.h>
#include <xen/types.h>
#include <xen/lib.h>
#include <xen/sched.h>
#include <asm/fixmap.h>
#include <asm/page.h>
#include <asm/processor.h>
#include <asm/tboot.h>

/* tboot=<physical address of shared page> */
static char opt_tboot[20] = "";
string_param("tboot", opt_tboot);

/* Global pointer to shared data; NULL means no measured launch. */
tboot_shared_t *g_tboot_shared;

static const uuid_t tboot_shared_uuid = TBOOT_SHARED_UUID;

void __init tboot_probe(void)
{
    tboot_shared_t *tboot_shared;
    unsigned long p_tboot_shared;

    /* Look for valid page-aligned address for shared page. */
    p_tboot_shared = simple_strtoul(opt_tboot, NULL, 0);
    if ( (p_tboot_shared == 0) || ((p_tboot_shared & ~PAGE_MASK) != 0) )
        return;

    /* Map and check for tboot UUID. */
    set_fixmap(FIX_TBOOT_SHARED_BASE, p_tboot_shared);
    tboot_shared = (tboot_shared_t *)fix_to_virt(FIX_TBOOT_SHARED_BASE);
    if ( memcmp(&tboot_shared_uuid, (uuid_t *)tboot_shared, sizeof(uuid_t)) )
        return;

    g_tboot_shared = tboot_shared;
    printk("TBOOT: found shared page at phys addr %lx:\n", p_tboot_shared);
    printk("  version: %d\n", tboot_shared->version);
    printk("  log_addr: 0x%08x\n", tboot_shared->log_addr);
    printk("  shutdown_entry32: 0x%08x\n", tboot_shared->shutdown_entry32);
    printk("  shutdown_entry64: 0x%08x\n", tboot_shared->shutdown_entry64);
    printk("  shutdown_type: %d\n", tboot_shared->shutdown_type);
    printk("  s3_tb_wakeup_entry: 0x%08x\n", tboot_shared->s3_tb_wakeup_entry);
    printk("  s3_k_wakeup_entry: 0x%08x\n", tboot_shared->s3_k_wakeup_entry);
    printk("  &acpi_sinfo: 0x%p\n", &tboot_shared->acpi_sinfo);
    if ( tboot_shared->version >= 0x02 )
    {
        printk("  tboot_base: 0x%08x\n", tboot_shared->tboot_base);
        printk("  tboot_size: 0x%x\n", tboot_shared->tboot_size);
    }
}

void tboot_shutdown(uint32_t shutdown_type)
{
    uint32_t map_base, map_size;
    int err;

    g_tboot_shared->shutdown_type = shutdown_type;

    local_irq_disable();

    /* Create identity map for tboot shutdown code. */
    if ( g_tboot_shared->version >= 0x02 )
    {
        map_base = PFN_DOWN(g_tboot_shared->tboot_base);
        map_size = PFN_UP(g_tboot_shared->tboot_size);
    }
    else
    {
        map_base = 0;
        map_size = PFN_UP(0xa0000);
    }

    err = map_pages_to_xen(map_base << PAGE_SHIFT, map_base, map_size,
                           __PAGE_HYPERVISOR);
    if ( err != 0 )
    {
        printk("error (0x%x) mapping tboot pages (mfns) @ 0x%x, 0x%x\n", err,
               map_base, map_size);
        return;
    }

    write_ptbase(idle_vcpu[0]);

#ifdef __x86_64__
    asm volatile ( "call *%%rdi" :: "D" (g_tboot_shared->shutdown_entry64) );
#else
    asm volatile ( "call *%0" :: "r" (g_tboot_shared->shutdown_entry32) );
#endif

    BUG(); /* should not reach here */
}

int tboot_in_measured_env(void)
{
    return (g_tboot_shared != NULL);
}

int tboot_in_range(paddr_t start, paddr_t end)
{
    if ( g_tboot_shared == NULL || g_tboot_shared->version < 0x02 )
        return 0;

    start = max_t(paddr_t, start, g_tboot_shared->tboot_base);
    end = min_t(paddr_t, end, 
                g_tboot_shared->tboot_base + g_tboot_shared->tboot_size);
 
    return start < end; 
}

/*
 * Local variables:
 * mode: C
 * c-set-style: "BSD"
 * c-basic-offset: 4
 * tab-width: 4
 * indent-tabs-mode: nil
 * End:
 */