cstate.c 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * arch/i386/kernel/acpi/cstate.c
  3. *
  4. * Copyright (C) 2005 Intel Corporation
  5. * Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
  6. * - Added _PDC for SMP C-states on Intel CPUs
  7. */
  8. #include <linux/kernel.h>
  9. #include <linux/module.h>
  10. #include <linux/init.h>
  11. #include <linux/acpi.h>
  12. #include <acpi/processor.h>
  13. #include <asm/acpi.h>
  14. /*
  15. * Initialize bm_flags based on the CPU cache properties
  16. * On SMP it depends on cache configuration
  17. * - When cache is not shared among all CPUs, we flush cache
  18. * before entering C3.
  19. * - When cache is shared among all CPUs, we use bm_check
  20. * mechanism as in UP case
  21. *
  22. * This routine is called only after all the CPUs are online
  23. */
  24. void acpi_processor_power_init_bm_check(struct acpi_processor_flags *flags,
  25. unsigned int cpu)
  26. {
  27. struct cpuinfo_x86 *c = cpu_data + cpu;
  28. flags->bm_check = 0;
  29. if (num_online_cpus() == 1)
  30. flags->bm_check = 1;
  31. else if (c->x86_vendor == X86_VENDOR_INTEL) {
  32. /*
  33. * Today all CPUs that support C3 share cache.
  34. * TBD: This needs to look at cache shared map, once
  35. * multi-core detection patch makes to the base.
  36. */
  37. flags->bm_check = 1;
  38. }
  39. }
  40. EXPORT_SYMBOL(acpi_processor_power_init_bm_check);