Commit Graph

473 Commits

Author SHA1 Message Date
kib e6a85661ce Implement read(2)/write(2) and neccessary lseek(2)
for posix shmfd. Add MAC framework entries for posix shm read and write.

Do not allow implicit extension of the underlying memory segment past
the limit set by ftruncate(2) by either of the syscalls.  Read and
write returns short i/o, lseek(2) fails with EINVAL when resulting
offset does not fit into the limit.

Discussed with:	alc
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
2018-08-24 15:00:02 +02:00
Sebastian Huber 3bc64b88c3 RTEMS: Add __tls_get_addr() to crt0
Add __tls_get_addr() for all targets to crt0.  This is not only used on
ARM.  In particular, it is used on RISC-V.  This helps to adequately
support the GCC libgomp.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de
2018-08-20 13:54:22 +02:00
Sebastian Huber dedeea9965 RTEMS: Add aligned_alloc() to crt0
This is necessary to build the latest GCC 7 branch.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85904

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2018-08-08 08:42:28 +02:00
Sebastian Huber 916ef5fb88 RTEMS: Unconditionally define _off_t to int64_t
Exotic RTEMS targets can define this back to int32_t as an exception if
there are good reasons.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2018-07-20 06:53:21 +02:00
Jeff Johnston cd31fbb2ae Add nvptx port.
- From: Cesar Philippidis <cesar@codesourcery.com>
  Date: Tue, 10 Apr 2018 14:43:42 -0700
  Subject: [PATCH] nvptx port

  This port adds support for Nvidia GPU's, which are primarily used as
  offload accelerators in OpenACC and OpenMP.
2018-04-13 15:42:37 -04:00
Richard Earnshaw 0bb8697333 [arm] Fix syscalls.c for newlib embedded syscalls builds
Newlib has a build configuration where syscalls can be directly
embedded in the newlib library rather than relying on libgloss.

This configuration was broken recently by an update to the libgloss
support for Arm that was not propagated to the syscalls interface in
newlib itself.  This patch restores the build.  It's essentially a
copy of https://sourceware.org/ml/newlib/2018/msg00128.html but there
are some other minor cleanups and changes that I've made at the same
time.  None of those cleanups affect functionality.

The prototypes of the following functions have been updated: _link,
_sbrk, _getpid, _write, _swiwrite, _lseek, _swilseek, _read and
_swiread.

Signed-off-by: Richard Earnshaw <Richard.Earnshaw@arm.com>
2018-03-15 09:55:11 +00:00
Joel Sherrill 5b97e36239 rtems/.../dirent.h: Add alphasort() prototype 2018-03-13 09:11:47 -05:00
Sebastian Huber f641474cb2 RTEMS: Use int for _CLOCKID_T_
Linux and FreeBSD use int as well.  In addition, this fixes an Ada
incompatiblity problem on 64-bit targets.  See also GCC:

  gcc/ada/libgnarl/s-osinte__rtems.ads

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2018-03-06 11:40:16 +01:00
Jaap de Wolff 8329f4867b add forward declaration to __cxa_atexit to aeabi_atexit, to prevent warnings 2018-02-16 12:16:07 +01:00
Jeff Johnston fffd2770db Bump release to 3.0.0 for yearly snapshot
- major release required due to removal of K&R support
2018-01-18 13:07:45 -05:00
Yaakov Selkowitz 70ee6b17df ansification: remove _EXFUN, _EXFUN_NOTHROW
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2018-01-17 11:47:29 -06:00
Yaakov Selkowitz 9087163804 ansification: remove _DEFUN
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2018-01-17 11:47:26 -06:00
Yaakov Selkowitz 67ee0cac4c ansification: remove _VOID
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2018-01-17 11:47:20 -06:00
Yaakov Selkowitz fff27f8429 ansification: remove _DEFUN_VOID
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2018-01-17 11:47:19 -06:00
Yaakov Selkowitz e6321aa6a6 ansification: remove _PTR
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2018-01-17 11:47:16 -06:00
Yaakov Selkowitz eea249da3b ansification: remove _PARAMS
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2018-01-17 11:47:13 -06:00
Yaakov Selkowitz 0bda30e1ff ansification: remove _CONST
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2018-01-17 11:47:08 -06:00
Yaakov Selkowitz 6783860a2e ansification: remove _AND
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2018-01-17 11:47:05 -06:00
Jon Turney c006fd459f makedoc: make errors visible
Discard QUICKREF sections, rather than writing them to stderr
Discard MATHREF sections, rather than discarding as an error
Pass NOTES sections through to texinfo, rather than discarding as an error
Don't redirect makedoc stderr to .ref file
Remove makedoc output on error
Remove .ref files from CLEANFILES
Regenerate Makefile.ins

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2017-12-07 11:54:11 +00:00
Yaakov Selkowitz adfde9d773 sys: remove TRAD_SYNOPSIS
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2017-12-01 03:41:52 -06:00
Sebastian Huber dadc9e7e4a RTEMS: Add semaphore <sys/lock.h> functions
Declare semaphore try wait and post binary functions.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2017-11-30 07:00:45 +01:00
Sebastian Huber 5a2ab9d55e RTEMS: Timed wait by ticks <sys/lock.h> functions
Declare timed wait by ticks functions.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2017-11-30 07:00:45 +01:00
Sebastian Huber 186166f67a RTEMS: Add set/get name <sys/lock.h> functions
Add inline functions to set/get the name.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2017-11-30 07:00:45 +01:00
Sebastian Huber 6480987f3a RTEMS: Add missing __getreent() to crt0
Default implementation was removed for RTEMS by
b1a388799d.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2017-11-20 10:12:18 +01:00
Sebastian Huber 0e3e375377 RTEMS: Add missing functions to crt0
This helps to get some more features from libstdc++.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2017-11-20 08:53:30 +01:00
Sebastian Huber ce189d8afe RTEMS: Remove internal timecounter API
Change copyright.  Original BSD content moved to
<machine/_kernel_time.h>.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2017-10-26 08:47:21 +02:00
Sebastian Huber c165a27c01 RTEMS: Fix _PTHREAD_MUTEX_INITIALIZER
Add missing braces around initializer.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2017-10-13 08:07:13 +02:00
Sebastian Huber 3a79700c2d RTEMS: Make pthread_mutex_t self-contained
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2017-10-05 14:56:13 +02:00
Sebastian Huber 55c5dda9b5 RTEMS: Make pthread_cond_t self-contained
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2017-10-05 14:56:13 +02:00
Sebastian Huber d902eef093 RTEMS: Make pthread_rwlock_t self-contained
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2017-10-05 14:56:13 +02:00
Sebastian Huber 9187bb23a0 RTEMS: Make pthread_barrier_t self-contained
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2017-10-05 14:56:13 +02:00
Sebastian Huber 8253c240cb RTEMS: Make sem_t self-contained
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2017-10-05 14:56:12 +02:00
Sebastian Huber 4fef7312b3 RTEMS: Optimize pthread_once_t
Reduce size of pthread_once_t and make it zero-initialized.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2017-10-05 14:56:12 +02:00
Sebastian Huber 524eb4dc29 RTEMS: Use __uint64_t for _CLOCK_T_
This addresses:

https://devel.rtems.org/ticket/2135

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2017-08-25 14:25:42 +02:00
Eric Blake 979d467ff6 headers: avoid bareword attributes
Always use the __-decorated form of an attribute name in public
headers, as the bareword form is in the user's namespace, and we
don't want compilation to break just because the user defines the
bareword to mean something else.

Signed-off-by: Eric Blake <eblake@redhat.com>
2017-08-17 07:10:03 -05:00
Sebastian Huber a3617d7bde Synchronize RTEMS <sys/bitset.h> with FreeBSD
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2017-07-12 08:04:45 +02:00
Sebastian Huber 1d49ce4d6b Synchronize RTEMS <sys/bitset.h> with FreeBSD
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2017-07-10 07:18:10 +02:00
Sebastian Huber 0fbd27dd1e Remove FreeBSD specifics from RTEMS <arpa/inet.h>
For whatever reason FreeBSD renames several functions provided by
<arpa/inet.h> and uses weak references to provide the standard function
names.  This causes problems on targets lacking proper support for weak
references.  We do not need this function renaming on RTEMS.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2017-06-12 08:41:24 +02:00
Sebastian Huber e9085e0ccd Fix RTEMS ioctl() declaration
Using uint32_t for ioctl_command_t does not work well on 64-bit targets.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2017-06-07 15:46:20 +02:00
Sebastian Huber dc93d7adff Update FreeBSD revision of RTEMS <sys/bitset.h>
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2017-06-07 15:46:20 +02:00
Sebastian Huber fd5d052d40 Fix some RTEMS CPUSET(9) macros
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2017-06-07 15:46:19 +02:00
Sebastian Huber c29f5b219d Fix RTEMS CPU_EQUAL_S()
According to the FreeBSD man page BIT_CMP() returns true in case the two
sets are NOT equal.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2017-06-07 15:46:19 +02:00
Sebastian Huber d70983ea1b Add de-facto standard <sys/ioctl.h> for RTEMS
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2017-05-25 12:42:08 -04:00
Sebastian Huber fa88e93d3d Add some POSIX header files for RTEMS
Add the POSIX header files

  * arpa/inet.h
  * net/if.h
  * netdb.h
  * netinet/in.h
  * netinet/tcp.h
  * sys/socket.h
  * sys/syslog.h
  * sys/uio.h
  * sys/un.h
  * syslog.h
  * termios.h

and their dependencies for RTEMS.  The origin of these files is the
latest FreeBSD.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2017-05-25 12:41:33 -04:00
Sebastian Huber 0b915d6be0 FreeBSD compatibility for RTEMS <sys/cpuset.h>
Make the RTEMS <sys/cpuset.h> compatible with the latest FreeBSD
version.

Fix the CPU_COPY() parameter order, see also:

https://devel.rtems.org/ticket/3023

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2017-05-25 12:36:27 -04:00
Sebastian Huber 764eda728f Add __bitcount*() to RTEMS <machine/types.h>
Use a dedicated header file <machine/_bitcount.h> to avoid cyclic header
dependencies in future changes.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2017-05-25 12:35:38 -04:00
Sebastian Huber 2693c1db69 Move ARM access.c from machine to sys
The implementation of the POSIX access() function is nothing machine
specific like memcpy(), etc.  Move it back to the system domain.  This
avoids problems due to the include search order of the Newlib/GCC build
which picks up machine includes before system includes.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2017-05-25 12:34:53 -04:00
Sebastian Huber 0008601042 Increase MSIZE for RTEMS
Increase the MSIZE for RTEMS to be in line with the latest FreeBSD
version.  The legacy network stack of RTEMS will provides its own
definition.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2017-05-25 12:33:59 -04:00
Sebastian Huber 2efb117047 FreeBSD compatibility for RTEMS <sys/param.h>
Update the RTEMS <machine/param.h> and <sys/param.h> to be compatible
with the latest FreeBSD version.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2017-05-25 12:33:40 -04:00
Sebastian Huber 15b59a15b4 Add generic <machine/_align.h> for RTEMS
It uses __BIGGEST_ALIGNMENT__ which is available in recent GCC and
LLVM/clang.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2017-05-25 12:33:02 -04:00