[PATCH 2/2] sparc64 niagara, usiii: Remove -D options from cfg file and move to bspopts.h

Gedare Bloom gedare at rtems.org
Sun May 13 15:20:04 UTC 2018


On Wed, May 9, 2018 at 4:23 PM, Joel Sherrill <joel at rtems.org> wrote:
> Updates #3425.
> ---
>  bsps/sparc64/include/arch/arch.h              |  4 ++++
>  bsps/sparc64/include/arch/mm/frame.h          |  4 ++++
>  bsps/sparc64/include/arch/mm/mmu.h            |  4 ++++
>  bsps/sparc64/include/arch/mm/tlb.h            |  3 +++
>  bsps/sparc64/include/arch/mm/tte.h            |  4 ++++
>  bsps/sparc64/niagara/config/niagara.cfg       |  2 +-
>  bsps/sparc64/usiii/config/usiii.cfg           |  2 +-
>  c/src/lib/libbsp/sparc64/niagara/configure.ac |  4 ++++
>  c/src/lib/libbsp/sparc64/usiii/configure.ac   | 10 +++++++++-
>  9 files changed, 34 insertions(+), 3 deletions(-)
>
> diff --git a/bsps/sparc64/include/arch/arch.h b/bsps/sparc64/include/arch/arch.h
> index 5fdd4a2..36aa922 100644
> --- a/bsps/sparc64/include/arch/arch.h
> +++ b/bsps/sparc64/include/arch/arch.h
> @@ -37,10 +37,14 @@
>  #ifndef KERN_sparc64_ARCH_H_
>  #define KERN_sparc64_ARCH_H_
>
> +#include <bspopts.h>
> +
>  #if defined (SUN4U)
>  #include <arch/sun4u/arch.h>
>  #elif defined (SUN4V)
>  #include <arch/sun4v/arch.h>
> +#else
> +#error "No SUN model defined"
>  #endif
>
>  #define ASI_AIUP               0x10    /** Access to primary context with user privileges. */
> diff --git a/bsps/sparc64/include/arch/mm/frame.h b/bsps/sparc64/include/arch/mm/frame.h
> index fb66e54..2fc17cc 100644
> --- a/bsps/sparc64/include/arch/mm/frame.h
> +++ b/bsps/sparc64/include/arch/mm/frame.h
> @@ -35,10 +35,14 @@
>  #ifndef KERN_sparc64_FRAME_H_
>  #define KERN_sparc64_FRAME_H_
>
> +#include <bspopts.h>
> +
>  #if defined (SUN4U)
>  #include <arch/mm/sun4u/frame.h>
>  #elif defined (SUN4V)
>  #include <arch/mm/sun4v/frame.h>
> +#else
> +#error "No SUN model defined"
>  #endif
>
>  #endif
> diff --git a/bsps/sparc64/include/arch/mm/mmu.h b/bsps/sparc64/include/arch/mm/mmu.h
> index 1d445f2..aab143f 100644
> --- a/bsps/sparc64/include/arch/mm/mmu.h
> +++ b/bsps/sparc64/include/arch/mm/mmu.h
> @@ -35,10 +35,14 @@
>  #ifndef KERN_sparc64_MMU_H_
>  #define KERN_sparc64_MMU_H_
>
> +#include <bspopts.h>
> +
>  #if defined (SUN4U)
>  #include <arch/mm/sun4u/mmu.h>
>  #elif defined (SUN4V)
>  #include <arch/mm/sun4v/mmu.h>
> +#else
> +#error "No SUN model defined"
>  #endif
>
>
> diff --git a/bsps/sparc64/include/arch/mm/tlb.h b/bsps/sparc64/include/arch/mm/tlb.h
> index 4adf26c..7a6b85d 100644
> --- a/bsps/sparc64/include/arch/mm/tlb.h
> +++ b/bsps/sparc64/include/arch/mm/tlb.h
> @@ -35,11 +35,14 @@
>  #ifndef KERN_sparc64_TLB_H_
>  #define KERN_sparc64_TLB_H_
>
> +#include <bspopts.h>
>
>  #if defined (SUN4U)
>  #include <arch/mm/sun4u/tlb.h>
>  #elif defined (SUN4V)
>  #include <arch/mm/sun4v/tlb.h>
> +#else
> +#error "No SUN model defined"
>  #endif
>
>  #endif
> diff --git a/bsps/sparc64/include/arch/mm/tte.h b/bsps/sparc64/include/arch/mm/tte.h
> index f0b746e..10a672b 100644
> --- a/bsps/sparc64/include/arch/mm/tte.h
> +++ b/bsps/sparc64/include/arch/mm/tte.h
> @@ -35,10 +35,14 @@
>  #ifndef KERN_sparc64_TTE_H_
>  #define KERN_sparc64_TTE_H_
>
> +#include <bspopts.h>
> +
>  #if defined (SUN4U)
>  #include <arch/mm/sun4u/tte.h>
>  #elif defined (SUN4V)
>  #include <arch/mm/sun4v/tte.h>
> +#else
> +#error "No SUN model defined"
>  #endif
>
>  #endif
> diff --git a/bsps/sparc64/niagara/config/niagara.cfg b/bsps/sparc64/niagara/config/niagara.cfg
> index 2fd8973..bfa73aa 100644
> --- a/bsps/sparc64/niagara/config/niagara.cfg
> +++ b/bsps/sparc64/niagara/config/niagara.cfg
> @@ -7,7 +7,7 @@ RTEMS_CPU=sparc64
>
>  #  This contains the compiler options necessary to select the CPU model
>  #  and (hopefully) optimize for it.
> -CPU_CFLAGS = -mcpu=niagara -DSUN4V
> +CPU_CFLAGS = -mcpu=niagara
>
>  # optimize flag: typically -g -O2
>  CFLAGS_OPTIMIZE_V = -g -O2
> diff --git a/bsps/sparc64/usiii/config/usiii.cfg b/bsps/sparc64/usiii/config/usiii.cfg
> index b9fad21..ee1c508 100644
> --- a/bsps/sparc64/usiii/config/usiii.cfg
> +++ b/bsps/sparc64/usiii/config/usiii.cfg
> @@ -7,7 +7,7 @@ RTEMS_CPU=sparc64
>
>  #  This contains the compiler options necessary to select the CPU model
>  #  and (hopefully) optimize for it.
> -CPU_CFLAGS = -mcpu=ultrasparc3 -DUS3 -DSUN4U
> +CPU_CFLAGS = -mcpu=ultrasparc3
>
>  # optimize flag: typically -g -O2
>  CFLAGS_OPTIMIZE_V = -g -O2
> diff --git a/c/src/lib/libbsp/sparc64/niagara/configure.ac b/c/src/lib/libbsp/sparc64/niagara/configure.ac
> index ced7e12..f8e9687 100644
> --- a/c/src/lib/libbsp/sparc64/niagara/configure.ac
> +++ b/c/src/lib/libbsp/sparc64/niagara/configure.ac
> @@ -10,6 +10,10 @@ RTEMS_CANONICAL_TARGET_CPU
>  AM_INIT_AUTOMAKE([no-define nostdinc foreign 1.12.2])
>  RTEMS_BSP_CONFIGURE
>
> +RTEMS_BSPOPTS_SET([SUN4V],[niagara],[1])
> +RTEMS_BSPOPTS_SET([SUN4V],[*],[])
> +RTEMS_BSPOPTS_HELP([SUN4V],
> +[If defined, enable SUN model optons for the Niagara model.])
>
>  RTEMS_BSP_CLEANUP_OPTIONS
>
> diff --git a/c/src/lib/libbsp/sparc64/usiii/configure.ac b/c/src/lib/libbsp/sparc64/usiii/configure.ac
> index 4244055..c99d938 100644
> --- a/c/src/lib/libbsp/sparc64/usiii/configure.ac
> +++ b/c/src/lib/libbsp/sparc64/usiii/configure.ac
> @@ -10,13 +10,21 @@ RTEMS_CANONICAL_TARGET_CPU
>  AM_INIT_AUTOMAKE([no-define nostdinc foreign 1.12.2])
>  RTEMS_BSP_CONFIGURE
>
> -
>  RTEMS_BSPOPTS_SET([SIMSPARC_FAST_IDLE],[*],[])
>  RTEMS_BSPOPTS_HELP([SIMSPARC_FAST_IDLE],
>  [If defined, speed up the clock ticks while the idle task is running so
>  time spent in the idle task is minimized.  This significantly reduces
>  the wall time required to execute the RTEMS test suites.])
>
> +RTEMS_BSPOPTS_SET([US3],[usiii],[1])
> +RTEMS_BSPOPTS_SET([US3],[*],[])
> +RTEMS_BSPOPTS_HELP([US3],
> +[If defined, enable UltraSPARC optons for the USIII BSP.])
> +
> +RTEMS_BSPOPTS_SET([SUN4U],[usiii],[1])
> +RTEMS_BSPOPTS_SET([SUN4U],[*],[])
> +RTEMS_BSPOPTS_HELP([SUN4U],
> +[If defined, enable SUN model optons for the USIII BSP.])
>
>  RTEMS_BSP_CLEANUP_OPTIONS
>

These are not really "optional" defines. It doesn't make sense for
example to compile an ultrasparc3 BSP without the SUN4U define. I
don't really know if this matters.

> --
> 1.8.3.1
>
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel



More information about the devel mailing list