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

@ -243,7 +243,7 @@ static void write_reg(int function, int index, u32_t value)
static void init_domain(int index)
{
size_t o, size, memsize;
size_t size, memsize;
phys_bytes busaddr;
size= 0x100000 / 8;
@ -332,7 +332,7 @@ static int do_add(message *m)
static int do_add_phys(message *m)
{
int i, r;
int i;
phys_bytes start;
size_t size;
@ -368,7 +368,6 @@ static int do_add_phys(message *m)
static int do_del_phys(message *m)
{
int r;
phys_bytes start;
size_t size;

View file

@ -792,7 +792,7 @@ PRIVATE int w_identify()
struct wini *wn = w_wn;
struct command cmd;
int i, s;
int s;
u16_t w;
unsigned long size;
int prev_wakeup;
@ -1191,9 +1191,9 @@ unsigned nr_req; /* length of request vector */
struct wini *wn = w_wn;
iovec_t *iop, *iov_end = iov + nr_req;
int n, r, s, errors, do_dma, do_write, do_copyout;
unsigned long v, block, w_status;
unsigned long block, w_status;
u64_t dv_size = w_dv->dv_size;
unsigned cylinder, head, sector, nbytes;
unsigned nbytes;
unsigned dma_buf_offset;
size_t addr_offset = 0;
@ -1475,7 +1475,6 @@ struct command *cmd; /* Command block */
unsigned base_ctl = wn->base_ctl;
pvb_pair_t outbyte[11]; /* vector for sys_voutb() */
int s; /* status for sys_(v)outb() */
unsigned long w_status;
if (w_wn->state & IGNORING) return ERR;

View file

@ -227,7 +227,6 @@ int drv_reset() {
int drv_start(int sub_dev, int DmaMode) {
u32_t enable_bit, result = 0;
u32_t debug;
/* Write default values to device in case user failed to configure.
If user did configure properly, everything is written twice.
@ -386,7 +385,6 @@ int drv_int_sum(void) {
int drv_int(int sub_dev) {
u32_t int_status;
u32_t bit;
u32_t debug;
/* return status of interrupt bit of specified channel*/
switch (sub_dev) {

View file

@ -116,7 +116,6 @@ PUBLIC int drv_init(void) {
PUBLIC int drv_init_hw (void) {
u16_t i, j;
u16_t chip_sel_ctrl_reg;
/* First, detect the hardware */
if (detect_hw() != OK) {
@ -230,7 +229,6 @@ int drv_reset() {
int drv_start(int sub_dev, int DmaMode) {
u32_t enable_bit, result = 0;
u32_t debug;
/* Write default values to device in case user failed to configure.
If user did configure properly, everything is written twice.
@ -388,7 +386,6 @@ int drv_int_sum(void) {
int drv_int(int sub_dev) {
u32_t int_status;
u32_t bit;
u32_t debug;
/* return status of interrupt bit of specified channel*/
switch (sub_dev) {

View file

@ -87,7 +87,7 @@ PUBLIC int is_status_msg_expected = FALSE;
PUBLIC void main(void)
{
int r, caller, proc_nr, chan;
int r, caller, proc_nr;
message mess, repl_mess;
/* SEF local startup. */
@ -311,7 +311,7 @@ PRIVATE int msg_open (int minor_dev_nr) {
PRIVATE int open_sub_dev(int sub_dev_nr, int dma_mode) {
sub_dev_t* sub_dev_ptr; int i;
sub_dev_t* sub_dev_ptr;
sub_dev_ptr = &sub_dev[sub_dev_nr];
/* Only one open at a time per sub device */
@ -410,7 +410,6 @@ PRIVATE int close_sub_dev(int sub_dev_nr) {
PRIVATE int msg_ioctl(message *m_ptr)
{
int status, len, chan;
phys_bytes user_phys;
sub_dev_t *sub_dev_ptr;
special_file_t* special_file_ptr;
@ -473,7 +472,7 @@ PRIVATE int msg_ioctl(message *m_ptr)
PRIVATE void msg_write(message *m_ptr)
{
int s, chan; sub_dev_t *sub_dev_ptr;
int chan; sub_dev_t *sub_dev_ptr;
special_file_t* special_file_ptr;
dprint("%s: msg_write() device %d\n", drv.DriverName, m_ptr->DEVICE);
@ -524,7 +523,7 @@ PRIVATE void msg_write(message *m_ptr)
PRIVATE void msg_read(message *m_ptr)
{
int s, chan; sub_dev_t *sub_dev_ptr;
int chan; sub_dev_t *sub_dev_ptr;
special_file_t* special_file_ptr;
dprint("%s: msg_read() device %d\n", drv.DriverName, m_ptr->DEVICE);

View file

@ -120,7 +120,6 @@ static void el3_reset(dpeth_t * dep)
*/
static void el3_write_fifo(dpeth_t * dep, int pktsize)
{
phys_bytes phys_user;
int bytes, ix = 0;
iovec_dat_s_t *iovp = &dep->de_write_iovec;
int r, padding = pktsize;

View file

@ -90,7 +90,7 @@ static void mem_getblock(dpeth_t *dep, u16_t offset, int size, void *dst)
*/
static void mem_nic2user(dpeth_t * dep, int pageno, int pktsize)
{
phys_bytes offset, phys_user;
phys_bytes offset;
iovec_dat_s_t *iovp = &dep->de_read_iovec;
int bytes, ix = 0;
@ -197,7 +197,6 @@ static void pio_getblock(dpeth_t *dep, u16_t offset, int size, void *dst)
*/
static void pio_nic2user(dpeth_t *dep, int pageno, int pktsize)
{
phys_bytes phys_user;
iovec_dat_s_t *iovp = &dep->de_read_iovec;
unsigned offset, iov_offset; int r, bytes, ix = 0;
@ -253,7 +252,6 @@ static void pio_nic2user(dpeth_t *dep, int pageno, int pktsize)
*/
static void pio_user2nic(dpeth_t *dep, int pageno, int pktsize)
{
phys_bytes phys_user;
iovec_dat_s_t *iovp = &dep->de_write_iovec;
int r, bytes, ix = 0;
@ -478,7 +476,7 @@ static void ns_recv(dpeth_t *dep, int fromint, int size)
static void ns_interrupt(dpeth_t * dep)
{
int isr, tsr;
int size, queue;
int queue;
while ((isr = inb_reg0(dep, DP_ISR)) != 0) {

View file

@ -360,7 +360,6 @@ PRIVATE int e1000_init_hw(e)
e1000_t *e;
{
int r, i;
u16_t word;
e->status |= E1000_ENABLED;
e->irq_hook = e->irq;

View file

@ -381,7 +381,6 @@ PRIVATE void f_expire_tmrs(struct driver *dp, message *m_ptr)
* timers. Possibly reschedule the next alarm.
*/
clock_t now; /* current time */
timer_t *tp;
int s;
/* Get the current time to compare the timers against. */

View file

@ -2938,7 +2938,6 @@ PRIVATE void fxp_expire_timers()
* timers. Possibly reschedule the next alarm.
*/
clock_t now; /* current time */
timer_t *tp;
int r;
/* Get the current time to compare the timers against. */

View file

@ -1486,14 +1486,12 @@ ether_card_t *ec;
static int lance_probe(ec)
ether_card_t *ec;
{
unsigned short pci_cmd, attached = 0;
unsigned short pci_cmd;
unsigned short ioaddr;
int lance_version, chip_version;
int devind, just_one, i, r;
u16_t vid, did;
u32_t bar;
u8_t ilr;
char *dname;
if ((ec->ec_pcibus | ec->ec_pcidev | ec->ec_pcifunc) != 0)

View file

@ -255,8 +255,6 @@ PUBLIC void init_buffer(void)
* 'tmp_phys', the normal address is 'tmp_buf'.
*/
unsigned left;
if(!(tmp_buf = alloc_contig(2*DMA_BUF_SIZE, AC_ALIGN4K, &tmp_phys)))
panic(__FILE__, "can't allocate tmp_buf", DMA_BUF_SIZE);
}
@ -271,7 +269,6 @@ message *mp; /* pointer to read or write message */
/* Carry out a single read or write request. */
iovec_t iovec1;
int r, opcode;
phys_bytes phys_addr;
u64_t position;
/* Disk address? Address and length of the user buffer? */
@ -309,7 +306,7 @@ message *mp; /* pointer to read or write message */
static iovec_t iovec[NR_IOREQS];
phys_bytes iovec_size;
unsigned nr_req;
int r, j, opcode;
int r, opcode;
u64_t position;
nr_req = mp->COUNT; /* Length of I/O vector */

View file

@ -290,7 +290,6 @@ unsigned nr_req; /* length of request vector */
unsigned long dv_size;
int accumulated_read = 0;
struct logdevice *log;
static int f;
size_t vir_offset = 0;
if(log_device < 0 || log_device >= NR_DEVS)

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;

View file

@ -289,7 +289,7 @@ PUBLIC int do_publish(message *m_ptr)
char key_name[DS_MAX_KEYLEN];
int flags = m_ptr->DS_FLAGS;
size_t length;
int nr, r;
int r;
/* MAP should not be overwritten. */
if((flags & DSF_TYPE_MAP) && (flags & DSF_OVERWRITE))

View file

@ -658,7 +658,6 @@ PUBLIC int eth_select(fd, operations)
int fd;
unsigned operations;
{
int i;
unsigned resops;
eth_fd_t *eth_fd;
@ -1115,8 +1114,7 @@ printf("eth_restart_ioctl: clearing etp_getstat in port %d\n",
PRIVATE int eth_sel_read (eth_fd)
eth_fd_t *eth_fd;
{
acc_t *pack, *tmp_acc, *next_acc;
int result;
acc_t *tmp_acc, *next_acc;
if (!(eth_fd->ef_flags & EFF_OPTSET))
return 1; /* Read will not block */

View file

@ -1447,11 +1447,8 @@ tcp_fd_t *tcp_fd;
int *bytesp;
{
tcp_conn_t *tcp_conn;
size_t data_size, read_size;
acc_t *data;
int fin_recv, urg, push, result;
i32_t old_window, new_window;
u16_t mss;
size_t data_size;
int fin_recv, urg, push;
*bytesp= 0; /* The default is that nothing is available */

View file

@ -296,7 +296,6 @@ PRIVATE int udp_select(fd, operations)
int fd;
unsigned operations;
{
int i;
unsigned resops;
udp_fd_t *udp_fd;