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

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Thu Sep 21 00:14:30 BST 2023


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

--- Comment #67 from Jacob Lifshay <programmerjake at gmail.com> ---
(In reply to Dmitry Selyutin from comment #66)
> Practically speaking, it's just the same function call, except that you do
> not jump directly. You interrupt the processor, it switches the context and
> priviledge level, then jumps to a specific pre-programmed location, then the
> kernel code serves the request. There's an awful lot of details inbetween
> these stages, but basically (dramatically simplified) this is it.

well, imo it would be much easier to just add an `if` to ISACaller that checks
if the current insn is `sc` (or, later, `scv`) and if it is, *skips* all
privilege transitions and everything, replacing all actions of `sc` with just
running the syscall translation code, and then advancing to the next
instruction. I'd guess this is exactly what qemu-user does.

basically:

class ISACaller(...):
    ...
    def call(self, name):
        ...
        asmop = yield from self.get_assembly_name()
        log("call", ins_name, asmop)

        if not self.is_svp64_mode and asmop == "sc" and self.syscall_emulation:
            yield from self.emulate_syscall()
            self.update_pc_next()
            return
        ...

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


More information about the libre-soc-bugs mailing list