core: declare jiffies_t and mstime_t and use them.
authorEric W. Biederman <ebiederm@xmission.com>
Fri, 8 Apr 2011 05:52:57 +0000 (22:52 -0700)
committerEric W. Biederman <ebiederm@xmission.com>
Fri, 8 Apr 2011 21:38:25 +0000 (14:38 -0700)
Create specific types for jiffies and for the output of the
millisecond timer and use them where appropriate in the code
base.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
core/fs/pxe/dnsresolv.c
core/fs/pxe/pxe.c
core/idle.c
core/include/core.h

index 641ea38..06d5a73 100644 (file)
@@ -182,7 +182,7 @@ uint32_t dns_resolv(const char *name)
     int ques, reps;    /* number of questions and replies */
     uint8_t timeout;
     const uint8_t *timeout_ptr = TimeoutTable;
-    uint32_t oldtime;
+    jiffies_t oldtime;
     uint32_t srv;
     uint32_t *srv_ptr;
     struct dnshdr *hd1 = (struct dnshdr *)DNSSendBuf;
index 21d27e5..262b38e 100644 (file)
@@ -485,7 +485,7 @@ static void fill_buffer(struct inode *inode)
     const uint8_t *timeout_ptr;
     uint8_t timeout;
     uint16_t buffersize;
-    uint32_t oldtime;
+    jiffies_t oldtime;
     void *data = NULL;
     static __lowmem struct s_PXENV_UDP_READ udp_read;
     struct pxe_pvt_inode *socket = PVT(inode);
@@ -520,7 +520,7 @@ static void fill_buffer(struct inode *inode)
         udp_read.d_port      = socket->tftp_localport;
         err = pxe_call(PXENV_UDP_READ, &udp_read);
         if (err) {
-           uint32_t now = jiffies();
+           jiffies_t now = jiffies();
 
            if (now-oldtime >= timeout) {
                oldtime = now;
@@ -678,8 +678,8 @@ static void __pxe_searchdir(const char *filename, struct file *file)
     int buffersize;
     int rrq_len;
     const uint8_t  *timeout_ptr;
-    uint32_t timeout;
-    uint32_t oldtime;
+    jiffies_t timeout;
+    jiffies_t oldtime;
     uint16_t tid;
     uint16_t opcode;
     uint16_t blk_num;
@@ -822,7 +822,7 @@ wait_pkt:
         udp_read.d_port      = tid;
         err = pxe_call(PXENV_UDP_READ, &udp_read);
         if (err || udp_read.status) {
-           uint32_t now = jiffies();
+           jiffies_t now = jiffies();
            if (now - oldtime >= timeout)
                goto sendreq;
         } else {
index 3f57393..dfdc77a 100644 (file)
@@ -24,7 +24,7 @@
 
 #define TICKS_TO_IDLE  4       /* Also in idle.inc */
 
-extern uint32_t _IdleTimer;
+extern jiffies_t _IdleTimer;
 extern uint16_t NoHalt;
 
 int (*idle_hook_func)(void);
index 114b049..a593c26 100644 (file)
@@ -65,12 +65,15 @@ __noreturn _kaboom(void);
 /*
  * Basic timer function...
  */
-extern volatile uint32_t __jiffies, __ms_timer;
-static inline uint32_t jiffies(void)
+typedef uint32_t jiffies_t;
+extern volatile jiffies_t __jiffies, __ms_timer;
+static inline jiffies_t jiffies(void)
 {
     return __jiffies;
 }
-static inline uint32_t ms_timer(void)
+typedef uint32_t mstime_t;
+typedef int32_t  mstimediff_t;
+static inline mstime_t ms_timer(void)
 {
     return __ms_timer;
 }