Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/usb/usb_core.h
| Show First 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | |||||
| /* locking wrappers for XFER lock */ | /* locking wrappers for XFER lock */ | ||||
| #define USB_XFER_LOCK(_x) USB_MTX_LOCK((_x)->xroot->xfer_mtx) | #define USB_XFER_LOCK(_x) USB_MTX_LOCK((_x)->xroot->xfer_mtx) | ||||
| #define USB_XFER_UNLOCK(_x) USB_MTX_UNLOCK((_x)->xroot->xfer_mtx) | #define USB_XFER_UNLOCK(_x) USB_MTX_UNLOCK((_x)->xroot->xfer_mtx) | ||||
| #define USB_XFER_LOCK_ASSERT(_x, _t) USB_MTX_ASSERT((_x)->xroot->xfer_mtx, _t) | #define USB_XFER_LOCK_ASSERT(_x, _t) USB_MTX_ASSERT((_x)->xroot->xfer_mtx, _t) | ||||
| /* helper for converting pointers to integers */ | /* helper for converting pointers to integers */ | ||||
| #define USB_P2U(ptr) \ | #define USB_P2U(ptr) \ | ||||
| (((const uint8_t *)(ptr)) - ((const uint8_t *)0)) | ((uintptr_t)(ptr)) | ||||
| /* helper for computing offsets */ | /* helper for computing offsets */ | ||||
| #define USB_ADD_BYTES(ptr,size) \ | #define USB_ADD_BYTES(ptr,size) \ | ||||
| ((void *)(USB_P2U(ptr) + (size))) | ((void *)(__DECONST(char *, (ptr)) + (size))) | ||||
| /* debug macro */ | /* debug macro */ | ||||
| #define USB_ASSERT KASSERT | #define USB_ASSERT KASSERT | ||||
| /* structure prototypes */ | /* structure prototypes */ | ||||
| struct file; | struct file; | ||||
| struct usb_bus; | struct usb_bus; | ||||
| ▲ Show 20 Lines • Show All 123 Lines • Show Last 20 Lines | |||||