[syslinux:master] com32: change clock_t to 32 bits, and in milliseconds
syslinux-bot for H. Peter Anvin
hpa at zytor.com
Mon Jul 5 15:48:14 PDT 2010
Commit-ID: a393bcdefd525c43fce16a9f50a03402533b55f4
Gitweb: http://syslinux.zytor.com/commit/a393bcdefd525c43fce16a9f50a03402533b55f4
Author: H. Peter Anvin <hpa at zytor.com>
AuthorDate: Mon, 5 Jul 2010 15:43:09 -0700
Committer: H. Peter Anvin <hpa at zytor.com>
CommitDate: Mon, 5 Jul 2010 15:43:09 -0700
com32: change clock_t to 32 bits, and in milliseconds
Previously, clock_t was 16 bits and counted timer ticks, now make it
32 bits and count milliseconds.
Signed-off-by: H. Peter Anvin <hpa at zytor.com>
---
com32/include/sys/times.h | 4 ++--
com32/lib/sys/times.c | 8 +++-----
2 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/com32/include/sys/times.h b/com32/include/sys/times.h
index 961c7b6..9047006 100644
--- a/com32/include/sys/times.h
+++ b/com32/include/sys/times.h
@@ -11,10 +11,10 @@ struct tms {
/* Empty */
};
-#define HZ 18 /* Piddly resolution... */
+#define HZ 1000
#define CLK_TCK HZ
-typedef uint16_t clock_t;
+typedef uint32_t clock_t;
clock_t times(struct tms *);
diff --git a/com32/lib/sys/times.c b/com32/lib/sys/times.c
index 12ed671..dd063f3 100644
--- a/com32/lib/sys/times.c
+++ b/com32/lib/sys/times.c
@@ -32,13 +32,11 @@
*/
#include <sys/times.h>
-#include <inttypes.h>
+#include <syslinux/pmapi.h>
#include <com32.h>
clock_t times(struct tms * buf)
{
- (void)buf; /* Ignored */
-
- /* Should we get this via INT 1Ah? */
- return *(uint16_t *) 0x46c;
+ (void)buf;
+ return *__com32.cs_pm->ms_timer;
}
More information about the Syslinux-commits
mailing list