Skip to content

Commit 858bb3b

Browse files
kiwi1969tzezula
authored andcommitted
Update InternalResource.java for z/OS
Allow z/OS to be an acceptable operating system Allow s390x to be an acceptable architecture Making these acceptable, allows the language interpreter to function for z/OS (cherry picked from commit d3a90eb)
1 parent dbdbfa8 commit 858bb3b

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

truffle/src/com.oracle.truffle.api/src/com/oracle/truffle/api/InternalResource.java

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,12 @@ enum OS {
484484
*
485485
* @since 23.1
486486
*/
487-
WINDOWS("windows");
487+
WINDOWS("windows"),
488+
489+
/**
490+
* The IBM z/OS operating system.
491+
*/
492+
ZOS("z/OS");
488493

489494
private final String id;
490495

@@ -517,6 +522,8 @@ public static OS getCurrent() {
517522
return DARWIN;
518523
} else if (os.toLowerCase().startsWith("windows")) {
519524
return WINDOWS;
525+
} else if (os.equalsIgnoreCase("z/OS")) {
526+
return ZOS;
520527
} else {
521528
throw CompilerDirectives.shouldNotReachHere("Unsupported OS name " + os);
522529
}
@@ -542,7 +549,13 @@ enum CPUArchitecture {
542549
*
543550
* @since 23.1
544551
*/
545-
AMD64("amd64");
552+
AMD64("amd64"),
553+
554+
/**
555+
* The IBM s390x 64-bit architecture.
556+
*
557+
*/
558+
S390X("s390x");
546559

547560
private final String id;
548561

@@ -573,6 +586,7 @@ public static CPUArchitecture getCurrent() {
573586
return switch (arch) {
574587
case "amd64", "x86_64" -> AMD64;
575588
case "aarch64", "arm64" -> AARCH64;
589+
case "s390x" -> S390X;
576590
default -> throw CompilerDirectives.shouldNotReachHere("Unsupported CPU architecture " + arch);
577591
};
578592
}

0 commit comments

Comments
 (0)