Commit Graph

31304 Commits

Author SHA1 Message Date
Ian Lepore
51304ddeb7 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.
2017-10-12 07:04:09 +02:00
Ian Lepore
0aef6fb350 timecounter: Merge FreeBSD change r280012
Use sbuf_printf() for sysctl strings instead of stack buffers and snprintf().

Update #3175.
2017-10-12 07:04:09 +02:00
Hans Petter Selasky
ea0b339bbc timecounter: Merge FreeBSD change r279728
Add mutex support to the pps_ioctl() API in the kernel. Bump kernel version to reflect structure change.

PR:		196897
MFC after:	1 week

Update #3175.
2017-10-12 07:04:09 +02:00
Sebastian Huber
ed9a6fd8ac posix: Use right time format in adjtime()
Update #2740.
2017-10-12 07:04:09 +02:00
Joel Sherrill
dfa9a2e7ea xz/README: Correct URL
Closes #2829.
2017-10-11 21:37:10 -05:00
Joel Sherrill
14e5a0824b Fix warnings for using C/ObjC specific GCC flags with C++
Closes #3181.
2017-10-11 21:32:32 -05:00
Joel Sherrill
871c23caba Fix spprofiling01 overriding recipe warning
Closes #3084.
2017-10-11 20:18:58 -05:00
Sebastian Huber
16aaf73bbb smpaffinity01: Fix test case
Update #2514.
2017-10-11 08:33:56 +02:00
Sebastian Huber
157c767868 posix: Include missing <limits.h> 2017-10-11 07:54:08 +02:00
Sebastian Huber
b2dbb634ec score: Remove CPU_set_Control
Use Processor_mask instead.

Update #2514.
2017-10-11 07:37:58 +02:00
Sebastian Huber
a3ad4afba8 posix: Validate affinity sets by the scheduler
Update #2514.
2017-10-11 07:37:54 +02:00
Sebastian Huber
db3a3decbd score: Add _Thread_queue_Dispatch_disable() 2017-10-10 10:03:48 +02:00
Sebastian Huber
bd5be58fa6 posix: Unconditional thread attribute support
Update #2514.
2017-10-10 07:18:09 +02:00
Sebastian Huber
4f9ed26655 posix: Constify default thread processor affinity
Set default thread processor affinity to all processors of the
pre-allocated set.  This allows to constify the
_POSIX_Threads_Default_attributes.

Update #2514.
2017-10-10 07:17:51 +02:00
Sebastian Huber
8c5267a268 posix: Simplify pthread_attr_setstack()
Simplify

* pthread_attr_setstack(), and
* pthread_attr_setstacksize().

Update #2514.
2017-10-10 07:11:29 +02:00
Sebastian Huber
da9f5f1133 posix: Remove rtems_pthread_attribute_compare()
Update #2514.
Close #3174.
2017-10-09 15:54:20 +02:00
Sebastian Huber
af9115f35c posix: Simplify POSIX_API_Control
Return stack area via pthread_getattr_np().

Simplify

* pthread_attr_setaffinity_np(), and
* pthread_attr_getaffinity_np()

and let the scheduler do the more sophisticated error checks.

Make

* pthread_setaffinity_np(),
* pthread_getaffinity_np(),
* pthread_attr_setaffinity_np(), and
* pthread_attr_getaffinity_np()

available in all configurations.

Update #2514.
Close #3145.
Close #3168.
2017-10-09 14:52:58 +02:00
Sebastian Huber
65012bfebb score: Change Timestamp_Control to sbintime_t
The timestamp are based on the uptime.  There is no need for a 64-bit
seconds part.  The signed 32-bit seconds part of the sbintime_t limits
the uptime to roughly 68 years.

Close #2740.
2017-10-09 08:30:07 +02:00
Sebastian Huber
2256946e9c score: Use struct timespec for TOD
Use the timestamps only for uptime based values.  Use struct timespec
for the absolute time values (TOD).

Update #2740.
2017-10-09 08:30:03 +02:00
Sebastian Huber
c0623a9941 score: Simplify _Timestamp_Add_to()
Update #2740.
2017-10-09 08:17:17 +02:00
Sebastian Huber
80933ab316 bsps/powerpc: Fix robust thread dispatch again
Use the saved MSR to account for FPU and AltiVec settings.

Update #2811.
2017-10-09 07:38:15 +02:00
Sebastian Huber
6489bcbfee psxtests/psx05: Fix timeout calculation
Update #3111.
2017-10-09 07:23:32 +02:00
Joel Sherrill
19cbd1943d pc386/.../bspreset.c: Readd proper reset code.
The removal of the Edison code removed the wrong part of the
conditional.

Closes #3172.
2017-10-08 22:26:13 -05:00
Sebastian Huber
098b67b676 posix: Resurrect signal support
This was accidentally removed during a merge conflict by
89fc9345de.
2017-10-06 20:01:39 +02:00
Sebastian Huber
587afc3400 confdefs: Fix typo 2017-10-06 14:20:00 +02:00
Sebastian Huber
170df3d9b1 bsp/imx: Add SPI bus driver
Update #3090.
2017-10-06 12:49:30 +02:00
Sebastian Huber
54380f4244 bsp/imx: Add imx_iomux_configure_pins()
Update #3090.
2017-10-06 12:49:30 +02:00
Sebastian Huber
e316be750c bsp/imx: Import iomux from FreeBSD
Update #3090.
2017-10-06 12:49:29 +02:00
Sebastian Huber
b39cda6ca4 bsp/imx: Fix I2C registration with path
Update #3090.
2017-10-06 12:49:29 +02:00
Sebastian Huber
8bdbefedd5 libdl: Fix warnings
Update #3155.
2017-10-06 09:43:17 +02:00
Sebastian Huber
4e38aed005 libdl: Use 64-bit ELF on 64-bit targets
Update #3155.
2017-10-06 09:43:17 +02:00
Sebastian Huber
900fda4567 rtems: Fix format warnings
Update #3111.
2017-10-06 09:43:17 +02:00
Sebastian Huber
de59c065c5 posix: Implement self-contained POSIX mutex
POSIX mutexes are now available in all configurations and no longer
depend on --enable-posix.

Update #2514.
Update #3112.
2017-10-05 14:29:02 +02:00
Sebastian Huber
5222488573 posix: Implement self-contained POSIX condvar
POSIX condition variables are now available in all configurations and no
longer depend on --enable-posix.

Update #2514.
Update #3113.
2017-10-05 14:29:02 +02:00
Sebastian Huber
89fc9345de posix: Implement self-contained POSIX rwlocks
POSIX rwlocks are now available in all configurations and no longer
depend on --enable-posix.

Update #2514.
Update #3115.
2017-10-05 14:29:02 +02:00
Sebastian Huber
e67929c4c0 posix: Implement self-contained POSIX barriers
POSIX barriers are now available in all configurations and no longer
depend on --enable-posix.

Update #2514.
Update #3114.
2017-10-05 14:29:01 +02:00
Sebastian Huber
c090db7405 posix: Implement self-contained POSIX semaphores
For semaphore object pointer and object validation see
POSIX_SEMAPHORE_VALIDATE_OBJECT().

Destruction or close of a busy semaphore returns an error status.  The
object is not flushed.

POSIX semaphores are now available in all configurations and no longer
depend on --enable-posix.

Update #2514.
Update #3116.
2017-10-05 14:29:01 +02:00
Sebastian Huber
47b1e31f11 posix: Optimize pthread_once_t
Reduce size of pthread_once_t and make it zero-initialized.

Update #3142.
2017-10-05 14:29:01 +02:00
Sebastian Huber
e46a075d35 Enforce compatible Newlib version
This Newlib check ensures that we have a 64-bit time_t and
self-contained POSIX synchronization objects.

Update #2514.
Update #3111.
Update #3112.
Update #3113.
Update #3114.
Update #3115.
Update #3116.
2017-10-05 14:28:56 +02:00
Sebastian Huber
5cf5d46ec8 score: Make status codes unconditional
The internal status codes encode a Classic rtems_status_code and error
codes used by the POSIX and C11/C++11 APIs.  In case the POSIX API is
disabled, the C11/C++11 support must still work.

Close #3167.
2017-10-05 09:45:30 +02:00
Sebastian Huber
dcdd329e5c posix: Fix aio_cancel()
Update #3164.
2017-10-04 09:25:22 +02:00
Sebastian Huber
f043b9bd3b bsp/imx: Add I2C bus driver
Update #3090.
2017-10-02 13:40:56 +02:00
Sebastian Huber
9db9024b7d bsp/imx: Fix I2C register header
Update #3090.
2017-10-02 13:40:56 +02:00
Sebastian Huber
ce28d601c9 bsp/imx: Add imx_get_reg_of_node()
Update #3090.
2017-10-02 13:40:56 +02:00
Sebastian Huber
7e195e66c7 bsp/imx: Add imx_get_irq_of_node()
Update #3090.
2017-10-02 13:40:56 +02:00
Sebastian Huber
4cfce5cb64 i2c: Add temperature sensor LM75A driver
Close #3163.
2017-10-02 13:40:46 +02:00
Sebastian Huber
9c063df3ab i2c: Fix EEPROM driver program timeout handling
The RTEMS_MILLISECONDS_TO_TICKS() macro doesn't round up. Do not use it
to calculate the program timeout in ticks. Check program done condition
after the timeout check to account for pre-emptions.

Update #3162.
2017-10-02 13:34:00 +02:00
Sebastian Huber
2e1d595972 i2c: Send MSB of address first for EEPROMs
Update #3161.
2017-10-02 13:34:00 +02:00
Daniel Hellstrom
f9fbb3336f libpci: fix pci device allocation
The refactoring of pci_dev_create() was incorrect since the code relied on
different defines before including pci/cfg.h. This reverts back to the
original code having two pci_dev_create() one in auto and one in read library.
confdefs.h selectes between the two libraries so both there is no link
conflict.

Updates #3029
2017-09-29 13:36:44 +02:00
Sebastian Huber
0b134aca35 bsp/bf537Stamp: Fix warning 2017-09-29 07:43:08 +02:00