Date: Mon, 7 Dec 2020 10:21:01 +0000 (UTC) From: Hans Petter Selasky <hselasky@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r368407 - head/stand/kshim Message-ID: <202012071021.0B7AL1VO076622@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202012071021.0B7AL1VO076622>