Add constants for fast path resume copying
[coreboot.git] / payloads / libpayload / libc / time.c
index b49879b9d81d933394ad3d8081940ddbbb78e74c..67675623a467e8397b450d3f2b4f8bc5b9f92d84 100644 (file)
  * SUCH DAMAGE.
  */
 
-/** @file libc/time.c
- * @brief General Time Functions
+/**
+ * @file libc/time.c
+ * General time functions
  */
 
-#include <config.h>
+#include <libpayload-config.h>
 #include <libpayload.h>
+#ifdef CONFIG_TARGET_I386
 #include <arch/rdtsc.h>
+#endif
 
 extern u32 cpu_khz;
 
@@ -46,6 +49,7 @@ static struct {
 #define TICKS_PER_SEC (cpu_khz * 1000)
 #define TICKS_PER_USEC (cpu_khz / 1000)
 
+#ifdef CONFIG_TARGET_I386
 static void update_clock(void)
 {
        u64 delta = rdtsc() - clock.ticks;
@@ -113,20 +117,29 @@ static void gettimeofday_init(void)
        clock.ticks = rdtsc();
 }
 #endif
+#endif
+#ifdef CONFIG_TARGET_POWERPC
+static void update_clock(void)
+{
+}
 
+static void gettimeofday_init(void)
+{
+}
+#endif
 /**
- * Return the current time broken into a timeval structure
- * @param tv A pointer to a timeval structure
- * @param tz Added for compatability - not used
- * @return 0 for success
+ * Return the current time broken into a timeval structure.
+ *
+ * @param tv A pointer to a timeval structure.
+ * @param tz Added for compatability - not used.
+ * @return 0 for success (this function cannot return non-zero currently).
  */
 int gettimeofday(struct timeval *tv, void *tz)
 {
-       /* Call the gtod init when we need it - this keeps
-          the code from being included in the binary if we don't
-          need it
-       */
-
+       /*
+        * Call the gtod init when we need it - this keeps the code from
+        * being included in the binary if we don't need it.
+        */
        if (!clock.ticks)
                gettimeofday_init();