[Libre-soc-bugs] [Bug 982] Support PowerPC ABI in ISACaller

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Mon Sep 18 20:45:15 BST 2023


https://bugs.libre-soc.org/show_bug.cgi?id=982

--- Comment #56 from Dmitry Selyutin <ghostmansd at gmail.com> ---
(In reply to Andrey Miroshnikov from comment #54)
> (In reply to Dmitry Selyutin from comment #52)
> This is brilliant! Thanks for doing this. During learning I was struggling
> how to use ctypes, this is so much more capable!

Nah, ctypes are easy and sweet, compared to many CFFI (C foreign function
interfaces) or other tools for C interop I saw. At least they are amazing for
simple tasks, and here we mostly need to wrap only one function. I'd just
extend them to deal with structures and unions in a dataclass-like format,
though: the current syntax for this is annoying.

> I'll give this a spin later.

Sure, no rush!

I've updated the code calling convention a bit so that the first argument in
__call__ is always expected to be a system call id (as it indeed happens IRL):

https://git.libre-soc.org/?p=openpower-isa.git;a=commitdiff;h=ad27091ea159b284c1bda2b089f670b83e5681a7

(In reply to Jacob Lifshay from comment #55)
> (In reply to Dmitry Selyutin from comment #52)
> > Folks, I've played a bit more with these shiny system call tables, and added
> > a simple class which can be used as a basis for ppc/ppc64/i386/amd64
> > conversion:
> 
> nice! though I wouldn't bother supporting i386...

Naah it was so trivial I could not resist.

> note that some system calls pass in structs and stuff, and those structs
> often have different layouts between architectures, so they will need more
> complex translation than just moving registers around.

Yep, I know. That's why we have lookup the exact entry point and why there's a
way to override some particular call by its name. :-) I'll extend this
mechanism a bit though.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the libre-soc-bugs mailing list