aboutsummaryrefslogtreecommitdiff
path: root/libjava/classpath/native/jni/java-lang
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/classpath/native/jni/java-lang')
-rw-r--r--libjava/classpath/native/jni/java-lang/Makefile.am6
-rw-r--r--libjava/classpath/native/jni/java-lang/Makefile.in57
-rw-r--r--libjava/classpath/native/jni/java-lang/gnu_java_lang_management_VMOperatingSystemMXBeanImpl.c60
-rw-r--r--libjava/classpath/native/jni/java-lang/java_lang_VMDouble.c22
4 files changed, 127 insertions, 18 deletions
diff --git a/libjava/classpath/native/jni/java-lang/Makefile.am b/libjava/classpath/native/jni/java-lang/Makefile.am
index 366d72e..aea9ded 100644
--- a/libjava/classpath/native/jni/java-lang/Makefile.am
+++ b/libjava/classpath/native/jni/java-lang/Makefile.am
@@ -1,4 +1,4 @@
-nativeexeclib_LTLIBRARIES = libjavalang.la libjavalangreflect.la
+nativeexeclib_LTLIBRARIES = libjavalang.la libjavalangreflect.la libjavalangmanagement.la
libjavalang_la_SOURCES = java_lang_VMSystem.c \
java_lang_VMFloat.c \
@@ -6,12 +6,14 @@ libjavalang_la_SOURCES = java_lang_VMSystem.c \
java_lang_VMMath.c \
java_lang_VMProcess.c
-libjavalang_la_LIBADD = $(wildcard $(top_builddir)/native/fdlibm/*.lo) \
+libjavalang_la_LIBADD = $(top_builddir)/native/fdlibm/libfdlibm.la \
$(top_builddir)/native/jni/classpath/jcl.lo \
$(top_builddir)/native/jni/native-lib/libclasspathnative.la
libjavalangreflect_la_SOURCES = java_lang_reflect_VMArray.c
+libjavalangmanagement_la_SOURCES = gnu_java_lang_management_VMOperatingSystemMXBeanImpl.c
+
AM_LDFLAGS = @CLASSPATH_MODULE@
AM_CPPFLAGS = @CLASSPATH_INCLUDES@ -I$(top_srcdir)/native/fdlibm
AM_CFLAGS = @WARNING_CFLAGS@ @STRICT_WARNING_CFLAGS@ @ERROR_CFLAGS@
diff --git a/libjava/classpath/native/jni/java-lang/Makefile.in b/libjava/classpath/native/jni/java-lang/Makefile.in
index 7393d91..3c87804 100644
--- a/libjava/classpath/native/jni/java-lang/Makefile.in
+++ b/libjava/classpath/native/jni/java-lang/Makefile.in
@@ -44,16 +44,21 @@ am__aclocal_m4_deps = $(top_srcdir)/../../config/depstand.m4 \
$(top_srcdir)/../../config/lead-dot.m4 \
$(top_srcdir)/../../config/multi.m4 \
$(top_srcdir)/../../config/no-executables.m4 \
- $(top_srcdir)/../../libtool.m4 $(top_srcdir)/m4/acattribute.m4 \
- $(top_srcdir)/m4/accross.m4 $(top_srcdir)/m4/acinclude.m4 \
+ $(top_srcdir)/../../libtool.m4 \
+ $(top_srcdir)/../../ltoptions.m4 \
+ $(top_srcdir)/../../ltsugar.m4 \
+ $(top_srcdir)/../../ltversion.m4 \
+ $(top_srcdir)/m4/acattribute.m4 $(top_srcdir)/m4/accross.m4 \
+ $(top_srcdir)/m4/acinclude.m4 \
$(top_srcdir)/m4/ax_create_stdint_h.m4 \
+ $(top_srcdir)/m4/ax_func_which_gethostbyname_r.m4 \
$(top_srcdir)/m4/gcc_attribute.m4 $(top_srcdir)/m4/iconv.m4 \
$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
$(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/pkg.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+mkinstalldirs = $(SHELL) $(top_srcdir)/../../mkinstalldirs
CONFIG_HEADER = $(top_builddir)/include/config.h
CONFIG_CLEAN_FILES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
@@ -65,30 +70,38 @@ am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
am__installdirs = "$(DESTDIR)$(nativeexeclibdir)"
nativeexeclibLTLIBRARIES_INSTALL = $(INSTALL)
LTLIBRARIES = $(nativeexeclib_LTLIBRARIES)
-libjavalang_la_DEPENDENCIES = $(wildcard \
- $(top_builddir)/native/fdlibm/*.lo) \
+libjavalang_la_DEPENDENCIES = \
+ $(top_builddir)/native/fdlibm/libfdlibm.la \
$(top_builddir)/native/jni/classpath/jcl.lo \
$(top_builddir)/native/jni/native-lib/libclasspathnative.la
am_libjavalang_la_OBJECTS = java_lang_VMSystem.lo java_lang_VMFloat.lo \
java_lang_VMDouble.lo java_lang_VMMath.lo \
java_lang_VMProcess.lo
libjavalang_la_OBJECTS = $(am_libjavalang_la_OBJECTS)
+libjavalangmanagement_la_LIBADD =
+am_libjavalangmanagement_la_OBJECTS = \
+ gnu_java_lang_management_VMOperatingSystemMXBeanImpl.lo
+libjavalangmanagement_la_OBJECTS = \
+ $(am_libjavalangmanagement_la_OBJECTS)
libjavalangreflect_la_LIBADD =
am_libjavalangreflect_la_OBJECTS = java_lang_reflect_VMArray.lo
libjavalangreflect_la_OBJECTS = $(am_libjavalangreflect_la_OBJECTS)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include
-depcomp = $(SHELL) $(top_srcdir)/depcomp
+depcomp = $(SHELL) $(top_srcdir)/../../depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
-LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
-SOURCES = $(libjavalang_la_SOURCES) $(libjavalangreflect_la_SOURCES)
+SOURCES = $(libjavalang_la_SOURCES) \
+ $(libjavalangmanagement_la_SOURCES) \
+ $(libjavalangreflect_la_SOURCES)
DIST_SOURCES = $(libjavalang_la_SOURCES) \
+ $(libjavalangmanagement_la_SOURCES) \
$(libjavalangreflect_la_SOURCES)
ETAGS = etags
CTAGS = ctags
@@ -97,12 +110,15 @@ ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
+AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BUILD_CLASS_FILES_FALSE = @BUILD_CLASS_FILES_FALSE@
BUILD_CLASS_FILES_TRUE = @BUILD_CLASS_FILES_TRUE@
+CAIRO_CFLAGS = @CAIRO_CFLAGS@
+CAIRO_LIBS = @CAIRO_LIBS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
@@ -148,6 +164,7 @@ DATE = @DATE@
DEFAULT_PREFS_PEER = @DEFAULT_PREFS_PEER@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
+DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
@@ -160,15 +177,16 @@ ERROR_CFLAGS = @ERROR_CFLAGS@
EXAMPLESDIR = @EXAMPLESDIR@
EXEEXT = @EXEEXT@
FASTJAR = @FASTJAR@
+FGREP = @FGREP@
FIND = @FIND@
FOUND_CACAO_FALSE = @FOUND_CACAO_FALSE@
FOUND_CACAO_TRUE = @FOUND_CACAO_TRUE@
FOUND_ECJ_FALSE = @FOUND_ECJ_FALSE@
FOUND_ECJ_TRUE = @FOUND_ECJ_TRUE@
-FOUND_GCJX_FALSE = @FOUND_GCJX_FALSE@
-FOUND_GCJX_TRUE = @FOUND_GCJX_TRUE@
FOUND_GCJ_FALSE = @FOUND_GCJ_FALSE@
FOUND_GCJ_TRUE = @FOUND_GCJ_TRUE@
+FOUND_JAVAC_FALSE = @FOUND_JAVAC_FALSE@
+FOUND_JAVAC_TRUE = @FOUND_JAVAC_TRUE@
FOUND_JIKES_FALSE = @FOUND_JIKES_FALSE@
FOUND_JIKES_TRUE = @FOUND_JIKES_TRUE@
FOUND_KJC_FALSE = @FOUND_KJC_FALSE@
@@ -176,7 +194,6 @@ FOUND_KJC_TRUE = @FOUND_KJC_TRUE@
FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@
FREETYPE2_LIBS = @FREETYPE2_LIBS@
GCJ = @GCJ@
-GCJX = @GCJX@
GCONF_CFLAGS = @GCONF_CFLAGS@
GCONF_LIBS = @GCONF_LIBS@
GDK_CFLAGS = @GDK_CFLAGS@
@@ -186,6 +203,7 @@ GENINSRC_TRUE = @GENINSRC_TRUE@
GJDOC = @GJDOC@
GLIB_CFLAGS = @GLIB_CFLAGS@
GLIB_LIBS = @GLIB_LIBS@
+GREP = @GREP@
GTK_CFLAGS = @GTK_CFLAGS@
GTK_LIBS = @GTK_LIBS@
INIT_LOAD_LIBRARY = @INIT_LOAD_LIBRARY@
@@ -197,6 +215,7 @@ INSTALL_GLIBJ_ZIP_TRUE = @INSTALL_GLIBJ_ZIP_TRUE@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JAVAC = @JAVAC@
JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION = @JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION@
JAVA_MAINTAINER_MODE_FALSE = @JAVA_MAINTAINER_MODE_FALSE@
JAVA_MAINTAINER_MODE_TRUE = @JAVA_MAINTAINER_MODE_TRUE@
@@ -206,6 +225,7 @@ JIKES = @JIKES@
JIKESENCODING = @JIKESENCODING@
JIKESWARNINGS = @JIKESWARNINGS@
KJC = @KJC@
+LD = @LD@
LDFLAGS = @LDFLAGS@
LIBDEBUG = @LIBDEBUG@
LIBICONV = @LIBICONV@
@@ -225,6 +245,7 @@ MKDIR = @MKDIR@
MOC = @MOC@
MOZILLA_CFLAGS = @MOZILLA_CFLAGS@
MOZILLA_LIBS = @MOZILLA_LIBS@
+NM = @NM@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -246,6 +267,7 @@ RANLIB = @RANLIB@
REGEN_PARSERS_FALSE = @REGEN_PARSERS_FALSE@
REGEN_PARSERS_TRUE = @REGEN_PARSERS_TRUE@
REMOVE = @REMOVE@
+SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRICT_WARNING_CFLAGS = @STRICT_WARNING_CFLAGS@
@@ -273,8 +295,10 @@ X_EXTRA_LIBS = @X_EXTRA_LIBS@
X_LIBS = @X_LIBS@
X_PRE_LIBS = @X_PRE_LIBS@
ZIP = @ZIP@
+ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
@@ -307,6 +331,7 @@ install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
mandir = @mandir@
mkdir_p = @mkdir_p@
multi_basedir = @multi_basedir@
@@ -324,18 +349,19 @@ target_os = @target_os@
target_vendor = @target_vendor@
toolexeclibdir = @toolexeclibdir@
vm_classes = @vm_classes@
-nativeexeclib_LTLIBRARIES = libjavalang.la libjavalangreflect.la
+nativeexeclib_LTLIBRARIES = libjavalang.la libjavalangreflect.la libjavalangmanagement.la
libjavalang_la_SOURCES = java_lang_VMSystem.c \
java_lang_VMFloat.c \
java_lang_VMDouble.c \
java_lang_VMMath.c \
java_lang_VMProcess.c
-libjavalang_la_LIBADD = $(wildcard $(top_builddir)/native/fdlibm/*.lo) \
+libjavalang_la_LIBADD = $(top_builddir)/native/fdlibm/libfdlibm.la \
$(top_builddir)/native/jni/classpath/jcl.lo \
$(top_builddir)/native/jni/native-lib/libclasspathnative.la
libjavalangreflect_la_SOURCES = java_lang_reflect_VMArray.c
+libjavalangmanagement_la_SOURCES = gnu_java_lang_management_VMOperatingSystemMXBeanImpl.c
AM_LDFLAGS = @CLASSPATH_MODULE@
AM_CPPFLAGS = @CLASSPATH_INCLUDES@ -I$(top_srcdir)/native/fdlibm
AM_CFLAGS = @WARNING_CFLAGS@ @STRICT_WARNING_CFLAGS@ @ERROR_CFLAGS@
@@ -401,6 +427,8 @@ clean-nativeexeclibLTLIBRARIES:
done
libjavalang.la: $(libjavalang_la_OBJECTS) $(libjavalang_la_DEPENDENCIES)
$(LINK) -rpath $(nativeexeclibdir) $(libjavalang_la_LDFLAGS) $(libjavalang_la_OBJECTS) $(libjavalang_la_LIBADD) $(LIBS)
+libjavalangmanagement.la: $(libjavalangmanagement_la_OBJECTS) $(libjavalangmanagement_la_DEPENDENCIES)
+ $(LINK) -rpath $(nativeexeclibdir) $(libjavalangmanagement_la_LDFLAGS) $(libjavalangmanagement_la_OBJECTS) $(libjavalangmanagement_la_LIBADD) $(LIBS)
libjavalangreflect.la: $(libjavalangreflect_la_OBJECTS) $(libjavalangreflect_la_DEPENDENCIES)
$(LINK) -rpath $(nativeexeclibdir) $(libjavalangreflect_la_LDFLAGS) $(libjavalangreflect_la_OBJECTS) $(libjavalangreflect_la_LIBADD) $(LIBS)
@@ -410,6 +438,7 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnu_java_lang_management_VMOperatingSystemMXBeanImpl.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/java_lang_VMDouble.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/java_lang_VMFloat.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/java_lang_VMMath.Plo@am__quote@
diff --git a/libjava/classpath/native/jni/java-lang/gnu_java_lang_management_VMOperatingSystemMXBeanImpl.c b/libjava/classpath/native/jni/java-lang/gnu_java_lang_management_VMOperatingSystemMXBeanImpl.c
new file mode 100644
index 0000000..68e89b3
--- /dev/null
+++ b/libjava/classpath/native/jni/java-lang/gnu_java_lang_management_VMOperatingSystemMXBeanImpl.c
@@ -0,0 +1,60 @@
+/* VMOperatingSystemMXBeanImpl.c - gnu.java.lang.management native functions
+ Copyright (C) 2006
+ Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+#include <config.h>
+#include <stdlib.h>
+
+#include "gnu_java_lang_management_VMOperatingSystemMXBeanImpl.h"
+
+/*
+ * Class: gnu_java_lang_management_VMOperatingSystemMXBeanImpl
+ * Method: getSystemLoadAverage
+ * Signature: ()D
+ */
+JNIEXPORT jdouble JNICALL
+Java_gnu_java_lang_management_VMOperatingSystemMXBeanImpl_getSystemLoadAverage (JNIEnv * env __attribute__ ((__unused__)), jclass cls __attribute__ ((__unused__)))
+{
+#ifdef HAVE_GETLOADAVG
+ double avg[1];
+ int nos = getloadavg(avg, 1);
+ if (nos == 1)
+ return avg[0];
+ else
+#endif
+ return -1;
+}
diff --git a/libjava/classpath/native/jni/java-lang/java_lang_VMDouble.c b/libjava/classpath/native/jni/java-lang/java_lang_VMDouble.c
index 2ee1f31..723f090 100644
--- a/libjava/classpath/native/jni/java-lang/java_lang_VMDouble.c
+++ b/libjava/classpath/native/jni/java-lang/java_lang_VMDouble.c
@@ -1,5 +1,5 @@
/* VMDouble.c - java.lang.VMDouble native functions
- Copyright (C) 1998, 1999, 2001, 2003, 2004, 2005, 2006
+ Copyright (C) 1998, 1999, 2001, 2003, 2004, 2005, 2006, 2007
Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -125,6 +125,16 @@ Java_java_lang_VMDouble_doubleToLongBits
val.d = doubleValue;
+#if defined(__IEEE_BYTES_LITTLE_ENDIAN)
+ /* On little endian ARM processors when using FPA, word order of
+ doubles is still big endian. So take that into account here. When
+ using VFP, word order of doubles follows byte order. */
+
+#define SWAP_DOUBLE(a) (((a) << 32) | (((a) >> 32) & 0x00000000ffffffff))
+
+ val.j = SWAP_DOUBLE(val.j);
+#endif
+
e = val.j & 0x7ff0000000000000LL;
f = val.j & 0x000fffffffffffffLL;
@@ -148,6 +158,10 @@ Java_java_lang_VMDouble_doubleToRawLongBits
val.d = doubleValue;
+#if defined(__IEEE_BYTES_LITTLE_ENDIAN)
+ val.j = SWAP_DOUBLE(val.j);
+#endif
+
return val.j;
}
@@ -165,6 +179,10 @@ Java_java_lang_VMDouble_longBitsToDouble
val.j = longValue;
+#if defined(__IEEE_BYTES_LITTLE_ENDIAN)
+ val.j = SWAP_DOUBLE(val.j);
+#endif
+
return val.d;
}
@@ -236,7 +254,7 @@ parseDoubleFromChars(JNIEnv * env, const char * buf)
#ifdef DEBUG
fprintf (stderr, "java.lang.VMDouble.parseDouble val = %g\n", val);
- fprintf (stderr, "java.lang.VMDouble.parseDouble %i != %i ???\n",
+ fprintf (stderr, "java.lang.VMDouble.parseDouble %p != %p ???\n",
endptr, last_non_ws);
#endif
if (endptr != last_non_ws)