bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Include mig generated device headers to avoid missing prototypes


From: Flavio Cruz
Subject: [PATCH] Include mig generated device headers to avoid missing prototypes
Date: Thu, 19 Jan 2023 14:22:12 -0500

Some of the existing definitions lacked the const qualifier, which was
added.
---
 device/dev_hdr.h     |  4 ++--
 device/dev_lookup.c  |  2 +-
 device/dev_name.c    |  4 ++--
 device/dev_pager.c   |  1 +
 device/device_emul.h |  4 ++--
 device/ds_routines.c | 13 +++++++------
 6 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/device/dev_hdr.h b/device/dev_hdr.h
index 56e0d825..ac6ce7e1 100644
--- a/device/dev_hdr.h
+++ b/device/dev_hdr.h
@@ -107,7 +107,7 @@ typedef     struct mach_device *mach_device_t;
 /*
  * To find and remove device entries
  */
-mach_device_t  device_lookup(char *);  /* by name */
+mach_device_t  device_lookup(const char *);    /* by name */
 
 void           mach_device_reference(mach_device_t);
 void           mach_device_deallocate(mach_device_t);
@@ -136,7 +136,7 @@ boolean_t   dev_map(dev_map_fn, mach_port_t);
  * device name lookup
  */
 extern boolean_t dev_name_lookup(
-    char *             name,
+    const char *       name,
     dev_ops_t          *ops,   /* out */
     int                *unit);  /* out */
 
diff --git a/device/dev_lookup.c b/device/dev_lookup.c
index febaebdd..bebdf6f3 100644
--- a/device/dev_lookup.c
+++ b/device/dev_lookup.c
@@ -116,7 +116,7 @@ dev_number_lookup(const dev_ops_t ops, int devnum)
  * table.
  */
 mach_device_t
-device_lookup(char *name)
+device_lookup(const char *name)
 {
        dev_ops_t       dev_ops;
        int             dev_minor;
diff --git a/device/dev_name.c b/device/dev_name.c
index 4595d31c..e64fd0e9 100644
--- a/device/dev_name.c
+++ b/device/dev_name.c
@@ -118,7 +118,7 @@ name_equal(src, len, target)
  * device name lookup
  */
 boolean_t dev_name_lookup(
-       char            *name,
+       const char              *name,
        dev_ops_t       *ops,   /* out */
        int             *unit)  /* out */
 {
@@ -134,7 +134,7 @@ boolean_t dev_name_lookup(
         * <partition>          is a letter in [a-h] (disks only?)
         */
 
-       char            *cp = name;
+       const char              *cp = name;
        int             len;
        int             j = 0;
        int             c;
diff --git a/device/dev_pager.c b/device/dev_pager.c
index 3a37a14d..728be036 100644
--- a/device/dev_pager.c
+++ b/device/dev_pager.c
@@ -50,6 +50,7 @@
 #include <vm/vm_kern.h>
 #include <vm/vm_user.h>
 
+#include <device/device_pager.server.h>
 #include <device/device_types.h>
 #include <device/ds_routines.h>
 #include <device/dev_hdr.h>
diff --git a/device/device_emul.h b/device/device_emul.h
index 683fc802..873d7f5b 100644
--- a/device/device_emul.h
+++ b/device/device_emul.h
@@ -36,12 +36,12 @@ struct device_emulation_ops
   void (*dealloc) (void *);
   ipc_port_t (*dev_to_port) (void *);
   io_return_t (*open) (ipc_port_t, mach_msg_type_name_t,
-                      dev_mode_t, char *, device_t *);
+                      dev_mode_t, const char *, device_t *);
   io_return_t (*close) (void *);
   io_return_t (*write) (void *, ipc_port_t, mach_msg_type_name_t,
                        dev_mode_t, recnum_t, io_buf_ptr_t, unsigned, int *);
   io_return_t (*write_inband) (void *, ipc_port_t, mach_msg_type_name_t,
-                              dev_mode_t, recnum_t, io_buf_ptr_inband_t,
+                              dev_mode_t, recnum_t, const io_buf_ptr_inband_t,
                               unsigned, int *);
   io_return_t (*read) (void *, ipc_port_t, mach_msg_type_name_t,
                       dev_mode_t, recnum_t, int, io_buf_ptr_t *, unsigned *);
diff --git a/device/ds_routines.c b/device/ds_routines.c
index 07cfd85b..e5dec6c7 100644
--- a/device/ds_routines.c
+++ b/device/ds_routines.c
@@ -84,6 +84,7 @@
 #include <vm/vm_user.h>
 
 #include <device/device_types.h>
+#include <device/device.server.h>
 #include <device/dev_hdr.h>
 #include <device/conf.h>
 #include <device/io_req.h>
@@ -140,7 +141,7 @@ struct kmem_cache   io_inband_cache;
 io_return_t
 ds_device_open (ipc_port_t open_port, ipc_port_t reply_port,
                mach_msg_type_name_t reply_port_type, dev_mode_t mode,
-               char *name, device_t *devp)
+               const_dev_name_t name, device_t *devp)
 {
   unsigned i;
   io_return_t err;
@@ -206,7 +207,7 @@ io_return_t
 ds_device_write_inband (device_t dev, ipc_port_t reply_port,
                        mach_msg_type_name_t reply_port_type,
                        dev_mode_t mode, recnum_t recnum,
-                       io_buf_ptr_inband_t data, unsigned count,
+                       const io_buf_ptr_inband_t data, unsigned count,
                        int *bytes_written)
 {
   /* Refuse if device is dead or not completely open.  */
@@ -245,7 +246,7 @@ ds_device_read (device_t dev, ipc_port_t reply_port,
 io_return_t
 ds_device_read_inband (device_t dev, ipc_port_t reply_port,
                       mach_msg_type_name_t reply_port_type, dev_mode_t mode,
-                      recnum_t recnum, int count, char *data,
+                      recnum_t recnum, int count, io_buf_ptr_inband_t data,
                       unsigned *bytes_read)
 {
   /* Refuse if device is dead or not completely open.  */
@@ -492,7 +493,7 @@ static io_return_t
 device_open(const ipc_port_t   reply_port,
            mach_msg_type_name_t reply_port_type,
            dev_mode_t          mode,
-           char *              name,
+           const char *                name,
            device_t            *device_p)
 {
        mach_device_t           device;
@@ -826,7 +827,7 @@ device_write_inband(void            *dev,
                    mach_msg_type_name_t        reply_port_type,
                    dev_mode_t          mode,
                    recnum_t            recnum,
-                   io_buf_ptr_inband_t data,
+                   const io_buf_ptr_inband_t   data,
                    unsigned int        data_count,
                    int                 *bytes_written)
 {
@@ -849,7 +850,7 @@ device_write_inband(void            *dev,
        ior->io_op              = IO_WRITE | IO_CALL | IO_INBAND;
        ior->io_mode            = mode;
        ior->io_recnum          = recnum;
-       ior->io_data            = data;
+       ior->io_data            = (io_buf_ptr_t)data;
        ior->io_count           = data_count;
        ior->io_total           = data_count;
        ior->io_alloc_size      = 0;
-- 
2.39.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]