[kaffe] CVS kaffe (guilhem): MD updates for ARM Linux (SIGNAL_ARGS, ...) + reindentation of toURI and File(UR
Kaffe CVS
Kaffe Mailing List <kaffe@kaffe.org>
Thu Sep 18 11:31:01 2003
PatchSet 4047
Date: 2003/09/18 18:29:01
Author: guilhem
Branch: HEAD
Tag: (none)
Log:
MD updates for ARM Linux (SIGNAL_ARGS, ...) + reindentation of toURI and File(URI)
Members:
ChangeLog:1.1643->1.1644
config/arm/linux/jit-md.h:1.4->1.5
config/arm/linux/md.h:1.3->1.4
libraries/javalib/java/io/File.java:1.37->1.38
Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.1643 kaffe/ChangeLog:1.1644
--- kaffe/ChangeLog:1.1643 Thu Sep 18 16:46:24 2003
+++ kaffe/ChangeLog Thu Sep 18 18:29:01 2003
@@ -1,3 +1,12 @@
+2003-09-18 Guilhem Lavaux <guilhem@kaffe.org>
+
+ * config/arm/linux/md.h, config/arm/linux/jit-md.h: Implemented
+ SIGNAL_ARGS, SIGNAL_GET_CONTEXT_POINTER, SIGNAL_PC.
+
+ * libraries/javalib/java/io/File.java:
+ (toURI, File(URI) ) Reindented, removed unnecessary code which was
+ throwing NullPointerException.
+
2003-09-18 Dalibor Topic <robilad@kaffe.org>
* config/arm/trampolines.c:
Index: kaffe/config/arm/linux/jit-md.h
diff -u kaffe/config/arm/linux/jit-md.h:1.4 kaffe/config/arm/linux/jit-md.h:1.5
--- kaffe/config/arm/linux/jit-md.h:1.4 Sat Oct 16 21:37:43 1999
+++ kaffe/config/arm/linux/jit-md.h Thu Sep 18 18:29:02 2003
@@ -52,29 +52,7 @@
*/
#define ARM_LINUX_HACK
-/* Function prototype for signal handlers */
-#if defined(HAVE_STRUCT_SIGCONTEXT_STRUCT) && !defined(__GLIBC__)
-/* Linux < 2.1.1 */
-#if defined(ARM_LINUX_HACK)
-#define EXCEPTIONPROTO \
- int sig, int r1, int r2, int r3, struct sigcontext_struct ctx
-#else
-#define EXCEPTIONPROTO \
- int sig, struct sigcontext_struct ctx
-#endif /* ARM_LINUX_HACK */
-
-#elif defined(HAVE_STRUCT_SIGCONTEXT) || defined(__GLIBC__)
-/* Linux >= 2.1.1 or Linux 2.0.x with glibc2 */
-#if defined(ARM_LINUX_HACK)
-#define EXCEPTIONPROTO \
- int sig, int r1, int r2, int r3, struct sigcontext ctx
-#else
-#define EXCEPTIONPROTO \
- int sig, struct sigcontext ctx
-#endif /* ARM_LINUX_HACK */
-#else
-#error Do not know how to define EXCEPTIONPROTO
-#endif
+#define EXCEPTIONPROTO SIGNAL_ARGS(sig, ctx)
/* Get the first exception frame from a signal handler */
#if defined(HAVE_REG_SIGCONTEXT)
Index: kaffe/config/arm/linux/md.h
diff -u kaffe/config/arm/linux/md.h:1.3 kaffe/config/arm/linux/md.h:1.4
--- kaffe/config/arm/linux/md.h:1.3 Tue Mar 11 08:00:16 2003
+++ kaffe/config/arm/linux/md.h Thu Sep 18 18:29:02 2003
@@ -15,6 +15,47 @@
#include "arm/common.h"
#include "arm/threads.h"
+
+/* It looks like the linux kernel sets r0 to the signal number
+ * and passes a pointer to the context as the fourth argument
+ * use this hack to account for that. -- gback
+ *
+ * Undef when this gets fixed -- check arch/arm/kernel/signal.c
+ */
+#define ARM_LINUX_HACK
+
+/* Function prototype for signal handlers */
+#if defined(HAVE_STRUCT_SIGCONTEXT_STRUCT) && !defined(__GLIBC__)
+/* Linux < 2.1.1 */
+#if defined(ARM_LINUX_HACK)
+#define SIGNAL_ARGS(sig, ctx) \
+ int sig, int r1, int r2, int r3, struct sigcontext_struct ctx
+#else
+#define SIGNAL_ARGS(sig, ctx) \
+ int sig, struct sigcontext_struct ctx
+#endif /* ARM_LINUX_HACK */
+
+#elif defined(HAVE_STRUCT_SIGCONTEXT) || defined(__GLIBC__)
+/* Linux >= 2.1.1 or Linux 2.0.x with glibc2 */
+#if defined(ARM_LINUX_HACK)
+#define SIGNAL_ARGS(sig, ctx) \
+ int sig, int r1, int r2, int r3, struct sigcontext ctx
+#else
+#define SIGNAL_ARGS(sig, ctx) \
+ int sig, struct sigcontext ctx
+#endif /* ARM_LINUX_HACK */
+#else
+#error Do not know how to define EXCEPTIONPROTO
+#endif
+
+#define GET_SIGNAL_CONTEXT_POINTER(ctx) (&ctx)
+
+#if defined(HAVE_REG_SIGCONTEXT)
+#define SIGNAL_PC(ctx) (ctx)->reg.ARM_pc
+#else
+#define SIGNAL_PC(ctx) (ctx)->arm_pc
+#endif
+
#if defined(TRANSLATOR)
#include "jit-md.h"
#endif
Index: kaffe/libraries/javalib/java/io/File.java
diff -u kaffe/libraries/javalib/java/io/File.java:1.37 kaffe/libraries/javalib/java/io/File.java:1.38
--- kaffe/libraries/javalib/java/io/File.java:1.37 Fri Sep 12 23:27:57 2003
+++ kaffe/libraries/javalib/java/io/File.java Thu Sep 18 18:29:03 2003
@@ -294,23 +294,21 @@
return existsInternal (path);
}
-// File(URI) copied from Kaffe's File.java
/**
* This method initializes a new <code>File</code> object to represent
* a file with the specified URI.
*
* @param uri The URI of the file
+ * @author Ito Kazumitsu
*/
-
-public File(URI uri) {
- if (uri == null) {
- throw new NullPointerException();
- }
- this.path = uri.getPath();
- if (this.path == null) {
- throw new IllegalArgumentException();
- }
-}
+ public File(URI uri)
+ {
+ this.path = uri.getPath();
+ if (this.path == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ }
/**
* This method initializes a new <code>File</code> object to represent
@@ -887,29 +885,30 @@
return new URL (url_string);
}
-// toURI() copied from Kaffe's File.java
-/**
- * @since 1.4
- */
-public URI toURI() {
- try {
- return new URI("file",
- null,
- (isDirectory() ?
- getAbsolutePath() + separator
- : getAbsolutePath()),
- null,
- null);
- }
- catch (URISyntaxException e) {
- throw (IllegalArgumentException)
- new IllegalArgumentException("Couldn't convert "
- + toString()
- + " to an URI")
- .initCause(e);
- }
-}
-
+ /**
+ * @since 1.4
+ * @author Ito Kazumitsu
+ */
+ public URI toURI() {
+ try
+ {
+ return new URI("file",
+ null,
+ (isDirectory() ?
+ getAbsolutePath() + separator
+ : getAbsolutePath()),
+ null,
+ null);
+ }
+ catch (URISyntaxException e)
+ {
+ throw (IllegalArgumentException)
+ new IllegalArgumentException("Couldn't convert "
+ + toString()
+ + " to an URI").initCause(e);
+ }
+ }
+
/*
* This native method actually creates the directory
*/