powernow-k7.c (6a33fc8cacfc7fac829c72bd321868be7e72f609) powernow-k7.c (d5b73cd870e2b049ef566aec2791dbf5fd26a7ec)
1/*
2 * AMD K7 Powernow driver.
3 * (C) 2003 Dave Jones on behalf of SuSE Labs.
4 * (C) 2003-2004 Dave Jones <davej@redhat.com>
5 *
6 * Licensed under the terms of the GNU GPL License version 2.
7 * Based upon datasheets & sample CPUs kindly provided by AMD.
8 *

--- 163 unchanged lines hidden (view full) ---

172#endif
173
174static int get_ranges(unsigned char *pst)
175{
176 unsigned int j;
177 unsigned int speed;
178 u8 fid, vid;
179
1/*
2 * AMD K7 Powernow driver.
3 * (C) 2003 Dave Jones on behalf of SuSE Labs.
4 * (C) 2003-2004 Dave Jones <davej@redhat.com>
5 *
6 * Licensed under the terms of the GNU GPL License version 2.
7 * Based upon datasheets & sample CPUs kindly provided by AMD.
8 *

--- 163 unchanged lines hidden (view full) ---

172#endif
173
174static int get_ranges(unsigned char *pst)
175{
176 unsigned int j;
177 unsigned int speed;
178 u8 fid, vid;
179
180 powernow_table = kzalloc((sizeof(struct cpufreq_frequency_table) *
180 powernow_table = kzalloc((sizeof(*powernow_table) *
181 (number_scales + 1)), GFP_KERNEL);
182 if (!powernow_table)
183 return -ENOMEM;
184
185 for (j = 0 ; j < number_scales; j++) {
186 fid = *pst++;
187
188 powernow_table[j].frequency = (fsb * fid_codes[fid]) / 10;

--- 115 unchanged lines hidden (view full) ---

304 int retval = 0;
305 union powernow_acpi_control_t pc;
306
307 if (acpi_processor_perf != NULL && powernow_table != NULL) {
308 retval = -EINVAL;
309 goto err0;
310 }
311
181 (number_scales + 1)), GFP_KERNEL);
182 if (!powernow_table)
183 return -ENOMEM;
184
185 for (j = 0 ; j < number_scales; j++) {
186 fid = *pst++;
187
188 powernow_table[j].frequency = (fsb * fid_codes[fid]) / 10;

--- 115 unchanged lines hidden (view full) ---

304 int retval = 0;
305 union powernow_acpi_control_t pc;
306
307 if (acpi_processor_perf != NULL && powernow_table != NULL) {
308 retval = -EINVAL;
309 goto err0;
310 }
311
312 acpi_processor_perf = kzalloc(sizeof(struct acpi_processor_performance),
313 GFP_KERNEL);
312 acpi_processor_perf = kzalloc(sizeof(*acpi_processor_perf), GFP_KERNEL);
314 if (!acpi_processor_perf) {
315 retval = -ENOMEM;
316 goto err0;
317 }
318
319 if (!zalloc_cpumask_var(&acpi_processor_perf->shared_cpu_map,
320 GFP_KERNEL)) {
321 retval = -ENOMEM;

--- 19 unchanged lines hidden (view full) ---

341
342 number_scales = acpi_processor_perf->state_count;
343
344 if (number_scales < 2) {
345 retval = -ENODEV;
346 goto err2;
347 }
348
313 if (!acpi_processor_perf) {
314 retval = -ENOMEM;
315 goto err0;
316 }
317
318 if (!zalloc_cpumask_var(&acpi_processor_perf->shared_cpu_map,
319 GFP_KERNEL)) {
320 retval = -ENOMEM;

--- 19 unchanged lines hidden (view full) ---

340
341 number_scales = acpi_processor_perf->state_count;
342
343 if (number_scales < 2) {
344 retval = -ENODEV;
345 goto err2;
346 }
347
349 powernow_table = kzalloc((sizeof(struct cpufreq_frequency_table) *
348 powernow_table = kzalloc((sizeof(*powernow_table) *
350 (number_scales + 1)), GFP_KERNEL);
351 if (!powernow_table) {
352 retval = -ENOMEM;
353 goto err2;
354 }
355
356 pc.val = (unsigned long) acpi_processor_perf->states[0].control;
357 for (i = 0; i < number_scales; i++) {

--- 134 unchanged lines hidden (view full) ---

492 latency = 100;
493 }
494 pr_debug("Settling Time: %d microseconds.\n",
495 psb->settlingtime);
496 pr_debug("Has %d PST tables. (Only dumping ones "
497 "relevant to this CPU).\n",
498 psb->numpst);
499
349 (number_scales + 1)), GFP_KERNEL);
350 if (!powernow_table) {
351 retval = -ENOMEM;
352 goto err2;
353 }
354
355 pc.val = (unsigned long) acpi_processor_perf->states[0].control;
356 for (i = 0; i < number_scales; i++) {

--- 134 unchanged lines hidden (view full) ---

491 latency = 100;
492 }
493 pr_debug("Settling Time: %d microseconds.\n",
494 psb->settlingtime);
495 pr_debug("Has %d PST tables. (Only dumping ones "
496 "relevant to this CPU).\n",
497 psb->numpst);
498
500 p += sizeof(struct psb_s);
499 p += sizeof(*psb);
501
502 pst = (struct pst_s *) p;
503
504 for (j = 0; j < psb->numpst; j++) {
505 pst = (struct pst_s *) p;
506 number_scales = pst->numpstates;
507
508 if ((etuple == pst->cpuid) &&
509 check_fsb(pst->fsbspeed) &&
510 (maxfid == pst->maxfid) &&
511 (startvid == pst->startvid)) {
512 print_pst_entry(pst, j);
500
501 pst = (struct pst_s *) p;
502
503 for (j = 0; j < psb->numpst; j++) {
504 pst = (struct pst_s *) p;
505 number_scales = pst->numpstates;
506
507 if ((etuple == pst->cpuid) &&
508 check_fsb(pst->fsbspeed) &&
509 (maxfid == pst->maxfid) &&
510 (startvid == pst->startvid)) {
511 print_pst_entry(pst, j);
513 p = (char *)pst + sizeof(struct pst_s);
512 p = (char *)pst + sizeof(*pst);
514 ret = get_ranges(p);
515 return ret;
516 } else {
517 unsigned int k;
513 ret = get_ranges(p);
514 return ret;
515 } else {
516 unsigned int k;
518 p = (char *)pst + sizeof(struct pst_s);
517 p = (char *)pst + sizeof(*pst);
519 for (k = 0; k < number_scales; k++)
520 p += 2;
521 }
522 }
523 printk(KERN_INFO PFX "No PST tables match this cpuid "
524 "(0x%x)\n", etuple);
525 printk(KERN_INFO PFX "This is indicative of a broken "
526 "BIOS.\n");

--- 220 unchanged lines hidden ---
518 for (k = 0; k < number_scales; k++)
519 p += 2;
520 }
521 }
522 printk(KERN_INFO PFX "No PST tables match this cpuid "
523 "(0x%x)\n", etuple);
524 printk(KERN_INFO PFX "This is indicative of a broken "
525 "BIOS.\n");

--- 220 unchanged lines hidden ---