<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<div class="moz-cite-prefix">On 10/10/2014 11:56 AM, Hesham Moustafa
wrote:<br>
</div>
<blockquote
cite="mid:CA+wsVCDxw1xVOw+_p+TfJ0RStL=Fc6ku5Na+PxmKfcHsj7iKAQ@mail.gmail.com"
type="cite">
<div dir="ltr"><br>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Wed, Oct 8, 2014 at 4:20 PM, Joel
Sherrill <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:joel.sherrill@oarcorp.com" target="_blank">joel.sherrill@oarcorp.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex"><span
class=""><br>
On 10/8/2014 12:15 AM, Sebastian Huber wrote:<br>
> On 07/10/14 15:53, Hesham Moustafa wrote:<br>
>> Hi,<br>
>><br>
>> I want to send shutdown signal from RTEMS to
qemu. Joel said that<br>
>> qemu-system-i386 does so; can anyone refers me
to how to implement that for<br>
>> qemu-system-or32 (openrisc)?<br>
> This is target dependent. Some targets implement
the registers of the reset<br>
> module. The easiest thing to figure this out is
looking at the Qemu sources.<br>
><br>
</span>We need to ask Christian. There is a command line
option to qemu<br>
which turns on "exit on reset" (--no-reboot). If the
simulated target<br>
hardware has a way to reset it from software, the target
specific<br>
simulation<br>
can honor the command line option and just exit rather
than start over.<br>
<br>
We use this on at least the pc386.<br>
<br>
</blockquote>
<div>Would you please provide the related QEMU code so that
I can try to imitate for or1k? <br>
</div>
</div>
</div>
</div>
</blockquote>
<br>
Bring Christian in on this. There has to be defined a hardware way
to <br>
shutdown. It can be as simple as a new "IO device" which has a
single<br>
register. When you write to it, the simulator just does an orderly
shutdown.<br>
<br>
But if the or1k HW already has some defined HW mechanism to request<br>
a reset, then we need to know that so that the simulator can exit or<br>
restart when that is touched properly.<br>
<br>
The qemu code is complex but it centers around
qemu_system_reset_request()<br>
as best I can tell.<br>
<blockquote
cite="mid:CA+wsVCDxw1xVOw+_p+TfJ0RStL=Fc6ku5Na+PxmKfcHsj7iKAQ@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
The questions for Christian are:<br>
<br>
+ Does the or1ksim have a software reset capability? If
not, can we<br>
add one?<br>
<br>
</blockquote>
<div>There is a single assembly instruction that shutdowns
the whole or1ksim simulator process. We can use it from
RTEMS. The question is where is the best place to put in
this instruction? It's BSP related, and I was thinking of
_CPU_Fatal_Halt, but it's not BSP related. However only
or1ksim simulator recognizes this instruction, and it has
no effect on other (future) target (QEMU, FPGA board,
etc).</div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
+ Can qemu be modified to support this?<br>
<br>
It should only be a few lines of code in qemu and one
write to the<br>
magic location in the BSP.<br>
<br>
It will be of great value in speeding the testing
procedure.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Joel Sherrill, Ph.D. Director of Research
& Development<br>
<a class="moz-txt-link-abbreviated" href="mailto:joel.sherrill@OARcorp.com">joel.sherrill@OARcorp.com</a> On-Line Applications
Research<br>
Ask me about RTEMS: a free RTOS Huntsville AL 35805<br>
Support Available (256) 722-9985<br>
<br>
</font></span></blockquote>
</div>
<br>
</div>
</div>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Joel Sherrill, Ph.D. Director of Research & Development
<a class="moz-txt-link-abbreviated" href="mailto:joel.sherrill@OARcorp.com">joel.sherrill@OARcorp.com</a> On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985</pre>
</body>
</html>