Commit 6d4c18a4 authored by Alex Brainman's avatar Alex Brainman

syscall: implement Syscall15

Fixes #2251.

R=golang-dev, rsc
CC=golang-dev, jp
https://golang.org/cl/5440050
parent 5a18aef6
......@@ -4,7 +4,7 @@
#include "amd64/asm.h"
#define maxargs 12
#define maxargs 15
// void runtime·asmstdcall(void *c);
TEXT runtime·asmstdcall(SB),7,$0
......
......@@ -117,3 +117,29 @@ func Syscall12(fn uintptr, nargs uintptr, a1 uintptr, a2 uintptr, a3 uintptr, a4
r1 = c.r1;
r2 = c.r2;
}
func Syscall15(fn uintptr, nargs uintptr, a1 uintptr, a2 uintptr, a3 uintptr, a4 uintptr, a5 uintptr, a6 uintptr, a7 uintptr, a8 uintptr, a9 uintptr, a10 uintptr, a11 uintptr, a12 uintptr, a13 uintptr, a14 uintptr, a15 uintptr) (r1 uintptr, r2 uintptr, err uintptr) {
WinCall c;
USED(a2);
USED(a3);
USED(a4);
USED(a5);
USED(a6);
USED(a7);
USED(a8);
USED(a9);
USED(a10);
USED(a11);
USED(a12);
USED(a13);
USED(a14);
USED(a15);
c.fn = (void*)fn;
c.n = nargs;
c.args = &a1;
runtime·cgocall(runtime·asmstdcall, &c);
err = c.err;
r1 = c.r1;
r2 = c.r2;
}
......@@ -37,6 +37,7 @@ func Syscall(trap, nargs, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno)
func Syscall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno)
func Syscall9(trap, nargs, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno)
func Syscall12(trap, nargs, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12 uintptr) (r1, r2 uintptr, err Errno)
func Syscall15(trap, nargs, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15 uintptr) (r1, r2 uintptr, err Errno)
func loadlibrary(filename *uint16) (handle, err Errno)
func getprocaddress(handle uintptr, procname *uint8) (proc uintptr, err Errno)
......@@ -147,6 +148,12 @@ func (p *Proc) Call(a ...uintptr) (r1, r2 uintptr, err error) {
return Syscall12(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], 0)
case 12:
return Syscall12(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11])
case 13:
return Syscall15(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], 0, 0)
case 14:
return Syscall15(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], 0)
case 15:
return Syscall15(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14])
default:
panic("Call " + p.Name + " with too many arguments " + itoa(len(a)) + ".")
}
......
......@@ -190,6 +190,11 @@ while(<>) {
while(@args < 12) {
push @args, "0";
}
} elsif(@args <= 15) {
$asm = "${syscalldot}Syscall15";
while(@args < 15) {
push @args, "0";
}
} else {
print STDERR "$ARGV:$.: too many arguments to system call\n";
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment