diff options
author | Hans Petter Selasky <hselasky@FreeBSD.org> | 2020-12-07 10:21:01 +0000 |
---|---|---|
committer | Hans Petter Selasky <hselasky@FreeBSD.org> | 2020-12-07 10:21:01 +0000 |
commit | 34602358c02f929b9baffd9f84eb82e772e6defb (patch) | |
tree | 523f79bae63c9e24f976f0914ff38afc78fa43b4 /stand | |
parent | a399cf139b5aedc5c7ce8811ea2f34268da7e8bd (diff) | |
download | src-test-34602358c02f929b9baffd9f84eb82e772e6defb.tar.gz src-test-34602358c02f929b9baffd9f84eb82e772e6defb.zip |
Tidy up code a bit. Add missing section comments.
No functional change.
MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking
Notes
Notes:
svn path=/head/; revision=368407
Diffstat (limited to 'stand')
-rw-r--r-- | stand/kshim/bsd_kernel.c | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/stand/kshim/bsd_kernel.c b/stand/kshim/bsd_kernel.c index 75eccb1d67257..627a77869e953 100644 --- a/stand/kshim/bsd_kernel.c +++ b/stand/kshim/bsd_kernel.c @@ -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) { @@ -255,6 +250,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) { |