process: enable uptime support
authorAlan Cox <alan@linux.intel.com>
Sun, 24 May 2015 21:45:11 +0000 (22:45 +0100)
committerAlan Cox <alan@linux.intel.com>
Sun, 24 May 2015 21:45:11 +0000 (22:45 +0100)
Kernel/process.c

index f0726f3..9721c99 100644 (file)
@@ -295,7 +295,7 @@ void load_average(void)
        struct runload *r;
        static uint8_t utick;
        uint8_t i;
-       uint8_t nr;
+       uint16_t nr;
 
        utick++;
        if (utick < 50)
@@ -310,7 +310,7 @@ void load_average(void)
 
        while (i++ < 3) {
                r->average = ((((r->average - (nr << 8)) * r->exponent) +
-                               (((unsigned long)nr) << 16)) >> 8);
+                               (((uint32_t)nr) << 16)) >> 8);
                r++;
        }
 }
@@ -357,6 +357,7 @@ void timer_interrupt(void)
                        }
                }
                updatetod();
+                load_average();
 #ifdef CONFIG_AUDIO
                audio_tick();
 #endif