~ubuntu-branches/ubuntu/raring/crash/raring

« back to all changes in this revision

Viewing changes to xen_hyper.c

  • Committer: Package Import Robot
  • Author(s): Stefan Bader
  • Date: 2012-10-25 16:29:52 UTC
  • mfrom: (0.1.17) (25.1.1 raring-proposed)
  • Revision ID: package-import@ubuntu.com-20121025162952-e42hkuic0u4h94p0
Tags: 6.1.0-1ubuntu1
* Merge from Debian unstable (LP: #1064475). Remaining changes:
  - debian/patches/01_spu_commands.patch
    + Provides SPU extension support
    + Enable SPU extension only on PPC (using .mk logic)
  - debian/rules:
    + Always build extensions and package them.
    + Cleanup for extensions

Show diffs side-by-side

added added

removed removed

Lines of Context:
64
64
        machdep->get_smp_cpus();
65
65
        machdep->memory_size();
66
66
 
67
 
#ifdef IA64
68
67
        if (symbol_exists("__per_cpu_offset")) {
69
68
                xht->flags |= XEN_HYPER_SMP;
70
69
                if((xht->__per_cpu_offset = malloc(sizeof(ulong) * XEN_HYPER_MAX_CPUS())) == NULL) {
76
75
                        error(FATAL, "cannot read __per_cpu_offset.\n");
77
76
                }
78
77
        }
79
 
#endif
80
78
 
81
79
#if defined(X86) || defined(X86_64)
82
80
        if (symbol_exists("__per_cpu_shift")) {
399
397
        XEN_HYPER_STRUCT_SIZE_INIT(schedule_data, "schedule_data");
400
398
        XEN_HYPER_MEMBER_OFFSET_INIT(schedule_data_schedule_lock, "schedule_data", "schedule_lock");
401
399
        XEN_HYPER_MEMBER_OFFSET_INIT(schedule_data_curr, "schedule_data", "curr");
402
 
        XEN_HYPER_MEMBER_OFFSET_INIT(schedule_data_idle, "schedule_data", "idle");
 
400
        if (MEMBER_EXISTS("schedule_data", "idle"))
 
401
                XEN_HYPER_MEMBER_OFFSET_INIT(schedule_data_idle, "schedule_data", "idle");
403
402
        XEN_HYPER_MEMBER_OFFSET_INIT(schedule_data_sched_priv, "schedule_data", "sched_priv");
404
403
        XEN_HYPER_MEMBER_OFFSET_INIT(schedule_data_s_timer, "schedule_data", "s_timer");
405
404
        XEN_HYPER_MEMBER_OFFSET_INIT(schedule_data_tick, "schedule_data", "tick");
541
540
                }
542
541
                schc->cpu_id = cpuid;
543
542
                schc->curr = ULONG(buf + XEN_HYPER_OFFSET(schedule_data_curr));
544
 
                schc->idle = ULONG(buf + XEN_HYPER_OFFSET(schedule_data_idle));
 
543
                if (MEMBER_EXISTS("schedule_data", "idle"))
 
544
                        schc->idle = ULONG(buf + XEN_HYPER_OFFSET(schedule_data_idle));
 
545
                else
 
546
                        schc->idle = xht->idle_vcpu_array[cpuid];
545
547
                schc->sched_priv =
546
548
                        ULONG(buf + XEN_HYPER_OFFSET(schedule_data_sched_priv));
547
549
                if (XEN_HYPER_VALID_MEMBER(schedule_data_tick))
633
635
        }
634
636
 
635
637
        /* allocate a context area */
636
 
        size = sizeof(struct xen_hyper_dumpinfo_context) * XEN_HYPER_MAX_CPUS();
 
638
        size = sizeof(struct xen_hyper_dumpinfo_context) * machdep->get_smp_cpus();
637
639
        if((xhdit->context_array = malloc(size)) == NULL) {
638
640
                error(FATAL, "cannot malloc dumpinfo table context space.\n");
639
641
        }
640
642
        BZERO(xhdit->context_array, size);
641
 
        size = sizeof(struct xen_hyper_dumpinfo_context_xen_core) * XEN_HYPER_MAX_CPUS();
 
643
        size = sizeof(struct xen_hyper_dumpinfo_context_xen_core) * machdep->get_smp_cpus();
642
644
        if((xhdit->context_xen_core_array = malloc(size)) == NULL) {
643
645
                error(FATAL, "cannot malloc dumpinfo table context_xen_core_array space.\n");
644
646
        }
645
647
        BZERO(xhdit->context_xen_core_array, size);
646
648
        addr = symbol_value("per_cpu__crash_notes");
647
 
        for (i = 0; i < XEN_HYPER_MAX_CPUS(); i++) {
 
649
        for (i = 0; i < machdep->get_smp_cpus(); i++) {
648
650
                ulong addr_notes;
649
651
 
650
652
                addr_notes = xen_hyper_per_cpu(addr, i);
1879
1881
        uint *cpu_idx;
1880
1882
        int i, j, cpus;
1881
1883
 
1882
 
        get_symbol_data("max_cpus", sizeof(xht->max_cpus), &xht->max_cpus);
1883
1884
        XEN_HYPER_STRUCT_SIZE_INIT(cpumask_t, "cpumask_t");
1884
 
        if (XEN_HYPER_SIZE(cpumask_t) * 8 > xht->max_cpus) {
1885
 
                xht->max_cpus = XEN_HYPER_SIZE(cpumask_t) * 8;
1886
 
        }
 
1885
        xht->max_cpus = XEN_HYPER_SIZE(cpumask_t) * 8;
 
1886
 
1887
1887
        if (xht->cpumask) {
1888
1888
                free(xht->cpumask);
1889
1889
        }