<div dir="auto"><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Jun 4, 2017 4:37 PM, "Hesham Almatary" <<a href="mailto:heshamelmatary@gmail.com">heshamelmatary@gmail.com</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Denis,<br>
<br>
Yes, I'm willing to fix these, just need time. Shouldn't be that difficult.<br>
<br>
You can get more details on RISC-V assembly reading RISC-V specs<br>
(especially user-level spec) [1]. For example/references, you may have<br>
a look at the riscv-linux and/or seL4 ports [2, 3] (though, you've to<br>
be aware of 64-bit vs 32-bit differences).<br>
<br>
You shouldn't need to write lots of assembly code though.<br></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">Most ports have only the context switch and interrupt handling in Assembly Language. Things like interrupt disable and other small accesses to special registers can usually be done with inline assembly period use in line assembly whenever possible and wrap it and a static inline function to make it look more readable.</div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
[1] <a href="https://riscv.org/specifications/" rel="noreferrer" target="_blank">https://riscv.org/<wbr>specifications/</a><br>
[2] <a href="https://github.com/riscv/riscv-linux/tree/priv-1.10/arch/riscv/kernel" rel="noreferrer" target="_blank">https://github.com/riscv/<wbr>riscv-linux/tree/priv-1.10/<wbr>arch/riscv/kernel</a><br>
[3] <a href="https://github.com/heshamelmatary/seL4/tree/RISCVUnofficialRelease-03062017/src/arch/riscv" rel="noreferrer" target="_blank">https://github.com/<wbr>heshamelmatary/seL4/tree/<wbr>RISCVUnofficialRelease-<wbr>03062017/src/arch/riscv</a><br>
<div class="elided-text"><br>
On Mon, Jun 5, 2017 at 7:21 AM, Denis Obrezkov <<a href="mailto:denisobrezkov@gmail.com">denisobrezkov@gmail.com</a>> wrote:<br>
> 2017-06-05 0:14 GMT+03:00 Hesham Almatary <<a href="mailto:heshamelmatary@gmail.com">heshamelmatary@gmail.com</a>>:<br>
>><br>
>> Hi Denis,<br>
>><br>
>> Yes, the Host-Target-Interface (HTIF) has been refactored/removed in<br>
>> RISC-V. Also, it was meant to work with riscv front-end server<br>
>> (riscv-fesvr) which is not the case for your HiFive BSP I guess.<br>
>><br>
>> I believe now it's the good time for you to start creating your own<br>
>> HiFive BSP. You'll have to read/know how to output data over the<br>
>> HiFive serial port or so, and develop your own console driver for the<br>
>> board. You might find this link useful [1] when creating a new BSP,<br>
>> and also use other BSPs as a reference (e.g. riscv_generic). Main<br>
>> things to be aware of when creating a new BSP are: 1) startup code, 2)<br>
>> console driver, and 3) timer driver. To make things easier for you,<br>
>> and to give you credit for your contributions when merged upstream,<br>
>> you'd want to create a new branch for your HiFive BSP based on<br>
>> priv-1.10, and rebase against it when/if I make changes to it.<br>
>><br>
>> Keep the good work up.<br>
>><br>
>> [1] <a href="https://devel.rtems.org/wiki/TBR/UserManual/Submitting_a_BSP" rel="noreferrer" target="_blank">https://devel.rtems.org/wiki/<wbr>TBR/UserManual/Submitting_a_<wbr>BSP</a><br>
>><br>
>> Best,<br>
>> Hesham<br>
>><br>
>> On Mon, Jun 5, 2017 at 7:00 AM, Denis Obrezkov <<a href="mailto:denisobrezkov@gmail.com">denisobrezkov@gmail.com</a>><br>
>> wrote:<br>
>> > 2017-06-04 16:17 GMT+03:00 Denis Obrezkov <<a href="mailto:denisobrezkov@gmail.com">denisobrezkov@gmail.com</a>>:<br>
>> >><br>
>> >> Now I have a problem with console-io.c file.<br>
>> >> The problem is with csr macros - there is no more such a register<br>
>> >> "tohost".<br>
>> >> Here it is described a little:<br>
>> >> <a href="https://github.com/riscv/riscv-pk/issues/25" rel="noreferrer" target="_blank">https://github.com/riscv/<wbr>riscv-pk/issues/25</a><br>
>> >><br>
>> >> Could you explain what should be done here and what for was mtohost<br>
>> >> register?<br>
>> >><br>
>> ><br>
>> > I have built riscv-generic bsp. Though there are a lot of warnings.<br>
>> > The current issue is that asm functions should be reimplemented (there<br>
>> > is no<br>
>> > more<br>
>> > such a register 'mtohost' in csr).<br>
>> ><br>
>> > --<br>
>> > Regards, Denis Obrezkov<br>
>><br>
>><br>
>><br>
>> --<br>
>> Hesham<br>
><br>
><br>
> Thanks Hasham,<br>
> will you be able to fix these asm functions to make BSP work in SPIKE<br>
> simulator?<br>
><br>
> Could you also point me to the good reference on risc-v assembler and about<br>
> assembler writing in general (for RISC) - I am not really good in it.<br>
><br>
> --<br>
> Regards, Denis Obrezkov<br>
<br>
<br>
<br>
</div><div class="elided-text">--<br>
Hesham<br>
______________________________<wbr>_________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/<wbr>mailman/listinfo/devel</a><br>
</div></blockquote></div><br></div></div></div>