Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


Linux kernel compatability enhancements (through 3.19)
[palacios.git] / linux_module / iface-pstate-ctrl.c
index 9b3e4bb..2c49be9 100644 (file)
@@ -939,8 +939,22 @@ static int governor_switch(char * s, unsigned int cpu)
     argv[3] = NULL;
 
     /* KCH: we can't wait here to actually see if we succeeded, we're in interrupt context */
-    return call_usermodehelper_fns("/bin/sh", argv, envp, UMH_NO_WAIT, NULL, gov_switch_cleanup, NULL);
 
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(3,9,0)
+    return call_usermodehelper_fns("/bin/sh", argv, envp, UMH_NO_WAIT, NULL, gov_switch_cleanup, NULL);
+#else
+    {
+      struct subprocess_info *sp;
+      
+      sp = call_usermodehelper_setup("/bin/sh", argv, envp, GFP_ATOMIC, NULL, gov_switch_cleanup, NULL);
+      if (!sp) { 
+       goto out_freeargv;
+      }
+      
+      return call_usermodehelper_exec(sp,0);
+    }
+#endif
+      
 out_freeargv:
     palacios_free(argv);
     return -1;
@@ -1740,27 +1754,22 @@ int pstate_proc_setup(void)
     struct proc_dir_entry *proc;
     struct proc_dir_entry *prochw;
 
-    proc = create_proc_entry("v3-dvfs",0444, palacios_get_procdir());
+    PAL_PROC_CREATE(proc,"v3-dvfs",0444,palacios_get_procdir(),&pstate_fops);
 
     if (!proc) { 
         ERROR("Failed to create proc entry for p-state control\n");
         return -1;
     }
 
-    proc->proc_fops = &pstate_fops;
-
     INFO("/proc/v3vee/v3-dvfs successfully created\n");
 
-    prochw = create_proc_entry("v3-dvfs-hw",0444,palacios_get_procdir());
-
+    PAL_PROC_CREATE(prochw,"v3-dvfs-hw",0444,palacios_get_procdir(),&pstate_hw_fops);
 
     if (!prochw) { 
         ERROR("Failed to create proc entry for p-state hw info\n");
         return -1;
     }
 
-    prochw->proc_fops = &pstate_hw_fops;
-
     INFO("/proc/v3vee/v3-dvfs-hw successfully created\n");
 
     return 0;