summaryrefslogtreecommitdiff
path: root/src/pkg/syscall/zsyscall_nacl_386.go
blob: 34a0bd4668dea8645594e8a8c3822aa48ab9782f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
// mksyscall.sh -l32 syscall_nacl.go syscall_nacl_386.go
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT

package syscall

import "unsafe"

func Chmod(path string, mode int) (errno int) {
	_, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), 0)
	errno = int(e1)
	return
}

func Clock() (clock int) {
	r0, _, _ := Syscall(SYS_CLOCK, 0, 0, 0)
	clock = int(r0)
	return
}

func Close(fd int) (errno int) {
	_, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0)
	errno = int(e1)
	return
}

func Exit(code int) {
	Syscall(SYS_EXIT, uintptr(code), 0, 0)
	return
}

func Fstat(fd int, stat *Stat_t) (errno int) {
	_, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
	errno = int(e1)
	return
}

func Getdents(fd int, buf []byte) (n int, errno int) {
	var _p0 *byte
	if len(buf) > 0 {
		_p0 = &buf[0]
	}
	r0, _, e1 := Syscall(SYS_GETDENTS, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)))
	n = int(r0)
	errno = int(e1)
	return
}

func Getpid() (pid int) {
	r0, _, _ := Syscall(SYS_GETPID, 0, 0, 0)
	pid = int(r0)
	return
}

func Gettimeofday(tv *Timeval) (errno int) {
	_, _, e1 := Syscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0)
	errno = int(e1)
	return
}

func Open(path string, mode int, perm int) (fd int, errno int) {
	r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(mode), uintptr(perm))
	fd = int(r0)
	errno = int(e1)
	return
}

func Read(fd int, p []byte) (n int, errno int) {
	var _p0 *byte
	if len(p) > 0 {
		_p0 = &p[0]
	}
	r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)))
	n = int(r0)
	errno = int(e1)
	return
}

func read(fd int, buf *byte, nbuf int) (n int, errno int) {
	r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf))
	n = int(r0)
	errno = int(e1)
	return
}

func Stat(path string, stat *Stat_t) (errno int) {
	_, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(StringBytePtr(path))), uintptr(unsafe.Pointer(stat)), 0)
	errno = int(e1)
	return
}

func Write(fd int, p []byte) (n int, errno int) {
	var _p0 *byte
	if len(p) > 0 {
		_p0 = &p[0]
	}
	r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(len(p)))
	n = int(r0)
	errno = int(e1)
	return
}

func MultimediaInit(subsys int) (errno int) {
	_, _, e1 := Syscall(SYS_MULTIMEDIA_INIT, uintptr(subsys), 0, 0)
	errno = int(e1)
	return
}

func MultimediaShutdown() (errno int) {
	_, _, e1 := Syscall(SYS_MULTIMEDIA_SHUTDOWN, 0, 0, 0)
	errno = int(e1)
	return
}

func CondCreate() (cv int, errno int) {
	r0, _, e1 := Syscall(SYS_COND_CREATE, 0, 0, 0)
	cv = int(r0)
	errno = int(e1)
	return
}

func CondWait(cv int, mutex int) (errno int) {
	_, _, e1 := Syscall(SYS_COND_WAIT, uintptr(cv), uintptr(mutex), 0)
	errno = int(e1)
	return
}

func CondSignal(cv int) (errno int) {
	_, _, e1 := Syscall(SYS_COND_SIGNAL, uintptr(cv), 0, 0)
	errno = int(e1)
	return
}

func CondBroadcast(cv int) (errno int) {
	_, _, e1 := Syscall(SYS_COND_BROADCAST, uintptr(cv), 0, 0)
	errno = int(e1)
	return
}

func CondTimedWaitAbs(cv int, mutex int, abstime *Timespec) (errno int) {
	_, _, e1 := Syscall(SYS_COND_TIMED_WAIT_ABS, uintptr(cv), uintptr(mutex), uintptr(unsafe.Pointer(abstime)))
	errno = int(e1)
	return
}

func MutexCreate() (mutex int, errno int) {
	r0, _, e1 := Syscall(SYS_MUTEX_CREATE, 0, 0, 0)
	mutex = int(r0)
	errno = int(e1)
	return
}

func MutexLock(mutex int) (errno int) {
	_, _, e1 := Syscall(SYS_MUTEX_LOCK, uintptr(mutex), 0, 0)
	errno = int(e1)
	return
}

func MutexUnlock(mutex int) (errno int) {
	_, _, e1 := Syscall(SYS_MUTEX_UNLOCK, uintptr(mutex), 0, 0)
	errno = int(e1)
	return
}

func MutexTryLock(mutex int) (errno int) {
	_, _, e1 := Syscall(SYS_MUTEX_TRYLOCK, uintptr(mutex), 0, 0)
	errno = int(e1)
	return
}

func SemCreate() (sema int, errno int) {
	r0, _, e1 := Syscall(SYS_SEM_CREATE, 0, 0, 0)
	sema = int(r0)
	errno = int(e1)
	return
}

func SemWait(sema int) (errno int) {
	_, _, e1 := Syscall(SYS_SEM_WAIT, uintptr(sema), 0, 0)
	errno = int(e1)
	return
}

func SemPost(sema int) (errno int) {
	_, _, e1 := Syscall(SYS_SEM_POST, uintptr(sema), 0, 0)
	errno = int(e1)
	return
}

func VideoInit(dx int, dy int) (errno int) {
	_, _, e1 := Syscall(SYS_VIDEO_INIT, uintptr(dx), uintptr(dy), 0)
	errno = int(e1)
	return
}

func VideoUpdate(data *uint32) (errno int) {
	_, _, e1 := Syscall(SYS_VIDEO_UPDATE, uintptr(unsafe.Pointer(data)), 0, 0)
	errno = int(e1)
	return
}

func VideoPollEvent(ev *byte) (errno int) {
	_, _, e1 := Syscall(SYS_VIDEO_POLL_EVENT, uintptr(unsafe.Pointer(ev)), 0, 0)
	errno = int(e1)
	return
}

func VideoShutdown() (errno int) {
	_, _, e1 := Syscall(SYS_VIDEO_SHUTDOWN, 0, 0, 0)
	errno = int(e1)
	return
}

func AudioInit(fmt int, nreq int, data *int) (errno int) {
	_, _, e1 := Syscall(SYS_AUDIO_INIT, uintptr(fmt), uintptr(nreq), uintptr(unsafe.Pointer(data)))
	errno = int(e1)
	return
}

func AudioShutdown() (errno int) {
	_, _, e1 := Syscall(SYS_AUDIO_SHUTDOWN, 0, 0, 0)
	errno = int(e1)
	return
}

func AudioStream(data *uint16, size *uintptr) (errno int) {
	_, _, e1 := Syscall(SYS_AUDIO_STREAM, uintptr(unsafe.Pointer(data)), uintptr(unsafe.Pointer(size)), 0)
	errno = int(e1)
	return
}