[PATCH 3/5] rt-tests: Move header files from src/lib to src/include

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Move header files from src/lib to src/include and adjust the Makefile to
reflect this change.

Signed-off-by: John Kacur <jkacur@xxxxxxxxxx>
---
 Makefile                 |    2 +-
 src/include/rt-get_cpu.h |   46 ++++++++++++++++++++++++++++++++++++++++++++++
 src/include/rt-utils.h   |   11 +++++++++++
 src/lib/rt-get_cpu.h     |   46 ----------------------------------------------
 src/lib/rt-utils.h       |   11 -----------
 5 files changed, 58 insertions(+), 58 deletions(-)
 create mode 100644 src/include/rt-get_cpu.h
 create mode 100644 src/include/rt-utils.h
 delete mode 100644 src/lib/rt-get_cpu.h
 delete mode 100644 src/lib/rt-utils.h

diff --git a/Makefile b/Makefile
index df5a2f4..b30a139 100644
--- a/Makefile
+++ b/Makefile
@@ -11,7 +11,7 @@ bindir  ?= $(prefix)/bin
 mandir	?= $(prefix)/share/man
 srcdir	?= $(prefix)/src
 
-CFLAGS = -D_GNU_SOURCE -Wall -Wno-nonnull -Isrc/lib -Isrc/include
+CFLAGS = -D_GNU_SOURCE -Wall -Wno-nonnull -Isrc/include
 
 ifndef DEBUG
 	CFLAGS	+= -O2
diff --git a/src/include/rt-get_cpu.h b/src/include/rt-get_cpu.h
new file mode 100644
index 0000000..15d05fc
--- /dev/null
+++ b/src/include/rt-get_cpu.h
@@ -0,0 +1,46 @@
+#ifndef __RT_GET_CPU_H
+#define __RT_GET_CPU_H
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <unistd.h>
+#include <sys/syscall.h>   /* For SYS_xxx definitions */
+#include <sched.h>
+#include <dlfcn.h>
+#ifdef __NR_getcpu
+static inline int get_cpu_setup(void) { return 0; }
+static inline int get_cpu(void)
+{
+        int c,s;
+	/* Show the source of get_cpu */
+#ifdef DEBUG
+	fprintf(stderr, "__NR_getcpu\n");
+#endif
+        s = syscall(__NR_getcpu, &c, NULL, NULL);
+        return (s == -1) ? s : c;
+}
+#elif defined(__GLIBC__) && defined(__GLIBC_MINOR__)	\
+	&& __GLIBC__>=2 && __GLIBC_MINOR__>=6
+#include <utmpx.h>
+static inline int get_cpu_setup(void) { return 0; }
+static inline int get_cpu(void) { return sched_getcpu(); }
+#else
+extern int get_cpu_setup(void);
+extern int (*get_cpu)(void);
+extern int (*get_cpu_vdsop)(unsigned int *, unsigned int *, void *);
+
+static inline int getcpu_vdso(void)
+{
+	unsigned int c,s;
+	/* Show the source of get_cpu */
+#ifdef DEBUG
+	fprintf(stderr, "getcpu_vdso\n");
+#endif
+	s = get_cpu_vdsop(&c, NULL, NULL);
+        return (s == -1) ? s : c;
+}
+
+#endif
+
+#endif	/* __RT_GET_CPU_H */
+
diff --git a/src/include/rt-utils.h b/src/include/rt-utils.h
new file mode 100644
index 0000000..cc23c33
--- /dev/null
+++ b/src/include/rt-utils.h
@@ -0,0 +1,11 @@
+#ifndef __RT_UTILS_H
+#define __RT_UTILS_H
+
+#define _STR(x) #x
+#define STR(x) _STR(x)
+#define MAX_PATH 256
+
+int check_privs(void);
+char *get_debugfileprefix(void);
+
+#endif	/* __RT_UTILS.H */
diff --git a/src/lib/rt-get_cpu.h b/src/lib/rt-get_cpu.h
deleted file mode 100644
index 15d05fc..0000000
--- a/src/lib/rt-get_cpu.h
+++ /dev/null
@@ -1,46 +0,0 @@
-#ifndef __RT_GET_CPU_H
-#define __RT_GET_CPU_H
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <unistd.h>
-#include <sys/syscall.h>   /* For SYS_xxx definitions */
-#include <sched.h>
-#include <dlfcn.h>
-#ifdef __NR_getcpu
-static inline int get_cpu_setup(void) { return 0; }
-static inline int get_cpu(void)
-{
-        int c,s;
-	/* Show the source of get_cpu */
-#ifdef DEBUG
-	fprintf(stderr, "__NR_getcpu\n");
-#endif
-        s = syscall(__NR_getcpu, &c, NULL, NULL);
-        return (s == -1) ? s : c;
-}
-#elif defined(__GLIBC__) && defined(__GLIBC_MINOR__)	\
-	&& __GLIBC__>=2 && __GLIBC_MINOR__>=6
-#include <utmpx.h>
-static inline int get_cpu_setup(void) { return 0; }
-static inline int get_cpu(void) { return sched_getcpu(); }
-#else
-extern int get_cpu_setup(void);
-extern int (*get_cpu)(void);
-extern int (*get_cpu_vdsop)(unsigned int *, unsigned int *, void *);
-
-static inline int getcpu_vdso(void)
-{
-	unsigned int c,s;
-	/* Show the source of get_cpu */
-#ifdef DEBUG
-	fprintf(stderr, "getcpu_vdso\n");
-#endif
-	s = get_cpu_vdsop(&c, NULL, NULL);
-        return (s == -1) ? s : c;
-}
-
-#endif
-
-#endif	/* __RT_GET_CPU_H */
-
diff --git a/src/lib/rt-utils.h b/src/lib/rt-utils.h
deleted file mode 100644
index cc23c33..0000000
--- a/src/lib/rt-utils.h
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef __RT_UTILS_H
-#define __RT_UTILS_H
-
-#define _STR(x) #x
-#define STR(x) _STR(x)
-#define MAX_PATH 256
-
-int check_privs(void);
-char *get_debugfileprefix(void);
-
-#endif	/* __RT_UTILS.H */
-- 
1.6.5.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [RT Stable]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux