why all the source files in the cpukit include a config.h, is this file realy needed in all the files?

2016-04-13 Thread 朱忠杰
there is a config.h included in all C source files in the cpukit, but not
included in bsps, why?
how can I figure out if this file is needed? Can we remove this file in
some source files?
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH] [RSB] use updated newlib revision for or1k

2016-04-13 Thread Joel Sherrill
Done.

If there is anything else that needs merging, just ping me.

On Mon, Apr 11, 2016 at 6:02 PM, Hesham Almatary 
wrote:

> That's Ok, so please merge your patch and discard this one.
>
> On Mon, Apr 11, 2016 at 10:40 AM Joel Sherrill  wrote:
>
>>
>> On Apr 10, 2016 7:11 PM, "Hesham Almatary" 
>> wrote:
>> >
>> > This is the patch. It would conflict with Joel's [PATCH 3/5]
>> 4.12/rtems-or1k.bset: Update newlib to 2.4.0, so we can choose either
>> according to the current RSB convention (releases or git revisions).
>>
>> The ports need to get to newlib 2.4.0. If I don't merge my patch, can you
>> bump the newlib version in yours?
>>
>> I am holding a few pthread patches that need the updated newlib.
>>
>> > On Wed, Mar 30, 2016 at 4:48 PM Stefan Wallentowitz <
>> ste...@wallentowitz.de> wrote:
>> >>
>> >> -BEGIN PGP SIGNED MESSAGE-
>> >> Hash: SHA1
>> >>
>> >> On 30.03.2016 07:29, Sebastian Huber wrote:
>> >> >
>> >> >
>> >> > On 30/03/16 07:26, Stefan Wallentowitz wrote:
>> >> >> there is also a GCC-6 snapshot available:
>> >> >> https://github.com/openrisc/newlib/releases/tag/gcc6-preview
>> >> >>
>> >> >> This was the GCC version used in the other architectures last
>> >> >> week, so maybe it makes sense to bump to this GCC version, too.
>> >> >
>> >> > Are there any plans to integrate the or1k stuff into the FSF GCC?
>> >> >
>> >>
>> >> Hi Sebastian,
>> >>
>> >> this is unfortunately not possible due to one missing FSF copyright
>> >> assignment of the original author. We have repeatedly tried to
>> >> convince him or find a proper workaround, but do not have a solution.
>> >> But we are keeping up with upstream GCC pretty fast currently.
>> >>
>> >> If you accidentally know somehow who would be interested to rewrite
>> >> the GCC port from scratch..
>> >>
>> >> Cheers,
>> >> Stefan
>> >> -BEGIN PGP SIGNATURE-
>> >> Version: GnuPG v2
>> >>
>> >> iEYEARECAAYFAlb7aKkACgkQuMYtsrn2U9wbjgCffW0gkH6MDa2T/SnwGGFkXLWe
>> >> s9oAnAyqPfD8jNiXSdDsfOZW3QIn2anE
>> >> =BBl7
>> >> -END PGP SIGNATURE-
>> >> ___
>> >> devel mailing list
>> >> devel@rtems.org
>> >> http://lists.rtems.org/mailman/listinfo/devel
>>
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

[PATCH] libcsupport: remove trailing space

2016-04-13 Thread norep1y
From: Du Huanpeng 

---
 cpukit/libcsupport/src/putk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cpukit/libcsupport/src/putk.c b/cpukit/libcsupport/src/putk.c
index 2532a64..3953f62 100644
--- a/cpukit/libcsupport/src/putk.c
+++ b/cpukit/libcsupport/src/putk.c
@@ -1,7 +1,7 @@
 /**
  *  @file
  *
- *  @brief Write Character to Stream 
+ *  @brief Write Character to Stream
  *  @ingroup libcsupport
  */
 
-- 
1.9.1
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH] libcsupport: remove tailing space

2016-04-13 Thread Gedare Bloom
Please remove signed-off-by and fix typo in commit message, "trailing"

On Wed, Apr 13, 2016 at 11:43 AM,   wrote:
> From: Du Huanpeng 
>
> Signed-off-by: Du Huanpeng 
> ---
>  cpukit/libcsupport/src/putk.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/cpukit/libcsupport/src/putk.c b/cpukit/libcsupport/src/putk.c
> index 2532a64..3953f62 100644
> --- a/cpukit/libcsupport/src/putk.c
> +++ b/cpukit/libcsupport/src/putk.c
> @@ -1,7 +1,7 @@
>  /**
>   *  @file
>   *
> - *  @brief Write Character to Stream
> + *  @brief Write Character to Stream
>   *  @ingroup libcsupport
>   */
>
> --
> 1.9.1
> ___
> devel mailing list
> devel@rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH] libcsupport: remove tailing space

2016-04-13 Thread norep1y
From: Du Huanpeng 

Signed-off-by: Du Huanpeng 
---
 cpukit/libcsupport/src/putk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cpukit/libcsupport/src/putk.c b/cpukit/libcsupport/src/putk.c
index 2532a64..3953f62 100644
--- a/cpukit/libcsupport/src/putk.c
+++ b/cpukit/libcsupport/src/putk.c
@@ -1,7 +1,7 @@
 /**
  *  @file
  *
- *  @brief Write Character to Stream 
+ *  @brief Write Character to Stream
  *  @ingroup libcsupport
  */
 
-- 
1.9.1
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH v3 1/2] Eliminate use of Newlib-specific

2016-04-13 Thread Sebastian Huber
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 .

The header file  is Newlib-specific.  It was used
instead of  to provide the internal type definitions
_CLOCK_T, _TIME_T_, _CLOCKID_T_, _TIMER_T_, and __suseconds_t.  Move
these definitions to  (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  include throughout.

Move __loff_t defintion to default (non-Linux) .  Define
it via _off64_t to avoid a dependency on the compiler.

Provide the __off_t definition via default (non-Linux) 
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) .
This prevents a potential __pid_t and pid_t incompatibility.  Add BSD
guard defines for pid_t.

Signed-off-by: Sebastian Huber 
---
 newlib/libc/include/machine/types.h| 27 +++---
 newlib/libc/include/reent.h|  1 -
 newlib/libc/include/sys/_timespec.h|  2 +-
 newlib/libc/include/sys/_timeval.h |  2 +-
 newlib/libc/include/sys/_types.h   | 21 
 newlib/libc/include/sys/config.h   |  1 -
 newlib/libc/include/sys/timeb.h|  2 +-
 newlib/libc/include/sys/times.h|  2 +-
 newlib/libc/include/sys/types.h|  8 +++-
 newlib/libc/sys/linux/sys/_types.h |  7 +++
 newlib/libc/sys/linux/sys/types.h  |  1 -
 newlib/libc/sys/rtems/include/machine/_types.h |  3 ---
 newlib/libc/sys/sparc64/sys/_timeval.h |  2 +-
 winsup/cygwin/include/cygwin/types.h   |  7 +--
 14 files changed, 40 insertions(+), 46 deletions(-)

diff --git a/newlib/libc/include/machine/types.h 
b/newlib/libc/include/machine/types.h
index 4250ee3..669242b 100644
--- a/newlib/libc/include/machine/types.h
+++ b/newlib/libc/include/machine/types.h
@@ -2,31 +2,10 @@
 #define_MACHTYPES_H_
 
 /*
- *  The following section is RTEMS specific and is needed to more
- *  closely match the types defined in the BSD machine/types.h.
- *  This is needed to let the RTEMS/BSD TCP/IP stack compile.
+ * This file is provided for backward compatibility.  It is no longer used in
+ * Newlib.  Do not add new things to it.
  */
-#if defined(__rtems__)
-#include 
-#endif
 
-#define_CLOCK_T_   unsigned long   /* clock() */
-#define_TIME_T_long/* time() */
-#define _CLOCKID_T_unsigned long
-#define _TIMER_T_  unsigned long
-
-#ifndef _HAVE_SYSTYPES
-typedef long int __off_t;
-typedef int __pid_t;
-#ifdef __GNUC__
-__extension__ typedef long long int __loff_t;
-#else
-typedef long int __loff_t;
-#endif
-#endif
-
-typedeflong__suseconds_t;  /* microseconds (signed) */
+#include 
 
 #endif /* _MACHTYPES_H_ */
-
-
diff --git a/newlib/libc/include/reent.h b/newlib/libc/include/reent.h
index 861be71..b7664b0 100644
--- a/newlib/libc/include/reent.h
+++ b/newlib/libc/include/reent.h
@@ -92,7 +92,6 @@ extern "C" {
 
 #include 
 #include 
-#include 
 
 #define __need_size_t
 #define __need_ptrdiff_t
diff --git a/newlib/libc/include/sys/_timespec.h 
b/newlib/libc/include/sys/_timespec.h
index bd66dfc..4a7aabc 100644
--- a/newlib/libc/include/sys/_timespec.h
+++ b/newlib/libc/include/sys/_timespec.h
@@ -34,7 +34,7 @@
 #ifndef _SYS__TIMESPEC_H_
 #define_SYS__TIMESPEC_H_
 
-#include 
+#include 
 
 #ifndef __time_t_defined
 typedef_TIME_T_time_t;
diff --git a/newlib/libc/include/sys/_timeval.h 
b/newlib/libc/include/sys/_timeval.h
index 0a4c539..d813d1f 100644
--- a/newlib/libc/include/sys/_timeval.h
+++ b/newlib/libc/include/sys/_timeval.h
@@ -29,7 +29,7 @@
 #ifndef _SYS__TIMEVAL_H_
 #define _SYS__TIMEVAL_H_
 
-#include 
+#include 
 
 #ifndef _SUSECONDS_T_DECLARED
 typedef__suseconds_t   suseconds_t;
diff --git a/newlib/libc/include/sys/_types.h b/newlib/libc/include/sys/_types.h
index 07bc276..b38a161 100644
--- a/newlib/libc/include/sys/_types.h
+++ b/newlib/libc/include/sys/_types.h
@@ -16,6 +16,12 @@
 typedef long _off_t;
 #endif
 
+#if defined(__XMK__)
+typedef signed char __pid_t;
+#else
+typedef int __pid_t;
+#endif
+
 #ifndef __dev_t_defined
 typedef short __dev_t;
 #endif
@@ -31,6 +37,14 @@ typedef unsigned short __gid_t;
 __extension__ typedef long long _off64_t;
 #endif
 
+#ifdef __CYGWIN__
+typedef _off64_t __off_t;
+#else
+typedef 

[PATCH v3 2/2] Add BSD guards for off_t, dev_t, uid_t, and gid_t

2016-04-13 Thread Sebastian Huber
Copy definitions of off_t, dev_t, uid_t, and gid_t verbatim from latest
FreeBSD .

Signed-off-by: Sebastian Huber 
---
 newlib/libc/include/sys/types.h | 20 
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/newlib/libc/include/sys/types.h b/newlib/libc/include/sys/types.h
index c0b5796..496c2ae 100644
--- a/newlib/libc/include/sys/types.h
+++ b/newlib/libc/include/sys/types.h
@@ -168,11 +168,23 @@ typedef int32_t register_t;
  */
 
 #ifndef __CYGWIN__ /* which defines these types in it's own types.h. */
-typedef _off_t off_t;
-typedef __dev_t dev_t;
-typedef __uid_t uid_t;
-typedef __gid_t gid_t;
+#ifndef _OFF_T_DECLARED
+typedef__off_t off_t;  /* file offset */
+#define_OFF_T_DECLARED
 #endif
+#ifndef _DEV_T_DECLARED
+typedef__dev_t dev_t;  /* device number or struct cdev 
*/
+#define_DEV_T_DECLARED
+#endif
+#ifndef _UID_T_DECLARED
+typedef__uid_t uid_t;  /* user id */
+#define_UID_T_DECLARED
+#endif
+#ifndef _GID_T_DECLARED
+typedef__gid_t gid_t;  /* group id */
+#define_GID_T_DECLARED
+#endif
+#endif /* !__CYGWIN__ */
 
 #ifndef _PID_T_DECLARED
 typedef__pid_t pid_t;  /* process id */
-- 
1.8.4.5

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Build failure for realview_pbx_a9_qemu_smp BSP

2016-04-13 Thread Darshit Shah
I recently tried rebuilding the realview_pbx_qemu_smp BSP with the 
latest toolchain. However, it seems like the build is broken.


The compilation breaks when trying to build the sample Hello program.  
The relevant part of the error given by make is:


Making all in hello
make[6]: Entering directory 
'/home/thedoctor/Programming/rtems/builds/realview_pbx_a9_qemu_smp/arm-rtems4.12/c/atsamv/testsuites/samples/hello'
arm-rtems4.12-gcc -B../../../../../atsamv/lib/ -specs bsp_specs -qrtems -mthumb -mcpu=cortex-m7 -mfpu=fpv5-d16 -mfloat-abi=hard -O2 -g -ffunction-sections -fdata-sections -Wall -Wmissing-prototypes -Wimplicit-function-declaration -Wstrict-prototypes -Wnested-externs  -Wl,--gc-sections  -mthumb -mcpu=cortex-m7 -mfpu=fpv5-d16 -mfloat-abi=hard   -o hello.exe init.o 
../../../../../atsamv/lib/librtemscpu.a(libscore_a-smp.o): In function `_SMP_Handler_initialize':

/home/thedoctor/Programming/rtems/builds/realview_pbx_a9_qemu_smp/arm-rtems4.12/c/atsamv/cpukit/score/../../../../../../../src/rtems/c/src/../../cpukit/score/src/smp.c:100:
 undefined reference to `_CPU_SMP_Initialize'
../../../../../atsamv/lib/librtemscpu.a(libscore_a-smp.o): In function 
`_SMP_Start_processors':
/home/thedoctor/Programming/rtems/builds/realview_pbx_a9_qemu_smp/arm-rtems4.12/c/atsamv/cpukit/score/../../../../../../../src/rtems/c/src/../../cpukit/score/src/smp.c:50:
 undefined reference to `_CPU_SMP_Start_processor'
../../../../../atsamv/lib/librtemscpu.a(libscore_a-smp.o): In function 
`_SMP_Handler_initialize':
/home/thedoctor/Programming/rtems/builds/realview_pbx_a9_qemu_smp/arm-rtems4.12/c/atsamv/cpukit/score/../../../../../../../src/rtems/c/src/../../cpukit/score/src/smp.c:100:
 undefined reference to `_CPU_SMP_Initialize'
/home/thedoctor/Programming/rtems/builds/realview_pbx_a9_qemu_smp/arm-rtems4.12/c/atsamv/cpukit/score/../../../../../../../src/rtems/c/src/../../cpukit/score/src/smp.c:115:
 undefined reference to `_CPU_SMP_Finalize_initialization'
../../../../../atsamv/lib/librtemscpu.a(libscore_a-smp.o): In function 
`_SMP_Send_message':
/home/thedoctor/Programming/rtems/builds/realview_pbx_a9_qemu_smp/arm-rtems4.12/c/atsamv/cpukit/score/../../../../../../../src/rtems/c/src/../../cpukit/score/src/smp.c:182:
 undefined reference to `_CPU_SMP_Send_interrupt'
../../../../../atsamv/lib/librtemscpu.a(libscore_a-threadrestart.o): In 
function `_Per_CPU_Send_interrupt':
/home/thedoctor/Programming/rtems/builds/realview_pbx_a9_qemu_smp/arm-rtems4.12/c/atsamv/cpukit/score/../../cpukit/../../../atsamv/lib/include/rtems/score/percpu.h:628:
 undefined reference to `_CPU_SMP_Send_interrupt'
/home/thedoctor/Programming/rtems/builds/realview_pbx_a9_qemu_smp/arm-rtems4.12/c/atsamv/cpukit/score/../../cpukit/../../../atsamv/lib/include/rtems/score/percpu.h:628:
 undefined reference to `_CPU_SMP_Send_interrupt'
/home/thedoctor/Programming/rtems/builds/realview_pbx_a9_qemu_smp/arm-rtems4.12/c/atsamv/cpukit/score/../../cpukit/../../../atsamv/lib/include/rtems/score/percpu.h:628:
 undefined reference to `_CPU_SMP_Send_interrupt'
/home/thedoctor/Programming/rtems/builds/realview_pbx_a9_qemu_smp/arm-rtems4.12/c/atsamv/cpukit/score/../../cpukit/../../../atsamv/lib/include/rtems/score/percpu.h:628:
 undefined reference to `_CPU_SMP_Send_interrupt'
../../../../../atsamv/lib/librtemscpu.a(libscore_a-threadstartmultitasking.o): 
In function `_Thread_Start_multitasking':
/home/thedoctor/Programming/rtems/builds/realview_pbx_a9_qemu_smp/arm-rtems4.12/c/atsamv/cpukit/score/../../../../../../../src/rtems/c/src/../../cpukit/score/src/threadstartmultitasking.c:44:
 undefined reference to `_CPU_SMP_Prepare_start_multitasking'
../../../../../atsamv/lib/librtemsbsp.a(libbsp_a-cache_manager.o): In function 
`_CPU_cache_invalidate_instruction_range':
/home/thedoctor/Programming/rtems/builds/realview_pbx_a9_qemu_smp/arm-rtems4.12/c/atsamv/lib/libbsp/arm/atsam/../../../../../../../../../src/rtems/c/src/lib/libbsp/arm/atsam/../shared/armv7m/include/cache_.h:66:
 undefined reference to `rtems_interrupt_disable'
/home/thedoctor/Programming/rtems/builds/realview_pbx_a9_qemu_smp/arm-rtems4.12/c/atsamv/lib/libbsp/arm/atsam/../../../../../../../../../src/rtems/c/src/lib/libbsp/arm/atsam/../shared/armv7m/include/cache_.h:68:
 undefined reference to `rtems_interrupt_enable'
collect2: error: ld returned 1 exit status
Makefile:626: recipe for target 'hello.exe' failed
make[6]: *** [hello.exe] Error 1
make[6]: Leaving directory 
'/home/thedoctor/Programming/rtems/builds/realview_pbx_a9_qemu_smp/arm-rtems4.12/c/atsamv/testsuites/samples/hello'
Makefile:584: recipe for target 'all-local' failed
make[5]: *** [all-local] Error 1
make[5]: Leaving directory 
'/home/thedoctor/Programming/rtems/builds/realview_pbx_a9_qemu_smp/arm-rtems4.12/c/atsamv/testsuites/samples'
Makefile:246: recipe for target 'all' failed
make[4]: *** [all] Error 2
make[4]: Leaving directory 

[PATCH v2 1/2] Eliminate use of Newlib-specific

2016-04-13 Thread Sebastian Huber
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 .

The header file  is Newlib-specific.  It was used
instead of  to provide the internal type definitions
_CLOCK_T, _TIME_T_, _CLOCKID_T_, _TIMER_T_, and __suseconds_t.  Move
these definitions to  (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  include throughout.

Move __loff_t defintion to default (non-Linux) , since
Cygwin needs this type.

Provide the __off_t definition via default (non-Linux) 
based on _off_t.  This prevents a potential __off_t and _off_t
incompatibility.

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

Signed-off-by: Sebastian Huber 
---
 newlib/libc/include/machine/types.h| 27 +++---
 newlib/libc/include/reent.h|  1 -
 newlib/libc/include/sys/_timespec.h|  2 +-
 newlib/libc/include/sys/_timeval.h |  2 +-
 newlib/libc/include/sys/_types.h   | 21 
 newlib/libc/include/sys/config.h   |  1 -
 newlib/libc/include/sys/timeb.h|  2 +-
 newlib/libc/include/sys/times.h|  2 +-
 newlib/libc/include/sys/types.h|  8 +++-
 newlib/libc/sys/linux/sys/_types.h |  7 +++
 newlib/libc/sys/linux/sys/types.h  |  1 -
 newlib/libc/sys/rtems/include/machine/_types.h |  3 ---
 newlib/libc/sys/sparc64/sys/_timeval.h |  2 +-
 13 files changed, 39 insertions(+), 40 deletions(-)

diff --git a/newlib/libc/include/machine/types.h 
b/newlib/libc/include/machine/types.h
index 4250ee3..669242b 100644
--- a/newlib/libc/include/machine/types.h
+++ b/newlib/libc/include/machine/types.h
@@ -2,31 +2,10 @@
 #define_MACHTYPES_H_
 
 /*
- *  The following section is RTEMS specific and is needed to more
- *  closely match the types defined in the BSD machine/types.h.
- *  This is needed to let the RTEMS/BSD TCP/IP stack compile.
+ * This file is provided for backward compatibility.  It is no longer used in
+ * Newlib.  Do not add new things to it.
  */
-#if defined(__rtems__)
-#include 
-#endif
 
-#define_CLOCK_T_   unsigned long   /* clock() */
-#define_TIME_T_long/* time() */
-#define _CLOCKID_T_unsigned long
-#define _TIMER_T_  unsigned long
-
-#ifndef _HAVE_SYSTYPES
-typedef long int __off_t;
-typedef int __pid_t;
-#ifdef __GNUC__
-__extension__ typedef long long int __loff_t;
-#else
-typedef long int __loff_t;
-#endif
-#endif
-
-typedeflong__suseconds_t;  /* microseconds (signed) */
+#include 
 
 #endif /* _MACHTYPES_H_ */
-
-
diff --git a/newlib/libc/include/reent.h b/newlib/libc/include/reent.h
index 861be71..b7664b0 100644
--- a/newlib/libc/include/reent.h
+++ b/newlib/libc/include/reent.h
@@ -92,7 +92,6 @@ extern "C" {
 
 #include 
 #include 
-#include 
 
 #define __need_size_t
 #define __need_ptrdiff_t
diff --git a/newlib/libc/include/sys/_timespec.h 
b/newlib/libc/include/sys/_timespec.h
index bd66dfc..4a7aabc 100644
--- a/newlib/libc/include/sys/_timespec.h
+++ b/newlib/libc/include/sys/_timespec.h
@@ -34,7 +34,7 @@
 #ifndef _SYS__TIMESPEC_H_
 #define_SYS__TIMESPEC_H_
 
-#include 
+#include 
 
 #ifndef __time_t_defined
 typedef_TIME_T_time_t;
diff --git a/newlib/libc/include/sys/_timeval.h 
b/newlib/libc/include/sys/_timeval.h
index 0a4c539..d813d1f 100644
--- a/newlib/libc/include/sys/_timeval.h
+++ b/newlib/libc/include/sys/_timeval.h
@@ -29,7 +29,7 @@
 #ifndef _SYS__TIMEVAL_H_
 #define _SYS__TIMEVAL_H_
 
-#include 
+#include 
 
 #ifndef _SUSECONDS_T_DECLARED
 typedef__suseconds_t   suseconds_t;
diff --git a/newlib/libc/include/sys/_types.h b/newlib/libc/include/sys/_types.h
index 07bc276..5280b26 100644
--- a/newlib/libc/include/sys/_types.h
+++ b/newlib/libc/include/sys/_types.h
@@ -15,6 +15,13 @@
 #ifndef __off_t_defined
 typedef long _off_t;
 #endif
+typedef _off_t __off_t; /* BSD compatibility */
+
+#if defined(__XMK__)
+typedef signed char __pid_t;
+#else
+typedef int __pid_t;
+#endif
 
 #ifndef __dev_t_defined
 typedef short __dev_t;
@@ -31,6 +38,13 @@ typedef unsigned short __gid_t;
 __extension__ typedef long long _off64_t;
 #endif
 
+/* Probably only used by Cygwin */
+#ifdef __GNUC__
+__extension__ typedef long long int __loff_t;
+#else

[PATCH v2 2/2] Add BSD guards for off_t, dev_t, uid_t, and gid_t

2016-04-13 Thread Sebastian Huber
Copy definitions of off_t, dev_t, uid_t, and gid_t verbatim from latest
FreeBSD .

Signed-off-by: Sebastian Huber 
---
 newlib/libc/include/sys/types.h | 20 
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/newlib/libc/include/sys/types.h b/newlib/libc/include/sys/types.h
index c0b5796..496c2ae 100644
--- a/newlib/libc/include/sys/types.h
+++ b/newlib/libc/include/sys/types.h
@@ -168,11 +168,23 @@ typedef int32_t register_t;
  */
 
 #ifndef __CYGWIN__ /* which defines these types in it's own types.h. */
-typedef _off_t off_t;
-typedef __dev_t dev_t;
-typedef __uid_t uid_t;
-typedef __gid_t gid_t;
+#ifndef _OFF_T_DECLARED
+typedef__off_t off_t;  /* file offset */
+#define_OFF_T_DECLARED
 #endif
+#ifndef _DEV_T_DECLARED
+typedef__dev_t dev_t;  /* device number or struct cdev 
*/
+#define_DEV_T_DECLARED
+#endif
+#ifndef _UID_T_DECLARED
+typedef__uid_t uid_t;  /* user id */
+#define_UID_T_DECLARED
+#endif
+#ifndef _GID_T_DECLARED
+typedef__gid_t gid_t;  /* group id */
+#define_GID_T_DECLARED
+#endif
+#endif /* !__CYGWIN__ */
 
 #ifndef _PID_T_DECLARED
 typedef__pid_t pid_t;  /* process id */
-- 
1.8.4.5

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel