Removed unused symbols.

Minor cleanups.
This commit is contained in:
Kees van Reeuwijk
2010-01-22 22:01:08 +00:00
parent 0cfbe936ce
commit a7cee5bec4
38 changed files with 31 additions and 102 deletions

View File

@@ -308,9 +308,6 @@ PRIVATE int lapic_enable_in_msr(void)
PUBLIC int lapic_enable(void)
{
u32_t val, nlvt;
u32_t timeout = 0xFFFF;
u32_t errstatus = 0;
int i;
unsigned cpu = cpuid;
if (!lapic_addr)

View File

@@ -64,7 +64,6 @@ struct proc *p;
}
case VMCTL_I386_PAGEDIRS:
{
int pde;
vm_pagedirs = (u32_t *) m_ptr->SVMCTL_VALUE;
return OK;
}

View File

@@ -35,8 +35,6 @@ PUBLIC int do_sdevio(
struct proc *rp;
struct priv *privp;
struct io_range *iorp;
int rem;
vir_bytes addr;
struct proc *destproc;
/* Allow safe copies and accesses to SELF */

View File

@@ -19,10 +19,6 @@ void pagefault( struct proc *pr,
struct exception_frame * frame,
int is_nested)
{
int s;
vir_bytes ph;
u32_t pte;
int procok = 0, pcok = 0, rangeok = 0;
int in_physcopy = 0;
reg_t pagefaultcr2;
@@ -108,8 +104,6 @@ PUBLIC void exception_handler(int is_nested, struct exception_frame * frame)
{
/* An exception or unexpected interrupt has occurred. */
struct proc *t;
struct ex_s {
char *msg;
int signum;
@@ -210,7 +204,7 @@ struct proc *t;
*===========================================================================*/
PUBLIC void proc_stacktrace(struct proc *whichproc)
{
reg_t bp, v_bp, v_pc, v_hbp;
reg_t v_bp, v_pc, v_hbp;
int iskernel;
v_bp = whichproc->p_reg.fp;

View File

@@ -36,8 +36,6 @@ PUBLIC int intr_init(int mine, int auto_eoi)
* use the BIOS locations instead. The flag "mine" is set if the 8259s are
* to be programmed for MINIX, or to be reset to what the BIOS expects.
*/
int i;
if (!intr_disabled())
intr_disable();

View File

@@ -50,7 +50,6 @@ FORWARD _PROTOTYPE( void set_cr3, (void) );
PUBLIC void vm_init(struct proc *newptproc)
{
int i;
if(vm_running)
minix_panic("vm_init: vm_running", NO_NUM);
vm_set_cr3(newptproc);
@@ -156,9 +155,7 @@ int lin_lin_copy(struct proc *srcproc, vir_bytes srclinaddr,
struct proc *dstproc, vir_bytes dstlinaddr, vir_bytes bytes)
{
u32_t addr;
int o1, o2;
int procslot;
int firstloop = 1;
NOREC_ENTER(linlincopy);
@@ -217,8 +214,6 @@ int lin_lin_copy(struct proc *srcproc, vir_bytes srclinaddr,
bytes -= chunk;
srclinaddr += chunk;
dstlinaddr += chunk;
firstloop = 0;
}
NOREC_RETURN(linlincopy, OK);
@@ -692,7 +687,7 @@ char *flagstr(u32_t e, int dir)
void vm_pt_print(u32_t *pagetable, u32_t v)
{
int pte, l = 0;
int pte;
int col = 0;
vmassert(!((u32_t) pagetable % I386_PAGE_SIZE));
@@ -758,7 +753,6 @@ u32_t read_cr3(void)
*===========================================================================*/
int vm_phys_memset(phys_bytes ph, u8_t c, phys_bytes bytes)
{
char *v;
u32_t p;
NOREC_ENTER(physmemset);
@@ -808,7 +802,7 @@ int vmcheck; /* if nonzero, can return VMSUSPEND */
struct vir_addr *vir_addr[2]; /* virtual source and destination address */
phys_bytes phys_addr[2]; /* absolute source and destination */
int seg_index;
int i, r;
int i;
struct proc *procs[2];
NOREC_ENTER(virtualcopy);
@@ -887,8 +881,6 @@ int vmcheck; /* if nonzero, can return VMSUSPEND */
caller = proc_addr(who_p);
if(RTS_ISSET(caller, RTS_VMREQUEST)) {
struct proc *target;
int pn;
vmassert(caller->p_vmrequest.vmresult != VMSUSPEND);
RTS_LOCK_UNSET(caller, RTS_VMREQUEST);
if(caller->p_vmrequest.vmresult != OK) {

View File

@@ -129,7 +129,6 @@ PUBLIC void prot_init(void)
/* Set up tables for protected mode.
* All GDT slots are allocated at compile time.
*/
struct gate_table_s *gtp;
struct desctableptr_s *dtp;
unsigned ldt_index;
register struct proc *rp;
@@ -439,7 +438,6 @@ PUBLIC void printseg(char *banner, int iscs, struct proc *pr, u32_t selector)
PUBLIC int prot_set_kern_seg_limit(vir_bytes limit)
{
struct proc *rp;
vir_bytes prev;
int orig_click;
int incr_clicks;

View File

@@ -33,7 +33,7 @@ PUBLIC void main()
struct boot_image *ip; /* boot image pointer */
register struct proc *rp; /* process pointer */
register struct priv *sp; /* privilege structure pointer */
register int i, j, s;
register int i, j;
int hdrindex; /* index to array of a.out headers */
phys_clicks text_base;
vir_clicks text_clicks, data_clicks, st_clicks;
@@ -75,7 +75,6 @@ PUBLIC void main()
for (i=0; i < NR_BOOT_PROCS; ++i) {
int schedulable_proc, proc_nr;
int ipc_to_m, kcalls;
bitchunk_t fv;
ip = &image[i]; /* process' attributes */
rp = proc_addr(ip->proc_nr); /* get process pointer */
@@ -278,8 +277,6 @@ int how;
{
/* This function prepares to shutdown MINIX. */
static timer_t shutdown_timer;
register struct proc *rp;
message m;
/* Continue after 1 second, to give processes a chance to get scheduled to
* do shutdown work. Set a watchog timer to call shutdown(). The timer

View File

@@ -38,7 +38,7 @@ PRIVATE irq_hook_t profile_clock_hook;
*===========================================================================*/
PUBLIC void init_profile_clock(u32_t freq)
{
int r, irq;
int irq;
intr_disable();

View File

@@ -43,8 +43,6 @@
#include <minix/endpoint.h>
#include <minix/safecopies.h>
#include <minix/portio.h>
#include <minix/u64.h>
#include <sys/vm_i386.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(),
@@ -74,7 +72,6 @@ PUBLIC void sys_task()
register struct proc *caller_ptr;
int s;
int call_nr;
int n = 0;
/* Initialize the system task. */
initialize();
@@ -462,7 +459,6 @@ register struct proc *rc; /* slot of process to clean up */
{
register struct proc *rp; /* iterate over process table */
register struct proc **xpp; /* iterate over caller queue */
struct proc *np;
if(isemptyp(rc)) minix_panic("clear_proc: empty process", rc->p_endpoint);
@@ -551,7 +547,7 @@ register struct proc *rc; /* slot of process to clean up */
*===========================================================================*/
PRIVATE struct proc *vmrestart_check(message *m)
{
int type, r;
int type;
struct proc *restarting;
/* Anyone waiting to be vm-restarted? */

View File

@@ -23,8 +23,6 @@ message *m_ptr; /* pointer to request message */
* in the PM (normal abort or panic) or TTY (after CTRL-ALT-DEL).
*/
int how = m_ptr->ABRT_HOW;
int length;
phys_bytes src_phys;
/* See if the monitor is to run the specified instructions. */
if (how == RBT_MONITOR) {

View File

@@ -22,9 +22,9 @@
PUBLIC int do_cprofile(m_ptr)
register message *m_ptr; /* pointer to request message */
{
int proc_nr, i, err = 0, k = 0;
int proc_nr, i;
phys_bytes len;
vir_bytes vir_dst, vir_src;
vir_bytes vir_dst;
switch (m_ptr->PROF_ACTION) {

View File

@@ -22,8 +22,6 @@ register message *m_ptr; /* pointer to request message */
{
/* Handle sys_exec(). A process has done a successful EXEC. Patch it up. */
register struct proc *rp;
phys_bytes phys_name;
char *np;
int proc_nr;
if(!isokendpt(m_ptr->PR_ENDPT, &proc_nr))

View File

@@ -48,17 +48,13 @@ message *m_ptr; /* pointer to request message */
PRIVATE void clear_proc(rc)
register struct proc *rc; /* slot of process to clean up */
{
register struct proc *rp; /* iterate over process table */
register struct proc **xpp; /* iterate over caller queue */
int i;
int sys_id;
/* Don't clear if already cleared. */
if(isemptyp(rc)) return;
/* Check the table with IRQ hooks to see if hooks should be released. */
for (i=0; i < NR_IRQ_HOOKS; i++) {
int proc;
if (rc->p_endpoint == irq_hooks[i].proc_nr_e) {
rm_irq_handler(&irq_hooks[i]); /* remove interrupt handler */
irq_hooks[i].proc_nr_e = NONE; /* mark hook as free */

View File

@@ -31,7 +31,7 @@ register message *m_ptr; /* pointer to request message */
register struct proc *rpc; /* child process pointer */
struct proc *rpp; /* parent process pointer */
struct mem_map *map_ptr; /* virtual address of map inside caller (PM) */
int i, gen, r;
int gen, r;
int p_proc;
if(!isokendpt(m_ptr->PR_ENDPT, &p_proc))

View File

@@ -29,7 +29,7 @@ register message *m_ptr; /* pointer to request message */
*/
size_t length;
vir_bytes src_vir;
int proc_nr, nr_e, nr, r;
int nr_e, nr, r;
struct proc *caller;
int wipe_rnd_bin = -1;
struct exec e_hdr;
@@ -122,7 +122,7 @@ register message *m_ptr; /* pointer to request message */
break;
}
case GET_RANDOMNESS_BIN: {
int i, bin = m_ptr->I_VAL_LEN2_E;
int bin = m_ptr->I_VAL_LEN2_E;
if(bin < 0 || bin >= RANDOM_SOURCES) {
kprintf("SYSTEM: GET_RANDOMNESS_BIN: %d out of range\n", bin);

View File

@@ -19,7 +19,6 @@ message *m_ptr; /* pointer to request message */
/* Handle sys_newmap(). Fetch the memory map. */
register struct proc *rp; /* process whose map is to be loaded */
struct mem_map *map_ptr; /* virtual address of map inside caller */
phys_bytes src_phys; /* physical address of map at the */
int proc_nr;
map_ptr = (struct mem_map *) m_ptr->PR_MEM_PTR;

View File

@@ -24,7 +24,6 @@ register message *m_ptr; /* pointer to request message */
* which is used to enable the kernel to have the tables cleared.
*/
int proc_nr;
vir_bytes vir_dst;
struct proc *rp;
/* Store process name, control struct, table locations. */

View File

@@ -26,9 +26,7 @@ PRIVATE vir_bytes sprof_info_addr_vir;
PUBLIC int do_sprofile(m_ptr)
register message *m_ptr; /* pointer to request message */
{
int proc_nr, i;
vir_bytes vir_dst;
phys_bytes length;
int proc_nr;
switch(m_ptr->PROF_ACTION) {

View File

@@ -7,7 +7,6 @@
*/
#include "../system.h"
#include "../vm.h"
/*===========================================================================*
@@ -18,7 +17,7 @@ register message *m_ptr; /* pointer to request message */
{
vir_bytes len, buf;
static char mybuf[DIAG_BUFSIZE];
struct proc *caller, *target;
struct proc *caller;
int s, i, proc_nr;
caller = proc_addr(who_p);

View File

@@ -11,7 +11,6 @@
#include "../vm.h"
#include "../debug.h"
#include <minix/type.h>
#include <minix/config.h>
/*===========================================================================*
* do_vmctl *
@@ -19,7 +18,7 @@
PUBLIC int do_vmctl(m_ptr)
register message *m_ptr; /* pointer to request message */
{
int proc_nr, i;
int proc_nr;
endpoint_t ep = m_ptr->SVMCTL_WHO;
struct proc *p, *rp, *target;
int err;