[RTEMS Project] #3175: Merge FreeBSD timecounter changes from 2015-01-20 to now
RTEMS trac
trac at rtems.org
Thu Oct 12 05:06:22 UTC 2017
#3175: Merge FreeBSD timecounter changes from 2015-01-20 to now
-----------------------------+------------------------------
Reporter: Sebastian Huber | Owner: Sebastian Huber
Type: enhancement | Status: assigned
Priority: normal | Milestone: 4.12.0
Component: score | Version: 4.12
Severity: normal | Resolution:
Keywords: |
-----------------------------+------------------------------
Comment (by Ian Lepore <ian@…>):
In [changeset:"51304ddeb797ce32c8c94c528caaf517edaa777f/rtems"
51304dde/rtems]:
{{{
#!CommitTicketReference repository="rtems"
revision="51304ddeb797ce32c8c94c528caaf517edaa777f"
timecounter: Merge FreeBSD change r282424
Implement a mechanism for making changes in the kernel<->driver PPS
interface without breaking ABI or API compatibility with existing drivers.
The existing data structures used to communicate between the kernel and
driver portions of PPS processing contain no spare/padding fields and no
flags field or other straightforward mechanism for communicating changes
in the structures or behaviors of the code. This makes it difficult to
MFC new features added to the PPS facility. ABI compatibility is
important; out-of-tree drivers in module form are known to exist. (Note
that the existing api_version field in the pps_params structure must
contain the value mandated by RFC 2783 and any RFCs that come along
after.)
These changes introduce a pair of abi-version fields which are filled in
by the driver and the kernel respectively to indicate the interface
version. The driver sets its version field before calling the new
pps_init_abi() function. That lets the kernel know how much of the
pps_state structure is understood by the driver and it can avoid using
newer fields at the end of the structure that it knows about if the driver
is a lower version. The kernel fills in its version field during the init
call, letting the driver know what features and data the kernel supports.
To implement the new version information in a way that is backwards
compatible with code from before these changes, the high bit of the
lightly-used 'kcmode' field is repurposed as a flag bit that indicates the
driver is aware of the abi versioning scheme. Basically if this bit is
clear that indicates a "version 0" driver and if it is set the driver_abi
field indicates the version.
These changes also move the recently-added 'mtx' field of pps_state from
the middle to the end of the structure, and make the kernel code that uses
this field conditional on the driver being abi version 1 or higher. It
changes the only driver currently supplying the mtx field, usb_serial, to
use pps_init_abi().
Reviewed by: hselasky@
Update #3175.
}}}
--
Ticket URL: <http://devel.rtems.org/ticket/3175#comment:3>
RTEMS Project <http://www.rtems.org/>
RTEMS Project
More information about the bugs
mailing list