qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Semihosting, arm, riscv, ppc and common code


From: Liviu Ionescu
Subject: Re: Semihosting, arm, riscv, ppc and common code
Date: Thu, 16 Jan 2020 09:57:00 +0200


> On 16 Jan 2020, at 04:04, Benjamin Herrenschmidt <address@hidden> wrote:
> 
> ... I agree, which is also why I want to use the same interface for
> powerpc, it will simply make life easier for everybody.


I don't know the current implementation in QEMU, but I suggest you also take a 
look at the current Arm specs:

        https://static.docs.arm.com/100863/0200/semihosting.pdf

The implementation in OpenOCD is:

        
https://github.com/xpack-dev-tools/openocd/blob/xpack/src/target/semihosting_common.c

> The calls
> aren't perfect but they do work sufficiently well to be useful and I
> haven't yet been convinced that it can't be extended if necessary.

In theory it can, in practice it'll not be easy.

Imagine that you decide to use Arm semihosting for your architecture, and 
implement it in QEMU.

Then you try to convince other tool developers to do the same. If you ask them 
nicely, they might copy/paste the Arm code, and you're done, major commercial 
tools will have Arm semihosting support for your architecture and it becomes a 
de facto standard.

If at a later time you decide to extend the protocol, you have to go again to 
all commercial tool vendors and ask them to implement the extension. You'll 
need good reasons to convince them.

In my case it was easier to convince SEGGER to add Arm semihosting support to 
their RISC-V JTAG, because we had a long relationship, but even so I doubt 
they'll be happy to implement extensions.

---

Anyway, from my experience, for practical cases the Arm semihosting is more 
than enough, once you have a functional implementation for the client side you 
simply forget about it, and you can use it for any architecture.

My implementation is the following:

        
https://github.com/micro-os-plus/semihosting-xpack/blob/xpack/src/syscalls-semihosting.cpp


Regards,

Liviu





reply via email to

[Prev in Thread] Current Thread [Next in Thread]