svn commit: r368407 - head/stand/kshim
Hans Petter Selasky
hselasky at FreeBSD.org
Mon Dec 7 10:21:01 UTC 2020
Author: hselasky
Date: Mon Dec 7 10:21:01 2020
New Revision: 368407
URL: https://svnweb.freebsd.org/changeset/base/368407
Log:
Tidy up code a bit. Add missing section comments.
No functional change.
MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking
Modified:
head/stand/kshim/bsd_kernel.c
Modified: head/stand/kshim/bsd_kernel.c
==============================================================================
--- head/stand/kshim/bsd_kernel.c Mon Dec 7 09:48:06 2020 (r368406)
+++ head/stand/kshim/bsd_kernel.c Mon Dec 7 10:21:01 2020 (r368407)
@@ -30,23 +30,14 @@ struct usb_process usb_process[USB_PROC_MAX];
static device_t usb_pci_root;
-/*------------------------------------------------------------------------*
- * Implementation of mutex API
- *------------------------------------------------------------------------*/
-
-struct mtx Giant;
int (*bus_alloc_resource_any_cb)(struct resource *res, device_t dev,
int type, int *rid, unsigned int flags);
int (*ofw_bus_status_ok_cb)(device_t dev);
int (*ofw_bus_is_compatible_cb)(device_t dev, char *name);
-static void
-mtx_system_init(void *arg)
-{
- mtx_init(&Giant, "Giant", NULL, MTX_DEF | MTX_RECURSE);
-}
-SYSINIT(mtx_system_init, SI_SUB_LOCK, SI_ORDER_MIDDLE, mtx_system_init, NULL);
-
+/*------------------------------------------------------------------------*
+ * Implementation of busdma API
+ *------------------------------------------------------------------------*/
int
bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment,
bus_size_t boundary, bus_addr_t lowaddr,
@@ -115,6 +106,10 @@ bus_dma_tag_destroy(bus_dma_tag_t dmat)
return (0);
}
+/*------------------------------------------------------------------------*
+ * Implementation of resource management API
+ *------------------------------------------------------------------------*/
+
struct resource *
bus_alloc_resource_any(device_t dev, int type, int *rid, unsigned int flags)
{
@@ -254,6 +249,19 @@ ofw_bus_is_compatible(device_t dev, char *name)
return ((*ofw_bus_is_compatible_cb)(dev, name));
}
+
+/*------------------------------------------------------------------------*
+ * Implementation of mutex API
+ *------------------------------------------------------------------------*/
+
+struct mtx Giant;
+
+static void
+mtx_system_init(void *arg)
+{
+ mtx_init(&Giant, "Giant", NULL, MTX_DEF | MTX_RECURSE);
+}
+SYSINIT(mtx_system_init, SI_SUB_LOCK, SI_ORDER_MIDDLE, mtx_system_init, NULL);
void
mtx_init(struct mtx *mtx, const char *name, const char *type, int opt)
More information about the svn-src-all
mailing list