[kgtp] r915 committed - Move gtprs2rsp.c to mmap dir....

  • From: kgtp@xxxxxxxxxxxxxx
  • To: kgtp@xxxxxxxxxxxxx
  • Date: Mon, 13 Feb 2012 04:23:18 +0000

Revision: 915
Author:   teawater
Date:     Sun Feb 12 20:22:03 2012
Log:      Move gtprs2rsp.c to mmap dir.
Update mmap dir.

http://code.google.com/p/kgtp/source/detail?r=915

Added:
 /branches/mmap/gtprb2rsp.c
Deleted:
 /branches/hotcode/gtprb2rsp.c
Modified:
 /branches/mmap/gtp.c
 /branches/mmap/gtp_rb.c

=======================================
--- /dev/null
+++ /branches/mmap/gtprb2rsp.c  Sun Feb 12 20:22:03 2012
@@ -0,0 +1,41 @@
+/*
+ * Translate gtpframe_pipe mmap to GDB rsp format.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * Copyright(C) KGTP team (https://code.google.com/p/kgtp/), 2012
+ */
+
+#include <sys/types.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdint.h>
+#include <sys/vfs.h>
+#include <signal.h>
+
+#define GTP_FRAME_PIPE_DIR     "/sys/kernel/debug/gtpframe_pipe"
+
+int
+main(int argc,char *argv[],char *envp[])
+{
+
+
+       return 0;
+}
=======================================
--- /branches/hotcode/gtprb2rsp.c       Mon Feb  6 17:28:08 2012
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Translate gtpframe_pipe mmap to GDB rsp format.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * Copyright(C) KGTP team (https://code.google.com/p/kgtp/), 2012
- */
-
-#include <sys/types.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <errno.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <stdint.h>
-#include <sys/vfs.h>
-#include <signal.h>
-
-#define GTP_FRAME_PIPE_DIR     "/sys/kernel/debug/gtpframe_pipe"
-
-int
-main(int argc,char *argv[],char *envp[])
-{
-
-
-       return 0;
-}
=======================================
--- /branches/mmap/gtp.c        Sat Feb  4 00:32:45 2012
+++ /branches/mmap/gtp.c        Sun Feb 12 20:22:03 2012
@@ -8759,6 +8759,34 @@

        return ret;
 }
+
+static int     gtpframe_pipe_mmap_block;
+static int     gtpframe_pipe_mmap_cpu;
+
+static int
+gtpframe_pipe_mmap(struct file *file, struct vm_area_struct *vma)
+{
+       down(&gtp_rw_lock);
+
+
+       up(&gtp_rw_lock);
+}
+
+#define GTP_FRAME_PIPE_MMAP_CPU                _IOW('G', 1, unsigned long)
+#define GTP_FRAME_PIPE_MMAP_WAIT       _IO('G', 2)
+
+static long
+gtpframe_pipe_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
+{
+       switch (cmd) {
+       case GTP_FRAME_PIPE_MMAP_CPU:
+               break;
+       case GTP_FRAME_PIPE_MMAP_WAIT:
+               break;
+       defalut:
+               return -EINVAL;
+       }
+}
 #endif

 static const struct file_operations gtp_operations = {
@@ -8791,6 +8819,12 @@
        .release        = gtpframe_pipe_release,
        .read           = gtpframe_pipe_read,
        .llseek         = gtpframe_pipe_llseek,
+       .mmap           = gtpframe_pipe_mmap,
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35))
+       .ioctl          = gtpframe_pipe_ioctl,
+#else
+       .unlocked_ioctl = gtpframe_pipe_ioctl,
+#endif
 };
 #endif

=======================================
--- /branches/mmap/gtp_rb.c     Sat Feb  4 00:49:25 2012
+++ /branches/mmap/gtp_rb.c     Sun Feb 12 20:22:03 2012
@@ -413,6 +413,14 @@

        return 0;
 }
+
+static int
+gtp_rb_is_empty()
+{
+       int                     cpu;
+       for_each_online_cpu(cpu) {
+
+}

 static void *
 gtp_rb_get_page(struct gtp_rb_s *rb)

Other related posts:

  • » [kgtp] r915 committed - Move gtprs2rsp.c to mmap dir.... - kgtp