]> sourceware.org Git - newlib-cygwin.git/commitdiff
newlib: xtensa: remove sys/xtensa. use machine/xtensa
authorAlexey Lapshin <alexey.lapshin@espressif.com>
Fri, 30 Aug 2024 09:35:24 +0000 (09:35 +0000)
committerCorinna Vinschen <corinna@vinschen.de>
Mon, 2 Sep 2024 20:16:59 +0000 (22:16 +0200)
Remove sys/xtensa that is actually duplicate newlib's code.
Move used code to machine/xtensa or to libgloss

15 files changed:
libgloss/xtensa/Makefile.inc
libgloss/xtensa/clibrary_init.c [moved from newlib/libc/sys/xtensa/clibrary_init.c with 91% similarity]
newlib/Makefile.am
newlib/configure
newlib/libc/acinclude.m4
newlib/libc/machine/xtensa/include/xtensa/config/core-isa.h [moved from newlib/libc/sys/xtensa/include/xtensa/config/core-isa.h with 100% similarity]
newlib/libc/machine/xtensa/sys/fenv.h [moved from newlib/libc/sys/xtensa/include/fenv.h with 97% similarity]
newlib/libc/sys/Makefile.inc
newlib/libc/sys/xtensa/Makefile.inc [deleted file]
newlib/libc/sys/xtensa/creat.c [deleted file]
newlib/libc/sys/xtensa/crt0.c [deleted file]
newlib/libc/sys/xtensa/include/unistd.h [deleted file]
newlib/libc/sys/xtensa/isatty.c [deleted file]
newlib/libc/sys/xtensa/sys/file.h [deleted file]
newlib/libm/machine/xtensa/acinclude.m4

index b4c818732d38923f0ba6f8365ff8a0da128d57f8..5cdb4ef39f7e7e859c91f418ae73b8aef63c14ac 100644 (file)
@@ -22,6 +22,7 @@ multilibtool_DATA += \
        %D%/crt1-boards.o
 
 %C%_libgloss_a_SOURCES = \
+       %D%/clibrary_init.c \
        %D%/sleep.S \
        %D%/syscalls.c \
        %D%/window-vectors.S
similarity index 91%
rename from newlib/libc/sys/xtensa/clibrary_init.c
rename to libgloss/xtensa/clibrary_init.c
index 24d4cf94cae411cf115edb78d923745d815fafa7..b8c7d3a6ac8fbd447c448d18124926886da30c2c 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (c) 2003-2006 Tensilica Inc.  ALL RIGHTS RESERVED.
 
-   Redistribution and use in source and binary forms, with or without
+  Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions are met:
 
    1. Redistributions of source code must retain the above copyright
@@ -29,8 +29,8 @@ const char * __progname = 0;
 
 void
 __clibrary_init (int argc, char **argv, char **envp,
-                void (*init)(void),
-                void (*fini)(void))
+                void (*init)(void),
+                void (*fini)(void))
 {
   if (argv != 0)
     __progname = *argv;
index 4ab36b8d841c5bacf1e2f23c22c114802a7368e5..87a7f859784f578dc4f0852ea1a6d89573461498 100644 (file)
@@ -233,7 +233,11 @@ stmp-targ-include: config.status
          fi
        $(AM_V_at)s=machine/$(machine_dir)/machine d=machine $(TARG_INCLUDE_CP_DIR)
        $(AM_V_at)s=machine/$(machine_dir)/sys d=sys $(TARG_INCLUDE_CP_DIR)
-       $(AM_V_at)s=machine/$(machine_dir)/include d= $(TARG_INCLUDE_CP_DIR)
+       $(AM_V_at)for i in $(call rwildcard,$(srcdir)/libc/machine/$(machine_dir)/include/,*.h); do \
+         f=`echo $$i | sed s:^$(srcdir)/libc/machine/$(machine_dir)/include/::`; \
+         $(MKDIR_P) targ-include/`dirname $$f`; \
+         cp $$i targ-include/$$f; \
+       done
        $(AM_V_at)s=sys/$(sys_dir)/include d= $(TARG_INCLUDE_CP_DIR)
        $(AM_V_at)for i in $(call rwildcard,$(srcdir)/libc/sys/$(sys_dir)/include/,*.h); do \
          f=`echo $$i | sed s:^$(srcdir)/libc/sys/$(sys_dir)/include/::`; \
index 14ed85e3028b40819c84a82948905af2ec4ec1fd..cb4747880d6b421a145f8987dee77a2f99b2c2ab 100755 (executable)
@@ -777,8 +777,6 @@ HAVE_LONG_DOUBLE_FALSE
 HAVE_LONG_DOUBLE_TRUE
 HAVE_LIBC_SYS_Z8KSIM_DIR_FALSE
 HAVE_LIBC_SYS_Z8KSIM_DIR_TRUE
-HAVE_LIBC_SYS_XTENSA_DIR_FALSE
-HAVE_LIBC_SYS_XTENSA_DIR_TRUE
 HAVE_LIBC_SYS_W65_DIR_FALSE
 HAVE_LIBC_SYS_W65_DIR_TRUE
 HAVE_LIBC_SYS_TIRTOS_DIR_FALSE
@@ -5513,13 +5511,6 @@ fi
 else
   HAVE_LIBC_SYS_W65_DIR_TRUE='#'
   HAVE_LIBC_SYS_W65_DIR_FALSE=
-fi
- if test "${sys_dir}" = xtensa; then
-  HAVE_LIBC_SYS_XTENSA_DIR_TRUE=
-  HAVE_LIBC_SYS_XTENSA_DIR_FALSE='#'
-else
-  HAVE_LIBC_SYS_XTENSA_DIR_TRUE='#'
-  HAVE_LIBC_SYS_XTENSA_DIR_FALSE=
 fi
  if test "${sys_dir}" = z8ksim; then
   HAVE_LIBC_SYS_Z8KSIM_DIR_TRUE=
@@ -7708,10 +7699,6 @@ if test -z "${HAVE_LIBC_SYS_W65_DIR_TRUE}" && test -z "${HAVE_LIBC_SYS_W65_DIR_F
   as_fn_error $? "conditional \"HAVE_LIBC_SYS_W65_DIR\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
-if test -z "${HAVE_LIBC_SYS_XTENSA_DIR_TRUE}" && test -z "${HAVE_LIBC_SYS_XTENSA_DIR_FALSE}"; then
-  as_fn_error $? "conditional \"HAVE_LIBC_SYS_XTENSA_DIR\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
 if test -z "${HAVE_LIBC_SYS_Z8KSIM_DIR_TRUE}" && test -z "${HAVE_LIBC_SYS_Z8KSIM_DIR_FALSE}"; then
   as_fn_error $? "conditional \"HAVE_LIBC_SYS_Z8KSIM_DIR\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
index 48a7dee510e58c671a65a41c33ab9b7849bd94a8..52a6c57cf11c1abc69c0af2f2fa4cbaa60292372 100644 (file)
@@ -23,7 +23,6 @@ m4_foreach_w([SYS_DIR], [
   sh sysmec sysnec810 sysnecv850 sysvi386 sysvnecv70
   tic80 tirtos
   w65
-  xtensa
   z8ksim
 ], [AM_CONDITIONAL([HAVE_LIBC_SYS_]m4_toupper(SYS_DIR)[_DIR], test "${sys_dir}" = SYS_DIR)])
 
similarity index 97%
rename from newlib/libc/sys/xtensa/include/fenv.h
rename to newlib/libc/machine/xtensa/sys/fenv.h
index 2fa76f758daffc201871adf39ce2d7b0217e2799..69c94f0cf45a04bcddfcce3de092d94891ee7343 100644 (file)
@@ -26,8 +26,8 @@
    OF THE POSSIBILITY OF SUCH DAMAGE.  */
 
 
-#ifndef _FENV_H
-#define _FENV_H
+#ifndef _SYS_FENV_H
+#define _SYS_FENV_H
 
 #ifdef __cplusplus
 extern "C" {
@@ -85,4 +85,4 @@ int fegetexcept(void);
 }
 #endif
 
-#endif
+#endif // _SYS_FENV_H
index 24d8407d5f894acefebcd69a860fdf4b37e4fe54..9f8758934e21b8fcf5c9bad63e7c6a6647daf228 100644 (file)
@@ -64,9 +64,6 @@ endif
 if HAVE_LIBC_SYS_W65_DIR
 include %D%/w65/Makefile.inc
 endif
-if HAVE_LIBC_SYS_XTENSA_DIR
-include %D%/xtensa/Makefile.inc
-endif
 if HAVE_LIBC_SYS_Z8KSIM_DIR
 include %D%/z8ksim/Makefile.inc
 endif
diff --git a/newlib/libc/sys/xtensa/Makefile.inc b/newlib/libc/sys/xtensa/Makefile.inc
deleted file mode 100644 (file)
index ddee58a..0000000
+++ /dev/null
@@ -1 +0,0 @@
-libc_a_SOURCES += %D%/creat.c %D%/isatty.c %D%/clibrary_init.c
diff --git a/newlib/libc/sys/xtensa/creat.c b/newlib/libc/sys/xtensa/creat.c
deleted file mode 100644 (file)
index 21e6a18..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-/* creat() "system call" (copied from libc/posix/creat.c) */
-
-#include <fcntl.h>
-
-int
-creat (const char *path, mode_t mode)
-{
-  return open (path, O_WRONLY | O_CREAT | O_TRUNC, mode);
-}
diff --git a/newlib/libc/sys/xtensa/crt0.c b/newlib/libc/sys/xtensa/crt0.c
deleted file mode 100644 (file)
index 11725dc..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Dummy crt0 code.  */
-
-/* Copyright (c) 2003 by Tensilica Inc.  ALL RIGHTS RESERVED.
-   These coded instructions, statements, and computer programs are the
-   copyrighted works and confidential proprietary information of Tensilica Inc.
-   They may not be modified, copied, reproduced, distributed, or disclosed to
-   third parties in any manner, medium, or form, in whole or in part, without
-   the prior written consent of Tensilica Inc.  */
-
-/* Xtensa systems normally use a crt1 file associated with a particular
-   linker support package (LSP).  There is no need for this crt0 file,
-   except that the newlib makefiles require it to exist if there is a
-   sys/xtensa directory.  The directory exists only to hold the header
-   files for the Xtensa ISS semihosting "platform".  */
-
-void crt0_unused (void) {}
diff --git a/newlib/libc/sys/xtensa/include/unistd.h b/newlib/libc/sys/xtensa/include/unistd.h
deleted file mode 100644 (file)
index 4f6fd29..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef _UNISTD_H_
-#define _UNISTD_H_
-
-# include <sys/unistd.h>
-
-#ifndef L_SET
-/* Old BSD names for the same constants; just for compatibility.  */
-#define                L_SET           SEEK_SET
-#define                L_INCR          SEEK_CUR
-#define                L_XTND          SEEK_END
-#endif
-
-#endif /* _UNISTD_H_ */
diff --git a/newlib/libc/sys/xtensa/isatty.c b/newlib/libc/sys/xtensa/isatty.c
deleted file mode 100644 (file)
index fe64209..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-/* isatty.c */
-
-/* Dumb implementation so programs will at least run.  */
-
-#include <sys/stat.h>
-#include <reent.h>
-
-int
-_isatty_r (struct _reent *ptr, int fd)
-{
-  struct stat buf;
-
-  if (_fstat_r (ptr, fd, &buf) < 0)
-    return 0;
-  if (S_ISCHR (buf.st_mode))
-    return 1;
-  return 0;
-}
diff --git a/newlib/libc/sys/xtensa/sys/file.h b/newlib/libc/sys/xtensa/sys/file.h
deleted file mode 100644 (file)
index 48a2ca0..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Copyright (c) 2005-2006 Tensilica Inc.  ALL RIGHTS RESERVED.
-
-   Redistribution and use in source and binary forms, with or without
-   modification, are permitted provided that the following conditions are met:
-
-   1. Redistributions of source code must retain the above copyright
-      notice, this list of conditions and the following disclaimer.
-
-   2. Redistributions in binary form must reproduce the above copyright
-      notice, this list of conditions and the following disclaimer in the
-      documentation and/or other materials provided with the distribution.
-
-   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
-   IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
-   TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-   PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL TENSILICA
-   INCORPORATED BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-   PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  */
-
-#include <sys/fcntl.h>
-
-/* Alternate names for values for the WHENCE argument to `lseek'.
-   These are the same as SEEK_SET, SEEK_CUR, and SEEK_END, respectively. */
-#ifndef L_SET
-#define L_SET   0       /* Seek from beginning of file.  */
-#define L_INCR  1       /* Seek from current position.  */
-#define L_XTND  2       /* Seek from end of file.  */
-#endif
index 4d242e057f2af0bd73bdbafcd0e3b1420c975a94..fc5001da0c868aadfa56fae45920e59841869eb7 100644 (file)
@@ -2,7 +2,7 @@ AC_CACHE_CHECK([for XCHAL_HAVE_FP_SQRT], newlib_cv_xchal_have_fp_sqrt, [dnl
     AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
 [[#define _LIBM
 // targ-include does not exist yet, use relative path
-#include "../sys/xtensa/include/xtensa/config/core-isa.h"
+#include "../machine/xtensa/include/xtensa/config/core-isa.h"
 #if (!XCHAL_HAVE_FP_SQRT)
 # error "Have not XCHAL_HAVE_FP_SQRT"
 #endif
This page took 0.047331 seconds and 5 git commands to generate.