--- Gnu-Mach/device/kmsg.c 2020/09/02 04:41:25 1.1.1.1 +++ Gnu-Mach/device/kmsg.c 2020/09/02 04:45:33 1.1.1.2 @@ -1,5 +1,7 @@ /* GNU Mach Kernel Message Device. - Copyright (C) 1998, 1999 Free Software Foundation, Inc. + + Copyright (C) 1998, 1999, 2007 Free Software Foundation, Inc. + Written by OKUJI Yoshinori. This is free software; you can redistribute it and/or modify @@ -16,14 +18,17 @@ You should have received a copy of the G along with the software; see the file COPYING. If not, write to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* Now kmsg provides stream interface, not random access methods. */ +/* kmsg provides a stream interface. */ #include +#include + #include +#include #include #include #include -#include +#include #define KMSGBUFSIZE (4096) /* XXX */ @@ -39,7 +44,7 @@ static queue_head_t kmsg_read_queue; /* Used for exclusive access to the device */ static int kmsg_in_use; /* Used for exclusive access to the routines */ -static simple_lock_data_t kmsg_lock; +decl_simple_lock_data (static, kmsg_lock); /* If already initialized or not */ static int kmsg_init_done = 0; @@ -106,7 +111,7 @@ kmsgread (dev_t dev, io_req_t ior) } ior->io_done = kmsg_read_done; - enqueue_tail (&kmsg_read_queue, ior); + enqueue_tail (&kmsg_read_queue, (queue_entry_t) ior); simple_unlock (&kmsg_lock); return D_IO_QUEUED; } @@ -145,7 +150,6 @@ kmsgread (dev_t dev, io_req_t ior) static boolean_t kmsg_read_done (io_req_t ior) { - int err; int amt, len; simple_lock (&kmsg_lock); @@ -153,7 +157,7 @@ kmsg_read_done (io_req_t ior) { /* The queue is empty. */ ior->io_done = kmsg_read_done; - enqueue_tail (&kmsg_read_queue, ior); + enqueue_tail (&kmsg_read_queue, (queue_entry_t) ior); simple_unlock (&kmsg_lock); return FALSE; }