Moves profalarm.h into pthread.h
authorBarret Rhoden <brho@cs.berkeley.edu>
Thu, 18 Jun 2015 13:58:58 +0000 (09:58 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Thu, 18 Jun 2015 16:03:26 +0000 (12:03 -0400)
Due to an upcoming change, we don't want any non-glibc pthread header files,
since they will sit directly in sysroot/usr/include.  That being said, futex.h
is probably okay.

Also, fixes up a discrepancy between the declaration and definition of
enable_profalarm().  Not sure why that compiled before...

user/pthread/profalarm.c
user/pthread/profalarm.h [deleted file]
user/pthread/pthread.h
user/utest/pvcalarm.c

index 9052079..d7ca1e1 100644 (file)
@@ -5,7 +5,7 @@
 #include <pthread.h>
 #include <pvcalarm.h>
 
-void pvcalarm_callback()
+void pvcalarm_callback(void)
 {
        if (current_uthread)
                pthread_kill((pthread_t)current_uthread, SIGPROF);
@@ -16,7 +16,7 @@ void enable_profalarm(uint64_t usecs)
        enable_pvcalarms(PVCALARM_PROF, usecs, pvcalarm_callback);
 }
 
-void disable_profalarm()
+void disable_profalarm(void)
 {
        disable_pvcalarms();
 }
diff --git a/user/pthread/profalarm.h b/user/pthread/profalarm.h
deleted file mode 100644 (file)
index 27cbe62..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Copyright (c) 2014 The Regents of the University of California
- * Kevin Klues <klueska@cs.berkeley.edu>
- * See LICENSE for details. */
-
-#ifndef PTHREAD_PROFALARM_H
-#define PTHREAD_PROFALARM_H
-
-__BEGIN_DECLS
-
-void enable_profalarm(int hz);
-void disable_profalarm();
-
-__END_DECLS
-
-#endif /* PTHREAD_PROFALARM_H */
index aaada32..ecb603a 100644 (file)
@@ -151,6 +151,10 @@ void pthread_need_tls(bool need);                  /* default is TRUE */
 void pthread_lib_init(void);
 void __pthread_generic_yield(struct pthread_tcb *pthread);
 
+/* Profiling alarms for pthreads.  (profalarm.c) */
+void enable_profalarm(uint64_t usecs);
+void disable_profalarm(void);
+
 /* The pthreads API */
 int pthread_attr_init(pthread_attr_t *);
 int pthread_attr_destroy(pthread_attr_t *);
index c562de3..dd3df13 100644 (file)
@@ -1,7 +1,6 @@
 #include <utest.h>
 #include <pthread.h>
 #include <pvcalarm.h>
-#include <profalarm.h>
 
 TEST_SUITE("PVCALARMS");