1 # The 4xx series is for primitives implemented in Mu. 2 3 # Signatures for major SubX functions defined so far. 4 5 # autogenerated 6 sig run-tests 7 8 # init.linux 9 # TODO: make this OS-specific 10 # TODO: include result type at least, even if register args are too much 11 sig syscall_exit # status/ebx: int 12 sig syscall_read # fd/ebx: int, buf/ecx: addr, size/edx: int -> nbytes-or-error/eax: int 13 sig syscall_write # fd/ebx: int, buf/ecx: addr, size/edx: int -> nbytes-or-error/eax: int 14 sig syscall_open # filename/ebx: (addr kernel-string), flags/ecx: int, dummy=0x180/edx -> fd-or-error/eax: int 15 sig syscall_close # fd/ebx: int -> status/eax 16 sig syscall_creat # filename/ebx: (addr kernel-string) -> fd-or-error/eax: int 17 sig syscall_unlink # filename/ebx: (addr kernel-string) -> status/eax: int 18 sig syscall_rename # source/ebx: (addr kernel-string), dest/ecx: (addr kernel-string) -> status/eax: int 19 sig syscall_mmap # arg/ebx: (addr mmap_arg_struct) -> status/eax: int 20 sig syscall_ioctl # fd/ebx: int, cmd/ecx: int, arg/edx: (addr _) 21 sig syscall_nanosleep # req/ebx: (addr timespec) 22 sig syscall_clock_gettime # clock/ebx: int, out/ecx: (addr timespec) 23 24 # Generated using: 25 # grep -h '^[a-z]' [0-9]*.subx |grep -v '^test-' 26 # Functions we don't want to make accessible from Mu are commented out. 27 # Many functions here may not be usable yet because of missing features 28 # (global variable support, etc.) 29 sig check-ints-equal a: int, b: int, msg: (addr array byte) 30 sig kernel-string-equal? s: (addr kernel-string), benchmark: (addr array byte) -> _/eax: boolean 31 sig new-segment len: int, ad: (addr allocation-descriptor) 32 sig string-equal? s: (addr array byte), benchmark: (addr array byte) -> _/eax: boolean 33 sig string-starts-with? s: (addr array byte), benchmark: (addr array byte) -> _/eax: boolean 34 sig check-strings-equal s: (addr array byte), expected: (addr array byte), msg: (addr array byte) 35 sig clear-stream f: (addr stream _) 36 sig rewind-stream f: (addr stream _) 37 sig initialize-trace-stream n: int 38 sig trace line: (addr array byte) 39 sig check-trace-contains line: (addr string), msg: (addr string) 40 sig check-trace-scans-to line: (addr string), msg: (addr string) 41 sig trace-scan line: (addr array byte) -> _/eax: boolean 42 sig next-line-matches? t: (addr stream byte), line: (addr array byte) -> _/eax: boolean 43 sig skip-next-line t: (addr stream byte) 44 sig clear-trace-stream 45 sig write f: (addr stream byte), s: (addr array byte) # writing to file descriptor not supported; use buffered-file 46 sig stream-data-equal? f: (addr stream byte), s: (addr array byte) -> _/eax: boolean 47 sig check-stream-equal f: (addr stream byte), s: (addr array byte), msg: (addr array byte) 48 sig next-stream-line-equal? f: (addr stream byte), s: (addr array byte) -> _/eax: boolean 49 sig check-next-stream-line-equal f: (addr stream byte), s: (addr array byte), msg: (addr array byte) 50 sig tailor-exit-descriptor ed: (addr exit-descriptor), nbytes: int 51 sig stop ed: (addr exit-descriptor), value: int 52 #sig read f: fd or (addr stream byte), s: (addr stream byte) -> _/eax: int 53 sig read-byte-buffered f: (addr buffered-file) -> _/eax: byte 54 sig read-byte s: (addr stream byte) -> _/eax: byte 55 #sig write-stream f: fd or (addr stream byte), s: (addr stream byte) 56 #sig error ed: (addr exit-descriptor), out: fd or (addr stream byte), msg: (addr array byte) 57 sig write-byte-buffered f: (addr buffered-file), n: int 58 sig flush<parse/0: instruction: run parse/0: ingredient: {name: " 1:integer <- add 2:literal, 2:literal ", value: 0, type: 0, properties: [" 1:integer <- add 2:literal, 2:literal ": "literal-string"]} parse/0: instruction: trace-should-contain parse/0: ingredient: {name: " mem: storing 4 in location 1 ", value: 0, type: 0, properties: [" mem: storing 4 in location 1 ": "literal-string"]} after-brace/0: recipe check_trace after-brace/0: run ... after-brace/0: trace-should-contain ... new/0: routine allocated memory from 1000 to 101000 schedule/0: check_trace run/0: instruction check_trace/0 run/0: run/42 {name: " 1:integer <- add 2:literal, 2:literal ", value: 0, type: 0, properties: [" 1:integer <- add 2:literal, 2:literal ": "literal-string"]} parse/0: instruction: add parse/0: ingredient: {name: "2", value: 0, type: 0, properties: ["2": "literal"]} parse/0: ingredient: {name: "2", value: 0, type: 0, properties: ["2": "literal"]} parse/0: product: {name: "1", value: 0, type: 1, properties: ["1": "integer"]} after-brace/0: recipe run1001 after-brace/0: add ... run/0: instruction run1001/0 run/0: {name: "1", value: 1, type: 1, properties: ["1": "integer"]} <- add/2 {name: "2", value: 2, type: 0, properties: ["2": "literal"]}, {name: "2", value: 2, type: 0, properties: ["2": "literal"]} run/0: ingredient 0 is 2 run/0: ingredient 1 is 2 run/0: product 0 is 4 mem/0: storing 4 in location 1 run/0: instruction check_trace/1 run/0: trace-should-contain/44 {name: " mem: storing 4 in location 1 ", value: 0, type: 0, properties: [" mem: storing 4 in location 1 ": "literal-string"]}