Fixed incorrect const values

This commit is contained in:
2025-02-21 13:47:56 +01:00
parent 04ece57b27
commit 1ca61190eb
22 changed files with 93 additions and 92 deletions

View File

@ -1,8 +1,8 @@
read(fd int, buffer *any, length int) -> int {
read(fd int, buffer *byte, length int) -> int {
return syscall(0, fd, buffer, length)
}
write(fd int, buffer *any, length int) -> int {
write(fd int, buffer *byte, length int) -> int {
return syscall(1, fd, buffer, length)
}
@ -14,16 +14,16 @@ close(fd int) -> int {
return syscall(3, fd)
}
mmap(address int, length int, protection int, flags int) -> *any {
mmap(address int, length uint, protection int, flags int) -> *any {
return syscall(9, address, length, protection, flags)
}
munmap(address *any, length int) -> int {
munmap(address *any, length uint) -> int {
return syscall(11, address, length)
}
clone(flags int, stack *any) -> int {
return syscall(56, flags, stack)
clone(flags uint, stack *any, parent *int, child *int, tls uint) -> int {
return syscall(56, flags, stack, parent, child, tls)
}
fork() -> int {

View File

@ -1,8 +1,8 @@
read(fd int, buffer *any, length int) -> int {
read(fd int, buffer *byte, length int) -> int {
return syscall(0x2000003, fd, buffer, length)
}
write(fd int, buffer *any, length int) -> int {
write(fd int, buffer *byte, length int) -> int {
return syscall(0x2000004, fd, buffer, length)
}

View File

@ -1,31 +1,17 @@
read(fd int64, buffer *any, length int64) -> int64 {
read(fd int64, buffer *byte, length int64) -> int64 {
fd = kernel32.GetStdHandle(-10 - fd)
kernel32.ReadConsole(fd, buffer, length, 0)
return length
}
write(fd int64, buffer *any, length int64) -> int64 {
write(fd int64, buffer *byte, length int64) -> int64 {
fd = kernel32.GetStdHandle(-10 - fd)
kernel32.WriteConsoleA(fd, buffer, length, 0)
return length
}
mmap(address int, length int, protection int, flags int) -> *any {
return kernel32.VirtualAlloc(address, length, flags, protection)
}
munmap(address *any, length int) -> int {
return kernel32.VirtualFree(address, length, mem.decommit)
}
const mem {
decommit 0x4000
}
extern kernel32 {
GetStdHandle(handle int64) -> int64
ReadConsole(fd int64, buffer *any, length uint32, written *uint32) -> bool
VirtualAlloc(address int, length int, flags int, protection int)
VirtualFree(address *any, length int, type int) -> bool
WriteConsoleA(fd int64, buffer *any, length uint32, written *uint32) -> bool
ReadConsole(fd int64, buffer *byte, length uint32, written *uint32) -> bool
WriteConsoleA(fd int64, buffer *byte, length uint32, written *uint32) -> bool
}