summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell King <rmk@arm.linux.org.uk>2012-10-22 13:04:05 +0100
committerroot <root@cubox.(none)>2012-10-22 14:57:04 +0100
commit75843921f1aff8f5221f7ac7df19a897db94eb6f (patch)
tree7c3478c44cacb11a502fadcfad6ec7c5d8ff2cf8
parentf94fd1d14e8cbda841f7c7a716e494c35f395825 (diff)
Move private definitions to bmm_lib_priv.h
-rw-r--r--Makefile.am2
-rw-r--r--bmm_lib.c1
-rw-r--r--bmm_lib.h32
-rw-r--r--bmm_lib_priv.h48
4 files changed, 50 insertions, 33 deletions
diff --git a/Makefile.am b/Makefile.am
index e7fa10d..c7f124b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -5,7 +5,7 @@ libbmm_la_LTLIBRARIES = libbmm.la
libbmm_ladir = $(libdir)
libbmm_la_LDFLAGS = -avoid-version -no-undefined -shrext .so.@ABI_VERSION@ \
-export-symbols-regex "bmm_*"
-libbmm_la_SOURCES = bmm_lib.c
+libbmm_la_SOURCES = bmm_lib.c bmm_lib_priv.h
libbmm_laincludedir = $(includedir)
libbmm_lainclude_HEADERS = bmm_lib.h
diff --git a/bmm_lib.c b/bmm_lib.c
index 043c6c8..433dbef 100644
--- a/bmm_lib.c
+++ b/bmm_lib.c
@@ -18,6 +18,7 @@
#include <fcntl.h>
#include <unistd.h>
+#include "bmm_lib_priv.h"
#include "bmm_lib.h"
//#define DEBUG
diff --git a/bmm_lib.h b/bmm_lib.h
index 56e4a3c..90c8893 100644
--- a/bmm_lib.h
+++ b/bmm_lib.h
@@ -14,36 +14,6 @@
#if !defined (__BMM_LIB_H__)
#define __BMM_LIB_H__
-#define BMM_MINOR (94)
-
-typedef struct {
- unsigned long input; /* the starting address of the block of memory */
- unsigned long output; /* the starting address of the block of memory */
- unsigned long length; /* the length of the block of memory */
- unsigned long arg; /* the arg of cmd */
-} ioctl_arg_t;
-
-#define BMEM_IOCTL_MAGIC 'G'
-/* ioctl commands */
-#define BMM_MALLOC _IOWR(BMEM_IOCTL_MAGIC, 0, ioctl_arg_t)
-#define BMM_FREE _IOWR(BMEM_IOCTL_MAGIC, 1, ioctl_arg_t)
-#define BMM_GET_VIRT_ADDR _IOWR(BMEM_IOCTL_MAGIC, 2, ioctl_arg_t)
-#define BMM_GET_PHYS_ADDR _IOWR(BMEM_IOCTL_MAGIC, 3, ioctl_arg_t)
-#define BMM_GET_MEM_ATTR _IOWR(BMEM_IOCTL_MAGIC, 4, ioctl_arg_t)
-#define BMM_SET_MEM_ATTR _IOWR(BMEM_IOCTL_MAGIC, 5, ioctl_arg_t)
-#define BMM_GET_MEM_SIZE _IOWR(BMEM_IOCTL_MAGIC, 6, ioctl_arg_t)
-#define BMM_GET_TOTAL_SPACE _IOWR(BMEM_IOCTL_MAGIC, 7, ioctl_arg_t)
-#define BMM_GET_FREE_SPACE _IOWR(BMEM_IOCTL_MAGIC, 8, ioctl_arg_t)
-#define BMM_FLUSH_CACHE _IOWR(BMEM_IOCTL_MAGIC, 9, ioctl_arg_t)
-#define BMM_DMA_MEMCPY _IOWR(BMEM_IOCTL_MAGIC, 10, ioctl_arg_t)
-#define BMM_DMA_SYNC _IOWR(BMEM_IOCTL_MAGIC, 11, ioctl_arg_t)
-#define BMM_CONSISTENT_SYNC _IOWR(BMEM_IOCTL_MAGIC, 12, ioctl_arg_t)
-#define BMM_DUMP _IOWR(BMEM_IOCTL_MAGIC, 13, ioctl_arg_t)
-#define BMM_GET_ALLOCATED_SPACE _IOWR(BMEM_IOCTL_MAGIC, 14, ioctl_arg_t)
-#define BMM_GET_KERN_PHYS_ADDR _IOWR(BMEM_IOCTL_MAGIC, 15, ioctl_arg_t)
-#define BMM_SYNC_USER _IOWR(BMEM_IOCTL_MAGIC, 16, ioctl_arg_t)
-
-
/* ioctl arguments: memory attributes */
#define BMM_ATTR_DEFAULT (0) /* cacheable bufferable */
#define BMM_ATTR_WRITECOMBINE (1 << 0) /* non-cacheable & bufferable */
@@ -64,8 +34,6 @@ typedef struct {
#define BMM_DMA_FROM_DEVICE (2) /* DMA_FROM_DEVICE */
#define BMM_DMA_NONE (3) /* DMA_NONE */
-#define BMM_DEVICE_FILE "/dev/bmm"
-
#if defined (__cplusplus)
extern "C" {
#endif
diff --git a/bmm_lib_priv.h b/bmm_lib_priv.h
new file mode 100644
index 0000000..ea71ffa
--- /dev/null
+++ b/bmm_lib_priv.h
@@ -0,0 +1,48 @@
+/*
+ * bmm_lib_priv.h
+ *
+ * Buffer Management Module
+ *
+ * User level BMM Defines/Globals/Functions
+ *
+ * Li Li (lea.li@marvell.com)
+
+ *(C) Copyright 2007 Marvell International Ltd.
+ * All Rights Reserved
+ */
+
+#ifndef __BMM_LIB_PRIV_H__
+#define __BMM_LIB_PRIV_H__
+
+#define BMM_MINOR (94)
+
+typedef struct {
+ unsigned long input; /* the starting address of the block of memory */
+ unsigned long output; /* the starting address of the block of memory */
+ unsigned long length; /* the length of the block of memory */
+ unsigned long arg; /* the arg of cmd */
+} ioctl_arg_t;
+
+#define BMEM_IOCTL_MAGIC 'G'
+/* ioctl commands */
+#define BMM_MALLOC _IOWR(BMEM_IOCTL_MAGIC, 0, ioctl_arg_t)
+#define BMM_FREE _IOWR(BMEM_IOCTL_MAGIC, 1, ioctl_arg_t)
+#define BMM_GET_VIRT_ADDR _IOWR(BMEM_IOCTL_MAGIC, 2, ioctl_arg_t)
+#define BMM_GET_PHYS_ADDR _IOWR(BMEM_IOCTL_MAGIC, 3, ioctl_arg_t)
+#define BMM_GET_MEM_ATTR _IOWR(BMEM_IOCTL_MAGIC, 4, ioctl_arg_t)
+#define BMM_SET_MEM_ATTR _IOWR(BMEM_IOCTL_MAGIC, 5, ioctl_arg_t)
+#define BMM_GET_MEM_SIZE _IOWR(BMEM_IOCTL_MAGIC, 6, ioctl_arg_t)
+#define BMM_GET_TOTAL_SPACE _IOWR(BMEM_IOCTL_MAGIC, 7, ioctl_arg_t)
+#define BMM_GET_FREE_SPACE _IOWR(BMEM_IOCTL_MAGIC, 8, ioctl_arg_t)
+#define BMM_FLUSH_CACHE _IOWR(BMEM_IOCTL_MAGIC, 9, ioctl_arg_t)
+#define BMM_DMA_MEMCPY _IOWR(BMEM_IOCTL_MAGIC, 10, ioctl_arg_t)
+#define BMM_DMA_SYNC _IOWR(BMEM_IOCTL_MAGIC, 11, ioctl_arg_t)
+#define BMM_CONSISTENT_SYNC _IOWR(BMEM_IOCTL_MAGIC, 12, ioctl_arg_t)
+#define BMM_DUMP _IOWR(BMEM_IOCTL_MAGIC, 13, ioctl_arg_t)
+#define BMM_GET_ALLOCATED_SPACE _IOWR(BMEM_IOCTL_MAGIC, 14, ioctl_arg_t)
+#define BMM_GET_KERN_PHYS_ADDR _IOWR(BMEM_IOCTL_MAGIC, 15, ioctl_arg_t)
+#define BMM_SYNC_USER _IOWR(BMEM_IOCTL_MAGIC, 16, ioctl_arg_t)
+
+#define BMM_DEVICE_FILE "/dev/bmm"
+
+#endif /* __BMM_LIB_PRIV_H__ */