From: John Kacur <jkacur@redhat.com>
To: Clark Williams <williams@redhat.com>,
Carsten Emde <carsten.emde@osadl.org>
Cc: John Kacur <jkacur@redhat.com>,
rt-users <linux-rt-users@vger.kernel.org>,
Thomas Gleixner <tglx@linutronix.de>
Subject: [PATCH 3/5] rt-tests: Move header files from src/lib to src/include
Date: Wed, 23 Dec 2009 17:02:58 +0100 [thread overview]
Message-ID: <1261584180-13922-4-git-send-email-jkacur@redhat.com> (raw)
In-Reply-To: <1261584180-13922-3-git-send-email-jkacur@redhat.com>
Move header files from src/lib to src/include and adjust the Makefile to
reflect this change.
Signed-off-by: John Kacur <jkacur@redhat.com>
---
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);
next prev parent reply other threads:[~2009-12-23 16:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-23 16:02 [PATCH 0/5] *** Add new priority inversion test, plus lib changes *** John Kacur
2009-12-23 16:02 ` [PATCH 1/5] rt-tests: Add error routines to the library John Kacur
2009-12-23 16:02 ` [PATCH 2/5] rt-tests: Add a new test pip - priority inheritance with processes John Kacur
2009-12-23 16:02 ` John Kacur [this message]
2009-12-23 16:02 ` [PATCH 4/5] rt-tests: pip - Use check_privs() from the rt-utils library John Kacur
2009-12-23 16:03 ` [PATCH 5/5] rt-tests: Add a "make tags" option John Kacur
2009-12-23 22:52 ` [PATCH 2/5] rt-tests: Add a new test pip - priority inheritance with processes Carsten Emde
2009-12-23 23:25 ` John Kacur
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1261584180-13922-4-git-send-email-jkacur@redhat.com \
--to=jkacur@redhat.com \
--cc=carsten.emde@osadl.org \
--cc=linux-rt-users@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=williams@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).