]> Zhao Yanbai Git Server - minix.git/commitdiff
Remove some unused #include.
authorKees van Reeuwijk <reeuwijk@few.vu.nl>
Wed, 17 Feb 2010 20:24:42 +0000 (20:24 +0000)
committerKees van Reeuwijk <reeuwijk@few.vu.nl>
Wed, 17 Feb 2010 20:24:42 +0000 (20:24 +0000)
Remove some unused variables and computations on them.

kernel/arch/i386/do_int86.c
kernel/arch/i386/memory.c
kernel/clock.c
kernel/proc.c
kernel/system.c
kernel/system/do_endksig.c

index c5ea394c569d1c3ee8736778acb1de413ef5278b..b65307059b9d0c31466f0dccd06514203590ccbf 100644 (file)
@@ -8,7 +8,6 @@
 #include "../../system.h"
 #include <minix/type.h>
 #include <minix/endpoint.h>
-#include <minix/portio.h>
 #include <ibm/int86.h>
 
 #include "proto.h"
index 27b211e4482907a34539125c8b53254be1c08735..83e7fc638cf4b8033eb1b8bdc279ced800227b59 100644 (file)
@@ -11,8 +11,6 @@
 
 #include <sys/vm_i386.h>
 
-#include <minix/portio.h>
-
 #include "proto.h"
 #include "../../proto.h"
 #include "../../proto.h"
@@ -85,7 +83,7 @@ PUBLIC void vm_init(struct proc *newptproc)
        } else {                                                \
                int fp;                                         \
                int mustinvl;                                   \
-               u32_t pdeval, *pdevalptr, mask;                 \
+               u32_t pdeval, mask;                             \
                phys_bytes offset;                              \
                vmassert(psok);                                 \
                if(PROC) {                                      \
@@ -116,9 +114,9 @@ PUBLIC void vm_init(struct proc *newptproc)
                vmassert(PDE != NOPDE);                                 \
                vmassert(mask);                                         \
                if(dirtypde & mask) {                                   \
-                       mustinvl = 1;                                   \
+                       mustinvl = TRUE;                                        \
                } else {                                                \
-                       mustinvl = 0;                                   \
+                       mustinvl = FALSE;                                       \
                }                                                       \
                inusepde = PDE;                                         \
                *PROCPDEPTR(ptproc, PDE) = pdeval;                      \
@@ -503,9 +501,8 @@ PUBLIC int vm_lookup(struct proc *proc, vir_bytes virtual, vir_bytes *physical,
  *===========================================================================*/
 PUBLIC int vm_contiguous(struct proc *targetproc, u32_t vir_buf, size_t bytes)
 {
-       int first = 1, r, boundaries = 0;
+       int first = 1, r;
        u32_t prev_phys, po;
-       u32_t prev_vir;
 
        vmassert(targetproc);
        vmassert(bytes > 0);
@@ -547,10 +544,8 @@ PUBLIC int vm_contiguous(struct proc *targetproc, u32_t vir_buf, size_t bytes)
                first = 0;
 
                prev_phys = phys;
-               prev_vir = vir_buf;
                vir_buf += I386_PAGE_SIZE;
                bytes -= I386_PAGE_SIZE;
-               boundaries++;
        }
 
        return 1;
@@ -560,7 +555,7 @@ PUBLIC int vm_contiguous(struct proc *targetproc, u32_t vir_buf, size_t bytes)
  *                              vm_suspend                                *
  *===========================================================================*/
 PRIVATE void vm_suspend(struct proc *caller, struct proc *target,
-       vir_bytes linaddr, vir_bytes len, int wrflag, int type)
+       vir_bytes linaddr, vir_bytes len, int type)
 {
        /* This range is not OK for this process. Set parameters  
         * of the request and notify VM about the pending request. 
@@ -616,7 +611,7 @@ int delivermsg(struct proc *rp)
                rp->p_delivermsg_lin, sizeof(message), addr);
 
        if(addr) {
-               vm_suspend(rp, rp, rp->p_delivermsg_lin, sizeof(message), 1,
+               vm_suspend(rp, rp, rp->p_delivermsg_lin, sizeof(message),
                        VMSTYPE_DELIVERMSG);
                r = VMSUSPEND;
        } else {
@@ -849,7 +844,6 @@ int vmcheck;                        /* if nonzero, can return VMSUSPEND */
        if((r=lin_lin_copy(procs[_SRC_], phys_addr[_SRC_],
                procs[_DST_], phys_addr[_DST_], bytes)) != OK) {
                struct proc *target;
-               int wr;
                phys_bytes lin;
                if(r != EFAULT_SRC && r != EFAULT_DST)
                        minix_panic("lin_lin_copy failed", r);
@@ -862,11 +856,9 @@ int vmcheck;                       /* if nonzero, can return VMSUSPEND */
                if(r == EFAULT_SRC) {
                        lin = phys_addr[_SRC_];
                        target = procs[_SRC_];
-                       wr = 0;
                } else if(r == EFAULT_DST) {
                        lin = phys_addr[_DST_];
                        target = procs[_DST_];
-                       wr = 1;
                } else {
                        minix_panic("r strange", r);
                }
@@ -878,7 +870,7 @@ int vmcheck;                        /* if nonzero, can return VMSUSPEND */
 #endif
 
                vmassert(proc_ptr->p_endpoint == SYSTEM);
-               vm_suspend(caller, target, lin, bytes, wr,
+               vm_suspend(caller, target, lin, bytes,
                                VMSTYPE_KERNELCALL);
                NOREC_RETURN(virtualcopy, VMSUSPEND);
        }
index fd57a3e2fe0ce9785968a4cb9f90dcf0f0742382..0e453ed2e3bf32ac49fcbd67110828db92d3d493 100644 (file)
@@ -31,7 +31,6 @@
 
 #include "kernel.h"
 #include "proc.h"
-#include <minix/com.h>
 #include <minix/endpoint.h>
 
 #include "clock.h"
@@ -187,7 +186,6 @@ PUBLIC int ap_timer_int_handler(void)
         */
 
        unsigned ticks = 1;
-       int expired = 0;
        struct proc * p, * billp;
 
 #ifdef CONFIG_WATCHDOG
@@ -225,13 +223,16 @@ PUBLIC int ap_timer_int_handler(void)
         * well.  If any of the timers expire, do_clocktick() will send out
         * signals.
         */
-       if ((p->p_misc_flags & MF_VIRT_TIMER) &&
-                       (p->p_virt_left -= ticks) <= 0) expired = 1;
-       if ((p->p_misc_flags & MF_PROF_TIMER) &&
-                       (p->p_prof_left -= ticks) <= 0) expired = 1;
+       if ((p->p_misc_flags & MF_VIRT_TIMER)){
+               p->p_virt_left -= ticks;
+       }
+       if ((p->p_misc_flags & MF_PROF_TIMER)){
+               p->p_prof_left -= ticks;
+       }
        if (! (priv(p)->s_flags & BILLABLE) &&
-                       (billp->p_misc_flags & MF_PROF_TIMER) &&
-                       (billp->p_prof_left -= ticks) <= 0) expired = 1;
+                       (billp->p_misc_flags & MF_PROF_TIMER)){
+               billp->p_prof_left -= ticks;
+       }
 
        /*
         * Check if a process-virtual timer expired. Check current process, but
index 57022e81a60631abed765be3245b76eef4b84ce1..84a4ed877e9c930403bf9d5553191a7b9c66a0d1 100644 (file)
@@ -33,7 +33,6 @@
 #include <minix/endpoint.h>
 #include <stddef.h>
 #include <signal.h>
-#include <minix/portio.h>
 #include <minix/syslib.h>
 
 #include "debug.h"
@@ -1050,7 +1049,7 @@ struct proc *caller_ptr;
  *===========================================================================*/
 PRIVATE int try_one(struct proc *src_ptr, struct proc *dst_ptr, int *postponed)
 {
-       int i, do_notify, done;
+       int i, done;
        unsigned flags;
        size_t size;
        endpoint_t dst_e;
@@ -1074,7 +1073,6 @@ PRIVATE int try_one(struct proc *src_ptr, struct proc *dst_ptr, int *postponed)
        dst_e= dst_ptr->p_endpoint;
 
        /* Scan the table */
-       do_notify= FALSE;       
        done= TRUE;
        for (i= 0; i<size; i++)
        {
index 796935e9198ae08017a908a0296e118af1db011e..04a57d7b19570831d7b556bb978406fad031cf86 100644 (file)
 #include <stdlib.h>
 #include <signal.h>
 #include <unistd.h>
-#include <string.h>
 #include <sys/sigcontext.h>
 #include <minix/endpoint.h>
 #include <minix/safecopies.h>
-#include <minix/portio.h>
 
 /* Declaration of the call vector that defines the mapping of system calls 
  * to handler functions. The vector is initialized in sys_init() with map(), 
@@ -324,7 +322,6 @@ PUBLIC void send_sig(int proc_nr, int sig_nr)
  * send a notification with source SYSTEM.
  */ 
   register struct proc *rp;
-  static int n;
 
   if(!isokprocn(proc_nr) || isemptyn(proc_nr))
        minix_panic("send_sig to empty process", proc_nr);
index 9bddd8a450b2e599f6e8b76379c2d0702f83cb60..1b09b894c9315632f7b3070b8ca1b6bcedefe158 100644 (file)
@@ -6,7 +6,6 @@
  */
 
 #include "../system.h"
-#include <signal.h>
 
 #if USE_ENDKSIG