Re: error while building from RSB

2018-06-15 Thread Joel Sherrill
On Fri, Jun 15, 2018, 10:37 PM Vijay Kumar Banerjee <
vijaykumar9...@gmail.com> wrote:

> On 16 June 2018 at 01:50, Gedare Bloom  wrote:
>
>> Hello there,
>>
>> someone on IRC mentions that www.gaisler.com works still. Maybe try
>> changing the URL to that one?
>>
>> https://www.gaisler.com/gdb/gdb-8.0.1-sis-leon2-leon3.diff
> returns 404
>
>> On Fri, Jun 15, 2018 at 1:09 PM, Vijay Kumar Banerjee
>>  wrote:
>> >
>> >
>> > On Fri, 15 Jun 2018, 22:35 Cillian O'Donnell, 
>> wrote:
>> >>
>> >>
>> >>
>> >> On Fri, 15 Jun 2018 at 17:49, Vijay Kumar Banerjee
>> >>  wrote:
>> >>>
>> >>> Hello,
>> >>>
>> >>> While trying to freshly build RTEMS from RSB with the following
>> command
>> >>>
>> >>> `../source-builder/sb-set-builder \
>> >>> --prefix=/home/lunatic/development/rtems/5 5/rtems-sparc"
>> >>>
>> >>> I'm getting the following error :
>> >>>
>> >>>  --
>> >>> error: downloading
>> >>> https://gaisler.org/gdb/gdb-8.0.1-sis-leon2-leon3.diff: all paths
>> have
>> >>> failed, giving up
>> >>> Build FAILED
>> >>> --
>> >>
>> >>
>> >> Yeah gailser.org does seem to be down. You could grep for that patch
>> in
>> >> rsb and comment it out and just build without it. You're using qemu to
>> run
>> >> it so I don't think the gdb patch is necessary.
>>
>
These patches should be on RTEMS.org. Those patches are on Jiri's home
server


>
>> > Will do it. Thanks. :)
>> >>>
>> >>>
>> >>> The url doesn't seem to work when I open from browser.
>> >>>
>> >>>
>> >>> -- vijay
>> >>> ___
>> >>> devel mailing list
>> >>> devel@rtems.org
>> >>> http://lists.rtems.org/mailman/listinfo/devel
>> >
>> >
>> > ___
>> > devel mailing list
>> > devel@rtems.org
>> > http://lists.rtems.org/mailman/listinfo/devel
>>
>
> ___
> devel mailing list
> devel@rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: error while building from RSB

2018-06-15 Thread Vijay Kumar Banerjee
On 16 June 2018 at 01:50, Gedare Bloom  wrote:

> Hello there,
>
> someone on IRC mentions that www.gaisler.com works still. Maybe try
> changing the URL to that one?
>
> https://www.gaisler.com/gdb/gdb-8.0.1-sis-leon2-leon3.diff
returns 404

> On Fri, Jun 15, 2018 at 1:09 PM, Vijay Kumar Banerjee
>  wrote:
> >
> >
> > On Fri, 15 Jun 2018, 22:35 Cillian O'Donnell, 
> wrote:
> >>
> >>
> >>
> >> On Fri, 15 Jun 2018 at 17:49, Vijay Kumar Banerjee
> >>  wrote:
> >>>
> >>> Hello,
> >>>
> >>> While trying to freshly build RTEMS from RSB with the following command
> >>>
> >>> `../source-builder/sb-set-builder \
> >>> --prefix=/home/lunatic/development/rtems/5 5/rtems-sparc"
> >>>
> >>> I'm getting the following error :
> >>>
> >>>  --
> >>> error: downloading
> >>> https://gaisler.org/gdb/gdb-8.0.1-sis-leon2-leon3.diff: all paths have
> >>> failed, giving up
> >>> Build FAILED
> >>> --
> >>
> >>
> >> Yeah gailser.org does seem to be down. You could grep for that patch in
> >> rsb and comment it out and just build without it. You're using qemu to
> run
> >> it so I don't think the gdb patch is necessary.
> >
> > Will do it. Thanks. :)
> >>>
> >>>
> >>> The url doesn't seem to work when I open from browser.
> >>>
> >>>
> >>> -- vijay
> >>> ___
> >>> devel mailing list
> >>> devel@rtems.org
> >>> http://lists.rtems.org/mailman/listinfo/devel
> >
> >
> > ___
> > devel mailing list
> > devel@rtems.org
> > http://lists.rtems.org/mailman/listinfo/devel
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: error while building from RSB

2018-06-15 Thread Gedare Bloom
Hello there,

someone on IRC mentions that www.gaisler.com works still. Maybe try
changing the URL to that one?

On Fri, Jun 15, 2018 at 1:09 PM, Vijay Kumar Banerjee
 wrote:
>
>
> On Fri, 15 Jun 2018, 22:35 Cillian O'Donnell,  wrote:
>>
>>
>>
>> On Fri, 15 Jun 2018 at 17:49, Vijay Kumar Banerjee
>>  wrote:
>>>
>>> Hello,
>>>
>>> While trying to freshly build RTEMS from RSB with the following command
>>>
>>> `../source-builder/sb-set-builder \
>>> --prefix=/home/lunatic/development/rtems/5 5/rtems-sparc"
>>>
>>> I'm getting the following error :
>>>
>>>  --
>>> error: downloading
>>> https://gaisler.org/gdb/gdb-8.0.1-sis-leon2-leon3.diff: all paths have
>>> failed, giving up
>>> Build FAILED
>>> --
>>
>>
>> Yeah gailser.org does seem to be down. You could grep for that patch in
>> rsb and comment it out and just build without it. You're using qemu to run
>> it so I don't think the gdb patch is necessary.
>
> Will do it. Thanks. :)
>>>
>>>
>>> The url doesn't seem to work when I open from browser.
>>>
>>>
>>> -- vijay
>>> ___
>>> devel mailing list
>>> devel@rtems.org
>>> http://lists.rtems.org/mailman/listinfo/devel
>
>
> ___
> devel mailing list
> devel@rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: error while building from RSB

2018-06-15 Thread Vijay Kumar Banerjee
On Fri, 15 Jun 2018, 22:35 Cillian O'Donnell,  wrote:

>
>
> On Fri, 15 Jun 2018 at 17:49, Vijay Kumar Banerjee <
> vijaykumar9...@gmail.com> wrote:
>
>> Hello,
>>
>> While trying to freshly build RTEMS from RSB with the following command
>>
>> `../source-builder/sb-set-builder \
>> --prefix=/home/lunatic/development/rtems/5 5/rtems-sparc"
>>
>> I'm getting the following error :
>>
>>  --
>> error: downloading https://gaisler.org/gdb/gdb-8.0.1-sis-leon2-leon3.diff:
>> all paths have failed, giving up
>> Build FAILED
>> --
>>
>
> Yeah gailser.org does seem to be down. You could grep for that patch in
> rsb and comment it out and just build without it. You're using qemu to run
> it so I don't think the gdb patch is necessary.
>
Will do it. Thanks. :)

>
>> The url doesn't seem to work when I open from browser.
>>
>>
>> -- vijay
>> ___
>> devel mailing list
>> devel@rtems.org
>> http://lists.rtems.org/mailman/listinfo/devel
>
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH] coverage : Add support to run coverage in supported bsp without extra options

2018-06-15 Thread Vijay Kumar Banerjee
On Fri, 15 Jun 2018, 08:39 Chris Johns,  wrote:

> On 14/06/2018 03:12, Gedare Bloom wrote:
> > On Wed, Jun 13, 2018 at 12:23 PM, Vijay Kumar Banerjee
> >  wrote:
> >> On Wed, 13 Jun 2018, 21:39 Gedare Bloom,  wrote:
> >>> On Wed, Jun 13, 2018 at 11:58 AM, Vijay Kumar Banerjee
> >>>  wrote:
>  On 13 June 2018 at 10:29, Gedare Bloom  wrote:
> > On Thu, Jun 7, 2018 at 7:08 AM, Vijay Kumar Banerjee
> >  wrote:
> >>  bsp = opts.find_arg('--rtems-bsp')
> >> +if 'cov' in bsp[1].split('-'):
> >
> > I'm not sure if this use of the 'cov' field in the bsp config
> filename
> > itself is the proper way to go about accomplishing the activation of
> > coverage. What are other possible ways to get this done? Is the use
> of
> > a portion of the bsp config filename done elsewhere in tester?
> 
>  This patch was made following Chris' comments in another thread
> 
>  https://lists.rtems.org/pipermail/devel/2018-June/021931.html
> 
> >>>
> >>> I can't be sure, but I don't think his intent was to infer the
> >>> coverage from the ini file name.
>
> Correct.
>
> >>> For example, does the tester parse
> >>> the ini file name to check for 'qemu' to decide if that target is
> >>> being used? Instead, it should look in to the config file to read the
> >>> option somehow.
> >>
> >> In leon3-qemu.ini the bsp option inside the
> >> config file is set to leon3-qemu.
> >>
> >> There's no such special thing added to bsp for coverage.
> >> Only difference we have is that,
> >> the option 'bsp_qemu_cov_opts' is added in the coverage supported file.
> we
> >> can
> >> read the config file to see if this option is present.
> >>
> >> Shall I do it this way?
> >
> > Yes, I suspect you should.
> >
>
> Can we have 'coverage = true' in the INI file to indicate this BSP supports
> coverage?
>
We can do it.

In the other thread, there were discussions on adding a section 'coverage'
to the ini file, and give all the coverage related options under it.

What do you think of that approach ?

>
> >>>
> >
> >> +coverage_enabled = True
>
> And that values maps to here.
>
> Chris
>
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

error while building from RSB

2018-06-15 Thread Vijay Kumar Banerjee
Hello,

While trying to freshly build RTEMS from RSB with the following command

`../source-builder/sb-set-builder \
--prefix=/home/lunatic/development/rtems/5 5/rtems-sparc"

I'm getting the following error :

 --
error: downloading https://gaisler.org/gdb/gdb-8.0.1-sis-leon2-leon3.diff:
all paths have failed, giving up
Build FAILED
--

The url doesn't seem to work when I open from browser.


-- vijay
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH 3/4] Add _CPU_Counter_frequency()

2018-06-15 Thread Gedare Bloom
OK thanks, it makes sense.

On Fri, Jun 15, 2018 at 11:03 AM, Sebastian Huber
 wrote:
> - Am 15. Jun 2018 um 16:16 schrieb Gedare Bloom ged...@rtems.org:
>
>> Hi Sebastian,
>>
>> The only real question I have is about the default value of 1 GHz.
>> (How) does this affect the accuracy/correctness of the BSPs that use
>> this default implementation?
>
> If a BSP doesn't provide a CPU counter implementation, then the default value 
> will be almost always wrong. The value of 1GHz was chosen to get reasonable 
> safe busy wait functions, e.g. they return not too early.
>
>>
>> As a side note, using Hz units in uint32_t means we limit to about 4.2
>> GHz. This seems a safe assumption, but worth documenting?
>
> Yes, sorry, the CPU counter API documentation is quite long on my TODO list:
>
> https://devel.rtems.org/ticket/2848
>
> Faster CPUs can scale down the CPU counter frequency if necessary.
>
> --
> 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.hu...@embedded-brains.de
> PGP : Public key available on request.
>
> Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH 3/4] Add _CPU_Counter_frequency()

2018-06-15 Thread Sebastian Huber
- Am 15. Jun 2018 um 16:16 schrieb Gedare Bloom ged...@rtems.org:

> Hi Sebastian,
> 
> The only real question I have is about the default value of 1 GHz.
> (How) does this affect the accuracy/correctness of the BSPs that use
> this default implementation?

If a BSP doesn't provide a CPU counter implementation, then the default value 
will be almost always wrong. The value of 1GHz was chosen to get reasonable 
safe busy wait functions, e.g. they return not too early.

> 
> As a side note, using Hz units in uint32_t means we limit to about 4.2
> GHz. This seems a safe assumption, but worth documenting?

Yes, sorry, the CPU counter API documentation is quite long on my TODO list:

https://devel.rtems.org/ticket/2848

Faster CPUs can scale down the CPU counter frequency if necessary.

-- 
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.hu...@embedded-brains.de
PGP : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Re: [PATCH 3/4] Add _CPU_Counter_frequency()

2018-06-15 Thread Gedare Bloom
Hi Sebastian,

The only real question I have is about the default value of 1 GHz.
(How) does this affect the accuracy/correctness of the BSPs that use
this default implementation?

As a side note, using Hz units in uint32_t means we limit to about 4.2
GHz. This seems a safe assumption, but worth documenting?

Gedare

On Fri, Jun 15, 2018 at 7:13 AM, Sebastian Huber
 wrote:
> Add rtems_counter_frequency() API function.  Use it to initialize the
> counter value converter via the new system initialization step
> (RTEMS_SYSINIT_CPU_COUNTER).  This decouples the counter implementation
> and the counter converter.  It avoids an unnecessary pull in of the
> 64-bit integer division from libgcc.
>
> Update #3456.
> ---
>  bsps/arm/altera-cyclone-v/start/bspstart.c |  2 --
>  bsps/arm/include/bsp/arm-a9mpcore-clock.h  |  9 -
>  bsps/arm/lpc176x/start/system-clocks.c |  5 +
>  bsps/arm/lpc24xx/start/system-clocks.c |  5 -
>  bsps/arm/lpc32xx/start/bspstart.c  |  6 +-
>  bsps/arm/realview-pbx-a9/start/bspstart.c  |  2 --
>  bsps/arm/shared/clock/clock-a9mpcore.c |  5 +
>  bsps/arm/shared/clock/clock-generic-timer.c| 11 +++
>  bsps/arm/shared/cpucounter/cpucounter-armv7m.c | 23 
> +++---
>  bsps/arm/tms570/cpucounter/cpucounterread.c|  7 +--
>  bsps/arm/xilinx-zynq/start/bspstart.c  |  2 --
>  bsps/powerpc/beatnik/start/bspstart.c  |  8 +---
>  bsps/powerpc/gen5200/start/bspstart.c  |  6 +-
>  bsps/powerpc/gen83xx/start/bspstart.c  |  6 +-
>  bsps/powerpc/haleakala/start/bspstart.c|  6 +-
>  bsps/powerpc/motorola_powerpc/start/bspstart.c |  8 +---
>  bsps/powerpc/mpc55xxevb/start/bspstart.c   |  6 +-
>  bsps/powerpc/mpc8260ads/start/bspstart.c   |  6 +-
>  bsps/powerpc/mvme3100/start/bspstart.c |  8 +---
>  bsps/powerpc/mvme5500/start/bspstart.c |  8 +---
>  bsps/powerpc/psim/start/bspstart.c |  6 +-
>  bsps/powerpc/qemuppc/start/bspstart.c  |  6 +-
>  bsps/powerpc/qoriq/start/bspstart.c| 10 +-
>  bsps/powerpc/ss555/start/bspstart.c|  6 +-
>  bsps/powerpc/t32mppc/start/bspstart.c  |  8 +---
>  bsps/powerpc/tqm8xx/start/bspstart.c   |  6 +-
>  bsps/powerpc/virtex/start/bspstart.c   |  7 +--
>  bsps/powerpc/virtex4/start/bspstart.c  |  5 -
>  bsps/powerpc/virtex5/start/bspstart.c  |  7 ---
>  bsps/shared/dev/cpucounter/cpucounterfrequency.c   | 20 +++
>  bsps/sparc/erc32/clock/ckinit.c| 15 +-
>  bsps/sparc/leon3/start/cpucounter.c| 22 -
>  c/src/lib/libbsp/arm/beagle/Makefile.am|  1 +
>  c/src/lib/libbsp/arm/csb336/Makefile.am|  1 +
>  c/src/lib/libbsp/arm/csb337/Makefile.am|  1 +
>  c/src/lib/libbsp/arm/edb7312/Makefile.am   |  1 +
>  c/src/lib/libbsp/arm/gdbarmsim/Makefile.am |  1 +
>  c/src/lib/libbsp/arm/gumstix/Makefile.am   |  1 +
>  c/src/lib/libbsp/arm/lm3s69xx/Makefile.am  |  1 +
>  c/src/lib/libbsp/arm/raspberrypi/Makefile.am   |  1 +
>  c/src/lib/libbsp/arm/rtl22xx/Makefile.am   |  1 +
>  c/src/lib/libbsp/arm/smdk2410/Makefile.am  |  1 +
>  c/src/lib/libbsp/arm/stm32f4/Makefile.am   |  1 +
>  c/src/lib/libbsp/sparc/leon2/Makefile.am   |  1 +
>  cpukit/include/rtems/counter.h | 12 ++-
>  cpukit/sapi/src/cpucounterconverter.c  | 18 ++---
>  cpukit/score/cpu/arm/include/rtems/score/cpu.h |  2 ++
>  cpukit/score/cpu/bfin/Makefile.am  |  1 +
>  cpukit/score/cpu/bfin/include/rtems/score/cpu.h|  2 ++
>  cpukit/score/cpu/epiphany/Makefile.am  |  1 +
>  .../score/cpu/epiphany/include/rtems/score/cpu.h   |  2 ++
>  cpukit/score/cpu/i386/Makefile.am  |  1 +
>  cpukit/score/cpu/i386/include/rtems/score/cpu.h|  2 ++
>  cpukit/score/cpu/lm32/Makefile.am  |  1 +
>  cpukit/score/cpu/lm32/include/rtems/score/cpu.h|  2 ++
>  cpukit/score/cpu/m32c/Makefile.am  |  1 +
>  cpukit/score/cpu/m32c/include/rtems/score/cpu.h|  2 ++
>  cpukit/score/cpu/m68k/Makefile.am  |  1 +
>  cpukit/score/cpu/m68k/include/rtems/score/cpu.h|  2 ++
>  cpukit/score/cpu/mips/Makefile.am  |  1 +
>  cpukit/score/cpu/mips/include/rtems/score/cpu.h|  2 ++
>  cpukit/score/cpu/moxie/Makefile.am |  1 +
>  cpukit/score/cpu/moxie/include/rtems/score/cpu.h   |  2 ++
>  cpukit/score/cpu/nios2/Makefile.am |  1 +
>  cpukit/score/cpu/nios2/include/rtems/score/cpu.h   |  2 ++
>  cpukit/score/cpu/no_cpu/Makefile.am

Re: Copyright and license notices in new and ported code

2018-06-15 Thread Gedare Bloom
Amaan,

If you only write the code in the file, then it is only your
individual copyright that goes on it.

For integrating 3rd party code, especially from BSD sources, you might
look at the rtems-libbsd method of handling this:
https://git.rtems.org/rtems-libbsd/tree/CONTRIBUTING.md

It is preferred in all new RTEMS development to use a 2-clause BSD
license, rather than the original RTEMS license.

Gedare

On Fri, Jun 15, 2018 at 6:16 AM, Amaan Cheval  wrote:
> Hi!
>
> In some RTEMS source files I see a series of copyright notices,
> including those for individuals and corporations, for eg.:
> https://git.rtems.org/rtems/tree/cpukit/score/cpu/arm/include/rtems/score/cpu.h#n7
> https://git.rtems.org/rtems/commit/?id=660db8c86fa16dc67c40bdeebbf671e50a7f3087
> (again, in cpu.h)
>
> I was just wondering how this ought to be for new code. Is this meant
> to be handled on a file-by-file basis? I don't see anything about it
> on the wiki either.
>
> For now I'm using this, let me know if I need to add OAR to the comment too:
>
> https://github.com/AmaanC/rtems-gsoc18/blob/ac/daily-01-compile-stub/cpukit/score/cpu/x86_64/include/rtems/score/cpu.h#L10
>
> I haven't yet, but I'll likely also port FreeBSD sources soon - in
> that case I ought to just preserve the file as much as possible to
> make future updates easier, right? (That is, no changes made to the
> copyright or added to the code if we can avoid it (by adding new files
> for customizations on top, for eg.)).
>
> Cheers
> ___
> devel mailing list
> devel@rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH 3/4] Add _CPU_Counter_frequency()

2018-06-15 Thread Sebastian Huber
Add rtems_counter_frequency() API function.  Use it to initialize the
counter value converter via the new system initialization step
(RTEMS_SYSINIT_CPU_COUNTER).  This decouples the counter implementation
and the counter converter.  It avoids an unnecessary pull in of the
64-bit integer division from libgcc.

Update #3456.
---
 bsps/arm/altera-cyclone-v/start/bspstart.c |  2 --
 bsps/arm/include/bsp/arm-a9mpcore-clock.h  |  9 -
 bsps/arm/lpc176x/start/system-clocks.c |  5 +
 bsps/arm/lpc24xx/start/system-clocks.c |  5 -
 bsps/arm/lpc32xx/start/bspstart.c  |  6 +-
 bsps/arm/realview-pbx-a9/start/bspstart.c  |  2 --
 bsps/arm/shared/clock/clock-a9mpcore.c |  5 +
 bsps/arm/shared/clock/clock-generic-timer.c| 11 +++
 bsps/arm/shared/cpucounter/cpucounter-armv7m.c | 23 +++---
 bsps/arm/tms570/cpucounter/cpucounterread.c|  7 +--
 bsps/arm/xilinx-zynq/start/bspstart.c  |  2 --
 bsps/powerpc/beatnik/start/bspstart.c  |  8 +---
 bsps/powerpc/gen5200/start/bspstart.c  |  6 +-
 bsps/powerpc/gen83xx/start/bspstart.c  |  6 +-
 bsps/powerpc/haleakala/start/bspstart.c|  6 +-
 bsps/powerpc/motorola_powerpc/start/bspstart.c |  8 +---
 bsps/powerpc/mpc55xxevb/start/bspstart.c   |  6 +-
 bsps/powerpc/mpc8260ads/start/bspstart.c   |  6 +-
 bsps/powerpc/mvme3100/start/bspstart.c |  8 +---
 bsps/powerpc/mvme5500/start/bspstart.c |  8 +---
 bsps/powerpc/psim/start/bspstart.c |  6 +-
 bsps/powerpc/qemuppc/start/bspstart.c  |  6 +-
 bsps/powerpc/qoriq/start/bspstart.c| 10 +-
 bsps/powerpc/ss555/start/bspstart.c|  6 +-
 bsps/powerpc/t32mppc/start/bspstart.c  |  8 +---
 bsps/powerpc/tqm8xx/start/bspstart.c   |  6 +-
 bsps/powerpc/virtex/start/bspstart.c   |  7 +--
 bsps/powerpc/virtex4/start/bspstart.c  |  5 -
 bsps/powerpc/virtex5/start/bspstart.c  |  7 ---
 bsps/shared/dev/cpucounter/cpucounterfrequency.c   | 20 +++
 bsps/sparc/erc32/clock/ckinit.c| 15 +-
 bsps/sparc/leon3/start/cpucounter.c| 22 -
 c/src/lib/libbsp/arm/beagle/Makefile.am|  1 +
 c/src/lib/libbsp/arm/csb336/Makefile.am|  1 +
 c/src/lib/libbsp/arm/csb337/Makefile.am|  1 +
 c/src/lib/libbsp/arm/edb7312/Makefile.am   |  1 +
 c/src/lib/libbsp/arm/gdbarmsim/Makefile.am |  1 +
 c/src/lib/libbsp/arm/gumstix/Makefile.am   |  1 +
 c/src/lib/libbsp/arm/lm3s69xx/Makefile.am  |  1 +
 c/src/lib/libbsp/arm/raspberrypi/Makefile.am   |  1 +
 c/src/lib/libbsp/arm/rtl22xx/Makefile.am   |  1 +
 c/src/lib/libbsp/arm/smdk2410/Makefile.am  |  1 +
 c/src/lib/libbsp/arm/stm32f4/Makefile.am   |  1 +
 c/src/lib/libbsp/sparc/leon2/Makefile.am   |  1 +
 cpukit/include/rtems/counter.h | 12 ++-
 cpukit/sapi/src/cpucounterconverter.c  | 18 ++---
 cpukit/score/cpu/arm/include/rtems/score/cpu.h |  2 ++
 cpukit/score/cpu/bfin/Makefile.am  |  1 +
 cpukit/score/cpu/bfin/include/rtems/score/cpu.h|  2 ++
 cpukit/score/cpu/epiphany/Makefile.am  |  1 +
 .../score/cpu/epiphany/include/rtems/score/cpu.h   |  2 ++
 cpukit/score/cpu/i386/Makefile.am  |  1 +
 cpukit/score/cpu/i386/include/rtems/score/cpu.h|  2 ++
 cpukit/score/cpu/lm32/Makefile.am  |  1 +
 cpukit/score/cpu/lm32/include/rtems/score/cpu.h|  2 ++
 cpukit/score/cpu/m32c/Makefile.am  |  1 +
 cpukit/score/cpu/m32c/include/rtems/score/cpu.h|  2 ++
 cpukit/score/cpu/m68k/Makefile.am  |  1 +
 cpukit/score/cpu/m68k/include/rtems/score/cpu.h|  2 ++
 cpukit/score/cpu/mips/Makefile.am  |  1 +
 cpukit/score/cpu/mips/include/rtems/score/cpu.h|  2 ++
 cpukit/score/cpu/moxie/Makefile.am |  1 +
 cpukit/score/cpu/moxie/include/rtems/score/cpu.h   |  2 ++
 cpukit/score/cpu/nios2/Makefile.am |  1 +
 cpukit/score/cpu/nios2/include/rtems/score/cpu.h   |  2 ++
 cpukit/score/cpu/no_cpu/Makefile.am|  1 +
 cpukit/score/cpu/no_cpu/cpucounterfrequency.c  | 20 +++
 cpukit/score/cpu/no_cpu/include/rtems/score/cpu.h  |  7 +++
 cpukit/score/cpu/or1k/Makefile.am  |  3 ++-
 cpukit/score/cpu/or1k/include/rtems/score/cpu.h|  4 ++--
 cpukit/score/cpu/powerpc/include/rtems/score/cpu.h |  2 ++
 cpukit/score/cpu/riscv/Makefile.am |  1 +
 cpukit/score/cpu/riscv/include/rtems/score/cpu.h   |  2 ++
 cpukit/score/cpu/sh/Makefile.am|  1 +
 

[PATCH 1/4] Reassign system initilization order numbers

2018-06-15 Thread Sebastian Huber
Assign each system initialization step a number divisible by 256 to
allow more easily future additions.  Keep the order as is.
---
 cpukit/include/rtems/sysinit.h | 78 +-
 1 file changed, 39 insertions(+), 39 deletions(-)

diff --git a/cpukit/include/rtems/sysinit.h b/cpukit/include/rtems/sysinit.h
index 535fb98e2c..93e3017358 100644
--- a/cpukit/include/rtems/sysinit.h
+++ b/cpukit/include/rtems/sysinit.h
@@ -28,45 +28,45 @@ extern "C" {
  */
 #define RTEMS_SYSINIT_BSP_WORK_AREAS 000100
 #define RTEMS_SYSINIT_BSP_START  000200
-#define RTEMS_SYSINIT_INITIAL_EXTENSIONS 000300
-#define RTEMS_SYSINIT_MP_EARLY   000301
-#define RTEMS_SYSINIT_DATA_STRUCTURES000302
-#define RTEMS_SYSINIT_MP 00030e
-#define RTEMS_SYSINIT_USER_EXTENSIONS000320
-#define RTEMS_SYSINIT_CLASSIC_TASKS  000340
-#define RTEMS_SYSINIT_CLASSIC_TIMER  000341
-#define RTEMS_SYSINIT_CLASSIC_SIGNAL 000342
-#define RTEMS_SYSINIT_CLASSIC_EVENT  000343
-#define RTEMS_SYSINIT_CLASSIC_MESSAGE_QUEUE  000344
-#define RTEMS_SYSINIT_CLASSIC_SEMAPHORE  000345
-#define RTEMS_SYSINIT_CLASSIC_PARTITION  000346
-#define RTEMS_SYSINIT_CLASSIC_REGION 000347
-#define RTEMS_SYSINIT_CLASSIC_DUAL_PORTED_MEMORY 000348
-#define RTEMS_SYSINIT_CLASSIC_RATE_MONOTONIC 000349
-#define RTEMS_SYSINIT_CLASSIC_BARRIER00034a
-#define RTEMS_SYSINIT_POSIX_SIGNALS  000360
-#define RTEMS_SYSINIT_POSIX_THREADS  000361
-#define RTEMS_SYSINIT_POSIX_MESSAGE_QUEUE000364
-#define RTEMS_SYSINIT_POSIX_SEMAPHORE000365
-#define RTEMS_SYSINIT_POSIX_TIMER000366
-#define RTEMS_SYSINIT_POSIX_SHM  000369
-#define RTEMS_SYSINIT_POSIX_KEYS 00036a
-#define RTEMS_SYSINIT_POSIX_CLEANUP  00036b
-#define RTEMS_SYSINIT_IDLE_THREADS   000380
-#define RTEMS_SYSINIT_LIBIO  000400
-#define RTEMS_SYSINIT_ROOT_FILESYSTEM000401
-#define RTEMS_SYSINIT_DRVMGR 000500
-#define RTEMS_SYSINIT_MP_SERVER  000501
-#define RTEMS_SYSINIT_BSP_PRE_DRIVERS000600
-#define RTEMS_SYSINIT_DRVMGR_LEVEL_1 000700
-#define RTEMS_SYSINIT_DEVICE_DRIVERS 000701
-#define RTEMS_SYSINIT_DRVMGR_LEVEL_2 000702
-#define RTEMS_SYSINIT_DRVMGR_LEVEL_3 000703
-#define RTEMS_SYSINIT_DRVMGR_LEVEL_4 000704
-#define RTEMS_SYSINIT_MP_FINALIZE000705
-#define RTEMS_SYSINIT_CLASSIC_USER_TASKS 000706
-#define RTEMS_SYSINIT_POSIX_USER_THREADS 000707
-#define RTEMS_SYSINIT_STD_FILE_DESCRIPTORS   000800
+#define RTEMS_SYSINIT_INITIAL_EXTENSIONS 000400
+#define RTEMS_SYSINIT_MP_EARLY   000500
+#define RTEMS_SYSINIT_DATA_STRUCTURES000600
+#define RTEMS_SYSINIT_MP 000700
+#define RTEMS_SYSINIT_USER_EXTENSIONS000900
+#define RTEMS_SYSINIT_CLASSIC_TASKS  000a00
+#define RTEMS_SYSINIT_CLASSIC_TIMER  000b00
+#define RTEMS_SYSINIT_CLASSIC_SIGNAL 000c00
+#define RTEMS_SYSINIT_CLASSIC_EVENT  000d00
+#define RTEMS_SYSINIT_CLASSIC_MESSAGE_QUEUE  000e00
+#define RTEMS_SYSINIT_CLASSIC_SEMAPHORE  000f00
+#define RTEMS_SYSINIT_CLASSIC_PARTITION  001000
+#define RTEMS_SYSINIT_CLASSIC_REGION 001100
+#define RTEMS_SYSINIT_CLASSIC_DUAL_PORTED_MEMORY 001200
+#define RTEMS_SYSINIT_CLASSIC_RATE_MONOTONIC 001300
+#define RTEMS_SYSINIT_CLASSIC_BARRIER001400
+#define RTEMS_SYSINIT_POSIX_SIGNALS  001500
+#define RTEMS_SYSINIT_POSIX_THREADS  001600
+#define RTEMS_SYSINIT_POSIX_MESSAGE_QUEUE001700
+#define RTEMS_SYSINIT_POSIX_SEMAPHORE001800
+#define RTEMS_SYSINIT_POSIX_TIMER001900
+#define RTEMS_SYSINIT_POSIX_SHM  001a00
+#define RTEMS_SYSINIT_POSIX_KEYS 001b00
+#define RTEMS_SYSINIT_POSIX_CLEANUP  001c00
+#define RTEMS_SYSINIT_IDLE_THREADS   001d00
+#define RTEMS_SYSINIT_LIBIO  001e00
+#define RTEMS_SYSINIT_ROOT_FILESYSTEM001f00
+#define RTEMS_SYSINIT_DRVMGR 002000
+#define RTEMS_SYSINIT_MP_SERVER  002100
+#define RTEMS_SYSINIT_BSP_PRE_DRIVERS002200
+#define RTEMS_SYSINIT_DRVMGR_LEVEL_1 002300
+#define RTEMS_SYSINIT_DEVICE_DRIVERS 002400
+#define RTEMS_SYSINIT_DRVMGR_LEVEL_2 002500
+#define RTEMS_SYSINIT_DRVMGR_LEVEL_3 002600
+#define RTEMS_SYSINIT_DRVMGR_LEVEL_4 002700
+#define RTEMS_SYSINIT_MP_FINALIZE002800
+#define RTEMS_SYSINIT_CLASSIC_USER_TASKS 002900
+#define RTEMS_SYSINIT_POSIX_USER_THREADS 002a00

[PATCH 4/4] arm: Simplify CPU counter support

2018-06-15 Thread Sebastian Huber
Use the standard ARMv7-M systick module for the ARMv7-M CPU counter
instead of DWT counter since the DWT counter is affected by power saving
states.

Use an inline function for _CPU_Counter_difference() for all ARM BSPs.

Update #3456.
---
 bsps/arm/include/bsp/clock-armv7m.h   |  78 +++
 bsps/arm/lpc176x/start/system-clocks.c|   9 --
 bsps/arm/shared/clock/clock-armv7m.c  | 151 --
 bsps/arm/shared/cpucounter/cpucounter-armv7m.c|  37 +-
 c/src/lib/libbsp/arm/altera-cyclone-v/Makefile.am |   1 -
 c/src/lib/libbsp/arm/atsam/Makefile.am|   1 -
 c/src/lib/libbsp/arm/beagle/Makefile.am   |   1 -
 c/src/lib/libbsp/arm/csb336/Makefile.am   |   1 -
 c/src/lib/libbsp/arm/csb337/Makefile.am   |   1 -
 c/src/lib/libbsp/arm/edb7312/Makefile.am  |   1 -
 c/src/lib/libbsp/arm/gdbarmsim/Makefile.am|   1 -
 c/src/lib/libbsp/arm/gumstix/Makefile.am  |   1 -
 c/src/lib/libbsp/arm/imx/Makefile.am  |   1 -
 c/src/lib/libbsp/arm/lm3s69xx/Makefile.am |   1 -
 c/src/lib/libbsp/arm/lpc24xx/Makefile.am  |   1 -
 c/src/lib/libbsp/arm/lpc32xx/Makefile.am  |   1 -
 c/src/lib/libbsp/arm/raspberrypi/Makefile.am  |   1 -
 c/src/lib/libbsp/arm/realview-pbx-a9/Makefile.am  |   1 -
 c/src/lib/libbsp/arm/rtl22xx/Makefile.am  |   1 -
 c/src/lib/libbsp/arm/smdk2410/Makefile.am |   1 -
 c/src/lib/libbsp/arm/stm32f4/Makefile.am  |   1 -
 c/src/lib/libbsp/arm/tms570/Makefile.am   |   1 -
 c/src/lib/libbsp/arm/xilinx-zynq/Makefile.am  |   1 -
 cpukit/score/cpu/arm/include/rtems/score/cpu.h|   7 +-
 24 files changed, 138 insertions(+), 163 deletions(-)
 create mode 100644 bsps/arm/include/bsp/clock-armv7m.h

diff --git a/bsps/arm/include/bsp/clock-armv7m.h 
b/bsps/arm/include/bsp/clock-armv7m.h
new file mode 100644
index 00..d635fb0c1b
--- /dev/null
+++ b/bsps/arm/include/bsp/clock-armv7m.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2011, 2018 Sebastian Huber.  All rights reserved.
+ *
+ *  embedded brains GmbH
+ *  Dornierstr. 4
+ *  82178 Puchheim
+ *  Germany
+ *  
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifndef BSP_CLOCK_ARMV7M_H
+#define BSP_CLOCK_ARMV7M_H
+
+#include 
+#include 
+
+#include 
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#ifdef ARM_MULTILIB_ARCH_V7M
+
+typedef struct {
+  struct timecounter base;
+  uint32_t ticks;
+} ARMV7M_Timecounter;
+
+extern ARMV7M_Timecounter _ARMV7M_TC;
+
+static inline uint32_t _ARMV7M_Clock_frequency(void)
+{
+#ifdef BSP_ARMV7M_SYSTICK_FREQUENCY
+  return BSP_ARMV7M_SYSTICK_FREQUENCY;
+#else
+  volatile ARMV7M_Systick *systick = _ARMV7M_Systick;
+  return ARMV7M_SYSTICK_CALIB_TENMS_GET(systick->calib) * 100;
+#endif
+}
+
+static uint32_t _ARMV7M_Clock_counter(ARMV7M_Timecounter *tc)
+{
+  volatile ARMV7M_Systick *systick;
+  rtems_interrupt_level level;
+  uint32_t interval;
+  uint32_t counter;
+  uint32_t ticks;
+
+  systick = _ARMV7M_Systick;
+  interval = systick->rvr;
+
+  rtems_interrupt_disable(level);
+  counter = systick->cvr;
+  ticks = tc->ticks;
+
+  if ((systick->csr & ARMV7M_SYSTICK_CSR_COUNTFLAG) != 0) {
+ticks += interval;
+tc->ticks = ticks;
+  }
+
+  counter = interval - counter + ticks;
+  rtems_interrupt_enable(level);
+
+  return counter;
+}
+
+#endif /* ARM_MULTILIB_ARCH_V7M */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* BSP_CLOCK_ARMV7M_H */
diff --git a/bsps/arm/lpc176x/start/system-clocks.c 
b/bsps/arm/lpc176x/start/system-clocks.c
index 2ec58727eb..6af52be053 100644
--- a/bsps/arm/lpc176x/start/system-clocks.c
+++ b/bsps/arm/lpc176x/start/system-clocks.c
@@ -118,12 +118,3 @@ CPU_Counter_ticks _CPU_Counter_read( void )
 {
   return lpc176x_get_timer1();
 }
-
-inline CPU_Counter_ticks _CPU_Counter_difference(
-  CPU_Counter_ticks second,
-  CPU_Counter_ticks first
-)
-{
-  return second - first;
-}
-
diff --git a/bsps/arm/shared/clock/clock-armv7m.c 
b/bsps/arm/shared/clock/clock-armv7m.c
index 39cd4efdc7..2efe4c2654 100644
--- a/bsps/arm/shared/clock/clock-armv7m.c
+++ b/bsps/arm/shared/clock/clock-armv7m.c
@@ -1,8 +1,8 @@
 /*
- * Copyright (c) 2011-2012 Sebastian Huber.  All rights reserved.
+ * Copyright (c) 2011, 2018 Sebastian Huber.  All rights reserved.
  *
  *  embedded brains GmbH
- *  Obere Lagerstr. 30
+ *  Dornierstr. 4
  *  82178 Puchheim
  *  Germany
  *  
@@ -12,146 +12,97 @@
  * http://www.rtems.org/license/LICENSE.
  */
 
-#include 
-#include 
-#include 
+#include 
 
-#include 
+#include 
+#include 
 
 #ifdef ARM_MULTILIB_ARCH_V7M
 
 /* This is defined in dev/clock/clockimpl.h */
 static void Clock_isr(void *arg);
 
-typedef struct {
-  rtems_timecounter_simple base;
-  void (*tick)(void);
-  bool countflag;
-} ARMV7M_Timecounter;
-
-static ARMV7M_Timecounter _ARMV7M_TC;

[PATCH 2/4] Add RTEMS_SYSINIT_CPU_COUNTER

2018-06-15 Thread Sebastian Huber
Add initialization step for the CPU counter support.

Update #3456.
---
 cpukit/include/rtems/sysinit.h|  3 ++-
 testsuites/sptests/spsysinit01/init.c | 18 +-
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/cpukit/include/rtems/sysinit.h b/cpukit/include/rtems/sysinit.h
index 93e3017358..2c718af8de 100644
--- a/cpukit/include/rtems/sysinit.h
+++ b/cpukit/include/rtems/sysinit.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015 embedded brains GmbH.  All rights reserved.
+ * Copyright (c) 2015, 2018 embedded brains GmbH.  All rights reserved.
  *
  *  embedded brains GmbH
  *  Dornierstr. 4
@@ -28,6 +28,7 @@ extern "C" {
  */
 #define RTEMS_SYSINIT_BSP_WORK_AREAS 000100
 #define RTEMS_SYSINIT_BSP_START  000200
+#define RTEMS_SYSINIT_CPU_COUNTER000300
 #define RTEMS_SYSINIT_INITIAL_EXTENSIONS 000400
 #define RTEMS_SYSINIT_MP_EARLY   000500
 #define RTEMS_SYSINIT_DATA_STRUCTURES000600
diff --git a/testsuites/sptests/spsysinit01/init.c 
b/testsuites/sptests/spsysinit01/init.c
index df299ac5af..b9521b950f 100644
--- a/testsuites/sptests/spsysinit01/init.c
+++ b/testsuites/sptests/spsysinit01/init.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016 embedded brains GmbH.  All rights reserved.
+ * Copyright (c) 2015, 2018 embedded brains GmbH.  All rights reserved.
  *
  *  embedded brains GmbH
  *  Dornierstr. 4
@@ -67,6 +67,8 @@ typedef enum {
   BSP_WORK_AREAS_POST,
   BSP_START_PRE,
   BSP_START_POST,
+  CPU_COUNTER_PRE,
+  CPU_COUNTER_POST,
   INITIAL_EXTENSIONS_PRE,
   INITIAL_EXTENSIONS_POST,
   DATA_STRUCTURES_PRE,
@@ -218,6 +220,20 @@ LAST(RTEMS_SYSINIT_BSP_START)
   next_step(BSP_START_POST);
 }
 
+FIRST(RTEMS_SYSINIT_CPU_COUNTER)
+{
+  /*
+   * Since the work performed here is BSP-specific, there is no way to test pre
+   * and post conditions.
+   */
+  next_step(CPU_COUNTER_PRE);
+}
+
+LAST(RTEMS_SYSINIT_CPU_COUNTER)
+{
+  next_step(CPU_COUNTER_POST);
+}
+
 FIRST(RTEMS_SYSINIT_INITIAL_EXTENSIONS)
 {
   assert(_Chain_Is_empty(&_User_extensions_Switches_list));
-- 
2.13.7

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Copyright and license notices in new and ported code

2018-06-15 Thread Amaan Cheval
Hi!

In some RTEMS source files I see a series of copyright notices,
including those for individuals and corporations, for eg.:
https://git.rtems.org/rtems/tree/cpukit/score/cpu/arm/include/rtems/score/cpu.h#n7
https://git.rtems.org/rtems/commit/?id=660db8c86fa16dc67c40bdeebbf671e50a7f3087
(again, in cpu.h)

I was just wondering how this ought to be for new code. Is this meant
to be handled on a file-by-file basis? I don't see anything about it
on the wiki either.

For now I'm using this, let me know if I need to add OAR to the comment too:

https://github.com/AmaanC/rtems-gsoc18/blob/ac/daily-01-compile-stub/cpukit/score/cpu/x86_64/include/rtems/score/cpu.h#L10

I haven't yet, but I'll likely also port FreeBSD sources soon - in
that case I ought to just preserve the file as much as possible to
make future updates easier, right? (That is, no changes made to the
copyright or added to the code if we can avoid it (by adding new files
for customizations on top, for eg.)).

Cheers
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [GSoC - x86_64] Using FreeBSD's UEFI loader for RTEMS static binaries

2018-06-15 Thread Amaan Cheval
On Thu, Jun 14, 2018 at 11:25 AM, Chris Johns  wrote:
> On 14/06/2018 05:33, Joel Sherrill wrote:
>> On Wed, Jun 13, 2018, 6:57 PM Amaan Cheval > > wrote:
>>
>> On Wed, Jun 13, 2018 at 9:35 PM, Gedare Bloom > > wrote:
>> > On Wed, Jun 13, 2018 at 11:33 AM, Amaan Cheval > > wrote:
>> >> Hi!
>> >>
>> >> As we discussed in the last thread on the topic[1], I'm trying to use
>> >> FreeBSD's loader.efi directly with RTEMS' generated static binaries
>> >> (since FreeBSD's loader.efi has an ELF loader).
>> >>
>> >> In brief, I did this by:
>> >> - Installing FreeBSD in QEMU with UEFI firmware
>> >> - Confirming that FreeBSD's loader.efi is in fact used
>> >> - Replacing FreeBSD's ELF kernel with a "custom" kernel[2] with an 
>> RTEMS ELF
>> >> - Verifying that the code running after FreeBSD's loader.efi is in
>> >> fact the "RTEMS ELF" by attaching gdb to QEMU (the rtems ELF is simply
>> >> a while(1) loop compiled with RTEMS' tools - see later on why I can't
>> >> do something more elaborate)
>> >>
>> >> Some more details of the process I followed for testing this:
>> >> https://gist.github.com/AmaanC/42faa131ee97a1d6c4c7c25c29f0fde9z
>> >>
>> >> I think this method is superior to the PIC RTEMS method because:
>> >> - FreeBSD uses it
>> >> - RTEMS retains static ELF binaries, which can likely easily be
>> >> combined with a Multiboot header + protect mode starter code
>> >> - FreeBSD has methods to provide ACPI related hints to their ELF
>> >> kernel - this might make our implementation with regards to ACPI
>> >> simpler too
>
> I agree this is the best approach. In time we can host on our file server a
> package of FreeBSD binaries that boot an RTEMS kernel.

Something worth noting here is that most Linux kernels (at least
Ubuntu and Debian, from my tests) would need to be recompiled to
enable write-support for UFS filesystems, which FreeBSD uses.
https://unix.stackexchange.com/questions/24589/mounting-ufs-partition-with-read-write-permissions-on-ubuntu-10-04

What this means is that it's likely best to provide to users a disk
image _including_ the FreeBSD kernel too, not just the bootloader,
since it can then be used to edit the image itself in QEMU to replace
the kernel with the RTEMS static binary.

Procedure would look like:
- Download freebsd.img
- Run qemu ... freebsd.img
- Edit filesystem to replace /boot/kernel/kernel with RTEMS binary
(leaving old FreeBSD kernel as a backup in /boot/kernel.old/)

I just thought I'd bring this caveat up. We can write documentation up
on the exact steps needed to accomplish this on the wiki soon too.

>
>> >>
>> >> Regarding some concerns Chris had with linker options and whatnot,
>> >> here's what FreeBSD uses:
>> >> https://www.freebsd.org/doc/en/books/arch-handbook/boot-kernel.html
>> >>
>> >> Here's what I used (with the code being a simple while(1) loop):
>> >>   x86_64-rtems5-gcc ktest.c -c -nostdlib
>> >>   x86_64-rtems5-ld ktest.o -e main -o kernel
>> >>
>
> Nice, this looks fine. It is normal for a bare metal piece of C code.
>
>> >>
>> 
>> -
>> >>
>> >> What I need input on:
>> >> - Right now, we use the following RTEMS code for testing:
>> >>
>> >> int main() {
>> >>   while(1) {}
>> >> }
>> >>
>> >
>> > It's not really an RTEMS code, it is a C program (ktest.c) compiled
>> > with the RTEMS-flavored toolchain, right?
>>
>> Yeah, for now that's right. I'm going to conduct the same gdb based
>> debug-stepping style test for RTEMS setting boot_card as the entry
>> point soon - for now, it crashes QEMU with:
>>
>> qemu: fatal: Trying to execute code outside RAM or ROM at 
>> 0x000b
>>
>> RAX=006004c0 RBX=006003d8 RCX=37f36000
>> RDX=0040
>> RSI=0400 RDI=0180 RBP=006003d8
>> RSP=3c589fb8
>> ...
>>
>> I see that it reaches that stage even from some code it ought not to
>> be executing, so I'll look into what that may be about.
>
> Hmm.
>
>>
>> >
>> > It would be nice to get an RTEMS x86-64 BSP to start, at least to
>> > confirm that you reach _start, and then even you can try to make it to
>> > the "boot_card" startup sequence.
>>
>> Right, I'll aim to have that working soon (using boot_card as the
>> entry, since "_start" usually does the bootloader stuff that we're now
>> offloading to FreeBSD, and then calls boot_card anyway).
>>
>>
>> To be consistent with other BSPs, I have a start.c on the Deos BSPs. It 
>> fetches
>> the boot arguments which are passed to boot_card() and does some other setup
>> specific to Deos.
>>
>> No need to do 

[PATCH 2/4] make: Remove obsolete AC_SUBST()

2018-06-15 Thread Sebastian Huber
---
 c/src/make/configure.ac | 4 
 1 file changed, 4 deletions(-)

diff --git a/c/src/make/configure.ac b/c/src/make/configure.ac
index 4b22b7e34d..9de68a40d7 100644
--- a/c/src/make/configure.ac
+++ b/c/src/make/configure.ac
@@ -66,11 +66,7 @@ RTEMS_CHECK_NETWORKING(RTEMS_BSP)
 RTEMS_CHECK_POSIX_API(RTEMS_BSP)
 RTEMS_CHECK_CXX(RTEMS_BSP)
 
-AC_SUBST(rtems_cv_prog_cc_cross)
 AC_SUBST(RTEMS_HAS_CPLUSPLUS)
-AC_SUBST(program_prefix)
-AC_SUBST(CC_CFLAGS_DEFAULT)
-AC_SUBST(CC_CFLAGS_DEBUG_V)
 AC_SUBST(RTEMS_API,[_RTEMS_API])
 
 cfg_dir="${RTEMS_TOPdir}/make"
-- 
2.13.7

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH 1/4] make: Remove CFLAGS_DEBUG_OPTIMIZE_V

2018-06-15 Thread Sebastian Huber
Do not document CFLAGS_DEBUG_OPTIMIZE_V, since this flag is not used.
---
 c/src/make/README | 4 
 1 file changed, 4 deletions(-)

diff --git a/c/src/make/README b/c/src/make/README
index 64589698ce..e2b96d9928 100644
--- a/c/src/make/README
+++ b/c/src/make/README
@@ -328,10 +328,6 @@
 CFLAGS_DEBUG_V  -- value of debug flag for compiler
[ eg: -g ]
 
-CFLAGS_DEBUG_OPTIMIZE_V
--- optimize flag if compiling for debug
- [ eg: "" ]
-
 CFLAGS_DEBUG
 CFLAGS_OPTIMIZE -- current values for each depending
 on make variant.
-- 
2.13.7

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH 4/4] tools: Remove install-if-change program

2018-06-15 Thread Sebastian Huber
The last installed tool in RTEMS repository is the install-if-change
script.  It is not used to build/install BSPs.  This script does the
same as the standard "install" program with an additional feature to
install variants via the -V command line option.

This script is used by the standard Makefile support:

c/src/make/host.cfg.in:INSTALL_CHANGE=$(PROJECT_BIN)/install-if-change

The INSTALL_CHANGE is used by:

c/src/make/host.cfg.in:ifndef INSTALL_CHANGE
c/src/make/host.cfg.in:INSTALL_CHANGE=$(PROJECT_BIN)/install-if-change
c/src/make/host.cfg.in:INSTALL_VARIANT=$(INSTALL_CHANGE) -V
"$(LIB_VARIANT)"

Remove the support for variant installation and instead use the standard
"install" program.  This breaks application Makefiles using the standard
Makefile support of RTEMS.

Close #3455.
---
 Makefile.am  |   2 +-
 c/src/make/README|  21 +-
 c/src/make/host.cfg.in   |   6 +-
 configure.ac |  15 -
 tools/build/Makefile.am  |   5 --
 tools/build/README   |   6 --
 tools/build/config.h.in  |  67 ---
 tools/build/configure.ac |  18 -
 tools/build/install-if-change.in | 139 ---
 9 files changed, 8 insertions(+), 271 deletions(-)
 delete mode 100644 tools/build/Makefile.am
 delete mode 100644 tools/build/README
 delete mode 100644 tools/build/config.h.in
 delete mode 100644 tools/build/configure.ac
 delete mode 100644 tools/build/install-if-change.in

diff --git a/Makefile.am b/Makefile.am
index ad65c1e565..5e9489db28 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -11,7 +11,7 @@ noinst_SCRIPTS = bootstrap
 
 
 dist-hook:
-   @files=`(cd $(srcdir); find cpukit c testsuites tools \
+   @files=`(cd $(srcdir); find cpukit c testsuites \
   -name configure.ac -print | sed 's,/configure.ac,,' | sort)`; \
for i in $$files; do \
  if test -f $(distdir)/$$i/configure.ac; then : ; \
diff --git a/c/src/make/README b/c/src/make/README
index e2b96d9928..f3491c2577 100644
--- a/c/src/make/README
+++ b/c/src/make/README
@@ -426,24 +426,9 @@
  the installation of libraries, executables, header files,
  and other things that need to be installed:
 
-INSTALL_CHANGE  - install a file only if the source
-  file is actually different than
-  the installed copy or if there is
-  no installed copy.  USAGE:
-
-  usage: install-if-change [ -vmV ] file [ file ... ] 
dest-directory-or-file
-   -v  -- verbose
--V suffix   -- suffix to append to targets (before any . suffix)
-eg: -V _g would change 'foo' to 'foo_g' and
-   'libfoo.a' to 'libfoo_g.a'
--m mode -- mode for new file(s)
-
-INSTALL_VARIANT - installs the built file using the
-  proper variant suffix (e.g. _g
-  for debug turns libmine.a into 
libmine_g.a)
-  This is implemented as a macro that
-  invokes install-if-change with the
-  appropriate -V argument setting.
+INSTALL_CHANGE  - set to host "install" program by default
+
+INSTALL_VARIANT - set to host "install" program by default
 
 Special Directory Makefile Targets
 --
diff --git a/c/src/make/host.cfg.in b/c/src/make/host.cfg.in
index 04bc04a6fb..caedc2ee9e 100644
--- a/c/src/make/host.cfg.in
+++ b/c/src/make/host.cfg.in
@@ -28,9 +28,11 @@ BIN2C=rtems-bin2c
 endif
 
 ifndef INSTALL_CHANGE
-INSTALL_CHANGE=$(PROJECT_BIN)/install-if-change
+INSTALL_CHANGE=install
+endif
+ifndef INSTALL_VARIANT
+INSTALL_VARIANT=install
 endif
-INSTALL_VARIANT=$(INSTALL_CHANGE) -V "$(LIB_VARIANT)"
 
 # ksh (or bash) is used by some shell scripts; ref build-tools/scripts/Makefile
 #
diff --git a/configure.ac b/configure.ac
index d88964fca2..2de9af56a4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -32,21 +32,6 @@ RTEMS_ENABLE_RTEMS_DEBUG
 RTEMS_ENABLE_PARAVIRT
 RTEMS_ENABLE_DRVMGR
 
-## Check if there are valid tools install and in the path.
-RTEMS_CHECK_TOOL(RTEMS_CC,gcc)
-test -z "$RTEMS_CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
-
-## NOTES:
-## * tools/build are host-native tools to be installed on the host.
-## * tools/cpu are host-native or host-cross-target-tools
-
-RTEMS_BUILD_CONFIG_SUBDIRS([tools/build])
-
-# Some BSPs carelessly apply these tools as build-tools
-AS_IF([test $host != $build],[
-RTEMS_HOST_CONFIG_SUBDIRS([tools/build])
-])
-
 RTEMS_TARGET_CONFIG_SUBDIRS([c])
 
 AC_CONFIG_FILES([Makefile])
diff --git a/tools/build/Makefile.am b/tools/build/Makefile.am
deleted file 

[PATCH 3/4] bsp/beatnik: Remove CFLAGS_DEBUG_V

2018-06-15 Thread Sebastian Huber
This was the only BSP setting this flag.
---
 bsps/powerpc/beatnik/config/beatnik.cfg | 4 
 1 file changed, 4 deletions(-)

diff --git a/bsps/powerpc/beatnik/config/beatnik.cfg 
b/bsps/powerpc/beatnik/config/beatnik.cfg
index 05bea383bf..7df626afe9 100644
--- a/bsps/powerpc/beatnik/config/beatnik.cfg
+++ b/bsps/powerpc/beatnik/config/beatnik.cfg
@@ -26,10 +26,6 @@ CFLAGS_OPTIMIZE_V += -ffunction-sections -fdata-sections
 
 LDFLAGS = -Wl,--gc-sections
 
-# debug flags: typically none, but at least -O1 is required due to this
-# BSP using inlined code
-CFLAGS_DEBUG_V = -O1 -g
-
 define bsp-post-link
$(default-bsp-post-link)
$(OBJCOPY) -O binary $@ $(basename $@)$(DOWNEXT)
-- 
2.13.7

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel