static int fill_note_info(struct elf_note_info *info,

                          long signr, const CPUArchState *env)

{

#define NUMNOTES 3

    CPUState *cpu = ENV_GET_CPU((CPUArchState *)env);

    TaskState *ts = (TaskState *)cpu->opaque;

    int i;



    info->notes = g_malloc0(NUMNOTES * sizeof (struct memelfnote));

    if (info->notes == NULL)

        return (-ENOMEM);

    info->prstatus = g_malloc0(sizeof (*info->prstatus));

    if (info->prstatus == NULL)

        return (-ENOMEM);

    info->psinfo = g_malloc0(sizeof (*info->psinfo));

    if (info->prstatus == NULL)

        return (-ENOMEM);



    /*

     * First fill in status (and registers) of current thread

     * including process info & aux vector.

     */

    fill_prstatus(info->prstatus, ts, signr);

    elf_core_copy_regs(&info->prstatus->pr_reg, env);

    fill_note(&info->notes[0], "CORE", NT_PRSTATUS,

              sizeof (*info->prstatus), info->prstatus);

    fill_psinfo(info->psinfo, ts);

    fill_note(&info->notes[1], "CORE", NT_PRPSINFO,

              sizeof (*info->psinfo), info->psinfo);

    fill_auxv_note(&info->notes[2], ts);

    info->numnote = 3;



    info->notes_size = 0;

    for (i = 0; i < info->numnote; i++)

        info->notes_size += note_size(&info->notes[i]);



    /* read and fill status of all threads */

    cpu_list_lock();

    CPU_FOREACH(cpu) {

        if (cpu == thread_cpu) {

            continue;

        }

        fill_thread_info(info, (CPUArchState *)cpu->env_ptr);

    }

    cpu_list_unlock();



    return (0);

}

static int fill_note_info(struct elf_note_info *info,

                          long signr, const CPUArchState *env)

{

#define NUMNOTES 3

    CPUState *cpu = ENV_GET_CPU((CPUArchState *)env);

    TaskState *ts = (TaskState *)cpu->opaque;

    int i;



    info->notes = g_malloc0(NUMNOTES * sizeof (struct memelfnote));

    if (info->notes == NULL)

        return (-ENOMEM);

    info->prstatus = g_malloc0(sizeof (*info->prstatus));

    if (info->prstatus == NULL)

        return (-ENOMEM);

    info->psinfo = g_malloc0(sizeof (*info->psinfo));

    if (info->prstatus == NULL)

        return (-ENOMEM);



    







    fill_prstatus(info->prstatus, ts, signr);

    elf_core_copy_regs(&info->prstatus->pr_reg, env);

    fill_note(&info->notes[0], "CORE", NT_PRSTATUS,

              sizeof (*info->prstatus), info->prstatus);

    fill_psinfo(info->psinfo, ts);

    fill_note(&info->notes[1], "CORE", NT_PRPSINFO,

              sizeof (*info->psinfo), info->psinfo);

    fill_auxv_note(&info->notes[2], ts);

    info->numnote = 3;



    info->notes_size = 0;

    for (i = 0; i < info->numnote; i++)

        info->notes_size += note_size(&info->notes[i]);



    

    cpu_list_lock();

    CPU_FOREACH(cpu) {

        if (cpu == thread_cpu) {

            continue;

        }

        fill_thread_info(info, (CPUArchState *)cpu->env_ptr);

    }

    cpu_list_unlock();



    return (0);

}

    info->notes = g_malloc0(NUMNOTES * sizeof (struct memelfnote));
static int FUNC_0(struct elf_note_info *VAR_0,

                          long VAR_1, const CPUArchState *VAR_2)

{

#define NUMNOTES 3

    CPUState *cpu = ENV_GET_CPU((CPUArchState *)VAR_2);

    TaskState *ts = (TaskState *)cpu->opaque;

    int VAR_3;



    VAR_0->notes = g_malloc0(NUMNOTES * sizeof (struct memelfnote));

    if (VAR_0->notes == NULL)

        return (-ENOMEM);

    VAR_0->prstatus = g_malloc0(sizeof (*VAR_0->prstatus));

    if (VAR_0->prstatus == NULL)

        return (-ENOMEM);

    VAR_0->psinfo = g_malloc0(sizeof (*VAR_0->psinfo));

    if (VAR_0->prstatus == NULL)

        return (-ENOMEM);



    







    fill_prstatus(VAR_0->prstatus, ts, VAR_1);

    elf_core_copy_regs(&VAR_0->prstatus->pr_reg, VAR_2);

    fill_note(&VAR_0->notes[0], "CORE", NT_PRSTATUS,

              sizeof (*VAR_0->prstatus), VAR_0->prstatus);

    fill_psinfo(VAR_0->psinfo, ts);

    fill_note(&VAR_0->notes[1], "CORE", NT_PRPSINFO,

              sizeof (*VAR_0->psinfo), VAR_0->psinfo);

    fill_auxv_note(&VAR_0->notes[2], ts);

    VAR_0->numnote = 3;



    VAR_0->notes_size = 0;

    for (VAR_3 = 0; VAR_3 < VAR_0->numnote; VAR_3++)

        VAR_0->notes_size += note_size(&VAR_0->notes[VAR_3]);



    

    cpu_list_lock();

    CPU_FOREACH(cpu) {

        if (cpu == thread_cpu) {

            continue;

        }

        fill_thread_info(VAR_0, (CPUArchState *)cpu->env_ptr);

    }

    cpu_list_unlock();



    return (0);

}

static int FUNC_0(struct elf_note_info *VAR_0,
long VAR_1, const CPUArchState *VAR_2)
{ #define NUMNOTES 3
CPUState *cpu = ENV_GET_CPU((CPUArchState *)VAR_2); TaskState *ts = (TaskState *)cpu->opaque; int VAR_3; VAR_0->notes = g_malloc0(NUMNOTES * sizeof (struct memelfnote)); if (VAR_0->notes == NULL)
return (-ENOMEM); VAR_0->prstatus = g_malloc0(sizeof (*VAR_0->prstatus)); if (VAR_0->prstatus == NULL)
return (-ENOMEM); VAR_0->psinfo = g_malloc0(sizeof (*VAR_0->psinfo)); if (VAR_0->prstatus == NULL)
return (-ENOMEM); fill_prstatus(VAR_0->prstatus, ts, VAR_1); elf_core_copy_regs(&VAR_0->prstatus->pr_reg, VAR_2); fill_note(&VAR_0->notes[0], "CORE", NT_PRSTATUS,
sizeof (*VAR_0->prstatus), VAR_0->prstatus); fill_psinfo(VAR_0->psinfo, ts); fill_note(&VAR_0->notes[1], "CORE", NT_PRPSINFO,
sizeof (*VAR_0->psinfo), VAR_0->psinfo); fill_auxv_note(&VAR_0->notes[2], ts); VAR_0->numnote = 3; VAR_0->notes_size = 0; for (VAR_3 = 0; VAR_3 < VAR_0->numnote; VAR_3++) VAR_0->notes_size += note_size(&VAR_0->notes[VAR_3]); cpu_list_lock(); CPU_FOREACH(cpu) { if (cpu == thread_cpu) { continue; } fill_thread_info(VAR_0, (CPUArchState *)cpu->env_ptr); } cpu_list_unlock(); return (0); }