Commit Graph

14 Commits

Author SHA1 Message Date
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
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
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
Sebastian Huber dcaf7fedb9 Use external header file for kernel space types
The FreeBSD kernel types are not used in Newlib.  Provide them via an
external header file to decouple Newlib and FreeBSD updates for RTEMS.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2016-11-07 14:03:53 +01:00
Sebastian Huber 2b496cf1af Provide vm_page_t for RTEMS via <machine/_types.h>
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2016-10-25 16:24:07 +02:00
Sebastian Huber 82768d9bab Provide FreeBSD types for <sys/types.h> on RTEMS
Provide the following types via <sys/types.h> on RTEMS for FreeBSD
compatibility if __BSD_VISIBLE

 * accmode_t,
 * cap_rights_t,
 * c_caddr_t,
 * cpulevel_t,
 * fixpt_t,
 * lwpid_t,
 * uintfptr_t,
 * vm_offset_t,
 * vm_ooffset_t,
 * vm_paddr_t,
 * vm_pindex_t, and
 * vm_size_t.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2016-04-21 10:29:04 +02:00
Sebastian Huber 8b6fc83330 Add RTEMS-specific types for BSD compatibility
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2016-04-19 23:42:35 +02:00
Sebastian Huber c5d5030aea Provide POSIX defined blksize_t in <sys/types.h>
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2016-04-15 14:51:40 +02:00
Sebastian Huber 57d2718c0e Provide POSIX defined blkcnt_t in <sys/types.h>
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2016-04-15 14:51:40 +02:00
Sebastian Huber eba91a5d0a Define mode_t via __mode_t
Use __uint32_t to avoid the use of GCC-specific _ST_INT32.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2016-04-15 14:51:39 +02:00
Sebastian Huber e77040b2bf Add BSD guard for ino_t in <sys/types.h>
Introduce internal type __ino_t.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2016-04-15 14:51:39 +02:00
Sebastian Huber 8a5af1a184 Use __machine_*_t_defined for internal types
Newlib defines defaults for internal types via <sys/_types.h> and uses
<machine/_types.h> to let targets define their own type if necessary.

Previously for example

	#ifndef __dev_t_defined
	typedef short __dev_t;
	#endif

However, the __*_t_defined pattern conflicts with the glibc type guard
pattern for user types, e.g. dev_t in this example.  Introduce a
__machine_*_t_defined pattern for internal types (defined by
<machine/_types.h>, used by <sys/_types.h>).  For example

	#ifndef __machine_dev_t_defined
	typedef short __dev_t;
	#endif

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2016-04-15 14:51:39 +02:00
Sebastian Huber 477463a201 Eliminate use of Newlib-specific <machine/types.h>
This change solves a glibc/BSD compatibility problem.

glibc and BSD use double underscore types for internal types.  The Linux
port of Newlib uses some glibc provided internal type definitions which
are not protected by guard defines, e.g. __off_t.  To avoid a conflict
Newlib uses single underscore types for some internal types, e.g.
_off_t.  However, for BSD compatibility we have to define the internal
types with double underscore names in <sys/_types.h>.

The header file <machine/types.h> is Newlib-specific.  It was used
instead of <sys/_types.h> to provide the internal type definitions
_CLOCK_T, _TIME_T_, _CLOCKID_T_, _TIMER_T_, and __suseconds_t.  Move
these definitions to <sys/_types.h> (there exist two instances of this
file, one for Linux and one for all other targets).  This makes the
_HAVE_SYSTYPES configuration define obsolete (could possibly break the
__RDOS__ target).  Use the standard <sys/_types.h> include throughout.

Move __loff_t defintion to default (non-Linux) <sys/_types.h>.  Define
it via _off64_t to avoid a dependency on the compiler.

Provide the __off_t definition via default (non-Linux) <sys/_types.h>
based on _off_t for all systems except Cygwin.  For Cygwin use _off64_t.
Define off_t via __off_t.

Provide the __pid_t definition via default (non-Linux) <sys/_types.h>.
This prevents a potential __pid_t and pid_t incompatibility.  Add BSD
guard defines for pid_t.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2016-04-13 13:30:27 +02:00
Sebastian Huber f04e46b141 Move header files
During libgcc build the first include search path for <...> is
"../newlib/libc/sys/rtems/include".  Move all RTEMS specific header
files to "libc/sys/rtems/include" so that they can be found.  Later
during libc build the header files in the previous location were somehow
present, but for libgcc build they were invisible.  This change is
necessary to use <pthread.h> for the GCC thread model implementation.

newlib/ChangeLog
2015-07-27  Sebastian Huber  <sebastian.huber@embedded-brains.de>

	libc/sys/rtems/machine/_types.h: Move to ...
	libc/sys/rtems/include/machine/_types.h: ... here.
	libc/sys/rtems/machine/limits.h: Move to ...
	libc/sys/rtems/include/machine/limits.h: ... here.
	libc/sys/rtems/machine/param.h: Move to ...
	libc/sys/rtems/include/machine/param.h: ... here.
	libc/sys/rtems/sys/cpuset.h: Move to ...
	libc/sys/rtems/include/sys/cpuset.h: ... here.
	libc/sys/rtems/sys/dirent.h: Move to ...
	libc/sys/rtems/include/sys/dirent.h: ... here.
	libc/sys/rtems/sys/param.h: Move to ...
	libc/sys/rtems/include/sys/param.h: ... here.
	libc/sys/rtems/sys/syslimits.h: Move to ...
	libc/sys/rtems/include/sys/syslimits.h: ... here.
	libc/sys/rtems/sys/utime.h: Move to ...
	libc/sys/rtems/include/sys/utime.h: ... here.
2015-07-29 12:53:53 -07:00
Renamed from newlib/libc/sys/rtems/machine/_types.h (Browse further)