svn commit: trunk/uClibc/libm: sh
carmelo at uclibc.org
carmelo at uclibc.org
Wed Jan 14 12:49:24 UTC 2009
Author: carmelo
Date: 2009-01-14 12:49:24 +0000 (Wed, 14 Jan 2009)
New Revision: 24828
Log:
libm_sh: Re-added sh specific files erroneously removed recently,
and moved under a better folder.
Signed-off-by: Carmelo Amoroso <carmelo.amoroso at st.com>
Added:
trunk/uClibc/libm/sh/
trunk/uClibc/libm/sh/Makefile.arch
trunk/uClibc/libm/sh/feholdexcpt.c
trunk/uClibc/libm/sh/fesetenv.c
Changeset:
Added: trunk/uClibc/libm/sh/Makefile.arch
===================================================================
--- trunk/uClibc/libm/sh/Makefile.arch (rev 0)
+++ trunk/uClibc/libm/sh/Makefile.arch 2009-01-14 12:49:24 UTC (rev 24828)
@@ -0,0 +1,18 @@
+# Makefile for uClibc
+#
+# Copyright (c) 2007 STMicroelectronics Ltd
+#
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+#
+
+libm_ARCH_SRC:=$(wildcard $(libm_ARCH_fpu_DIR)/*.c)
+libm_ARCH_OBJ:=$(patsubst $(libm_ARCH_fpu_DIR)/%.c,$(libm_ARCH_fpu_OUT)/%.o,$(libm_ARCH_SRC))
+
+libm_ARCH_OBJS:=$(libm_ARCH_OBJ)
+
+ifeq ($(DOPIC),y)
+libm-a-y+=$(libm_ARCH_OBJS:.o=.os)
+else
+libm-a-y+=$(libm_ARCH_OBJS)
+endif
+libm-so-y+=$(libm_ARCH_OBJS:.o=.os)
Added: trunk/uClibc/libm/sh/feholdexcpt.c
===================================================================
--- trunk/uClibc/libm/sh/feholdexcpt.c (rev 0)
+++ trunk/uClibc/libm/sh/feholdexcpt.c 2009-01-14 12:49:24 UTC (rev 24828)
@@ -0,0 +1,30 @@
+/*
+ *
+ * Copyright (c) 2007 STMicroelectronics Ltd
+ * Filippo Arcidiacono (filippo.arcidiacono at st.com)
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ *
+ * Taken from glibc 2.6
+ *
+ */
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+int
+feholdexcept (fenv_t *envp)
+{
+ unsigned long int temp;
+
+ /* Store the environment. */
+ _FPU_GETCW (temp);
+ envp->__fpscr = temp;
+
+ /* Now set all exceptions to non-stop. */
+ temp &= ~FE_ALL_EXCEPT;
+ _FPU_SETCW (temp);
+
+ return 1;
+}
+libm_hidden_def (feholdexcept)
Added: trunk/uClibc/libm/sh/fesetenv.c
===================================================================
--- trunk/uClibc/libm/sh/fesetenv.c (rev 0)
+++ trunk/uClibc/libm/sh/fesetenv.c 2009-01-14 12:49:24 UTC (rev 24828)
@@ -0,0 +1,27 @@
+/*
+ *
+ * Copyright (c) 2007 STMicroelectronics Ltd
+ * Filippo Arcidiacono (filippo.arcidiacono at st.com)
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ *
+ * Taken from glibc 2.6
+ *
+ */
+
+#include <fenv.h>
+#include <fpu_control.h>
+
+int
+fesetenv (const fenv_t *envp)
+{
+ if (envp == FE_DFL_ENV)
+ _FPU_SETCW (_FPU_DEFAULT);
+ else
+ {
+ unsigned long int temp = envp->__fpscr;
+ _FPU_SETCW (temp);
+ }
+ return 0;
+}
+libm_hidden_def (fesetenv)
More information about the uClibc-cvs
mailing list