From: Kees van Reeuwijk Date: Tue, 30 Mar 2010 14:07:15 +0000 (+0000) Subject: More use of endpoint_t. Other code cleanup. X-Git-Tag: v3.1.7~189 X-Git-Url: http://zhaoyanbai.com/repos/?a=commitdiff_plain;h=4865e3f4f987ffa2a0f13454fd3065aa91ecc3f7;p=minix.git More use of endpoint_t. Other code cleanup. --- diff --git a/drivers/amddev/amddev.c b/drivers/amddev/amddev.c index 16bd92acb..d95e4c043 100644 --- a/drivers/amddev/amddev.c +++ b/drivers/amddev/amddev.c @@ -56,8 +56,8 @@ static void write_reg(int function, int index, u32_t value); static void init_domain(int index); static void init_map(unsigned int ix); static int do_add4pci(message *m); -static void add_range(u32_t busaddr, u32_t size); -static void del_range(u32_t busaddr, u32_t size); +static void add_range(phys_bytes busaddr, phys_bytes size); +static void del_range(phys_bytes busaddr, phys_bytes size); static void report_exceptions(void); /* SEF functions and variables. */ @@ -428,9 +428,9 @@ static int do_add4pci(message *m) } -static void add_range(u32_t busaddr, u32_t size) +static void add_range(phys_bytes busaddr, phys_bytes size) { - u32_t o; + phys_bytes o; #if 0 printf("add_range: mapping 0x%x@0x%x\n", size, busaddr); @@ -443,9 +443,9 @@ static void add_range(u32_t busaddr, u32_t size) } } -static void del_range(u32_t busaddr, u32_t size) +static void del_range(phys_bytes busaddr, phys_bytes size) { - u32_t o, bit; + phys_bytes o; #if 0 printf("del_range: mapping 0x%x@0x%x\n", size, busaddr); @@ -453,7 +453,7 @@ static void del_range(u32_t busaddr, u32_t size) for (o= 0; oiov_addr, addr_offset, - (vir_bytes)dma_buf+dma_buf_offset, n, D); + (vir_bytes)(dma_buf+dma_buf_offset), + n, D); if (s != OK) { panic("w_transfer: sys_vircopy failed: %d", s); } @@ -1485,7 +1486,7 @@ struct command *cmd; /* Command block */ PRIVATE void setup_dma(sizep, proc_nr, iov, addr_offset, do_write, do_copyoutp) unsigned *sizep; -int proc_nr; +endpoint_t proc_nr; iovec_t *iov; size_t addr_offset; int do_write; @@ -2137,8 +2138,8 @@ unsigned nr_req; /* length of request vector */ } else { dmabytes += nbytes; while (nbytes > 0) { - size_t chunk; - chunk = nbytes; + vir_bytes chunk = nbytes; + if (chunk > iov->iov_size) chunk = iov->iov_size; position= add64ul(position, chunk); diff --git a/drivers/atl2/atl2.c b/drivers/atl2/atl2.c index 3190117e3..b20d47949 100644 --- a/drivers/atl2/atl2.c +++ b/drivers/atl2/atl2.c @@ -865,7 +865,8 @@ PRIVATE void atl2_writev(message *m, int from_int) /* Write packet data. */ iovec_s_t *iovp; - size_t off, count, left, pos, size, skip; + size_t off, count, left, pos, skip; + vir_bytes size; u8_t *sizep; int i, j, r, batch, maxnum; diff --git a/drivers/bios_wini/bios_wini.c b/drivers/bios_wini/bios_wini.c index c9bb15143..dde0e9372 100644 --- a/drivers/bios_wini/bios_wini.c +++ b/drivers/bios_wini/bios_wini.c @@ -188,7 +188,8 @@ unsigned nr_req; /* length of request vector */ struct wini *wn = w_wn; iovec_t *iop, *iov_end = iov + nr_req; int r, errors; - unsigned nbytes, count, chunk; + unsigned count; + vir_bytes chunk, nbytes; unsigned long block; vir_bytes i13e_rw_off, rem_buf_size; unsigned secspcyl = wn->heads * wn->sectors; diff --git a/drivers/dec21140A/dec21140A.c b/drivers/dec21140A/dec21140A.c index e8074759f..a0c16b6aa 100644 --- a/drivers/dec21140A/dec21140A.c +++ b/drivers/dec21140A/dec21140A.c @@ -273,8 +273,7 @@ PRIVATE void do_conf(message * mp) } -PRIVATE void do_get_name(mp) -message *mp; +PRIVATE void do_get_name(message *mp) { int r; strncpy(mp->DL_NAME, progname, sizeof(mp->DL_NAME)); @@ -460,7 +459,8 @@ PRIVATE void do_vread_s(message * mp, int from_int) { char *buffer; u32_t size; - int r, bytes, ix = 0; + int r, ix = 0; + vir_bytes bytes; dpeth_t *dep = NULL; de_loc_descr_t *descr = NULL; iovec_dat_s_t *iovp = NULL; diff --git a/drivers/dec21140A/dec21140A.h b/drivers/dec21140A/dec21140A.h index 675070a34..0a2202eea 100644 --- a/drivers/dec21140A/dec21140A.h +++ b/drivers/dec21140A/dec21140A.h @@ -120,7 +120,7 @@ typedef struct dpeth { iovec_dat_s_t de_write_iovec; vir_bytes de_read_s; vir_bytes de_send_s; - int de_client; + endpoint_t de_client; } dpeth_t; diff --git a/drivers/dp8390/dp8390.c b/drivers/dp8390/dp8390.c index cd1694628..0413133b1 100644 --- a/drivers/dp8390/dp8390.c +++ b/drivers/dp8390/dp8390.c @@ -141,9 +141,9 @@ _PROTOTYPE( static void dp_pio8_getblock, (dpeth_t *dep, int page, _PROTOTYPE( static void dp_pio16_getblock, (dpeth_t *dep, int page, size_t offset, size_t size, void *dst) ); _PROTOTYPE( static int dp_pkt2user, (dpeth_t *dep, int page, - int length) ); + vir_bytes length) ); _PROTOTYPE( static int dp_pkt2user_s, (dpeth_t *dep, int page, - int length) ); + vir_bytes length) ); _PROTOTYPE( static void dp_user2nic, (dpeth_t *dep, iovec_dat_t *iovp, vir_bytes offset, int nic_addr, vir_bytes count) ); _PROTOTYPE( static void dp_user2nic_s, (dpeth_t *dep, iovec_dat_s_t *iovp, @@ -792,8 +792,7 @@ message *mp; /*===========================================================================* * do_init * *===========================================================================*/ -static void do_init(mp) -message *mp; +static void do_init(message *mp) { int port; dpeth_t *dep; @@ -1541,9 +1540,7 @@ void *dst; /*===========================================================================* * dp_pkt2user * *===========================================================================*/ -static int dp_pkt2user(dep, page, length) -dpeth_t *dep; -int page, length; +static int dp_pkt2user(dpeth_t *dep, int page, vir_bytes length) { int last, count; @@ -1579,9 +1576,7 @@ int page, length; /*===========================================================================* * dp_pkt2user_s * *===========================================================================*/ -static int dp_pkt2user_s(dep, page, length) -dpeth_t *dep; -int page, length; +static int dp_pkt2user_s(dpeth_t *dep, int page, vir_bytes length) { int last, count; @@ -1625,7 +1620,8 @@ int nic_addr; vir_bytes count; { vir_bytes vir_hw; - int bytes, i, r; + int i, r; + vir_bytes bytes; vir_hw = (vir_bytes)dep->de_locmem + nic_addr; diff --git a/drivers/dp8390/dp8390.h b/drivers/dp8390/dp8390.h index 083ddf630..901428b1a 100644 --- a/drivers/dp8390/dp8390.h +++ b/drivers/dp8390/dp8390.h @@ -285,7 +285,7 @@ typedef struct dpeth iovec_dat_t de_tmp_iovec; iovec_dat_s_t de_tmp_iovec_s; vir_bytes de_read_s; - int de_client; + endpoint_t de_client; message de_sendmsg; dp_user2nicf_t de_user2nicf; dp_user2nicf_s_t de_user2nicf_s; diff --git a/drivers/dpeth/devio.c b/drivers/dpeth/devio.c index b5c708a92..2ee8b9046 100644 --- a/drivers/dpeth/devio.c +++ b/drivers/dpeth/devio.c @@ -53,7 +53,8 @@ PUBLIC unsigned int inw(unsigned short port) ** Name: unsigned int insb(unsigned short int port, int proc_nr, void *buffer, int count); ** Function: Reads a sequence of bytes from specified i/o port to user space buffer. */ -PUBLIC void insb(unsigned short int port, int proc_nr, void *buffer, int count) +PUBLIC void insb(unsigned short int port, endpoint_t proc_nr, + void *buffer, int count) { int rc; @@ -91,7 +92,7 @@ PUBLIC void outw(unsigned short port, unsigned long value) ** Name: void outsb(unsigned short int port, int proc_nr, void *buffer, int count); ** Function: Writes a sequence of bytes from user space to specified i/o port. */ -PUBLIC void outsb(unsigned short port, int proc_nr, void *buffer, int count) +PUBLIC void outsb(unsigned short port, endpoint_t proc_nr, void *buffer, int count) { int rc; diff --git a/drivers/dpeth/dp.h b/drivers/dpeth/dp.h index 75a7d0299..a0ec2d765 100644 --- a/drivers/dpeth/dp.h +++ b/drivers/dpeth/dp.h @@ -228,11 +228,11 @@ void dp_next_iovec(iovec_dat_s_t * iovp); #else unsigned int inb(unsigned short int); unsigned int inw(unsigned short int); -void insb(unsigned short int, int, void *, int); +void insb(unsigned short int, endpoint_t, void *, int); void insw(unsigned short int, int, void *, int); void outb(unsigned short int, unsigned long); void outw(unsigned short int, unsigned long); -void outsb(unsigned short int, int, void *, int); +void outsb(unsigned short int, endpoint_t, void *, int); void outsw(unsigned short int, int, void *, int); #endif diff --git a/kernel/arch/i386/apic.c b/kernel/arch/i386/apic.c index 1547ecca3..808572a92 100644 --- a/kernel/arch/i386/apic.c +++ b/kernel/arch/i386/apic.c @@ -50,7 +50,7 @@ PUBLIC int ioapic_enabled; PUBLIC u32_t ioapic_id_mask[8], lapic_id_mask[8]; PUBLIC u32_t lapic_addr_vaddr; PUBLIC vir_bytes lapic_addr; -PUBLIC u32_t lapic_eoi_addr; +PUBLIC vir_bytes lapic_eoi_addr; PUBLIC u32_t lapic_taskpri_addr; PUBLIC int bsp_lapic_id; diff --git a/kernel/arch/i386/debugreg.h b/kernel/arch/i386/debugreg.h index 8590fea5a..e8f9f7897 100644 --- a/kernel/arch/i386/debugreg.h +++ b/kernel/arch/i386/debugreg.h @@ -27,12 +27,12 @@ #define DR7_LN_4(bp) (3 << (18+4*(bp))) /* 4 bytes */ /* debugreg.S */ -void ld_dr0(u32_t value); -void ld_dr1(u32_t value); -void ld_dr2(u32_t value); -void ld_dr3(u32_t value); -void ld_dr6(u32_t value); -void ld_dr7(u32_t value); +void ld_dr0(phys_bytes value); +void ld_dr1(phys_bytes value); +void ld_dr2(phys_bytes value); +void ld_dr3(phys_bytes value); +void ld_dr6(phys_bytes value); +void ld_dr7(phys_bytes value); u32_t st_dr0(void); u32_t st_dr1(void); u32_t st_dr2(void); diff --git a/kernel/main.c b/kernel/main.c index b2cd22c82..500f68573 100644 --- a/kernel/main.c +++ b/kernel/main.c @@ -55,7 +55,7 @@ PUBLIC void main() } for (sp = BEG_PRIV_ADDR, i = 0; sp < END_PRIV_ADDR; ++sp, ++i) { sp->s_proc_nr = NONE; /* initialize as free */ - sp->s_id = (proc_nr_t) i; /* priv structure index */ + sp->s_id = (sys_id_t) i; /* priv structure index */ ppriv_addr[i] = sp; /* priv ptr from number */ } diff --git a/kernel/proc.c b/kernel/proc.c index 8f5cf31b1..69b90213a 100644 --- a/kernel/proc.c +++ b/kernel/proc.c @@ -53,7 +53,7 @@ FORWARD _PROTOTYPE( int mini_receive, (struct proc *caller_ptr, int src, FORWARD _PROTOTYPE( int mini_senda, (struct proc *caller_ptr, asynmsg_t *table, size_t size)); FORWARD _PROTOTYPE( int deadlock, (int function, - register struct proc *caller, int src_dst)); + register struct proc *caller, proc_nr_t src_dst)); FORWARD _PROTOTYPE( int try_async, (struct proc *caller_ptr)); FORWARD _PROTOTYPE( int try_one, (struct proc *src_ptr, struct proc *dst_ptr, int *postponed)); @@ -245,7 +245,7 @@ check_misc_flags: *===========================================================================*/ PUBLIC int do_ipc(call_nr, src_dst_e, m_ptr, bit_map) int call_nr; /* system call number and flags */ -int src_dst_e; /* src to receive from or dst to send to */ +endpoint_t src_dst_e; /* src to receive from or dst to send to */ message *m_ptr; /* pointer to message in the caller's space */ long bit_map; /* notification event set or flags */ { diff --git a/kernel/proto.h b/kernel/proto.h index 12355fbd2..8a0040e4f 100644 --- a/kernel/proto.h +++ b/kernel/proto.h @@ -35,7 +35,7 @@ _PROTOTYPE( void prepare_shutdown, (int how) ); _PROTOTYPE( void minix_shutdown, (struct timer *tp) ); /* proc.c */ -_PROTOTYPE( int do_ipc, (int call_nr, int src_dst, +_PROTOTYPE( int do_ipc, (int call_nr, endpoint_t src_dst, message *m_ptr, long bit_map) ); _PROTOTYPE( int mini_notify, (const struct proc *src, endpoint_t dst) ); _PROTOTYPE( void enqueue, (struct proc *rp) ); @@ -60,7 +60,7 @@ _PROTOTYPE( void cstart, (U16_t cs, U16_t ds, U16_t mds, _PROTOTYPE( int get_priv, (register struct proc *rc, int proc_type) ); _PROTOTYPE( void set_sendto_bit, (const struct proc *rc, int id) ); _PROTOTYPE( void unset_sendto_bit, (const struct proc *rc, int id) ); -_PROTOTYPE( void send_sig, (int proc_nr, int sig_nr) ); +_PROTOTYPE( void send_sig, (endpoint_t proc_nr, int sig_nr) ); _PROTOTYPE( void cause_sig, (proc_nr_t proc_nr, int sig_nr) ); _PROTOTYPE( void sig_delay_done, (struct proc *rp) ); _PROTOTYPE( void kernel_call, (message *m_user, struct proc * caller) ); @@ -165,7 +165,7 @@ _PROTOTYPE( void arch_pre_exec, (struct proc *pr, u32_t, u32_t)); _PROTOTYPE( int arch_umap, (struct proc *pr, vir_bytes, vir_bytes, int, phys_bytes *)); _PROTOTYPE( int arch_do_vmctl, (message *m_ptr, struct proc *p)); -_PROTOTYPE( int vm_contiguous, (struct proc *targetproc, u32_t vir_buf, size_t count)); +_PROTOTYPE( int vm_contiguous, (struct proc *targetproc, vir_bytes vir_buf, size_t count)); _PROTOTYPE( void proc_stacktrace, (struct proc *proc) ); _PROTOTYPE( int vm_lookup, (const struct proc *proc, vir_bytes virtual, vir_bytes *result, u32_t *ptent)); _PROTOTYPE( int delivermsg, (struct proc *target)); diff --git a/kernel/system.c b/kernel/system.c index e2fa72d49..8c20dc469 100644 --- a/kernel/system.c +++ b/kernel/system.c @@ -326,7 +326,7 @@ PUBLIC void unset_sendto_bit(const struct proc *rp, int id) /*===========================================================================* * send_sig * *===========================================================================*/ -PUBLIC void send_sig(int proc_nr, int sig_nr) +PUBLIC void send_sig(endpoint_t proc_nr, int sig_nr) { /* Notify a system process about a signal. This is straightforward. Simply * set the signal that is to be delivered in the pending signals map and @@ -392,8 +392,7 @@ int sig_nr; /* signal to be sent */ /*===========================================================================* * sig_delay_done * *===========================================================================*/ -PUBLIC void sig_delay_done(rp) -struct proc *rp; +PUBLIC void sig_delay_done(struct proc *rp) { /* A process is now known not to send any direct messages. * Tell PM that the stop delay has ended, by sending a signal to the process. diff --git a/servers/ds/main.c b/servers/ds/main.c index 1efe80585..27a59a9e1 100644 --- a/servers/ds/main.c +++ b/servers/ds/main.c @@ -17,7 +17,7 @@ PRIVATE int callnr; /* system call number */ /* Declare some local functions. */ FORWARD _PROTOTYPE(void get_work, (message *m_ptr) ); -FORWARD _PROTOTYPE(void reply, (int whom, message *m_ptr) ); +FORWARD _PROTOTYPE(void reply, (endpoint_t whom, message *m_ptr) ); /* SEF functions and variables. */ FORWARD _PROTOTYPE( void sef_local_startup, (void) ); @@ -108,11 +108,11 @@ PRIVATE void sef_local_startup() /*===========================================================================* * get_work * *===========================================================================*/ -PRIVATE void get_work(m_ptr) -message *m_ptr; /* message buffer */ +PRIVATE void get_work( + message *m_ptr /* message buffer */ +) { - int status = 0; - status = sef_receive(ANY, m_ptr); /* this blocks until message arrives */ + int status = sef_receive(ANY, m_ptr); /* blocks until message arrives */ if (OK != status) panic("failed to receive message!: %d", status); who_e = m_ptr->m_source; /* message arrived! set sender */ @@ -122,12 +122,12 @@ message *m_ptr; /* message buffer */ /*===========================================================================* * reply * *===========================================================================*/ -PRIVATE void reply(who_e, m_ptr) -int who_e; /* destination */ -message *m_ptr; /* message buffer */ +PRIVATE void reply( + endpoint_t who_e, /* destination */ + message *m_ptr /* message buffer */ +) { - int s; - s = send(who_e, m_ptr); /* send the message */ + int s = send(who_e, m_ptr); /* send the message */ if (OK != s) printf("DS: unable to send reply to %d: %d\n", who_e, s); } diff --git a/servers/ds/store.c b/servers/ds/store.c index 76e1efde4..53e83ad2e 100644 --- a/servers/ds/store.c +++ b/servers/ds/store.c @@ -113,14 +113,14 @@ PRIVATE char *ds_getprocname(endpoint_t e) /*===========================================================================* * ds_getprocep * *===========================================================================*/ -PRIVATE endpoint_t ds_getprocep(char *s) +PRIVATE endpoint_t ds_getprocep(const char *s) { /* Get a process endpoint given its name. */ struct data_store *dsp; if((dsp = lookup_entry(s, DSF_TYPE_LABEL)) != NULL) return dsp->u.u32; - return -1; + return (endpoint_t) -1; } /*===========================================================================* diff --git a/servers/inet/inet.c b/servers/inet/inet.c index 364c251ee..4628bd298 100644 --- a/servers/inet/inet.c +++ b/servers/inet/inet.c @@ -74,7 +74,7 @@ THIS_FILE #define RANDOM_DEV_NAME "/dev/random" -int this_proc; /* Process number of this server. */ +endpoint_t this_proc; /* Process number of this server. */ /* Killing Solaris */ int killer_inet= 0; @@ -100,7 +100,8 @@ PUBLIC void main() { mq_t *mq; int r; - int source, m_type; + endpoint_t source; + int m_type; /* SEF local startup. */ sef_local_startup(); diff --git a/servers/inet/mnx_eth.c b/servers/inet/mnx_eth.c index 0ffd969be..3d969532f 100644 --- a/servers/inet/mnx_eth.c +++ b/servers/inet/mnx_eth.c @@ -31,13 +31,13 @@ FORWARD _PROTOTYPE( void write_int, (eth_port_t *eth_port) ); FORWARD _PROTOTYPE( void eth_recvev, (event_t *ev, ev_arg_t ev_arg) ); FORWARD _PROTOTYPE( void eth_sendev, (event_t *ev, ev_arg_t ev_arg) ); FORWARD _PROTOTYPE( eth_port_t *find_port, (message *m) ); -FORWARD _PROTOTYPE( void eth_restart, (eth_port_t *eth_port, int tasknr) ); +FORWARD _PROTOTYPE( void eth_restart, (eth_port_t *eth_port, endpoint_t tasknr) ); FORWARD _PROTOTYPE( void send_getstat, (eth_port_t *eth_port) ); PUBLIC void osdep_eth_init() { int i, j, r, rport; - u32_t tasknr; + endpoint_t tasknr; struct eth_conf *ecp; eth_port_t *eth_port, *rep; message mess; @@ -475,9 +475,8 @@ PUBLIC void eth_rec(message *m) PUBLIC void eth_check_drivers(message *m) { - int r, tasknr; - - tasknr= m->m_source; + int r; + endpoint_t tasknr= m->m_source; #if 0 if (notification_count < 100) { @@ -674,8 +673,7 @@ eth_port_t *eth_port; eth_port->etp_osdep.etp_state= OEPS_SEND_SENT; } -PRIVATE void write_int(eth_port) -eth_port_t *eth_port; +PRIVATE void write_int(eth_port_t *eth_port) { acc_t *pack; int multicast; @@ -886,9 +884,7 @@ message *m; return loc_port; } -static void eth_restart(eth_port, tasknr) -eth_port_t *eth_port; -int tasknr; +static void eth_restart(eth_port_t *eth_port, endpoint_t tasknr) { int r; unsigned flags, dl_flags; diff --git a/servers/inet/osdep_eth.h b/servers/inet/osdep_eth.h index c19c3171f..cb04d5d9c 100644 --- a/servers/inet/osdep_eth.h +++ b/servers/inet/osdep_eth.h @@ -18,7 +18,7 @@ typedef struct osdep_eth_port { int etp_state; int etp_flags; - int etp_task; + endpoint_t etp_task; int etp_port; int etp_recvconf; int etp_send_ev; diff --git a/servers/inet/sr.c b/servers/inet/sr.c index 1fc8e56a3..0146e54ed 100644 --- a/servers/inet/sr.c +++ b/servers/inet/sr.c @@ -97,10 +97,10 @@ FORWARD _PROTOTYPE ( int walk_queue, (sr_fd_t *sr_fd, mq_t **q_head_ptr, FORWARD _PROTOTYPE ( void process_req_q, (mq_t *mq, mq_t *tail, mq_t **tail_ptr) ); FORWARD _PROTOTYPE ( void sr_event, (event_t *evp, ev_arg_t arg) ); -FORWARD _PROTOTYPE ( int cp_u2b, (int proc, int gid, vir_bytes offset, - acc_t **var_acc_ptr, int size) ); -FORWARD _PROTOTYPE ( int cp_b2u, (acc_t *acc_ptr, int proc, int gid, - vir_bytes offset) ); +FORWARD _PROTOTYPE ( int cp_u2b, (endpoint_t proc, cp_grant_id_t gid, + vir_bytes offset, acc_t **var_acc_ptr, int size) ); +FORWARD _PROTOTYPE ( int cp_b2u, (acc_t *acc_ptr, endpoint_t proc, + cp_grant_id_t gid, vir_bytes offset) ); PUBLIC void sr_init() { @@ -809,9 +809,7 @@ int for_ioctl; (int)(*head_ptr)->mq_mess.IO_GRANT, offset); } -PRIVATE void sr_select_res(fd, ops) -int fd; -unsigned ops; +PRIVATE void sr_select_res(int fd, unsigned ops) { sr_fd_t *sr_fd; @@ -891,8 +889,8 @@ ev_arg_t arg; } PRIVATE int cp_u2b(proc, gid, offset, var_acc_ptr, size) -int proc; -int gid; +endpoint_t proc; +cp_grant_id_t gid; vir_bytes offset; acc_t **var_acc_ptr; int size; @@ -955,8 +953,8 @@ int size; PRIVATE int cp_b2u(acc_ptr, proc, gid, offset) acc_t *acc_ptr; -int proc; -int gid; +endpoint_t proc; +cp_grant_id_t gid; vir_bytes offset; { acc_t *acc; diff --git a/servers/inet/sr_int.h b/servers/inet/sr_int.h index 5f562f3f4..0a5494ecd 100644 --- a/servers/inet/sr_int.h +++ b/servers/inet/sr_int.h @@ -13,7 +13,7 @@ typedef struct sr_fd int srf_flags; int srf_fd; int srf_port; - int srf_select_proc; + endpoint_t srf_select_proc; sr_open_t srf_open; sr_close_t srf_close; sr_write_t srf_write; diff --git a/servers/ipc/main.c b/servers/ipc/main.c index e88b700a9..05a72c160 100644 --- a/servers/ipc/main.c +++ b/servers/ipc/main.c @@ -117,7 +117,7 @@ PRIVATE void sef_local_startup() /*===========================================================================* * sef_cb_init_fresh * *===========================================================================*/ -PRIVATE int sef_cb_init_fresh(int type, sef_init_info_t *info) +PRIVATE int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info)) { /* Initialize the ipc server. */ diff --git a/servers/is/main.c b/servers/is/main.c index f65c648e9..cc8e0c374 100644 --- a/servers/is/main.c +++ b/servers/is/main.c @@ -11,10 +11,10 @@ #include /* Allocate space for the global variables. */ -message m_in; /* the input message itself */ -message m_out; /* the output message used for reply */ -int who_e; /* caller's proc number */ -int callnr; /* system call number */ +PRIVATE message m_in; /* the input message itself */ +PRIVATE message m_out; /* the output message used for reply */ +PRIVATE endpoint_t who_e; /* caller's proc number */ +PRIVATE int callnr; /* system call number */ extern int errno; /* error number set by system library */ diff --git a/servers/iso9660fs/device.c b/servers/iso9660fs/device.c index b5c575589..9afc6c459 100644 --- a/servers/iso9660fs/device.c +++ b/servers/iso9660fs/device.c @@ -286,7 +286,7 @@ int flags; /* mode bits and flags */ * gen_io * *===========================================================================*/ PRIVATE int gen_io(task_nr, mess_ptr) -int task_nr; /* which task to call */ +endpoint_t task_nr; /* which task to call */ message *mess_ptr; /* pointer to message for task */ { /* All file system I/O ultimately comes down to I/O on major/minor device @@ -330,9 +330,7 @@ message *mess_ptr; /* pointer to message for task */ /*===========================================================================* * dev_close * *===========================================================================*/ -PUBLIC void dev_close(driver_e, dev) -endpoint_t driver_e; -dev_t dev; /* device to close */ +PUBLIC void dev_close(endpoint_t driver_e, dev_t dev) { (void) gen_opcl(driver_e, DEV_CLOSE, dev, 0, 0); } diff --git a/servers/iso9660fs/main.c b/servers/iso9660fs/main.c index 74abfe568..a3fb0cd25 100644 --- a/servers/iso9660fs/main.c +++ b/servers/iso9660fs/main.c @@ -19,7 +19,7 @@ FORWARD _PROTOTYPE( int sef_cb_init_fresh, (int type, sef_init_info_t *info) ); * main * *===========================================================================*/ PUBLIC int main(void) { - int who_e, ind, error; + endpoint_t who_e, ind, error; message m; /* SEF local startup. */ diff --git a/servers/iso9660fs/proto.h b/servers/iso9660fs/proto.h index d5c339121..8942286de 100644 --- a/servers/iso9660fs/proto.h +++ b/servers/iso9660fs/proto.h @@ -18,7 +18,7 @@ _PROTOTYPE( int block_dev_io, (int op, Dev_t dev, int proc, void *buf, u64_t pos, int bytes, int flags) ); _PROTOTYPE( int dev_open, (endpoint_t driver_e, Dev_t dev, int proc, int flags) ); -_PROTOTYPE( void dev_close, (endpoint_t driver_e, Dev_t dev) ); +_PROTOTYPE( void dev_close, (endpoint_t driver_e, dev_t dev) ); _PROTOTYPE( int fs_new_driver, (void) ); /* inode.c */ diff --git a/servers/iso9660fs/stadir.c b/servers/iso9660fs/stadir.c index b7c992f89..c3ded5a98 100644 --- a/servers/iso9660fs/stadir.c +++ b/servers/iso9660fs/stadir.c @@ -8,18 +8,15 @@ #include -FORWARD _PROTOTYPE(int stat_dir_record, (struct dir_record *dir, int pipe_pos, - int who_e, cp_grant_id_t gid) ); - - /*===========================================================================* * stat_dir_record * *===========================================================================*/ -PRIVATE int stat_dir_record(dir, pipe_pos, who_e, gid) -register struct dir_record *dir; /* pointer to dir record to stat */ -int pipe_pos; /* position in a pipe, supplied by fstat() */ -int who_e; /* Caller endpoint */ -cp_grant_id_t gid; /* grant for the stat buf */ +PRIVATE int stat_dir_record( + register struct dir_record *dir, /* pointer to dir record to stat */ + int pipe_pos, /* position in a pipe, supplied by fstat() */ + endpoint_t who_e, /* Caller endpoint */ + cp_grant_id_t gid /* grant for the stat buf */ +) { /* This function returns all the info about a particular inode. It's missing * the recording date because of a bug in the standard functions stdtime. diff --git a/servers/mfs/device.c b/servers/mfs/device.c index 4d547c026..faf2b700d 100644 --- a/servers/mfs/device.c +++ b/servers/mfs/device.c @@ -24,7 +24,7 @@ FORWARD _PROTOTYPE( void safe_io_cleanup, (cp_grant_id_t, cp_grant_id_t *, int)); FORWARD _PROTOTYPE( int gen_opcl, (endpoint_t driver_e, int op, Dev_t dev, int proc_e, int flags) ); -FORWARD _PROTOTYPE( int gen_io, (int task_nr, message *mess_ptr) ); +FORWARD _PROTOTYPE( int gen_io, (endpoint_t task_nr, message *mess_ptr) ); /*===========================================================================* @@ -314,9 +314,10 @@ int flags; /* mode bits and flags */ /*===========================================================================* * gen_io * *===========================================================================*/ -PRIVATE int gen_io(task_nr, mess_ptr) -int task_nr; /* which task to call */ -message *mess_ptr; /* pointer to message for task */ +PRIVATE int gen_io( + endpoint_t task_nr, /* which task to call */ + message *mess_ptr /* pointer to message for task */ +) { /* All file system I/O ultimately comes down to I/O on major/minor device * pairs. These lead to calls on the following routines via the dmap table. diff --git a/servers/mfs/main.c b/servers/mfs/main.c index 835432594..d24758b9b 100644 --- a/servers/mfs/main.c +++ b/servers/mfs/main.c @@ -167,9 +167,10 @@ message *m_in; /* pointer to message */ /*===========================================================================* * reply * *===========================================================================*/ -PUBLIC void reply(who, m_out) -int who; -message *m_out; /* report result */ +PUBLIC void reply( + endpoint_t who, + message *m_out /* report result */ +) { if (OK != send(who, m_out)) /* send the message */ printf("MFS(%d) was unable to send reply\n", SELF_E); diff --git a/servers/mfs/proto.h b/servers/mfs/proto.h index 18ece47b1..ea350cc4a 100644 --- a/servers/mfs/proto.h +++ b/servers/mfs/proto.h @@ -52,7 +52,7 @@ _PROTOTYPE( int fs_unlink, (void) ); _PROTOTYPE( int truncate_inode, (struct inode *rip, off_t len) ); /* main.c */ -_PROTOTYPE( void reply, (int who, message *m_out) ); +_PROTOTYPE( void reply, (endpoint_t who, message *m_out) ); /* misc.c */ _PROTOTYPE( int fs_flush, (void) ); diff --git a/servers/mfs/stadir.c b/servers/mfs/stadir.c index 00968084d..1906b16b8 100644 --- a/servers/mfs/stadir.c +++ b/servers/mfs/stadir.c @@ -8,17 +8,15 @@ #include "super.h" #include -FORWARD _PROTOTYPE( int stat_inode, (struct inode *rip, int who_e, - cp_grant_id_t gid) ); - /*===========================================================================* * stat_inode * *===========================================================================*/ -PRIVATE int stat_inode(rip, who_e, gid) -register struct inode *rip; /* pointer to inode to stat */ -int who_e; /* Caller endpoint */ -cp_grant_id_t gid; /* grant for the stat buf */ +PRIVATE int stat_inode( + register struct inode *rip, /* pointer to inode to stat */ + endpoint_t who_e, /* Caller endpoint */ + cp_grant_id_t gid /* grant for the stat buf */ +) { /* Common code for stat and fstat system calls. */ diff --git a/servers/pfs/stadir.c b/servers/pfs/stadir.c index 500d0f827..8c2a79b68 100644 --- a/servers/pfs/stadir.c +++ b/servers/pfs/stadir.c @@ -2,17 +2,15 @@ #include "inode.h" #include -FORWARD _PROTOTYPE( int stat_inode, (struct inode *rip, int who_e, - cp_grant_id_t gid) ); - /*===========================================================================* * stat_inode * *===========================================================================*/ -PRIVATE int stat_inode(rip, who_e, gid) -register struct inode *rip; /* pointer to inode to stat */ -int who_e; /* Caller endpoint */ -cp_grant_id_t gid; /* grant for the stat buf */ +PRIVATE int stat_inode( + register struct inode *rip, /* pointer to inode to stat */ + endpoint_t who_e, /* Caller endpoint */ + cp_grant_id_t gid /* grant for the stat buf */ +) { /* Common code for stat and fstat system calls. */