~ubuntu-branches/ubuntu/trusty/makedumpfile/trusty

« back to all changes in this revision

Viewing changes to sadump_info.c

  • Committer: Package Import Robot
  • Author(s): John Wright
  • Date: 2012-07-16 04:01:21 UTC
  • mfrom: (1.1.7) (7.1.7 sid)
  • Revision ID: package-import@ubuntu.com-20120716040121-h1lmu3tfl2kkn2oh
New upstream version

Show diffs side-by-side

added added

removed removed

Lines of Context:
46
46
                          KEXEC_CORE_NOTE_DESC_BYTES )
47
47
 
48
48
#define for_each_online_cpu(cpu)                                        \
49
 
        for (cpu = 0; cpu < BITPERBYTE * si->cpumask_size; ++cpu)       \
 
49
        for (cpu = 0; cpu < max_mask_cpu(); ++cpu)      \
50
50
                if (is_online_cpu(cpu))
51
51
 
52
52
enum {
95
95
static unsigned long long pfn_to_block(unsigned long long pfn);
96
96
static int lookup_diskset(unsigned long long whole_offset, int *diskid,
97
97
                          unsigned long long *disk_offset);
 
98
static int max_mask_cpu(void);
98
99
static int cpu_online_mask_init(void);
99
100
static int per_cpu_init(void);
100
101
static int get_data_from_elf_note_desc(const char *note_buf, uint32_t n_descsz,
799
800
}
800
801
 
801
802
static int
 
803
max_mask_cpu(void)
 
804
{
 
805
        return BITPERBYTE * si->cpumask_size;
 
806
}
 
807
 
 
808
static int
802
809
cpu_online_mask_init(void)
803
810
{
804
811
        ulong cpu_online_mask_addr;
1289
1296
{
1290
1297
        unsigned long mask;
1291
1298
 
 
1299
        if (cpu < 0 || cpu >= max_mask_cpu())
 
1300
                return FALSE;
 
1301
 
1292
1302
        mask = ULONG(si->cpu_online_mask_buf +
1293
1303
                     (cpu / BITPERWORD) * sizeof(unsigned long));
1294
1304
 
1300
1310
{
1301
1311
        unsigned long addr;
1302
1312
 
1303
 
        if (cpu < 0 || cpu >= get_nr_cpus())
 
1313
        if (!is_online_cpu(cpu))
1304
1314
                return 0UL;
1305
1315
 
1306
1316
        if (!readmem(VADDR, ~ptr + cpu*sizeof(unsigned long), &addr,
1313
1323
static unsigned long
1314
1324
per_cpu_ptr(unsigned long ptr, int cpu)
1315
1325
{
1316
 
        if (cpu < 0 || cpu >= get_nr_cpus())
 
1326
        if (!is_online_cpu(cpu))
1317
1327
                return 0UL;
1318
1328
 
1319
1329
        if (si->__per_cpu_offset[cpu] == si->__per_cpu_load)
1329
1339
        char note_buf[KEXEC_NOTE_BYTES], zero_buf[KEXEC_NOTE_BYTES];
1330
1340
        char *prstatus_ptr;
1331
1341
 
1332
 
        if (cpu < 0 || get_nr_cpus() <= cpu)
 
1342
        if (!is_online_cpu(cpu))
1333
1343
                return FALSE;
1334
1344
 
1335
1345
        if (SYMBOL(crash_notes) == NOT_FOUND_SYMBOL)