]> rtime.felk.cvut.cz Git - jailhouse.git/commitdiff
core: Rename CPU suspension state variables
authorJan Kiszka <jan.kiszka@siemens.com>
Thu, 25 Sep 2014 05:56:29 +0000 (07:56 +0200)
committerJan Kiszka <jan.kiszka@siemens.com>
Thu, 25 Sep 2014 13:51:33 +0000 (15:51 +0200)
Rename stop_cpu and cpu_stopped to suspend_cpu and cpu_suspended. This
is more consistent with the function names that manipulate the CPU
state.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
hypervisor/arch/arm/include/asm/percpu.h
hypervisor/arch/x86/control.c
hypervisor/arch/x86/include/asm/percpu.h
hypervisor/control.c

index eda19192e4cdad970149fc0113e8ace2735d6126..448612f0fb5e36709fd5812f8c1149636ba728c7 100644 (file)
@@ -43,11 +43,7 @@ struct per_cpu {
 //     unsigned long linux_ip;
        bool initialized;
 
-       volatile bool stop_cpu;
-       volatile bool wait_for_sipi;
-       volatile bool cpu_stopped;
-       bool init_signaled;
-       int sipi_vector;
+       volatile bool cpu_suspended;
        bool flush_caches;
        bool shutdown_cpu;
        int shutdown_state;
index e0c0ec970a7aad28b557ece596c23c1431ae7f5b..b775b140e7e233584c084f9a6a59197261e8e995 100644 (file)
@@ -128,19 +128,19 @@ void arch_shutdown(void)
 void arch_suspend_cpu(unsigned int cpu_id)
 {
        struct per_cpu *target_data = per_cpu(cpu_id);
-       bool target_stopped;
+       bool target_suspended;
 
        spin_lock(&target_data->control_lock);
 
-       target_data->stop_cpu = true;
-       target_stopped = target_data->cpu_stopped;
+       target_data->suspend_cpu = true;
+       target_suspended = target_data->cpu_suspended;
 
        spin_unlock(&target_data->control_lock);
 
-       if (!target_stopped) {
+       if (!target_suspended) {
                apic_send_nmi_ipi(target_data);
 
-               while (!target_data->cpu_stopped)
+               while (!target_data->cpu_suspended)
                        cpu_relax();
        }
 }
@@ -150,7 +150,7 @@ void arch_resume_cpu(unsigned int cpu_id)
        /* make any state changes visible before releasing the CPU */
        memory_barrier();
 
-       per_cpu(cpu_id)->stop_cpu = false;
+       per_cpu(cpu_id)->suspend_cpu = false;
 }
 
 void arch_reset_cpu(unsigned int cpu_id)
@@ -212,17 +212,17 @@ int x86_handle_events(struct per_cpu *cpu_data)
        spin_lock(&cpu_data->control_lock);
 
        do {
-               if (cpu_data->init_signaled && !cpu_data->stop_cpu) {
+               if (cpu_data->init_signaled && !cpu_data->suspend_cpu) {
                        x86_enter_wait_for_sipi(cpu_data);
                        sipi_vector = -1;
                        break;
                }
 
-               cpu_data->cpu_stopped = true;
+               cpu_data->cpu_suspended = true;
 
                spin_unlock(&cpu_data->control_lock);
 
-               while (cpu_data->stop_cpu)
+               while (cpu_data->suspend_cpu)
                        cpu_relax();
 
                if (cpu_data->shutdown_cpu) {
@@ -233,7 +233,7 @@ int x86_handle_events(struct per_cpu *cpu_data)
 
                spin_lock(&cpu_data->control_lock);
 
-               cpu_data->cpu_stopped = false;
+               cpu_data->cpu_suspended = false;
 
                if (cpu_data->sipi_vector >= 0) {
                        if (!cpu_data->failed) {
index a169be4a588b9a6b1f76dafcb31ca99c4ec41c5d..4b63c0692ed389be2531b1a639e4fa55b707c8eb 100644 (file)
@@ -64,8 +64,8 @@ struct per_cpu {
 
        /*
         * protects the following per_cpu fields (unless CPU is stopped):
-        *  - stop_cpu
-        *  - cpu_stopped (except for spinning on it to become true)
+        *  - suspend_cpu
+        *  - cpu_suspended (except for spinning on it to become true)
         *  - wait_for_sipi
         *  - init_signaled
         *  - sipi_vector
@@ -73,9 +73,9 @@ struct per_cpu {
         */
        spinlock_t control_lock;
 
-       volatile bool stop_cpu;
+       volatile bool suspend_cpu;
        volatile bool wait_for_sipi;
-       volatile bool cpu_stopped;
+       volatile bool cpu_suspended;
        bool init_signaled;
        int sipi_vector;
        bool flush_virt_caches;
index ca279658a74fd4c07f0cb61b301ca7c9bca52292..7b3fbd831c11a330423224a2d269b51316f90513 100644 (file)
@@ -809,7 +809,7 @@ void panic_stop(void)
 {
        panic_printk("Stopping CPU %d (Cell: \"%s\")\n", this_cpu_id(),
                     this_cell()->config->name);
-       this_cpu_data()->cpu_stopped = true;
+       this_cpu_data()->cpu_suspended = true;
 
        if (phys_processor_id() == panic_cpu)
                panic_in_progress = 0;