svn commit: r232132 - head/sys/dev/acpica/Osd
Jung-uk Kim
jkim at FreeBSD.org
Fri Feb 24 23:15:22 UTC 2012
Author: jkim
Date: Fri Feb 24 23:15:21 2012
New Revision: 232132
URL: http://svn.freebsd.org/changeset/base/232132
Log:
Fix a long-standing bug for AcpiOsGetTimer(). time_t is 32-bit on i386 and
it needs proper casting before multiplication.
MFC after: 3 days
Modified:
head/sys/dev/acpica/Osd/OsdSchedule.c
Modified: head/sys/dev/acpica/Osd/OsdSchedule.c
==============================================================================
--- head/sys/dev/acpica/Osd/OsdSchedule.c Fri Feb 24 20:42:47 2012 (r232131)
+++ head/sys/dev/acpica/Osd/OsdSchedule.c Fri Feb 24 23:15:21 2012 (r232132)
@@ -1,7 +1,7 @@
/*-
* Copyright (c) 2000 Michael Smith
* Copyright (c) 2000 BSDi
- * Copyright (c) 2007-2009 Jung-uk Kim <jkim at FreeBSD.org>
+ * Copyright (c) 2007-2012 Jung-uk Kim <jkim at FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -248,8 +248,8 @@ AcpiOsGetTimer(void)
KASSERT(cold == 0, ("acpi: timer op not yet supported during boot"));
binuptime(&bt);
- t = ((UINT64)10000000 * (uint32_t)(bt.frac >> 32)) >> 32;
- t += bt.sec * 10000000;
+ t = (uint64_t)bt.sec * 10000000;
+ t += ((uint64_t)10000000 * (uint32_t)(bt.frac >> 32)) >> 32;
return (t);
}
More information about the svn-src-head
mailing list