[Libre-soc-bugs] [Bug 982] Support PowerPC ABI in ISACaller
bugzilla-daemon at libre-soc.org
bugzilla-daemon at libre-soc.org
Thu Sep 14 07:57:14 BST 2023
https://bugs.libre-soc.org/show_bug.cgi?id=982
--- Comment #23 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
(In reply to Jacob Lifshay from comment #22)
> Andrey, while I was reading the code you wrote:
> https://git.libre-soc.org/?p=openpower-isa.git;a=blob;f=src/openpower/test/
> syscall/syscall_cases.py;h=2e64315833810a7c38ee9733cba1e9e04e38ceeb;
> hb=1be8996cbea4d5bcb96ed9a91c2f0dbfcacf7ee1#l38
>
> you need to pass a pointer to the bytes to the write syscall, not put the
> bytes directly in the register.
yes. this is exactly a function call (just with r0={thesystemcallnumber}
therefore, you need to read the man page:
https://man7.org/linux/man-pages/man2/write.2.html
note that the header is:
ssize_t write(int fd, const void buf[.count], size_t count);
read the ABI dcument calling convention:
https://git.libre-soc.org/?p=openpower-isa.git;a=blob;f=media/calling-conv;hb=HEAD
and set r3=fd (stdout) r4=*ADDRESS* of buf r5=count.
can i suggest putting the above links and some explanatory comments
into the code so that it can be referred to as a way to help guide
people on syscalls?
also: every single file *MUST* have:
* Copyright notices (including the original if you copied contents
of the file from somewhere)
* License Header (SPDX)
* Thank you to NLnet and the associated EU Grant.
all of that is MANDATORY for the project.
also in this case put the bug URL to crossref here.
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the libre-soc-bugs
mailing list