Mercurial > pub > dyncall > dyncall
comparison doc/manual/callconvs/callconv_x64.tex @ 340:6e33db95e724
- syscall infos in doc
author | Tassilo Philipp |
---|---|
date | Sat, 04 Jan 2020 22:48:51 +0100 |
parents | 74c056b597b7 |
children | c607d67cd6b8 |
comparison
equal
deleted
inserted
replaced
339:4f9f49fb82ce | 340:6e33db95e724 |
---|---|
44 | 44 |
45 | 45 |
46 | 46 |
47 \paragraph{\product{dyncall} support} | 47 \paragraph{\product{dyncall} support} |
48 | 48 |
49 \product{dyncall} supports the MS Windows and System V calling convention.\\ | 49 Currently, the MS Windows and System V calling conventions are supported.\\ |
50 \\ | 50 \product{Dyncall} can also be used to issue syscalls on System V platforms by |
51 | 51 using the syscall number as target parameter and selecting the correct mode. |
52 | |
53 | 52 |
54 \subsubsection{MS Windows} | 53 \subsubsection{MS Windows} |
55 | 54 |
56 \paragraph{Registers and register usage} | 55 \paragraph{Registers and register usage} |
57 | 56 |
239 & \vdots & & \\ | 238 & \vdots & & \\ |
240 \end{tabular} | 239 \end{tabular} |
241 \caption{Stack layout on x64 System V (Linux/*BSD)} | 240 \caption{Stack layout on x64 System V (Linux/*BSD)} |
242 \end{figure} | 241 \end{figure} |
243 | 242 |
243 | |
244 \newpage | |
245 | |
246 \subsubsection{System V syscalls} | |
247 | |
248 \paragraph{Parameter passing} | |
249 | |
250 \begin{itemize} | |
251 \item syscall is issued via the {\em syscall} instruction | |
252 \item kernel destroys registers rcx and r11 | |
253 \item syscall number is set in rax | |
254 \item up to 6 params are passed in the following registers in this order: rdi, rsi, rdx, rcx, r8, r9 | |
255 \item no stack in use, meaning syscalls are limited to six arguments | |
256 \item register rax holds the return value (values in between -4095 and -1 indicate errors) | |
257 \end{itemize} | |
258 |