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.


DVFS - added forgotten user-space library
Peter Dinda [Wed, 20 Aug 2014 14:35:38 +0000 (09:35 -0500)]
linux_usr/v3_user_dvfs.c [new file with mode: 0644]
linux_usr/v3_user_dvfs.h [new file with mode: 0644]

diff --git a/linux_usr/v3_user_dvfs.c b/linux_usr/v3_user_dvfs.c
new file mode 100644 (file)
index 0000000..8d4d930
--- /dev/null
@@ -0,0 +1,76 @@
+#include <unistd.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <malloc.h>
+#include <string.h>
+#include <stdio.h>
+
+#include "v3_ctrl.h"
+#include "v3_user_dvfs.h"
+
+int v3_user_dvfs_acquire_direct(uint32_t core)
+{
+    struct v3_dvfs_ctrl_request r;
+
+    r.cmd=V3_DVFS_ACQUIRE;
+    r.acq_type=V3_DVFS_DIRECT;
+    r.pcore=core;
+    r.freq_khz=0;
+    r.pstate=0;
+
+    return v3_dev_ioctl(V3_DVFS_CTRL,&r);
+}
+
+int v3_user_dvfs_acquire_external(uint32_t core)
+{
+    struct v3_dvfs_ctrl_request r;
+
+    r.cmd=V3_DVFS_ACQUIRE;
+    r.acq_type=V3_DVFS_EXTERNAL;
+    r.pcore=core;
+    r.freq_khz=0;
+    r.pstate=0;
+
+    return v3_dev_ioctl(V3_DVFS_CTRL,&r);
+}
+
+int v3_user_dvfs_release(uint32_t core)
+{
+    struct v3_dvfs_ctrl_request r;
+
+    r.cmd=V3_DVFS_RELEASE;
+    r.acq_type=V3_DVFS_DIRECT;
+    r.pcore=core;
+    r.freq_khz=0;
+    r.pstate=0;
+
+    return v3_dev_ioctl(V3_DVFS_CTRL,&r);
+}
+
+
+int v3_user_dvfs_set_pstate(uint32_t core, uint8_t pstate)
+{
+    struct v3_dvfs_ctrl_request r;
+
+    r.cmd=V3_DVFS_SETPSTATE;
+    r.acq_type=V3_DVFS_DIRECT;
+    r.pcore=core;
+    r.freq_khz=0;
+    r.pstate=pstate;
+
+    return v3_dev_ioctl(V3_DVFS_CTRL,&r);
+}
+
+int v3_user_dvfs_set_freq(uint32_t core, uint64_t freq_khz)
+{
+    struct v3_dvfs_ctrl_request r;
+
+    r.cmd=V3_DVFS_SETFREQ;
+    r.acq_type=V3_DVFS_EXTERNAL;
+    r.pcore=core;
+    r.freq_khz=freq_khz;
+    r.pstate=0;
+
+    return v3_dev_ioctl(V3_DVFS_CTRL,&r);
+}
+
diff --git a/linux_usr/v3_user_dvfs.h b/linux_usr/v3_user_dvfs.h
new file mode 100644 (file)
index 0000000..12e02e0
--- /dev/null
@@ -0,0 +1,19 @@
+#ifndef _V3_USER_DVFS_
+#define _V3_USER_DVFS_
+
+#include <stdint.h>
+#include "v3_ctrl.h"
+#include "iface-pstate-ctrl.h"
+
+// Use these together
+int v3_user_dvfs_acquire_direct(uint32_t core); 
+int v3_user_dvfs_set_pstate(uint32_t core, uint8_t pstate);
+
+// Use these together
+int v3_user_dvfs_acquire_external(uint32_t core); 
+int v3_user_dvfs_set_freq(uint32_t core, uint64_t freq_khz);
+
+int v3_user_dvfs_release(uint32_t core); 
+
+#endif
+