Commit Graph
9756 Commits
Author SHA1 Message Date
Joel Sherrill 612297e813 Misc: Spell length correctly 2016-07-12 05:44:17 -05:00
Joel Sherrill 665f03acb3 DOSFS - LENGHT -> LENGTH
closes #2756,
2016-07-12 05:43:06 -05:00
Sebastian Huber 6f6cf78501 score: Postpone SMP shutdown in _Terminate()
This enables fatal extensions to continue program execution after some
fatal errors.
2016-07-06 09:33:32 +02:00
Sebastian Huber 008efaff7f score: Do not disable ISR in _Terminate()
This partially reverts 38ee75853f.  Let
the calling context decide if interrupts must be disabled or not.  The
goal is to enable fatal extensions to continue program execution after
some fatal errors.
2016-07-06 09:33:20 +02:00
Pavel Pisa 2b885d6084 libdl/rtl-obj.c: ensure that loaded code is synchronized through caches.
Synchronize each cluster of sections of the same type separately
to support even cases where text and data are allocated from different
areas (for example due allocation from different MPU protection regions).

rtems_cache_instruction_sync_after_code_change is called even to data
sections. Propagation of data only changes should not require cache
maintenance operation on sane SMP mutithread capable systems if barrier
instruction is added but be on safe side even for case where self
modifying code uses data sections initial values etc.
2016-07-04 15:55:57 +02:00
Pavel Pisa 0e507d5510 rtems+bsps/cache: Define cache manager operations for code synchronization and maximal alignment.
There is need for unambiguous named and defined cache function
which should be called when code is updated, loaded
or is self-modifying.

There should be function to obtain maximal cache line length
as well. This function can and should be used for allocations
which can be used for data and or code and ensures that
there are no partial cache lines overlaps on start and
end of allocated region.
2016-07-04 15:55:57 +02:00
Pavel Pisa 0cb50ab25b score/arm: Ensure that copile time alignment is 64 bytes for Cortex-A multilib.
Some/many Cortex-A cores have data cache line length 64 bytes and maximum
value has to be used for system structures alignment.
2016-07-04 15:55:57 +02:00
Pavel Pisa 19a9090164 arm/score and shared: define ARM hypervisor mode and alternate vector table base access.
The main reason for inclusion of minimum hypervisor related defines
is that current ARM boards firmware and loaders (U-boot for example)
start loaded operating system kernel in HYP mode to allow it take
control of virtualization (Linux/KVM for example).
2016-07-04 15:55:56 +02:00
Sebastian Huber 2e3ba71256 net: Fix byte order issue for getnameinfo() 2016-07-01 15:16:10 +02:00
Sebastian Huber df2177ab5e score: Change scheduler node init and destroy
Provide the scheduler node to initialize or destroy to the corresponding
operations.  This makes it possible to have more than one scheduler node
per thread.
2016-07-01 14:47:07 +02:00
Sebastian Huber 4cb13c3998 score: Fix MPCI message layout
Restore the 32-bit priority field in MP_packet_Prefix.

Bug introduced by 254dc82daf.

Close #2750.
2016-07-01 11:55:23 +02:00
Sebastian Huber c0bd0064ac rtems: Fix rtems_task_set_scheduler() API
Task priorities are only valid within a scheduler instance. The
rtems_task_set_scheduler() directive moves a task from one scheduler
instance to another using the current priority of the thread. However,
the current task priority of the source scheduler instance is undefined
in the target scheduler instance. Add a third parameter to specify the
priority.

Close #2749.
2016-07-01 11:51:49 +02:00
Sebastian Huber 8d5b03802e score: Workaround for #2751
The ARM and PowerPC interrupt epilogues call _Thread_Dispatch() with
interrupts disabled (counter example: SPARC).

On SMP configurations, since inter-processor interrupts set the thread
dispatch necessary indicator this prevents a thread dispatch
notification in post-switch handlers (which all run with interrupts
disabled).

On all configurations, this is a serious issue for the interrupt
latency.

Update #2751
2016-07-01 11:51:49 +02:00
Sebastian Huber 23dedc448e score: Next try to fix thread lock on SMP 2016-07-01 11:51:49 +02:00
Sebastian Huber 4142f73762 score: Fix priority affinity SMP scheduler
Bug introduced by 9bfad8cd51.
2016-07-01 11:51:48 +02:00
Sebastian Huber 09c87fb06b score: Strong APA scheduler processor allocation
Use _Scheduler_SMP_Allocate_processor_exact() to prevent unexpected
migrations.
2016-06-30 09:51:18 +02:00
Sebastian Huber 029877282e score: Avoid atomic fences for thread wait flags
The use of atomic fences is brittle and may break due to changes in
different areas which is hard to manage.
2016-06-30 07:57:44 +02:00
Sebastian Huber b6b25a9e68 score: Fix thread lock on SMP configurations 2016-06-30 07:57:33 +02:00
Sebastian Huber 297d4372ce score: _CPU_SMP_Send_interrupt() documentation 2016-06-29 11:04:39 +02:00
Sebastian Huber 9bb3ce3918 score: Fix SMP message handling
According to the C11 standard only atomic read-modify-write operations
guarantee that the last value written in modification order is read, see
"7.17.3 Order and consistency".  Thus we must use a read-modify-write in
_SMP_Inter_processor_interrupt_handler() to make sure we read an
up-to-date message.
2016-06-29 09:50:47 +02:00
Christian Mauderer 095ecbf263 libnetworking: Import current <sys/socket.h>
Import the <sys/socket.h> from current FreeBSD.  This allows to build
some current software (e.g. libressl).
2016-06-28 13:10:01 +02:00
Sebastian Huber e79a0ca75f libnetworking: Move RTEMS-specific socket wake-up
Close #2748.
2016-06-28 13:10:01 +02:00
Christian Mauderer 4ba4f8218a libnetworking: Hide SO_PRIVSTATE 2016-06-28 13:10:01 +02:00
Christian Mauderer f0fc2c0e02 libnetworking: Add <machine/_align.h>
This is necessary for new <sys/socket.h>.
2016-06-28 13:10:01 +02:00
Christian Mauderer 4c02385d8f libnetworking: Import current <arpa/inet.h>
Import the <arpa/inet.h> from current FreeBSD.  Necessary due to changes
in <netinet/in.h>.  Remove BSD hack from <arpa/inet.h>.

Clean up problems with htonl().  These functions are defined in
<arpa/inet.h>.  This lead to some problems because they are defined in
<rtems/endian.h> too.  Add NTOHL, ... to
<rtems/rtems_bsdnet_internal.h>.
2016-06-28 13:10:01 +02:00
Christian Mauderer 657e6c93ef libnetworking: Import current <netinet/in.h>
Import the <netinet/in.h> from current FreeBSD.  This allows to build
some current software (e.g. libressl).

Add legacy support like

* prototype for in_cksum(),
* IPPORT_USERRESERVED,
* deprecated IPCTL_RT* defines,
* ip_fw_chk_t and ip_fw_ctl_t,
* ip_nat_... (IP NAT hooks), and
* IP_NAT option for get/setsockopt()

to new <rtems/rtems_netinet_in.h>.
2016-06-28 13:09:44 +02:00
Christian Mauderer 005c3fe701 libnetworking: Import current <netinet6/in6.h>
Import the <netinet6/in6.h> from current FreeBSD.  This allows to build
some current software (e.g. libressl).
2016-06-28 13:02:20 +02:00
Christian Mauderer f2082cc61d libnetworking: Import <sys/_sockaddr_storage.h>
Import the <sys/_sockaddr_storage.h> from current FreeBSD.  Necessary
for <netinet/in.h> update.
2016-06-28 13:02:20 +02:00
Christian Mauderer 195d412d39 libnetworking: Add minimal getnameinfo()
This implementation just falls back to giving a string representation of
the IP.  It supports IPv4 only.

Add test for getnameinfo().
2016-06-28 13:01:47 +02:00
Christian Mauderer 232d6fecb6 libnetworking: Import current <netdb.h>
Import the <netdb.h> from current FreeBSD.  This allows to build some
current software (e.g. libressl).

Add __h_errno().

Update gethostent_r() API.  Linux and FreeBSD use a common API now.
Adapt the RTEMS one to provide the same one.

Match gethostbyname_r() with prototype.
2016-06-28 13:01:38 +02:00
Christian Mauderer 7e6f2350ea libnetworking: Add <rtems/rtems_netdb.h>
Move prototypes of non-portable _get*by*name/addr and _set/end*ent
functions.  This makes it easier to update <netdb.h>.
2016-06-28 13:01:37 +02:00
Christian Mauderer 187a074404 libcsupport: Add dummy for setgroups().
The dummy for setgroups() allows applications using it to build (for example
civetweb webserver).
2016-06-28 13:01:37 +02:00
Sebastian Huber 254dc82daf score: Change Priority_Control to 64-bit
A 32-bit Priority_Control limits the uptime to 49 days with a 1ms clock
tick in case the EDF scheduler is used.  Increase it to 64-bit to enable
proper operation of the EDF scheduler,

Close 2173.
2016-06-24 14:44:31 +02:00
Sebastian Huber 1d72f03e5a score: Silence integer conversion warnings 2016-06-24 14:44:31 +02:00
Sebastian Huber 50a56dff13 score: Move SCHEDULER_EDF_PRIO_MSB
This is an implementation detail of the EDF scheduler.
2016-06-24 11:52:57 +02:00
Sebastian Huber a4a307dfbd score: Fix _Scheduler_EDF_Yield()
A non-preemptive task must yield if it says so.
2016-06-24 10:28:02 +02:00
Sebastian Huber 51e008dda1 posix: Fix pthread_create()
Do not access data of the executing thread without proper locks.
2016-06-24 10:28:02 +02:00
Sebastian Huber 93f158f943 score: Fix EDF no-preempt thread handling 2016-06-23 10:36:23 +02:00
Alexander Krutwig 006af6ac76 score: Improve heap protection
Check block pointers of deferred free list before use.
2016-06-22 16:07:43 +02:00
Sebastian Huber 9bfad8cd51 score: Add thread priority to scheduler nodes
The thread priority is manifest in two independent areas.  One area is
the user visible thread priority along with a potential thread queue.
The other is the scheduler.  Currently, a thread priority update via
_Thread_Change_priority() first updates the user visble thread priority
and the thread queue, then the scheduler is notified if necessary.  The
priority is passed to the scheduler via a local variable.  A generation
counter ensures that the scheduler discards out-of-date priorities.

This use of a local variable ties the update in these two areas close
together.  For later enhancements and the OMIP locking protocol
implementation we need more flexibility.  Add a thread priority
information block to Scheduler_Node and synchronize priority value
updates via a sequence lock on SMP configurations.

Update #2556.
2016-06-22 14:44:56 +02:00
Sebastian Huber 69a6802bfa score: Move _RBTree_Find()
The _RBTree_Find() is no longer used in the score.  Move it to sapi and
make it rtems_rbtree_find().  Move corresponding types and support
functions to sapi.
2016-06-22 14:37:11 +02:00
Sebastian Huber 768c483b70 score: Move _RBTree_Insert()
The _RBTree_Insert() is no longer used in the score.  Move it to sapi
and make it rtems_rbtree_insert().
2016-06-22 14:37:11 +02:00
Sebastian Huber 99fc1d1d1b score: Rework EDF scheduler
Use inline red-black tree insert.  Do not use shifting priorities since
this is not supported by the thread queues.  Due to the 32-bit
Priority_Control this currently limits the uptime to 49days with a 1ms
clock tick.

Update #2173.
2016-06-22 14:37:11 +02:00
Sebastian Huber 9a78f8a507 score: Modify release job scheduler operation
Pass the deadline in watchdog ticks to the scheduler.

Update #2173.
2016-06-22 14:37:10 +02:00
Sebastian Huber 7ec66e0890 score: Remove hidden deadline overrule for CBS
Do what the user commands.  Maybe we should add a rtems_cbs_period()
that calls rtems_rate_monotonic_period() with the right parameter.

Update #2173.
2016-06-22 14:37:10 +02:00
Sebastian Huber 77ff5599e0 score: Introduce map priority scheduler operation
Introduce map/unmap priority scheduler operations to map thread priority
values from/to the user domain to/from the scheduler domain.  Use the
map priority operation to validate the thread priority.  The EDF
schedulers use this new operation to distinguish between normal
priorities and priorities obtain through a job release.

Update #2173.
Update #2556.
2016-06-22 14:36:40 +02:00
Sebastian Huber b8f76fa28e score: Delete unused _Scheduler_Priority_compare()
By convention, thread priorities must be integers in RTEMS.  Smaller
values represent more important threads.
2016-06-22 14:00:29 +02:00
Sebastian Huber c82835a231 rtems: Rework RTEMS API to SuperCore priority
Use same structure as POSIX API for thread priority conversion to/from
SuperCore.
2016-06-22 14:00:28 +02:00
Sebastian Huber 1a4eac500c posix: Generalize _POSIX_Priority_To_core()
Move POSIX API priority validation into _POSIX_Priority_To_core().
2016-06-22 14:00:28 +02:00
Sebastian Huber 5a32c486f9 posix: Make POSIX API aware of scheduler instances 2016-06-22 14:00:28 +02:00