WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] pvops dom0 acpi processor cleanup

To: Jeremy Fitzhardinge <Jeremy.Fitzhardinge@xxxxxxxxxx>
Subject: [Xen-devel] [PATCH] pvops dom0 acpi processor cleanup
From: "Yu, Ke" <ke.yu@xxxxxxxxx>
Date: Thu, 10 Dec 2009 20:27:07 +0800
Accept-language: en-US
Acceptlanguage: en-US
Cc: Xen-Devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Thu, 10 Dec 2009 04:27:33 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Acp5lBafrGySM6a6SySehz0NVCli7g==
Thread-topic: [PATCH] pvops dom0 acpi processor cleanup
acpi processor cleanup

    remove unnecessary macro to reduce the dependency between acpi processor
    driver and xen acpi processor driver, so that make it easy to de-couple
    them in the future.
 
    Signed-off-by: Yu Ke <ke.yu@xxxxxxxxx>

diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
index b75098d..df9b8d5 100644
--- a/drivers/acpi/processor_core.c
+++ b/drivers/acpi/processor_core.c
@@ -1005,9 +1005,8 @@ int acpi_processor_device_add(acpi_handle handle, struct 
acpi_device **device)
        if (!pr)
                return -ENODEV;
 
-       if (processor_cntl_xen())
-               processor_cntl_xen_notify(pr,
-                       PROCESSOR_HOTPLUG, HOTPLUG_TYPE_ADD);
+    processor_cntl_xen_notify(pr,
+            PROCESSOR_HOTPLUG, HOTPLUG_TYPE_ADD);
 
        if ((pr->id >= 0) && (pr->id < nr_cpu_ids)) {
                kobject_uevent(&(*device)->dev.kobj, KOBJ_ONLINE);
@@ -1048,18 +1047,16 @@ static void __ref 
acpi_processor_hotplug_notify(acpi_handle handle,
                        break;
                }
 
-               if (processor_cntl_xen())
-                       processor_cntl_xen_notify(pr,
-                                       PROCESSOR_HOTPLUG, HOTPLUG_TYPE_ADD);
+        processor_cntl_xen_notify(pr,
+                PROCESSOR_HOTPLUG, HOTPLUG_TYPE_ADD);
 
                if (pr->id >= 0 && (pr->id < nr_cpu_ids)) {
                        kobject_uevent(&device->dev.kobj, KOBJ_OFFLINE);
                        break;
                }
 
-               if (processor_cntl_xen())
-                       processor_cntl_xen_notify(pr, PROCESSOR_HOTPLUG,
-                                                       HOTPLUG_TYPE_REMOVE);
+        processor_cntl_xen_notify(pr, PROCESSOR_HOTPLUG,
+                HOTPLUG_TYPE_REMOVE);
 
                result = acpi_processor_start(device);
                if ((!result) && ((pr->id >= 0) && (pr->id < nr_cpu_ids))) {
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index 1b382e2..8157ecc 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -458,8 +458,7 @@ static int acpi_processor_get_power_info_cst(struct 
acpi_processor *pr)
                cx.power = obj->integer.value;
 
                /* cache control methods to notify xen*/
-               if (processor_cntl_xen_pm())
-                       processor_cntl_xen_power_cache(pr->acpi_id, i, reg);
+        processor_cntl_xen_power_cache(pr->acpi_id, i, reg);
 
                current_count++;
                memcpy(&(pr->power.states[current_count]), &cx, sizeof(cx));
diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c
index 84db5c8..8e3cd82 100644
--- a/drivers/acpi/processor_perflib.c
+++ b/drivers/acpi/processor_perflib.c
@@ -170,9 +170,6 @@ int xen_acpi_processor_ppc_has_changed(struct 
acpi_processor *pr)
 {
        int ret;
 
-       if (!processor_cntl_xen_pmperf())
-               return 0;
-
        ret = acpi_processor_get_platform_limit(pr);
 
        if (ret < 0)
diff --git a/drivers/xen/acpi_processor.c b/drivers/xen/acpi_processor.c
index 7348949..5715c8f 100644
--- a/drivers/xen/acpi_processor.c
+++ b/drivers/xen/acpi_processor.c
@@ -69,30 +69,6 @@ int processor_cntl_xen_power_cache(int cpu, int cx,
 }
 EXPORT_SYMBOL(processor_cntl_xen_power_cache);
 
-int processor_cntl_xen(void)
-{
-       return 1;
-}
-EXPORT_SYMBOL(processor_cntl_xen);
-
-int processor_cntl_xen_pm(void)
-{
-       return (xen_ops.pm_ops[PM_TYPE_IDLE] != NULL);
-}
-EXPORT_SYMBOL(processor_cntl_xen_pm);
-
-int processor_cntl_xen_pmperf(void)
-{
-       return  (xen_ops.pm_ops[PM_TYPE_PERF] != NULL);
-}
-EXPORT_SYMBOL(processor_cntl_xen_pmperf);
-
-int processor_cntl_xen_pmthr(void)
-{
-       return (xen_ops.pm_ops[PM_TYPE_THR] != NULL);
-}
-EXPORT_SYMBOL(processor_cntl_xen_pmthr);
-
 int processor_cntl_xen_notify(struct acpi_processor *pr, int event, int type)
 {
        int ret = -EINVAL;
diff --git a/include/xen/acpi.h b/include/xen/acpi.h
index 8506688..3e7eab4 100644
--- a/include/xen/acpi.h
+++ b/include/xen/acpi.h
@@ -50,20 +50,12 @@ int (*pm_ops[PM_TYPE_MAX])(struct acpi_processor *pr, int 
event);
        int (*hotplug)(struct acpi_processor *pr, int type);
 };
 
-extern int processor_cntl_xen(void);
-extern int processor_cntl_xen_pm(void);
-extern int processor_cntl_xen_pmperf(void);
-extern int processor_cntl_xen_pmthr(void);
 extern int processor_cntl_xen_notify(struct acpi_processor *pr,
                        int event, int type);
 extern int processor_cntl_xen_power_cache(int cpu, int cx,
                struct acpi_power_register *reg);
 #else
 
-static inline int processor_cntl_xen(void) { return 0; }
-static inline int processor_cntl_xen_pm(void) { return 0; }
-static inline int processor_cntl_xen_pmperf(void) { return 0; }
-static inline int processor_cntl_xen_pmthr(void) { return 0; }
 static inline int processor_cntl_xen_notify(struct acpi_processor *pr,
                        int event, int type)
 {

Attachment: pvop-acpi-processor-cleanup.patch
Description: pvop-acpi-processor-cleanup.patch

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>