[kaffe] Super-H ports
Kiyo Inaba
inaba at src.ricoh.co.jp
Sat May 31 01:45:02 PDT 2003
I wrote:
> I have some doubts for the result but, my linux box says
It may take a while how 'InetAddressImpl' issue is settled, and I
don't want to destroy some efforts I made (by debuging jit code
etc...), I send tentative patch for Super-H. This patch is against
CVS 030515 (just one day before the introduction of new InetAddressImpl),
and mainly let configure know the architecture 'superh'.
Of course, I know that if we change the directory name in 'config'
from 'superh' to 'sh', we may not need this additional effort but
still we have to specify architecture name when configuring because
of the naming convention of superh gcc is slightly different from
kaffe. Detail will be described in 'FAQ.cross-compile'.
BTW, the failure last time are because of some libraries I don't
install on sh3 machine, and without that, all tests passed.
Kiyo
-----------------------------------------------------------------
diff -Naur kaffe-snap-030515.orig/config.sub kaffe-snap-030515/config.sub
--- kaffe-snap-030515.orig/config.sub Wed May 21 20:09:09 2003
+++ kaffe-snap-030515/config.sub Sat May 31 16:49:45 2003
@@ -259,6 +259,7 @@
| pyramid \
| sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
+ | superh \
| sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
| strongarm \
| tahoe | thumb | tic80 | tron \
@@ -331,6 +332,7 @@
| romp-* | rs6000-* \
| sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+ | superh-* \
| sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
| sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
| tahoe-* | thumb-* \
@@ -1037,7 +1039,7 @@
we32k)
basic_machine=we32k-att
;;
- sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
+ sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele | superh)
basic_machine=sh-unknown
;;
sh64)
diff -Naur kaffe-snap-030515.orig/libltdl/config.sub kaffe-snap-030515/libltdl/config.sub
--- kaffe-snap-030515.orig/libltdl/config.sub Wed May 7 17:00:57 2003
+++ kaffe-snap-030515/libltdl/config.sub Sat May 31 16:50:14 2003
@@ -259,6 +259,7 @@
| pyramid \
| sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
+ | superh \
| sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
| strongarm \
| tahoe | thumb | tic80 | tron \
@@ -331,6 +332,7 @@
| romp-* | rs6000-* \
| sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+ | superh-* \
| sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
| sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
| tahoe-* | thumb-* \
@@ -1037,7 +1039,7 @@
we32k)
basic_machine=we32k-att
;;
- sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
+ sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele | superh)
basic_machine=sh-unknown
;;
sh64)
diff -Naur kaffe-snap-030515.orig/config/config-mem.h kaffe-snap-030515/config/config-mem.h
--- kaffe-snap-030515.orig/config/config-mem.h Tue May 6 11:33:42 2003
+++ kaffe-snap-030515/config/config-mem.h Sat May 31 17:00:09 2003
@@ -46,10 +46,10 @@
/*
* Some systems (Linux) do not declare swab in any standard header file
*/
-/*
extern void swab(const void *from, void *to, size_t n);
-*/
+/*
extern void swab(const void *from, void *to, ssize_t n);
+*/
#endif
#endif
diff -Naur kaffe-snap-030515.orig/kaffe/kaffevm/stringParsing.c kaffe-snap-030515/kaffe/kaffevm/stringParsing.c
--- kaffe-snap-030515.orig/kaffe/kaffevm/stringParsing.c Sat Apr 26 06:35:34 2003
+++ kaffe-snap-030515/kaffe/kaffevm/stringParsing.c Sat May 31 17:19:34 2003
@@ -822,10 +822,14 @@
parseErrorInfo pe;
parsedString ps;
int retval;
+ va_list * args;
+
+ args = KCALLOC(1, sizeof(args));
ps.data = str;
ps.len = strlen(str);
- retval = parseString_private(&pe, &ps, ss, values, SPO_Noop, NULL);
+ retval = parseString_private(&pe, &ps, ss, values, SPO_Noop, *args);
+ KFREE(args);
return( retval );
}
@@ -838,541 +842,5 @@
strncpy(retval, ps->data, ps->len);
retval[ps->len] = '\0';
}
- return( retval );
-}
-
-static
-char *test1Strings[] = {
- "[team:0x1:create]",
- "[a:0x100:b]",
- "[team:0x1:create",
- "[team:1:create",
- "[team:0x1:create]baddata",
- "[]",
- "[:]",
- "[::]",
- "[a:b:c]",
- 0
-};
-
-static
-parsedString test1Substrings[] = {
- { "[team:0x1:create] ** This is junk ** " },
- { "[a:0x100:b] ** This is junk ** " },
- { "[team:0x1:create ** This is junk ** " },
- { "[team:1:create ** This is junk ** " },
- { "[team:0x1:create]baddata ** This is junk ** " },
- { "[] ** This is junk ** " },
- { "[:] ** This is junk ** " },
- { "[::] ** This is junk ** " },
- { "[a:b:c] ** This is junk ** " },
- { 0 }
-};
-
-static
-struct {
- int result;
- parsedString name;
- int commands;
- parsedString usage;
-} test1Results[] = {
- {
- 1,
- { "team:0x1:create]", 4 },
- 0x1,
- { "create]", 6 }
- },
- {
- 1,
- { "a:0x100:b]", 1 },
- 0x100,
- { "b]", 1 }
- },
- { 0, { 0, 0 }, 0, { 0, 0 } },
- { 0, { 0, 0 }, 0, { 0, 0 } },
- { 0, { 0, 0 }, 0, { 0, 0 } },
- { 0, { 0, 0 }, 0, { 0, 0 } },
- { 0, { 0, 0 }, 0, { 0, 0 } },
- { 0, { 0, 0 }, 0, { 0, 0 } },
- { 0, { 0, 0 }, 0, { 0, 0 } }
-};
-
-static
-struct {
- int result;
- parsedString name;
- int commands;
- parsedString usage;
-} test1SubResults[] = {
- {
- 1,
- { "team:0x1:create] ** This is junk ** ", 4 },
- 0x1,
- { "create] ** This is junk ** ", 6 }
- },
- {
- 1,
- { "a:0x100:b] ** This is junk ** ", 1 },
- 0x100,
- { "b] ** This is junk ** ", 1 }
- },
- { 0, { 0, 0 }, 0, { 0, 0 } },
- { 0, { 0, 0 }, 0, { 0, 0 } },
- { 0, { 0, 0 }, 0, { 0, 0 } },
- { 0, { 0, 0 }, 0, { 0, 0 } },
- { 0, { 0, 0 }, 0, { 0, 0 } },
- { 0, { 0, 0 }, 0, { 0, 0 } },
- { 0, { 0, 0 }, 0, { 0, 0 } }
-};
-
-static
-stringScript test1Commands[] = {
- { SPO_Expect, { "[" } },
- { SPO_String },
- { SPO_Expect, { ":" } },
- { SPO_Integer },
- { SPO_Expect, { ":" } },
- { SPO_String },
- { SPO_Expect, { "]" } },
- { SPO_End },
-};
-
-static
-int test1(void)
-{
- int lpc, result, commands, retval = 1;
- parsedString name, usage;
-
- for( lpc = 0; test1Strings[lpc]; lpc++ )
- {
- result = parseString(test1Strings[lpc],
- SPO_Expect, "[",
- SPO_String, &name,
- SPO_Expect, ":",
- SPO_Integer, &commands,
- SPO_Expect, ":",
- SPO_String, &usage,
- SPO_Expect, "]",
- SPO_End);
- if( (test1Results[lpc].result == result) &&
- (!result ||
- (!strcmp(test1Results[lpc].name.data, name.data) &&
- (test1Results[lpc].name.len == name.len) &&
- (test1Results[lpc].commands == commands) &&
- !strcmp(test1Results[lpc].usage.data, usage.data) &&
- (test1Results[lpc].usage.len == usage.len))) )
- {
- }
- else
- {
- printf("Failure on %s\n", test1Strings[lpc]);
- retval = 0;
- }
- }
-
- for( lpc = 0; test1Strings[lpc]; lpc++ )
- {
- result = parseString_script(test1Strings[lpc],
- test1Commands,
- &name,
- &commands,
- &usage);
- if( (test1Results[lpc].result == result) &&
- (!result ||
- (!strcmp(test1Results[lpc].name.data, name.data) &&
- (test1Results[lpc].name.len == name.len) &&
- (test1Results[lpc].commands == commands) &&
- !strcmp(test1Results[lpc].usage.data, usage.data) &&
- (test1Results[lpc].usage.len == usage.len))) )
- {
- }
- else
- {
- printf("Failure on %s\n", test1Strings[lpc]);
- retval = 0;
- }
- }
-
- for( lpc = 0; test1Strings[lpc]; lpc++ )
- {
- void *values[] = {
- &name,
- &commands,
- &usage
- };
-
- result = parseString_script_values(test1Strings[lpc],
- test1Commands,
- values);
- if( (test1Results[lpc].result == result) &&
- (!result ||
- (!strcmp(test1Results[lpc].name.data, name.data) &&
- (test1Results[lpc].name.len == name.len) &&
- (test1Results[lpc].commands == commands) &&
- !strcmp(test1Results[lpc].usage.data, usage.data) &&
- (test1Results[lpc].usage.len == usage.len))) )
- {
- }
- else
- {
- printf("Failure on %s\n", test1Strings[lpc]);
- retval = 0;
- }
- }
-
- for( lpc = 0; test1Substrings[lpc].data; lpc++ )
- {
- test1Substrings[lpc].len = strlen(test1Strings[lpc]);
- result = parseSubString(&test1Substrings[lpc],
- SPO_Expect, "[",
- SPO_String, &name,
- SPO_Expect, ":",
- SPO_Integer, &commands,
- SPO_Expect, ":",
- SPO_String, &usage,
- SPO_Expect, "]",
- SPO_End);
- if( (test1SubResults[lpc].result == result) &&
- (!result ||
- (!strcmp(test1SubResults[lpc].name.data, name.data) &&
- (test1SubResults[lpc].name.len == name.len) &&
- (test1SubResults[lpc].commands == commands) &&
- !strcmp(test1SubResults[lpc].usage.data, usage.data) &&
- (test1SubResults[lpc].usage.len == usage.len))) )
- {
- }
- else
- {
- printf("Failure on %s\n", test1Substrings[lpc].data);
- retval = 0;
- }
- }
- return( retval );
-}
-
-static
-char *test2Strings[] = {
- ".:../Klasses.jar",
- ".",
- ":",
- ".:",
- 0
-};
-
-struct test2Parse {
- int lpc;
- int event;
- parsedString cpath;
-};
-
-static
-struct {
- int result;
-} test2Results[] = {
- { 1 },
- { 1 },
- { 0 },
- { 0 }
-};
-
-static
-parsedString test2ParseValues[] = {
- { ".:../Klasses.jar", 1 },
- { "../Klasses.jar", 14 },
- { ".", 1 },
- { ":", 0 },
- { "", 0 },
- { ".:", 1 },
- { "", 0 }
-};
-
-static
-struct {
- parsedString *values;
-} test2HandledValues[] = {
- { &test2ParseValues[0] },
- { &test2ParseValues[2] },
- { &test2ParseValues[3] },
- { &test2ParseValues[5] }
-};
-
-static
-int test2Handler(struct test2Parse *tp)
-{
- int retval = 0;
-
- if( !strcmp(tp->cpath.data,
- test2HandledValues[tp->lpc].values[tp->event].data) &&
- (tp->cpath.len ==
- test2HandledValues[tp->lpc].values[tp->event].len) )
- {
- retval = 1;
- }
- tp->event++;
- return( retval );
-}
-
-static
-int test2(void)
-{
- int result, lpc, retval = 1;
- struct test2Parse tp;
-
- for( lpc = 0; test2Strings[lpc]; lpc++ )
- {
- tp.lpc = lpc;
- tp.event = 0;
- result = parseString(test2Strings[lpc],
- SPO_NotEmpty,
- SPO_Do,
- SPO_NonEmptyString, &tp.cpath,
- SPO_While, ":", "",
- SPO_Handle, test2Handler, &tp,
- SPO_End,
- SPO_End,
- SPO_End);
- if( test2Results[lpc].result == result )
- {
- }
- else
- {
- printf("Failure on %s\n", test2Strings[lpc]);
- retval = 0;
- }
- }
- return( retval );
-}
-
-static
-char *test3Strings[] = {
- "stack.tim at irontown",
- "stack.tim",
- "stack",
- "stack at irontown",
- "stack at irontown.cs.utah.edu",
- 0
-};
-
-struct {
- int result;
- parsedString name;
- parsedString instance;
- parsedString realm;
-} test3Results[] = {
- { 1, { "stack.tim at irontown", 5 }, { "tim at irontown", 3 }, { "irontown", 8 } },
- { 1, { "stack.tim", 5 }, { "tim", 3 }, { "irontown", 8 } },
- { 1, { "stack", 5 }, { "", 0 }, { "irontown", 8 } },
- { 1, { "stack at irontown", 5 }, { "", 0, }, { "irontown", 8 } },
- { 1, { "stack at irontown.cs.utah.edu", 5 }, { "", 0 }, { "irontown.cs.utah.edu", 20 } }
-};
-
-static
-int test3(void)
-{
- parsedString name, instance, realm;
- int result, lpc, retval = 1;
-
- for( lpc = 0; test3Strings[lpc]; lpc++ )
- {
- instance.data = "";
- instance.len = 0;
- realm.data = "irontown";
- realm.len = 8;
- result = parseString(test3Strings[lpc],
- SPO_String, &name,
- SPO_OneOf, ".@",
- SPO_Cond, ".",
- SPO_String, &instance,
- SPO_End,
- SPO_Cond, "@",
- SPO_String, &realm,
- SPO_End,
- SPO_End,
- SPO_End);
- if( (test3Results[lpc].result == result) &&
- (!result ||
- (!strcmp(test3Results[lpc].name.data, name.data) &&
- (test3Results[lpc].name.len == name.len) &&
- !strcmp(test3Results[lpc].instance.data, instance.data) &&
- (test3Results[lpc].instance.len == instance.len) &&
- !strcmp(test3Results[lpc].realm.data, realm.data) &&
- (test3Results[lpc].realm.len == realm.len))) )
- {
- }
- else
- {
- printf("Failure on %s\n", test3Strings[lpc]);
- retval = 0;
- }
- }
- return( retval );
-}
-
-static
-char *test4Strings[] = {
- "tcp:localhost/14000",
- "localhost/14000",
- 0
-};
-
-static
-struct {
- int result;
- parsedString protocol;
- parsedString host;
- int port;
-} test4Results[] = {
- { 1, { "tcp:localhost/14000", 3 }, { "localhost/14000", 9 }, 14000 },
- { 1, { "tcp", 3 }, { "localhost/14000", 9 }, 14000 }
-};
-
-static
-int test4(void)
-{
- int result, lpc, port, retval = 1;
- parsedString protocol, host;
-
- for( lpc = 0; test4Strings[lpc]; lpc++ )
- {
- protocol.data = "tcp";
- protocol.len = 3;
- result = parseString(test4Strings[lpc],
- SPO_NonEmptyString, &protocol,
- SPO_Cond, ":",
- SPO_End,
- SPO_NonEmptyString, &host,
- SPO_Expect, "/",
- SPO_Integer, &port,
- SPO_End);
- if( (test4Results[lpc].result == result) &&
- (!result ||
- (!strcmp(test4Results[lpc].protocol.data, protocol.data) &&
- (test4Results[lpc].protocol.len == protocol.len) &&
- !strcmp(test4Results[lpc].host.data, host.data) &&
- (test4Results[lpc].host.len == host.len) &&
- (test4Results[lpc].port == port))) )
- {
- }
- else
- {
- printf("Failure on %s\n", test4Strings[lpc]);
- retval = 0;
- }
- }
- return( retval );
-}
-
-static
-char *test5Strings[] = {
- "arg1",
- "arg1 arg2",
- "arg1 arg2 arg3",
- 0
-};
-
-static
-int test5Handler(parsedString *ps)
-{
- int retval = 1;
-
- return( retval );
-}
-
-static
-int test5(void)
-{
- int lpc, retval = 1;
- parsedString arg;
-
- for( lpc = 0; test5Strings[lpc]; lpc++ )
- {
- parseString(test5Strings[lpc],
- SPO_Do,
- SPO_NonEmptyString, &arg,
- SPO_WhileSpace,
- SPO_Handle, test5Handler, &arg,
- SPO_End,
- SPO_End);
- }
- return( retval );
-}
-
-static
-char *test6Strings[] = {
- "irontown:/z/stack/jinstall/Image",
- "irontown:/Image",
- "irontown:/Image/",
- 0
-};
-
-static
-struct {
- int result;
- parsedString host;
- parsedString dir;
- parsedString file;
-} test6Results[] = {
- { 1,
- { "irontown:/z/stack/jinstall/Image", 8 },
- { "/z/stack/jinstall/Image", 17 },
- { "Image", 5 } },
- { 1,
- { "irontown:/Image", 8 },
- { "/Image", 0 },
- { "Image", 5 } },
- { 1,
- { "irontown:/Image/", 8 },
- { "/Image/", 6 },
- { "", 0 } },
-};
-
-static
-int test6(void)
-{
- parsedString host, dir, file;
- int result, lpc, retval = 1;
-
- for( lpc = 0; test6Strings[lpc]; lpc++ )
- {
- result = parseString(test6Strings[lpc],
- SPO_NotEmpty,
- SPO_String, &host,
- SPO_Expect, ":",
- SPO_String, &dir,
- SPO_Do,
- SPO_String, &file,
- SPO_While, "/", "",
- SPO_End,
- SPO_End,
- SPO_End);
- if( (test6Results[lpc].result == result) &&
- (!result ||
- (!strcmp(test6Results[lpc].host.data, host.data) &&
- (test6Results[lpc].host.len == host.len) &&
- !strcmp(test6Results[lpc].dir.data, dir.data) &&
- (test6Results[lpc].dir.len == dir.len) &&
- !strcmp(test6Results[lpc].file.data, file.data) &&
- (test6Results[lpc].file.len == file.len))) )
- {
- }
- else
- {
- printf("Failure on %s\n", test6Strings[lpc]);
- retval = 0;
- }
- }
- return( retval );
-}
-
-int testStringParsingModule(void)
-{
- int retval;
-
- retval = test1() &&
- test2() &&
- test3() &&
- test4() &&
- test5() &&
- test6();
return( retval );
}
More information about the kaffe
mailing list