Remove some unused #include.

Remove some unused variables and computations on them.
This commit is contained in:
Kees van Reeuwijk 2010-02-17 20:24:42 +00:00
parent 1e9a3c1423
commit 97c169b93a
6 changed files with 17 additions and 31 deletions

View 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"

View 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);
}

View 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

View 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++)
{

View file

@ -38,11 +38,9 @@
#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);

View file

@ -6,7 +6,6 @@
*/
#include "../system.h"
#include <signal.h>
#if USE_ENDKSIG