aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@linux.intel.com>2011-02-17 22:03:27 +0000
committerH. Peter Anvin <hpa@linux.intel.com>2011-02-17 15:59:53 -0800
commitd3c3e191b8e2515422d7e38d2fcc8df05d1faff7 (patch)
tree39b493462b736c319aafcec5eaefea07e647dc61
parenta7ded880aa0f475ba6fdf1f70db690d1ccf9e31d (diff)
downloadsyslinux-d3c3e191b8e2515422d7e38d2fcc8df05d1faff7.tar.gz
syslinux-d3c3e191b8e2515422d7e38d2fcc8df05d1faff7.tar.xz
syslinux-d3c3e191b8e2515422d7e38d2fcc8df05d1faff7.zip
sys/times.h: Mark times() static inline
As times() is just an accessor function for accessing __ms_timer it's worth marking it as static inline so that we don't incur any function call overhead just for accessing a symbol. Signed-off-by: Matt Fleming <matt.fleming@linux.intel.com> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
-rw-r--r--com32/include/sys/times.h8
-rw-r--r--com32/lib/sys/times.c42
2 files changed, 7 insertions, 43 deletions
diff --git a/com32/include/sys/times.h b/com32/include/sys/times.h
index 90470063..5eda2954 100644
--- a/com32/include/sys/times.h
+++ b/com32/include/sys/times.h
@@ -16,6 +16,12 @@ struct tms {
typedef uint32_t clock_t;
-clock_t times(struct tms *);
+extern volatile uint32_t __ms_timer;
+
+static inline clock_t times(struct tms *buf)
+{
+ (void)buf;
+ return __ms_timer;
+}
#endif /* _SYS_TIMES_H */
diff --git a/com32/lib/sys/times.c b/com32/lib/sys/times.c
deleted file mode 100644
index 518ba822..00000000
--- a/com32/lib/sys/times.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/* ----------------------------------------------------------------------- *
- *
- * Copyright 2004-2008 H. Peter Anvin - All Rights Reserved
- *
- * Permission is hereby granted, free of charge, to any person
- * obtaining a copy of this software and associated documentation
- * files (the "Software"), to deal in the Software without
- * restriction, including without limitation the rights to use,
- * copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom
- * the Software is furnished to do so, subject to the following
- * conditions:
- *
- * The above copyright notice and this permission notice shall
- * be included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * ----------------------------------------------------------------------- */
-
-/*
- * sys/times.c
- *
- * Returns something like a clock.
- */
-
-#include <sys/times.h>
-#include <syslinux/pmapi.h>
-#include <com32.h>
-
-clock_t times(struct tms * buf)
-{
- (void)buf;
- return __ms_timer;
-}