[PATCH 2/2] bsps/sparc: Add XtratuM BSP.
Joel Sherrill
joel.sherrill at OARcorp.com
Wed May 21 14:15:37 UTC 2014
On 5/21/2014 8:54 AM, Gedare Bloom wrote:
> On Wed, May 21, 2014 at 4:04 AM, Christian Mauderer
> <Christian.Mauderer at embedded-brains.de> wrote:
>> First of all: Thanks for your comments. You will find answers below.
Rather than resetting this discussion, there is some below and a comment on
the README and general use here.
The README says there are two environment variables. Why not configure
time parameters? I thought that was how the other paravirtualization work
was doing it.
And is there anyway to test this BSP on anything other than real hardware?
Obviously, it can't be built without xtratum installed. But that is below.
>> Am 20.05.2014 16:58, schrieb Gedare Bloom:
>>> On Tue, May 20, 2014 at 5:16 AM, Christian Mauderer
>>> <christian.mauderer at embedded-brains.de> wrote:
>>>> From: Christian Mauderer <Christian.Mauderer at embedded-brains.de>
>>>>
>>>> ---
>>>> c/src/lib/libbsp/shared/include/fatal.h | 6 +-
>>>> c/src/lib/libbsp/sparc/acinclude.m4 | 2 +
>>>> c/src/lib/libbsp/sparc/shared/irq_asm.S | 97 ++++++++++++++++
>>>> c/src/lib/libbsp/sparc/shared/start/start.S | 58 +++++++++-
>>>> .../lib/libbsp/sparc/shared/startup/linkcmds.base | 19 ++++
>>>> c/src/lib/libbsp/sparc/xtratum/Makefile.am | 119 ++++++++++++++++++++
>>>> c/src/lib/libbsp/sparc/xtratum/README | 8 ++
>>>> c/src/lib/libbsp/sparc/xtratum/bsp_specs | 17 +++
>>>> .../sparc/xtratum/clock/clock-xtratum-exec.c | 23 ++++
>>>> .../libbsp/sparc/xtratum/clock/clock-xtratum-hw.c | 21 ++++
>>>> .../lib/libbsp/sparc/xtratum/clock/clock-xtratum.h | 103 +++++++++++++++++
>>>> c/src/lib/libbsp/sparc/xtratum/configure.ac | 33 ++++++
>>>> .../libbsp/sparc/xtratum/console/console-config.c | 27 +++++
>>>> .../libbsp/sparc/xtratum/console/printk-support.c | 28 +++++
>>>> .../sparc/xtratum/console/xtratum-hyper-console.c | 71 ++++++++++++
>>>> c/src/lib/libbsp/sparc/xtratum/include/bsp.h | 52 +++++++++
>>>> c/src/lib/libbsp/sparc/xtratum/include/cache_.h | 113 +++++++++++++++++++
>>>> .../sparc/xtratum/include/clock-xtratum-exec.h | 26 +++++
>>>> c/src/lib/libbsp/sparc/xtratum/include/irq.h | 2 +
>>>> c/src/lib/libbsp/sparc/xtratum/include/tm27.h | 30 +++++
>>>> .../sparc/xtratum/include/xtratum-hyper-console.h | 30 +++++
>>>> c/src/lib/libbsp/sparc/xtratum/include/xtratum.h | 87 +++++++++++++++
>>>> c/src/lib/libbsp/sparc/xtratum/irq/irq.c | 77 +++++++++++++
>>>> .../libbsp/sparc/xtratum/make/custom/xtratum.cfg | 55 +++++++++
>>>> c/src/lib/libbsp/sparc/xtratum/preinstall.am | 123 +++++++++++++++++++++
>>>> .../libbsp/sparc/xtratum/startup/bsppredriver.c | 7 ++
>>>> c/src/lib/libbsp/sparc/xtratum/startup/bspreset.c | 52 +++++++++
>>>> c/src/lib/libbsp/sparc/xtratum/startup/bspsmp.c | 104 +++++++++++++++++
>>>> c/src/lib/libbsp/sparc/xtratum/startup/bspstart.c | 22 ++++
>>>> .../libbsp/sparc/xtratum/startup/example_xm_cf.xml | 66 +++++++++++
>>>> .../lib/libbsp/sparc/xtratum/startup/isr-en-dis.S | 50 +++++++++
>>>> .../libbsp/sparc/xtratum/startup/linkcmds.xtratum | 20 ++++
>>>> c/src/lib/libbsp/sparc/xtratum/startup/psr.c | 26 +++++
>>>> c/src/lib/libbsp/sparc/xtratum/startup/setvec.c | 61 ++++++++++
>>>> c/src/lib/libbsp/sparc/xtratum/startup/spurious.c | 35 ++++++
>>>> c/src/lib/libbsp/sparc/xtratum/startup/tbr.c | 30 +++++
>>>> c/src/lib/libbsp/sparc/xtratum/xm/xmhdr.c | 36 ++++++
>>>> cpukit/score/cpu/sparc/rtems/score/cpu.h | 11 +-
>>>> testsuites/smptests/smpfatal08/init.c | 3 +-
>>>> 39 files changed, 1735 insertions(+), 15 deletions(-)
>>>> create mode 100644 c/src/lib/libbsp/sparc/xtratum/Makefile.am
>>>> create mode 100644 c/src/lib/libbsp/sparc/xtratum/README
>>>> create mode 100644 c/src/lib/libbsp/sparc/xtratum/bsp_specs
>>>> create mode 100644 c/src/lib/libbsp/sparc/xtratum/clock/clock-xtratum-exec.c
>>>> create mode 100644 c/src/lib/libbsp/sparc/xtratum/clock/clock-xtratum-hw.c
>>>> create mode 100644 c/src/lib/libbsp/sparc/xtratum/clock/clock-xtratum.h
>>>> create mode 100644 c/src/lib/libbsp/sparc/xtratum/configure.ac
>>>> create mode 100644 c/src/lib/libbsp/sparc/xtratum/console/console-config.c
>>>> create mode 100644 c/src/lib/libbsp/sparc/xtratum/console/printk-support.c
>>>> create mode 100644 c/src/lib/libbsp/sparc/xtratum/console/xtratum-hyper-console.c
>>>> create mode 100644 c/src/lib/libbsp/sparc/xtratum/include/bsp.h
>>>> create mode 100644 c/src/lib/libbsp/sparc/xtratum/include/cache_.h
>>>> create mode 100644 c/src/lib/libbsp/sparc/xtratum/include/clock-xtratum-exec.h
>>>> create mode 100644 c/src/lib/libbsp/sparc/xtratum/include/irq.h
>>>> create mode 100644 c/src/lib/libbsp/sparc/xtratum/include/tm27.h
>>>> create mode 100644 c/src/lib/libbsp/sparc/xtratum/include/xtratum-hyper-console.h
>>>> create mode 100644 c/src/lib/libbsp/sparc/xtratum/include/xtratum.h
>>>> create mode 100644 c/src/lib/libbsp/sparc/xtratum/irq/irq.c
>>>> create mode 100644 c/src/lib/libbsp/sparc/xtratum/make/custom/xtratum.cfg
>>>> create mode 100644 c/src/lib/libbsp/sparc/xtratum/preinstall.am
>>>> create mode 100644 c/src/lib/libbsp/sparc/xtratum/startup/bsppredriver.c
>>>> create mode 100644 c/src/lib/libbsp/sparc/xtratum/startup/bspreset.c
>>>> create mode 100644 c/src/lib/libbsp/sparc/xtratum/startup/bspsmp.c
>>>> create mode 100644 c/src/lib/libbsp/sparc/xtratum/startup/bspstart.c
>>>> create mode 100644 c/src/lib/libbsp/sparc/xtratum/startup/example_xm_cf.xml
>>>> create mode 100644 c/src/lib/libbsp/sparc/xtratum/startup/isr-en-dis.S
>>>> create mode 100644 c/src/lib/libbsp/sparc/xtratum/startup/linkcmds.xtratum
>>>> create mode 100644 c/src/lib/libbsp/sparc/xtratum/startup/psr.c
>>>> create mode 100644 c/src/lib/libbsp/sparc/xtratum/startup/setvec.c
>>>> create mode 100644 c/src/lib/libbsp/sparc/xtratum/startup/spurious.c
>>>> create mode 100644 c/src/lib/libbsp/sparc/xtratum/startup/tbr.c
>>>> create mode 100644 c/src/lib/libbsp/sparc/xtratum/xm/xmhdr.c
>>>>
>>>> diff --git a/c/src/lib/libbsp/shared/include/fatal.h b/c/src/lib/libbsp/shared/include/fatal.h
>>>> index e928bba..8ca90bb 100644
>>>> --- a/c/src/lib/libbsp/shared/include/fatal.h
>>>> +++ b/c/src/lib/libbsp/shared/include/fatal.h
>>>> @@ -101,7 +101,11 @@ typedef enum {
>>>> PPC_FATAL_EXCEPTION_INITIALIZATION = BSP_FATAL_CODE_BLOCK(7),
>>>>
>>>> /* Libchip fatal codes */
>>>> - DWMAC_FATAL_TOO_MANY_RBUFS_CONFIGURED = BSP_FATAL_CODE_BLOCK(8)
>>>> + DWMAC_FATAL_TOO_MANY_RBUFS_CONFIGURED = BSP_FATAL_CODE_BLOCK(8),
>>>> +
>>>> + /* XtratuM fatal codes */
>>>> + XTRATUM_FATAL_CLOCK_IRQ_INSTALL = BSP_FATAL_CODE_BLOCK(9),
>>>> + XTRATUM_FATAL_CPU_SMP_INITIALIZE
>>>> } bsp_fatal_code;
>>>>
>>>> RTEMS_COMPILER_NO_RETURN_ATTRIBUTE static inline void
>>>> diff --git a/c/src/lib/libbsp/sparc/acinclude.m4 b/c/src/lib/libbsp/sparc/acinclude.m4
>>>> index 4d40305..0e053fa 100644
>>>> --- a/c/src/lib/libbsp/sparc/acinclude.m4
>>>> +++ b/c/src/lib/libbsp/sparc/acinclude.m4
>>>> @@ -8,6 +8,8 @@ AC_DEFUN([RTEMS_CHECK_BSPDIR],
>>>> AC_CONFIG_SUBDIRS([leon2]);;
>>>> leon3 )
>>>> AC_CONFIG_SUBDIRS([leon3]);;
>>>> + xtratum )
>>>> + AC_CONFIG_SUBDIRS([xtratum]);;
>>>> *)
>>>> AC_MSG_ERROR([Invalid BSP]);;
>>>> esac
>>>> diff --git a/c/src/lib/libbsp/sparc/shared/irq_asm.S b/c/src/lib/libbsp/sparc/shared/irq_asm.S
>>>> index bf2dca9..69522a2 100644
>>>> --- a/c/src/lib/libbsp/sparc/shared/irq_asm.S
>>>> +++ b/c/src/lib/libbsp/sparc/shared/irq_asm.S
>>>> @@ -23,6 +23,10 @@
>>>> #include <rtems/score/percpu.h>
>>>> #include <bspopts.h>
>>>>
>>>> +#ifdef RTEMS_PARAVIRT_XTRATUM
>>>> +#include <xm.h>
>>> What is this header file? I don't see it in the commit, is it part of
>>> the installed XtratuM?
>>>
>> That is correct. It's part of XtratuM. Is there some preferred way of
>> marking such headers?
>>
> Not that I know of. We have discussed a similar issue with the POK
> paravirtualization project. The problem is to allow external code
> linking to RTEMS. The design should be considered carefully and
> probably discussed in a separate thread.
>
> [...]
Agreed. But I don't see any practical solution to this other than to assume
that the interface file is provided by the virtualization engine. They
own it.
If the virtualization software changes its interface, then the .h would
naturally update that way.
We also have the issue of any library code the virtualization engine
needs the BSP/app to link with. We had concerns that it may not
be in the right format.
I may be cynical here but I think the only practical solution is to
assume that the virtualization engine's .h along with .o/.a files
the BSP must link with are externally provided. This means that
the BSP must account for them being in an incompatible format
and at least provide a manual procedure or script to deal with
that once.
Since xtratum is GPL v2, I assume that puts it in the same bucket
as the Pok work. We may have issues with the code on different
hosts but if they are helpful, hopefully this can be addressed
and testing can be automated on the buildbot instance.
If we end up with code for a closed source hypervisor, then we
have a different set of problems to face.
>>>> diff --git a/c/src/lib/libbsp/sparc/xtratum/startup/spurious.c b/c/src/lib/libbsp/sparc/xtratum/startup/spurious.c
>>>> new file mode 100644
>>>> index 0000000..2d4428a
>>>> --- /dev/null
>>>> +++ b/c/src/lib/libbsp/sparc/xtratum/startup/spurious.c
>>>> @@ -0,0 +1,35 @@
>>>> +/*
>>>> + * LEON Spurious Trap Handler
>>>> + *
>>>> + * This is just enough of a trap handler to let us know what
>>>> + * the likely source of the trap was.
>>>> + *
>>>> + * Developed as part of the port of RTEMS to the LEON implementation
>>>> + * of the SPARC by On-Line Applications Research Corporation (OAR)
>>>> + * under contract to the European Space Agency (ESA).
>>>> + *
>>>> + * COPYRIGHT (c) 1995. European Space Agency.
>>>> + *
>>>> + * Modified for LEON3 BSP.
>>>> + * COPYRIGHT (c) 2004.
>>>> + * Gaisler Research.
>>>> + *
>>>> + * This terms of the RTEMS license apply to this file.
>>>> + */
>>>> +
>>>> +#include <bsp.h>
>>>> +#include <rtems/bspIo.h>
>>>> +
>>>> +void _BSP_Exception_frame_print( const CPU_Exception_frame *frame )
>>>> +{
>>>> + uint32_t trap;
>>>> + uint32_t real_trap;
>>>> + const CPU_Interrupt_frame *isf;
>>>> +
>>>> + trap = frame->trap;
>>>> + real_trap = SPARC_REAL_TRAP_NUMBER(trap);
>>>> + isf = frame->isf;
>>>> +
>>>> + printk( "Unexpected trap (0x%02x) at address 0x%08x\n", real_trap, isf->tpc);
>>>> +}
>>>> +
>>> I don't think this code will get called ever?
>>>
>> The _BSP_Exception_frame_print of the sparc gets called by the
>> _CPU_Exception_frame_print. This again is called by
>> rtems_exception_frame_print which is called i.E. in the
>> bsp_fatal_extension or in spfatal26-test.
>>
> OK. It should get a more suitable file name e.g.
> bspexceptionframeprint.c. I realize the other sparc BSPs implemented
> it in spurious.c, but this BSP does not have a spurious exception
> handler, so it doesn't make a lot of sense to have spurious.c.
>
> Gedare
> _______________________________________________
> rtems-devel mailing list
> rtems-devel at rtems.org
> http://www.rtems.org/mailman/listinfo/rtems-devel
--
Joel Sherrill, Ph.D. Director of Research & Development
joel.sherrill at OARcorp.com On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985
More information about the devel
mailing list