X-Git-Url: http://git.megacz.com/?p=nestedvm.git;a=blobdiff_plain;f=src%2Forg%2Fibex%2Fnestedvm%2FRuntime.java;h=4d965e70eaa0989df49779642ebae6ed73f2500a;hp=2a4567fb87552bfc01c0899648f9fe7a009e8007;hb=37a9506df9dab17552c6c34b62dc4295504b6c8c;hpb=896193619af1e0534356ac622494ae77c7e42594;ds=sidebyside diff --git a/src/org/ibex/nestedvm/Runtime.java b/src/org/ibex/nestedvm/Runtime.java index 2a4567f..4d965e7 100644 --- a/src/org/ibex/nestedvm/Runtime.java +++ b/src/org/ibex/nestedvm/Runtime.java @@ -9,6 +9,8 @@ import java.io.*; import java.util.Arrays; public abstract class Runtime implements UsermodeConstants,Registers,Cloneable { + public static final String VERSION = "1.0"; + /** True to write useful diagnostic information to stderr when things go wrong */ final static boolean STDERR_DIAG = true; @@ -1422,6 +1424,13 @@ public abstract class Runtime implements UsermodeConstants,Registers,Cloneable { } } + static byte[] getNullTerminatedBytes(String s) { + byte[] buf1 = getBytes(s); + byte[] buf2 = new byte[buf1.length+1]; + System.arraycopy(buf1,0,buf2,0,buf1.length); + return buf2; + } + final static String toHex(int n) { return "0x" + Long.toString(n & 0xffffffffL, 16); } final static int min(int a, int b) { return a < b ? a : b; } final static int max(int a, int b) { return a > b ? a : b; }