[PATCH 1/2] cpukit: Add Epiphany architecture port v2

Sebastian Huber sebastian.huber at embedded-brains.de
Wed May 13 07:40:51 UTC 2015



On 09/05/15 16:45, Hesham ALMatary wrote:
[...]
> diff --git a/cpukit/score/cpu/epiphany/cpu.c b/cpukit/score/cpu/epiphany/cpu.c
> new file mode 100644
> index 0000000..9ec8f94
> --- /dev/null
> +++ b/cpukit/score/cpu/epiphany/cpu.c
> @@ -0,0 +1,114 @@
> +/*
> + * Epiphany CPU Dependent Source
> + *
> + * Copyright (c) 2015 University of York.
> + * Hesham ALMatary <hmka501 at york.ac.uk>
> + *
> + * COPYRIGHT (c) 1989-1999.
> + * On-Line Applications Research Corporation (OAR).

I doubt that OAR has a copyright for contents of this new file, but if 
they have one, then the license change from the standard RTEMS license 
to BSD is a problem.

> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions
> + * are met:
> + * 1. Redistributions of source code must retain the above copyright
> + *    notice, this list of conditions and the following disclaimer.
> + * 2. Redistributions in binary form must reproduce the above copyright
> + *    notice, this list of conditions and the following disclaimer in the
> + *    documentation and/or other materials provided with the distribution.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
> + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
> + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
> + * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
> + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
> + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
> + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
> + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
> + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
> + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
> + * SUCH DAMAGE.
> + */
> +
> +#include <rtems/system.h>
> +#include <rtems/score/isr.h>
> +#include <rtems/score/wkspace.h>
> +#include <bsp/linker-symbols.h>
> +#include <rtems/score/cpu.h>
> +
> +void _init(void);
> +void _fini(void);
> +
> +void _init(void)
> +{
> +  /* Do nothing */
> +}
> +
> +void _fini(void)
> +{
> +  /* Do nothing */
> +}

If you need to define _init() and _fini() here, then something is wrong 
with the GCC configuration for this target.  For example:

nm /opt/rtems-4.11/lib/gcc/sparc-rtems4.11/4.9.2/crti.o
00000000 T _fini
00000000 T _init

[...]

> diff --git a/cpukit/score/cpu/epiphany/rtems/score/cpu.h b/cpukit/score/cpu/epiphany/rtems/score/cpu.h
> new file mode 100644
> index 0000000..9958599
> --- /dev/null
> +++ b/cpukit/score/cpu/epiphany/rtems/score/cpu.h
> @@ -0,0 +1,1185 @@
[...]
> +
> +static inline void _CPU_Context_volatile_clobber( uintptr_t pattern )
> +{
> +  /* TODO */
> +}
> +
> +static inline void _CPU_Context_validate( uintptr_t pattern )
> +{
> +  while (1) {
> +    /* TODO */
> +  }
> +}
> +

It would be nice to have implementations of the above two functions at 
least for all new ports.  See test sptests/spcontext01.  It ensures that 
the context switch and interrupt code works now and later if some makes 
a modification.

The Doxygen comment copy and paste in the cpu.h files is a real mess in 
general. It would be better to mention only the architectures specifics 
in this file, e.g. references to the ABI documents.

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.




More information about the devel mailing list