From: Chris D. <chr...@gm...> - 2015-05-05 05:14:45
|
Hi, *** The original patch series was out-of-date. Please disregard. *** This patch series introduces an abstraction layer into the libusb core that allows different platforms to use native constructs to achieve the required functionality. Two examples of these constructs are event notification mechanisms and programmable timers that provide notification of expiration. The highlights of this patch series are as follows: * Completely eliminate all POSIX emulation for the Windows/WinCE backends * Add support for eventfd on Linux platforms * Enable the use of libusb_get_pollfds() and friends on Windows/WinCE * Does not break ABI for any currently existing applications [1] There is one fundamental change that I would like to highlight in regards to timers. The current behavior on Linux is that the timerfd is armed with an absolute timeout. This will favor slightly earlier expiration as the timer immediately starts expiring as soon the clock is read. This means that any time spent processing or waiting to be scheduled between reading the clock and arming the timer counts towards the timeout. The new behavior uses a relative timeout, thus the timer doesn't start ticking until it is actually armed. This doesn't mean much for arming the timer the first time, but when rearming the timer for an already in-flight transfer, the timer will tend to expire slightly after the actual timeout as it is necessary to read the clock and compute the remaining time left for expiration. Any processing, scheduling, context switch, etc. cannot be accounted for and will extend the timeout of the next transfer. It is my intent that this patch series close out the development phase for v1.0.20. If this can get at least one comprehensive review from another maintainer, I propose that this be merged and we create a release candidate ASAP. After the standard RC shakedown, I would then like to move forward with the usbdk and hotplug integration for Windows and have a quick turn-around release for v1.0.21. Regards, Chris [1] Strictly speaking, it breaks ABI for any 64-bit Windows applications as the libusb_os_handle type is 8 bytes while the int representing a file descriptor is only 4. However, no existing application could have used the API functions dealing with file descriptors on Windows, so I see this as a non-issue. Chris Dickens (15): API: Introduce libusb_os_handle type core: First pass of platform event abstraction POSIX: Event and timer abstraction implementation POSIX: Add support for eventfd linux_udev: Use new event abstraction linux_netlink: Use new event abstraction Windows: Event and timer abstraction implementation POSIX: Implement event handling functionality Windows: Implement event handling functionality Windows: Backend changes to support new abstraction layer WinCE: Backend changes to support new abstraction layer Misc: Update Visual Studio project files Xcode: Update project file to account for file changes Android: Update makefile to account for file changes Remove the now obsolete poll_windows.{c,h} files Xcode/config.h | 4 +- Xcode/libusb.xcodeproj/project.pbxproj | 16 +- android/config.h | 4 +- android/jni/libusb.mk | 6 +- configure.ac | 69 +-- examples/Makefile.am | 2 +- libusb/Makefile.am | 30 +- libusb/core.c | 42 +- libusb/hotplug.c | 2 +- libusb/io.c | 583 +++++++++++-------------- libusb/libusb.h | 49 ++- libusb/libusbi.h | 143 ++++--- libusb/os/events_posix.c | 315 ++++++++++++++ libusb/os/events_posix.h | 28 ++ libusb/os/events_windows.c | 217 ++++++++++ libusb/os/events_windows.h | 15 + libusb/os/haiku/haiku_usb_raw.cpp | 4 - libusb/os/linux_netlink.c | 38 +- libusb/os/linux_udev.c | 43 +- libusb/os/linux_usbfs.c | 23 +- libusb/os/poll_posix.c | 53 --- libusb/os/poll_posix.h | 11 - libusb/os/poll_windows.c | 728 -------------------------------- libusb/os/poll_windows.h | 131 ------ libusb/os/wince_usb.c | 97 ++--- libusb/os/wince_usb.h | 3 +- libusb/os/windows_common.h | 27 ++ libusb/os/windows_usb.c | 290 ++++++------- libusb/os/windows_usb.h | 6 +- libusb/version.h | 2 +- msvc/config.h | 7 +- msvc/libusb_dll.dsp | 47 +-- msvc/libusb_dll_2005.vcproj | 20 +- msvc/libusb_dll_2010.vcxproj | 10 +- msvc/libusb_dll_2010.vcxproj.filters | 20 +- msvc/libusb_dll_2012.vcxproj | 13 +- msvc/libusb_dll_2012.vcxproj.filters | 27 +- msvc/libusb_dll_2013.vcxproj | 13 +- msvc/libusb_dll_wince.vcproj | 4 +- msvc/libusb_sources | 4 +- msvc/libusb_static.dsp | 36 +- msvc/libusb_static_2005.vcproj | 20 +- msvc/libusb_static_2010.vcxproj | 12 +- msvc/libusb_static_2010.vcxproj.filters | 30 +- msvc/libusb_static_2012.vcxproj | 14 +- msvc/libusb_static_2012.vcxproj.filters | 28 +- msvc/libusb_static_2013.vcxproj | 14 +- msvc/libusb_static_wince.vcproj | 4 +- msvc/listdevs.dsp | 2 +- msvc/xusb.dsp | 2 +- 50 files changed, 1428 insertions(+), 1880 deletions(-) create mode 100644 libusb/os/events_posix.c create mode 100644 libusb/os/events_posix.h create mode 100644 libusb/os/events_windows.c create mode 100644 libusb/os/events_windows.h delete mode 100644 libusb/os/poll_posix.c delete mode 100644 libusb/os/poll_posix.h delete mode 100644 libusb/os/poll_windows.c delete mode 100644 libusb/os/poll_windows.h mode change 100644 => 100755 msvc/config.h -- 1.9.3 |