Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Feb 2012 23:15:21 +0000 (UTC)
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r232132 - head/sys/dev/acpica/Osd
Message-ID:  <201202242315.q1ONFLTm088275@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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@FreeBSD.org>
+ * Copyright (c) 2007-2012 Jung-uk Kim <jkim@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);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201202242315.q1ONFLTm088275>