FORWARD _PROTOTYPE( void log_signal, (struct driver *dp, message *m_ptr) );
FORWARD _PROTOTYPE( int log_other, (struct driver *dp, message *m_ptr) );
FORWARD _PROTOTYPE( void log_geometry, (struct partition *entry) );
-FORWARD _PROTOTYPE( void log_reply, (int code, int replyee, int proc, int status) );
FORWARD _PROTOTYPE( int subread, (struct logdevice *log, int count, int proc_nr, vir_bytes user_vir) );
/* Entry points to this driver. */
/*===========================================================================*
* main *
*===========================================================================*/
-PUBLIC void main(void)
+PUBLIC int main(void)
{
int i;
for(i = 0; i < NR_DEVS; i++) {
logdevices[i].log_select_ready_ops = 0;
logdevices[i].log_proc_nr = 0;
logdevices[i].log_revive_alerted = 0;
- }
- driver_task(&log_dtab);
+ }
+ driver_task(&log_dtab);
+ return(OK);
}
/*===========================================================================*
vir_bytes user_vir;
struct device *dv;
unsigned long dv_size;
- int s, accumulated_read = 0;
+ int accumulated_read = 0;
struct logdevice *log;
if(log_device < 0 || log_device >= NR_DEVS)
log = &logdevices[log_device];
while (nr_req > 0) {
- char *buf;
/* How much to transfer and where to / from. */
count = iov->iov_size;
user_vir = iov->iov_addr;
return(OK);
}
-/*===========================================================================*
- * log_reply *
- *===========================================================================*/
-PRIVATE void log_reply(code, replyee, process, status)
-int code; /* TASK_REPLY or REVIVE */
-int replyee; /* destination for message (normally FS) */
-int process; /* which user requested the printing */
-int status; /* number of chars printed or error code */
-{
- message mess;
-
- mess.m_type = code;
- mess.REP_STATUS = status;
- mess.REP_PROC_NR = process;
- send(replyee, &mess);
-}
-
/*============================================================================*
* log_do_open *
*============================================================================*/
*============================================================================*/
PRIVATE void do_status(message *m_ptr)
{
- int d, nr = 0;
+ int d;
message m;
/* Caller has requested pending status information, which currently
PRIVATE struct device m_geom[NR_DEVS]; /* base and size of each device */
PRIVATE int m_device; /* current device */
-PRIVATE struct randomness krandom; /* randomness from the kernel */
extern int errno; /* error number for PM calls */
/*===========================================================================*
* main *
*===========================================================================*/
-PUBLIC void main(void)
+PUBLIC int main(void)
{
r_init(); /* initialize the memory driver */
driver_task(&r_dtab); /* start driver's main loop */
+ return(OK);
}
/*===========================================================================*
unsigned nr_req; /* length of request vector */
{
/* Read or write one the driver's minor devices. */
- phys_bytes mem_phys, user_phys;
- int seg;
unsigned count, left, chunk;
vir_bytes user_vir;
struct device *dv;
unsigned long dv_size;
- int s;
/* Get minor device number and check for /dev/null. */
dv = &m_geom[m_device];
PRIVATE void r_init()
{
/* Initialize this task. All minor devices are initialized one by one. */
- int i, s;
-
random_init();
r_random(NULL, NULL); /* also set periodic timer */
}