More use of endpoint_t. Other code cleanup.

This commit is contained in:
Kees van Reeuwijk 2010-03-30 14:07:15 +00:00
parent 2ff73172b4
commit 4865e3f4f9
34 changed files with 120 additions and 133 deletions

View file

@ -56,8 +56,8 @@ static void write_reg(int function, int index, u32_t value);
static void init_domain(int index); static void init_domain(int index);
static void init_map(unsigned int ix); static void init_map(unsigned int ix);
static int do_add4pci(message *m); 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);
static void del_range(u32_t busaddr, u32_t size); static void del_range(phys_bytes busaddr, phys_bytes size);
static void report_exceptions(void); static void report_exceptions(void);
/* SEF functions and variables. */ /* 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 #if 0
printf("add_range: mapping 0x%x@0x%x\n", size, busaddr); 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 #if 0
printf("del_range: mapping 0x%x@0x%x\n", size, busaddr); 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; o<size; o += I386_PAGE_SIZE) for (o= 0; o<size; o += I386_PAGE_SIZE)
{ {
bit= (busaddr+o)/I386_PAGE_SIZE; u32_t bit= (busaddr+o)/I386_PAGE_SIZE;
table[bit/8] |= (1 << (bit % 8)); table[bit/8] |= (1 << (bit % 8));
} }
} }

View file

@ -110,7 +110,7 @@ PRIVATE phys_bytes dma_buf_phys;
PRIVATE struct prdte PRIVATE struct prdte
{ {
u32_t prdte_base; phys_bytes prdte_base;
u16_t prdte_count; u16_t prdte_count;
u8_t prdte_reserved; u8_t prdte_reserved;
u8_t prdte_flags; u8_t prdte_flags;
@ -145,11 +145,11 @@ FORWARD _PROTOTYPE( int w_identify, (void) );
FORWARD _PROTOTYPE( char *w_name, (void) ); FORWARD _PROTOTYPE( char *w_name, (void) );
FORWARD _PROTOTYPE( int w_specify, (void) ); FORWARD _PROTOTYPE( int w_specify, (void) );
FORWARD _PROTOTYPE( int w_io_test, (void) ); FORWARD _PROTOTYPE( int w_io_test, (void) );
FORWARD _PROTOTYPE( int w_transfer, (int proc_nr, int opcode, u64_t position, FORWARD _PROTOTYPE( int w_transfer, (endpoint_t proc_nr, int opcode,
iovec_t *iov, unsigned nr_req)); u64_t position, iovec_t *iov, unsigned nr_req) );
FORWARD _PROTOTYPE( int com_out, (struct command *cmd) ); FORWARD _PROTOTYPE( int com_out, (struct command *cmd) );
FORWARD _PROTOTYPE( int com_out_ext, (struct command *cmd) ); FORWARD _PROTOTYPE( int com_out_ext, (struct command *cmd) );
FORWARD _PROTOTYPE( void setup_dma, (unsigned *sizep, int proc_nr, FORWARD _PROTOTYPE( void setup_dma, (unsigned *sizep, endpoint_t proc_nr,
iovec_t *iov, size_t addr_offset, int do_write, iovec_t *iov, size_t addr_offset, int do_write,
int *do_copyoutp) ); int *do_copyoutp) );
FORWARD _PROTOTYPE( void w_need_reset, (void) ); FORWARD _PROTOTYPE( void w_need_reset, (void) );
@ -1151,7 +1151,7 @@ PRIVATE int error_dma(struct wini *wn)
* w_transfer * * w_transfer *
*===========================================================================*/ *===========================================================================*/
PRIVATE int w_transfer(proc_nr, opcode, position, iov, nr_req) PRIVATE int w_transfer(proc_nr, opcode, position, iov, nr_req)
int proc_nr; /* process doing the request */ endpoint_t proc_nr; /* process doing the request */
int opcode; /* DEV_GATHER_S or DEV_SCATTER_S */ int opcode; /* DEV_GATHER_S or DEV_SCATTER_S */
u64_t position; /* offset on device to read or write */ u64_t position; /* offset on device to read or write */
iovec_t *iov; /* pointer to read or write request vector */ iovec_t *iov; /* pointer to read or write request vector */
@ -1268,7 +1268,8 @@ unsigned nr_req; /* length of request vector */
if(proc_nr != SELF) { if(proc_nr != SELF) {
s= sys_safecopyto(proc_nr, iov->iov_addr, s= sys_safecopyto(proc_nr, iov->iov_addr,
addr_offset, addr_offset,
(vir_bytes)dma_buf+dma_buf_offset, n, D); (vir_bytes)(dma_buf+dma_buf_offset),
n, D);
if (s != OK) { if (s != OK) {
panic("w_transfer: sys_vircopy failed: %d", s); 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, PRIVATE void setup_dma(sizep, proc_nr, iov, addr_offset, do_write,
do_copyoutp) do_copyoutp)
unsigned *sizep; unsigned *sizep;
int proc_nr; endpoint_t proc_nr;
iovec_t *iov; iovec_t *iov;
size_t addr_offset; size_t addr_offset;
int do_write; int do_write;
@ -2137,8 +2138,8 @@ unsigned nr_req; /* length of request vector */
} else { } else {
dmabytes += nbytes; dmabytes += nbytes;
while (nbytes > 0) { while (nbytes > 0) {
size_t chunk; vir_bytes chunk = nbytes;
chunk = nbytes;
if (chunk > iov->iov_size) if (chunk > iov->iov_size)
chunk = iov->iov_size; chunk = iov->iov_size;
position= add64ul(position, chunk); position= add64ul(position, chunk);

View file

@ -865,7 +865,8 @@ PRIVATE void atl2_writev(message *m, int from_int)
/* Write packet data. /* Write packet data.
*/ */
iovec_s_t *iovp; 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; u8_t *sizep;
int i, j, r, batch, maxnum; int i, j, r, batch, maxnum;

View file

@ -188,7 +188,8 @@ unsigned nr_req; /* length of request vector */
struct wini *wn = w_wn; struct wini *wn = w_wn;
iovec_t *iop, *iov_end = iov + nr_req; iovec_t *iop, *iov_end = iov + nr_req;
int r, errors; int r, errors;
unsigned nbytes, count, chunk; unsigned count;
vir_bytes chunk, nbytes;
unsigned long block; unsigned long block;
vir_bytes i13e_rw_off, rem_buf_size; vir_bytes i13e_rw_off, rem_buf_size;
unsigned secspcyl = wn->heads * wn->sectors; unsigned secspcyl = wn->heads * wn->sectors;

View file

@ -273,8 +273,7 @@ PRIVATE void do_conf(message * mp)
} }
PRIVATE void do_get_name(mp) PRIVATE void do_get_name(message *mp)
message *mp;
{ {
int r; int r;
strncpy(mp->DL_NAME, progname, sizeof(mp->DL_NAME)); 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; char *buffer;
u32_t size; u32_t size;
int r, bytes, ix = 0; int r, ix = 0;
vir_bytes bytes;
dpeth_t *dep = NULL; dpeth_t *dep = NULL;
de_loc_descr_t *descr = NULL; de_loc_descr_t *descr = NULL;
iovec_dat_s_t *iovp = NULL; iovec_dat_s_t *iovp = NULL;

View file

@ -120,7 +120,7 @@ typedef struct dpeth {
iovec_dat_s_t de_write_iovec; iovec_dat_s_t de_write_iovec;
vir_bytes de_read_s; vir_bytes de_read_s;
vir_bytes de_send_s; vir_bytes de_send_s;
int de_client; endpoint_t de_client;
} dpeth_t; } dpeth_t;

View file

@ -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, _PROTOTYPE( static void dp_pio16_getblock, (dpeth_t *dep, int page,
size_t offset, size_t size, void *dst) ); size_t offset, size_t size, void *dst) );
_PROTOTYPE( static int dp_pkt2user, (dpeth_t *dep, int page, _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, _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, _PROTOTYPE( static void dp_user2nic, (dpeth_t *dep, iovec_dat_t *iovp,
vir_bytes offset, int nic_addr, vir_bytes count) ); vir_bytes offset, int nic_addr, vir_bytes count) );
_PROTOTYPE( static void dp_user2nic_s, (dpeth_t *dep, iovec_dat_s_t *iovp, _PROTOTYPE( static void dp_user2nic_s, (dpeth_t *dep, iovec_dat_s_t *iovp,
@ -792,8 +792,7 @@ message *mp;
/*===========================================================================* /*===========================================================================*
* do_init * * do_init *
*===========================================================================*/ *===========================================================================*/
static void do_init(mp) static void do_init(message *mp)
message *mp;
{ {
int port; int port;
dpeth_t *dep; dpeth_t *dep;
@ -1541,9 +1540,7 @@ void *dst;
/*===========================================================================* /*===========================================================================*
* dp_pkt2user * * dp_pkt2user *
*===========================================================================*/ *===========================================================================*/
static int dp_pkt2user(dep, page, length) static int dp_pkt2user(dpeth_t *dep, int page, vir_bytes length)
dpeth_t *dep;
int page, length;
{ {
int last, count; int last, count;
@ -1579,9 +1576,7 @@ int page, length;
/*===========================================================================* /*===========================================================================*
* dp_pkt2user_s * * dp_pkt2user_s *
*===========================================================================*/ *===========================================================================*/
static int dp_pkt2user_s(dep, page, length) static int dp_pkt2user_s(dpeth_t *dep, int page, vir_bytes length)
dpeth_t *dep;
int page, length;
{ {
int last, count; int last, count;
@ -1625,7 +1620,8 @@ int nic_addr;
vir_bytes count; vir_bytes count;
{ {
vir_bytes vir_hw; vir_bytes vir_hw;
int bytes, i, r; int i, r;
vir_bytes bytes;
vir_hw = (vir_bytes)dep->de_locmem + nic_addr; vir_hw = (vir_bytes)dep->de_locmem + nic_addr;

View file

@ -285,7 +285,7 @@ typedef struct dpeth
iovec_dat_t de_tmp_iovec; iovec_dat_t de_tmp_iovec;
iovec_dat_s_t de_tmp_iovec_s; iovec_dat_s_t de_tmp_iovec_s;
vir_bytes de_read_s; vir_bytes de_read_s;
int de_client; endpoint_t de_client;
message de_sendmsg; message de_sendmsg;
dp_user2nicf_t de_user2nicf; dp_user2nicf_t de_user2nicf;
dp_user2nicf_s_t de_user2nicf_s; dp_user2nicf_s_t de_user2nicf_s;

View file

@ -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); ** 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. ** 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; 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); ** 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. ** 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; int rc;

View file

@ -228,11 +228,11 @@ void dp_next_iovec(iovec_dat_s_t * iovp);
#else #else
unsigned int inb(unsigned short int); unsigned int inb(unsigned short int);
unsigned int inw(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 insw(unsigned short int, int, void *, int);
void outb(unsigned short int, unsigned long); void outb(unsigned short int, unsigned long);
void outw(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); void outsw(unsigned short int, int, void *, int);
#endif #endif

View file

@ -50,7 +50,7 @@ PUBLIC int ioapic_enabled;
PUBLIC u32_t ioapic_id_mask[8], lapic_id_mask[8]; PUBLIC u32_t ioapic_id_mask[8], lapic_id_mask[8];
PUBLIC u32_t lapic_addr_vaddr; PUBLIC u32_t lapic_addr_vaddr;
PUBLIC vir_bytes lapic_addr; PUBLIC vir_bytes lapic_addr;
PUBLIC u32_t lapic_eoi_addr; PUBLIC vir_bytes lapic_eoi_addr;
PUBLIC u32_t lapic_taskpri_addr; PUBLIC u32_t lapic_taskpri_addr;
PUBLIC int bsp_lapic_id; PUBLIC int bsp_lapic_id;

View file

@ -27,12 +27,12 @@
#define DR7_LN_4(bp) (3 << (18+4*(bp))) /* 4 bytes */ #define DR7_LN_4(bp) (3 << (18+4*(bp))) /* 4 bytes */
/* debugreg.S */ /* debugreg.S */
void ld_dr0(u32_t value); void ld_dr0(phys_bytes value);
void ld_dr1(u32_t value); void ld_dr1(phys_bytes value);
void ld_dr2(u32_t value); void ld_dr2(phys_bytes value);
void ld_dr3(u32_t value); void ld_dr3(phys_bytes value);
void ld_dr6(u32_t value); void ld_dr6(phys_bytes value);
void ld_dr7(u32_t value); void ld_dr7(phys_bytes value);
u32_t st_dr0(void); u32_t st_dr0(void);
u32_t st_dr1(void); u32_t st_dr1(void);
u32_t st_dr2(void); u32_t st_dr2(void);

View file

@ -55,7 +55,7 @@ PUBLIC void main()
} }
for (sp = BEG_PRIV_ADDR, i = 0; sp < END_PRIV_ADDR; ++sp, ++i) { for (sp = BEG_PRIV_ADDR, i = 0; sp < END_PRIV_ADDR; ++sp, ++i) {
sp->s_proc_nr = NONE; /* initialize as free */ 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 */ ppriv_addr[i] = sp; /* priv ptr from number */
} }

View file

@ -53,7 +53,7 @@ FORWARD _PROTOTYPE( int mini_receive, (struct proc *caller_ptr, int src,
FORWARD _PROTOTYPE( int mini_senda, (struct proc *caller_ptr, FORWARD _PROTOTYPE( int mini_senda, (struct proc *caller_ptr,
asynmsg_t *table, size_t size)); asynmsg_t *table, size_t size));
FORWARD _PROTOTYPE( int deadlock, (int function, 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_async, (struct proc *caller_ptr));
FORWARD _PROTOTYPE( int try_one, (struct proc *src_ptr, struct proc *dst_ptr, FORWARD _PROTOTYPE( int try_one, (struct proc *src_ptr, struct proc *dst_ptr,
int *postponed)); int *postponed));
@ -245,7 +245,7 @@ check_misc_flags:
*===========================================================================*/ *===========================================================================*/
PUBLIC int do_ipc(call_nr, src_dst_e, m_ptr, bit_map) PUBLIC int do_ipc(call_nr, src_dst_e, m_ptr, bit_map)
int call_nr; /* system call number and flags */ 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 */ message *m_ptr; /* pointer to message in the caller's space */
long bit_map; /* notification event set or flags */ long bit_map; /* notification event set or flags */
{ {

View file

@ -35,7 +35,7 @@ _PROTOTYPE( void prepare_shutdown, (int how) );
_PROTOTYPE( void minix_shutdown, (struct timer *tp) ); _PROTOTYPE( void minix_shutdown, (struct timer *tp) );
/* proc.c */ /* 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) ); message *m_ptr, long bit_map) );
_PROTOTYPE( int mini_notify, (const struct proc *src, endpoint_t dst) ); _PROTOTYPE( int mini_notify, (const struct proc *src, endpoint_t dst) );
_PROTOTYPE( void enqueue, (struct proc *rp) ); _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( int get_priv, (register struct proc *rc, int proc_type) );
_PROTOTYPE( void set_sendto_bit, (const struct proc *rc, int id) ); _PROTOTYPE( void set_sendto_bit, (const struct proc *rc, int id) );
_PROTOTYPE( void unset_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 cause_sig, (proc_nr_t proc_nr, int sig_nr) );
_PROTOTYPE( void sig_delay_done, (struct proc *rp) ); _PROTOTYPE( void sig_delay_done, (struct proc *rp) );
_PROTOTYPE( void kernel_call, (message *m_user, struct proc * caller) ); _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, _PROTOTYPE( int arch_umap, (struct proc *pr, vir_bytes, vir_bytes,
int, phys_bytes *)); int, phys_bytes *));
_PROTOTYPE( int arch_do_vmctl, (message *m_ptr, struct proc *p)); _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( 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 vm_lookup, (const struct proc *proc, vir_bytes virtual, vir_bytes *result, u32_t *ptent));
_PROTOTYPE( int delivermsg, (struct proc *target)); _PROTOTYPE( int delivermsg, (struct proc *target));

View file

@ -326,7 +326,7 @@ PUBLIC void unset_sendto_bit(const struct proc *rp, int id)
/*===========================================================================* /*===========================================================================*
* send_sig * * 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 /* 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 * 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 * * sig_delay_done *
*===========================================================================*/ *===========================================================================*/
PUBLIC void sig_delay_done(rp) PUBLIC void sig_delay_done(struct proc *rp)
struct proc *rp;
{ {
/* A process is now known not to send any direct messages. /* 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. * Tell PM that the stop delay has ended, by sending a signal to the process.

View file

@ -17,7 +17,7 @@ PRIVATE int callnr; /* system call number */
/* Declare some local functions. */ /* Declare some local functions. */
FORWARD _PROTOTYPE(void get_work, (message *m_ptr) ); 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. */ /* SEF functions and variables. */
FORWARD _PROTOTYPE( void sef_local_startup, (void) ); FORWARD _PROTOTYPE( void sef_local_startup, (void) );
@ -108,11 +108,11 @@ PRIVATE void sef_local_startup()
/*===========================================================================* /*===========================================================================*
* get_work * * get_work *
*===========================================================================*/ *===========================================================================*/
PRIVATE void get_work(m_ptr) PRIVATE void get_work(
message *m_ptr; /* message buffer */ message *m_ptr /* message buffer */
)
{ {
int status = 0; int status = sef_receive(ANY, m_ptr); /* blocks until message arrives */
status = sef_receive(ANY, m_ptr); /* this blocks until message arrives */
if (OK != status) if (OK != status)
panic("failed to receive message!: %d", status); panic("failed to receive message!: %d", status);
who_e = m_ptr->m_source; /* message arrived! set sender */ who_e = m_ptr->m_source; /* message arrived! set sender */
@ -122,12 +122,12 @@ message *m_ptr; /* message buffer */
/*===========================================================================* /*===========================================================================*
* reply * * reply *
*===========================================================================*/ *===========================================================================*/
PRIVATE void reply(who_e, m_ptr) PRIVATE void reply(
int who_e; /* destination */ endpoint_t who_e, /* destination */
message *m_ptr; /* message buffer */ message *m_ptr /* message buffer */
)
{ {
int s; int s = send(who_e, m_ptr); /* send the message */
s = send(who_e, m_ptr); /* send the message */
if (OK != s) if (OK != s)
printf("DS: unable to send reply to %d: %d\n", who_e, s); printf("DS: unable to send reply to %d: %d\n", who_e, s);
} }

View file

@ -113,14 +113,14 @@ PRIVATE char *ds_getprocname(endpoint_t e)
/*===========================================================================* /*===========================================================================*
* ds_getprocep * * ds_getprocep *
*===========================================================================*/ *===========================================================================*/
PRIVATE endpoint_t ds_getprocep(char *s) PRIVATE endpoint_t ds_getprocep(const char *s)
{ {
/* Get a process endpoint given its name. */ /* Get a process endpoint given its name. */
struct data_store *dsp; struct data_store *dsp;
if((dsp = lookup_entry(s, DSF_TYPE_LABEL)) != NULL) if((dsp = lookup_entry(s, DSF_TYPE_LABEL)) != NULL)
return dsp->u.u32; return dsp->u.u32;
return -1; return (endpoint_t) -1;
} }
/*===========================================================================* /*===========================================================================*

View file

@ -74,7 +74,7 @@ THIS_FILE
#define RANDOM_DEV_NAME "/dev/random" #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 */ /* Killing Solaris */
int killer_inet= 0; int killer_inet= 0;
@ -100,7 +100,8 @@ PUBLIC void main()
{ {
mq_t *mq; mq_t *mq;
int r; int r;
int source, m_type; endpoint_t source;
int m_type;
/* SEF local startup. */ /* SEF local startup. */
sef_local_startup(); sef_local_startup();

View file

@ -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_recvev, (event_t *ev, ev_arg_t ev_arg) );
FORWARD _PROTOTYPE( void eth_sendev, (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( 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) ); FORWARD _PROTOTYPE( void send_getstat, (eth_port_t *eth_port) );
PUBLIC void osdep_eth_init() PUBLIC void osdep_eth_init()
{ {
int i, j, r, rport; int i, j, r, rport;
u32_t tasknr; endpoint_t tasknr;
struct eth_conf *ecp; struct eth_conf *ecp;
eth_port_t *eth_port, *rep; eth_port_t *eth_port, *rep;
message mess; message mess;
@ -475,9 +475,8 @@ PUBLIC void eth_rec(message *m)
PUBLIC void eth_check_drivers(message *m) PUBLIC void eth_check_drivers(message *m)
{ {
int r, tasknr; int r;
endpoint_t tasknr= m->m_source;
tasknr= m->m_source;
#if 0 #if 0
if (notification_count < 100) if (notification_count < 100)
{ {
@ -674,8 +673,7 @@ eth_port_t *eth_port;
eth_port->etp_osdep.etp_state= OEPS_SEND_SENT; eth_port->etp_osdep.etp_state= OEPS_SEND_SENT;
} }
PRIVATE void write_int(eth_port) PRIVATE void write_int(eth_port_t *eth_port)
eth_port_t *eth_port;
{ {
acc_t *pack; acc_t *pack;
int multicast; int multicast;
@ -886,9 +884,7 @@ message *m;
return loc_port; return loc_port;
} }
static void eth_restart(eth_port, tasknr) static void eth_restart(eth_port_t *eth_port, endpoint_t tasknr)
eth_port_t *eth_port;
int tasknr;
{ {
int r; int r;
unsigned flags, dl_flags; unsigned flags, dl_flags;

View file

@ -18,7 +18,7 @@ typedef struct osdep_eth_port
{ {
int etp_state; int etp_state;
int etp_flags; int etp_flags;
int etp_task; endpoint_t etp_task;
int etp_port; int etp_port;
int etp_recvconf; int etp_recvconf;
int etp_send_ev; int etp_send_ev;

View file

@ -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, FORWARD _PROTOTYPE ( void process_req_q, (mq_t *mq, mq_t *tail,
mq_t **tail_ptr) ); mq_t **tail_ptr) );
FORWARD _PROTOTYPE ( void sr_event, (event_t *evp, ev_arg_t arg) ); FORWARD _PROTOTYPE ( void sr_event, (event_t *evp, ev_arg_t arg) );
FORWARD _PROTOTYPE ( int cp_u2b, (int proc, int gid, vir_bytes offset, FORWARD _PROTOTYPE ( int cp_u2b, (endpoint_t proc, cp_grant_id_t gid,
acc_t **var_acc_ptr, int size) ); vir_bytes offset, acc_t **var_acc_ptr, int size) );
FORWARD _PROTOTYPE ( int cp_b2u, (acc_t *acc_ptr, int proc, int gid, FORWARD _PROTOTYPE ( int cp_b2u, (acc_t *acc_ptr, endpoint_t proc,
vir_bytes offset) ); cp_grant_id_t gid, vir_bytes offset) );
PUBLIC void sr_init() PUBLIC void sr_init()
{ {
@ -809,9 +809,7 @@ int for_ioctl;
(int)(*head_ptr)->mq_mess.IO_GRANT, offset); (int)(*head_ptr)->mq_mess.IO_GRANT, offset);
} }
PRIVATE void sr_select_res(fd, ops) PRIVATE void sr_select_res(int fd, unsigned ops)
int fd;
unsigned ops;
{ {
sr_fd_t *sr_fd; sr_fd_t *sr_fd;
@ -891,8 +889,8 @@ ev_arg_t arg;
} }
PRIVATE int cp_u2b(proc, gid, offset, var_acc_ptr, size) PRIVATE int cp_u2b(proc, gid, offset, var_acc_ptr, size)
int proc; endpoint_t proc;
int gid; cp_grant_id_t gid;
vir_bytes offset; vir_bytes offset;
acc_t **var_acc_ptr; acc_t **var_acc_ptr;
int size; int size;
@ -955,8 +953,8 @@ int size;
PRIVATE int cp_b2u(acc_ptr, proc, gid, offset) PRIVATE int cp_b2u(acc_ptr, proc, gid, offset)
acc_t *acc_ptr; acc_t *acc_ptr;
int proc; endpoint_t proc;
int gid; cp_grant_id_t gid;
vir_bytes offset; vir_bytes offset;
{ {
acc_t *acc; acc_t *acc;

View file

@ -13,7 +13,7 @@ typedef struct sr_fd
int srf_flags; int srf_flags;
int srf_fd; int srf_fd;
int srf_port; int srf_port;
int srf_select_proc; endpoint_t srf_select_proc;
sr_open_t srf_open; sr_open_t srf_open;
sr_close_t srf_close; sr_close_t srf_close;
sr_write_t srf_write; sr_write_t srf_write;

View file

@ -117,7 +117,7 @@ PRIVATE void sef_local_startup()
/*===========================================================================* /*===========================================================================*
* sef_cb_init_fresh * * 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. */ /* Initialize the ipc server. */

View file

@ -11,10 +11,10 @@
#include <minix/endpoint.h> #include <minix/endpoint.h>
/* Allocate space for the global variables. */ /* Allocate space for the global variables. */
message m_in; /* the input message itself */ PRIVATE message m_in; /* the input message itself */
message m_out; /* the output message used for reply */ PRIVATE message m_out; /* the output message used for reply */
int who_e; /* caller's proc number */ PRIVATE endpoint_t who_e; /* caller's proc number */
int callnr; /* system call number */ PRIVATE int callnr; /* system call number */
extern int errno; /* error number set by system library */ extern int errno; /* error number set by system library */

View file

@ -286,7 +286,7 @@ int flags; /* mode bits and flags */
* gen_io * * gen_io *
*===========================================================================*/ *===========================================================================*/
PRIVATE int gen_io(task_nr, mess_ptr) 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 */ message *mess_ptr; /* pointer to message for task */
{ {
/* All file system I/O ultimately comes down to I/O on major/minor device /* 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 * * dev_close *
*===========================================================================*/ *===========================================================================*/
PUBLIC void dev_close(driver_e, dev) PUBLIC void dev_close(endpoint_t driver_e, dev_t dev)
endpoint_t driver_e;
dev_t dev; /* device to close */
{ {
(void) gen_opcl(driver_e, DEV_CLOSE, dev, 0, 0); (void) gen_opcl(driver_e, DEV_CLOSE, dev, 0, 0);
} }

View file

@ -19,7 +19,7 @@ FORWARD _PROTOTYPE( int sef_cb_init_fresh, (int type, sef_init_info_t *info) );
* main * * main *
*===========================================================================*/ *===========================================================================*/
PUBLIC int main(void) { PUBLIC int main(void) {
int who_e, ind, error; endpoint_t who_e, ind, error;
message m; message m;
/* SEF local startup. */ /* SEF local startup. */

View file

@ -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) ); u64_t pos, int bytes, int flags) );
_PROTOTYPE( int dev_open, (endpoint_t driver_e, Dev_t dev, int proc, _PROTOTYPE( int dev_open, (endpoint_t driver_e, Dev_t dev, int proc,
int flags) ); 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) ); _PROTOTYPE( int fs_new_driver, (void) );
/* inode.c */ /* inode.c */

View file

@ -8,18 +8,15 @@
#include <minix/vfsif.h> #include <minix/vfsif.h>
FORWARD _PROTOTYPE(int stat_dir_record, (struct dir_record *dir, int pipe_pos,
int who_e, cp_grant_id_t gid) );
/*===========================================================================* /*===========================================================================*
* stat_dir_record * * stat_dir_record *
*===========================================================================*/ *===========================================================================*/
PRIVATE int stat_dir_record(dir, pipe_pos, who_e, gid) PRIVATE int stat_dir_record(
register struct dir_record *dir; /* pointer to dir record to stat */ register struct dir_record *dir, /* pointer to dir record to stat */
int pipe_pos; /* position in a pipe, supplied by fstat() */ int pipe_pos, /* position in a pipe, supplied by fstat() */
int who_e; /* Caller endpoint */ endpoint_t who_e, /* Caller endpoint */
cp_grant_id_t gid; /* grant for the stat buf */ cp_grant_id_t gid /* grant for the stat buf */
)
{ {
/* This function returns all the info about a particular inode. It's missing /* 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. * the recording date because of a bug in the standard functions stdtime.

View file

@ -24,7 +24,7 @@ FORWARD _PROTOTYPE( void safe_io_cleanup, (cp_grant_id_t, cp_grant_id_t *,
int)); int));
FORWARD _PROTOTYPE( int gen_opcl, (endpoint_t driver_e, int op, FORWARD _PROTOTYPE( int gen_opcl, (endpoint_t driver_e, int op,
Dev_t dev, int proc_e, int flags) ); 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 * * gen_io *
*===========================================================================*/ *===========================================================================*/
PRIVATE int gen_io(task_nr, mess_ptr) PRIVATE int gen_io(
int task_nr; /* which task to call */ endpoint_t task_nr, /* which task to call */
message *mess_ptr; /* pointer to message for task */ message *mess_ptr /* pointer to message for task */
)
{ {
/* All file system I/O ultimately comes down to I/O on major/minor device /* 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. * pairs. These lead to calls on the following routines via the dmap table.

View file

@ -167,9 +167,10 @@ message *m_in; /* pointer to message */
/*===========================================================================* /*===========================================================================*
* reply * * reply *
*===========================================================================*/ *===========================================================================*/
PUBLIC void reply(who, m_out) PUBLIC void reply(
int who; endpoint_t who,
message *m_out; /* report result */ message *m_out /* report result */
)
{ {
if (OK != send(who, m_out)) /* send the message */ if (OK != send(who, m_out)) /* send the message */
printf("MFS(%d) was unable to send reply\n", SELF_E); printf("MFS(%d) was unable to send reply\n", SELF_E);

View file

@ -52,7 +52,7 @@ _PROTOTYPE( int fs_unlink, (void) );
_PROTOTYPE( int truncate_inode, (struct inode *rip, off_t len) ); _PROTOTYPE( int truncate_inode, (struct inode *rip, off_t len) );
/* main.c */ /* main.c */
_PROTOTYPE( void reply, (int who, message *m_out) ); _PROTOTYPE( void reply, (endpoint_t who, message *m_out) );
/* misc.c */ /* misc.c */
_PROTOTYPE( int fs_flush, (void) ); _PROTOTYPE( int fs_flush, (void) );

View file

@ -8,17 +8,15 @@
#include "super.h" #include "super.h"
#include <minix/vfsif.h> #include <minix/vfsif.h>
FORWARD _PROTOTYPE( int stat_inode, (struct inode *rip, int who_e,
cp_grant_id_t gid) );
/*===========================================================================* /*===========================================================================*
* stat_inode * * stat_inode *
*===========================================================================*/ *===========================================================================*/
PRIVATE int stat_inode(rip, who_e, gid) PRIVATE int stat_inode(
register struct inode *rip; /* pointer to inode to stat */ register struct inode *rip, /* pointer to inode to stat */
int who_e; /* Caller endpoint */ endpoint_t who_e, /* Caller endpoint */
cp_grant_id_t gid; /* grant for the stat buf */ cp_grant_id_t gid /* grant for the stat buf */
)
{ {
/* Common code for stat and fstat system calls. */ /* Common code for stat and fstat system calls. */

View file

@ -2,17 +2,15 @@
#include "inode.h" #include "inode.h"
#include <sys/stat.h> #include <sys/stat.h>
FORWARD _PROTOTYPE( int stat_inode, (struct inode *rip, int who_e,
cp_grant_id_t gid) );
/*===========================================================================* /*===========================================================================*
* stat_inode * * stat_inode *
*===========================================================================*/ *===========================================================================*/
PRIVATE int stat_inode(rip, who_e, gid) PRIVATE int stat_inode(
register struct inode *rip; /* pointer to inode to stat */ register struct inode *rip, /* pointer to inode to stat */
int who_e; /* Caller endpoint */ endpoint_t who_e, /* Caller endpoint */
cp_grant_id_t gid; /* grant for the stat buf */ cp_grant_id_t gid /* grant for the stat buf */
)
{ {
/* Common code for stat and fstat system calls. */ /* Common code for stat and fstat system calls. */