Re: [PATCH v3 2/2] libtests/ofw01: Added a test for RTEMS OFW

2020-12-27 Thread Niteesh G. S.
Hello Christian,

On Sun, Dec 27, 2020 at 2:39 PM Christian Mauderer 
wrote:

> Hello Niteesh,
>
> I pushed the two patches.
>
Thanks for pushing the patches.

Thanks,
Niteesh.

> Best regards
>
> Christian
>
> On 22/12/2020 19:01, Niteesh G. S. wrote:
> > Hello Christian,
> >
> > On Tue, Dec 22, 2020 at 6:33 PM Christian Mauderer  > > wrote:
> >
> > Hello Niteesh,
> >
> > On 19/12/2020 16:57, Niteesh G. S. wrote:
> >  > Hello Christian,
> >  >
> >  > On Sat, Dec 19, 2020 at 7:11 PM Christian Mauderer
> > mailto:o...@c-mauderer.de>
> >  > >> wrote:
> >  >
> >  > Hello Niteesh,
> >  >
> >  > sorry, I somehow forget to check that patch set. I'll do it
> > in the next
> >  > few days.
> >  >
> >  > No problem, please take your time :).
> >
> > I have a problem with the patches on a non-fdt-BSP: The test doesn't
> > link. I tried it with the xilinx_zynq_a9_qemu BSP.
> >
> >
> > Basically the bsp_fdt_get() is missing on that BSP. To work arround
> > that, it is possible to change the return statement in the
> > __wrap_bsp_fdt_get to:
> >
> >
> >   #ifdef BSP_FDT_IS_SUPPORTED
> > return __real_bsp_fdt_get();
> >   #else
> >return some_bin;
> >   #endif
> >
> > I am sorry for not testing it on a non-fdt-BSP, I totally forgot about
> > this part though
> > you mentioned it in the previous patch.
> >
> > Note that in the no-fdt-bsp-case, it has to return a valid FDT
> because
> > otherwise the ofw initialization fails.
> >
> > I tested that modified version on xilinx_zynq_a9_qemu and on BBB and
> it
> > seems to work fine. If you are OK with this modification (and no one
> > objects in the next two days) I'll push the patches with this
> > modification.
> >
> >
> > Please push if no one objects.
> >
> >  > If you are on vacation, enjoy your vacations :)
> >
> > Thanks. It wouldn't be reasonable to travel during a pandemic and I
> > don't like traveling anyway.
> >
> > +1
> >
> > Therefore it's a quiet and relaxing
> > vacation ;-)
> >
> >
> > :)
> >
> >
> > Thanks,
> > Niteesh.
> >
> > Best regards
> >
> > Christian
> >
> >  >
> >  > Thanks,
> >  > Niteesh.
> >  >
> >  >
> >  > Best regards
> >  >
> >  > Christian
> >  >
> >  > On 17/12/2020 12:15, Niteesh G. S. wrote:
> >  >  > ping.
> >  >  >
> >  >  >
> >  >  > On Fri, Dec 4, 2020 at 1:41 PM G S Niteesh Babu
> >  > mailto:niteesh...@gmail.com>
> > >
> >  >  > 
> >  >  >  >
> >  >  > This commit adds a basic test that tests all the
> > implemented
> >  >  > RTEMS OFW functions.
> >  >  > ---
> >  >  >   spec/build/testsuites/libtests/grp.yml   |   2 +
> >  >  >   spec/build/testsuites/libtests/ofw01.yml |  21 +++
> >  >  >   testsuites/libtests/ofw01/init.c | 197
> >  > +++
> >  >  >   testsuites/libtests/ofw01/ofw01.doc  |  29 
> >  >  >   testsuites/libtests/ofw01/ofw01.scn  |   2 +
> >  >  >   testsuites/libtests/ofw01/some.c |  72
> +
> >  >  >   testsuites/libtests/ofw01/some.dts   |  76
> +
> >  >  >   testsuites/libtests/ofw01/some.h |  15 ++
> >  >  >   8 files changed, 414 insertions(+)
> >  >  >   create mode 100644
> > spec/build/testsuites/libtests/ofw01.yml
> >  >  >   create mode 100644 testsuites/libtests/ofw01/init.c
> >  >  >   create mode 100644
> testsuites/libtests/ofw01/ofw01.doc
> >  >  >   create mode 100644
> testsuites/libtests/ofw01/ofw01.scn
> >  >  >   create mode 100644 testsuites/libtests/ofw01/some.c
> >  >  >   create mode 100644 testsuites/libtests/ofw01/some.dts
> >  >  >   create mode 100644 testsuites/libtests/ofw01/some.h
> >  >  >
> >  >  > diff --git a/spec/build/testsuites/libtests/grp.yml
> >  >  > b/spec/build/testsuites/libtests/grp.yml
> >  >  > index aff46c9f8f..82c2288e2f 100644
> >  >  > --- a/spec/build/testsuites/libtests/grp.yml
> >  >  > +++ b/spec/build/testsuites/libtests/grp.yml
> >  >  > @@ -316,6 +316,8 @@ links:
> >  >  > uid: write
> >  >  >   - role: build-dependency
> >  >  > uid: writev
> >  >  > +- role: build-dependency
> >  >  > +  uid: ofw01
> >  >  >   type: 

Re: [PATCH v3 2/2] libtests/ofw01: Added a test for RTEMS OFW

2020-12-27 Thread Christian Mauderer

Hello Niteesh,

I pushed the two patches.

Best regards

Christian

On 22/12/2020 19:01, Niteesh G. S. wrote:

Hello Christian,

On Tue, Dec 22, 2020 at 6:33 PM Christian Mauderer > wrote:


Hello Niteesh,

On 19/12/2020 16:57, Niteesh G. S. wrote:
 > Hello Christian,
 >
 > On Sat, Dec 19, 2020 at 7:11 PM Christian Mauderer
mailto:o...@c-mauderer.de>
 > >> wrote:
 >
 >     Hello Niteesh,
 >
 >     sorry, I somehow forget to check that patch set. I'll do it
in the next
 >     few days.
 >
 > No problem, please take your time :).

I have a problem with the patches on a non-fdt-BSP: The test doesn't
link. I tried it with the xilinx_zynq_a9_qemu BSP.


Basically the bsp_fdt_get() is missing on that BSP. To work arround
that, it is possible to change the return statement in the
__wrap_bsp_fdt_get to:


      #ifdef BSP_FDT_IS_SUPPORTED
        return __real_bsp_fdt_get();
      #else
       return some_bin;
      #endif

I am sorry for not testing it on a non-fdt-BSP, I totally forgot about 
this part though

you mentioned it in the previous patch.

Note that in the no-fdt-bsp-case, it has to return a valid FDT because
otherwise the ofw initialization fails.

I tested that modified version on xilinx_zynq_a9_qemu and on BBB and it
seems to work fine. If you are OK with this modification (and no one
objects in the next two days) I'll push the patches with this
modification.


Please push if no one objects.

 > If you are on vacation, enjoy your vacations :)

Thanks. It wouldn't be reasonable to travel during a pandemic and I
don't like traveling anyway.

+1

Therefore it's a quiet and relaxing
vacation ;-)


:)


Thanks,
Niteesh.

Best regards

Christian

 >
 > Thanks,
 > Niteesh.
 >
 >
 >     Best regards
 >
 >     Christian
 >
 >     On 17/12/2020 12:15, Niteesh G. S. wrote:
 >      > ping.
 >      >
 >      >
 >      > On Fri, Dec 4, 2020 at 1:41 PM G S Niteesh Babu
 >     mailto:niteesh...@gmail.com>
>
 >      > 
      >
 >      >     This commit adds a basic test that tests all the
implemented
 >      >     RTEMS OFW functions.
 >      >     ---
 >      >       spec/build/testsuites/libtests/grp.yml   |   2 +
 >      >       spec/build/testsuites/libtests/ofw01.yml |  21 +++
 >      >       testsuites/libtests/ofw01/init.c         | 197
 >     +++
 >      >       testsuites/libtests/ofw01/ofw01.doc      |  29 
 >      >       testsuites/libtests/ofw01/ofw01.scn      |   2 +
 >      >       testsuites/libtests/ofw01/some.c         |  72 +
 >      >       testsuites/libtests/ofw01/some.dts       |  76 +
 >      >       testsuites/libtests/ofw01/some.h         |  15 ++
 >      >       8 files changed, 414 insertions(+)
 >      >       create mode 100644
spec/build/testsuites/libtests/ofw01.yml
 >      >       create mode 100644 testsuites/libtests/ofw01/init.c
 >      >       create mode 100644 testsuites/libtests/ofw01/ofw01.doc
 >      >       create mode 100644 testsuites/libtests/ofw01/ofw01.scn
 >      >       create mode 100644 testsuites/libtests/ofw01/some.c
 >      >       create mode 100644 testsuites/libtests/ofw01/some.dts
 >      >       create mode 100644 testsuites/libtests/ofw01/some.h
 >      >
 >      >     diff --git a/spec/build/testsuites/libtests/grp.yml
 >      >     b/spec/build/testsuites/libtests/grp.yml
 >      >     index aff46c9f8f..82c2288e2f 100644
 >      >     --- a/spec/build/testsuites/libtests/grp.yml
 >      >     +++ b/spec/build/testsuites/libtests/grp.yml
 >      >     @@ -316,6 +316,8 @@ links:
 >      >         uid: write
 >      >       - role: build-dependency
 >      >         uid: writev
 >      >     +- role: build-dependency
 >      >     +  uid: ofw01
 >      >       type: build
 >      >       use-after:
 >      >       - rtemstest
 >      >     diff --git a/spec/build/testsuites/libtests/ofw01.yml
 >      >     b/spec/build/testsuites/libtests/ofw01.yml
 >      >     new file mode 100644
 >      >     index 00..8517c58bad
 >      >     --- /dev/null
 >      >     +++ b/spec/build/testsuites/libtests/ofw01.yml
 >      >     @@ -0,0 +1,21 @@
 >      >     +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
 >      >     +build-type: test-program
 >      >     +cflags: []
 >      >     +copyrights:
 >      >     +- Copyright (C) 2020 

Re: [PATCH v3 2/2] libtests/ofw01: Added a test for RTEMS OFW

2020-12-22 Thread Niteesh G. S.
Hello Christian,

On Tue, Dec 22, 2020 at 6:33 PM Christian Mauderer 
wrote:

> Hello Niteesh,
>
> On 19/12/2020 16:57, Niteesh G. S. wrote:
> > Hello Christian,
> >
> > On Sat, Dec 19, 2020 at 7:11 PM Christian Mauderer  > > wrote:
> >
> > Hello Niteesh,
> >
> > sorry, I somehow forget to check that patch set. I'll do it in the
> next
> > few days.
> >
> > No problem, please take your time :).
>
> I have a problem with the patches on a non-fdt-BSP: The test doesn't
> link. I tried it with the xilinx_zynq_a9_qemu BSP.
>


> Basically the bsp_fdt_get() is missing on that BSP. To work arround
> that, it is possible to change the return statement in the
> __wrap_bsp_fdt_get to:
>
>
>  #ifdef BSP_FDT_IS_SUPPORTED
>return __real_bsp_fdt_get();
>  #else
>   return some_bin;
>  #endif
>
I am sorry for not testing it on a non-fdt-BSP, I totally forgot about this
part though
you mentioned it in the previous patch.


> Note that in the no-fdt-bsp-case, it has to return a valid FDT because
> otherwise the ofw initialization fails.
>
> I tested that modified version on xilinx_zynq_a9_qemu and on BBB and it
> seems to work fine. If you are OK with this modification (and no one
> objects in the next two days) I'll push the patches with this modification.
>

Please push if no one objects.


> > If you are on vacation, enjoy your vacations :)
>
> Thanks. It wouldn't be reasonable to travel during a pandemic and I
> don't like traveling anyway.

+1

> Therefore it's a quiet and relaxing
> vacation ;-)
>

:)


Thanks,
Niteesh.

> Best regards
>
> Christian
>
> >
> > Thanks,
> > Niteesh.
> >
> >
> > Best regards
> >
> > Christian
> >
> > On 17/12/2020 12:15, Niteesh G. S. wrote:
> >  > ping.
> >  >
> >  >
> >  > On Fri, Dec 4, 2020 at 1:41 PM G S Niteesh Babu
> > mailto:niteesh...@gmail.com>
> >  > >>
> wrote:
> >  >
> >  > This commit adds a basic test that tests all the implemented
> >  > RTEMS OFW functions.
> >  > ---
> >  >   spec/build/testsuites/libtests/grp.yml   |   2 +
> >  >   spec/build/testsuites/libtests/ofw01.yml |  21 +++
> >  >   testsuites/libtests/ofw01/init.c | 197
> > +++
> >  >   testsuites/libtests/ofw01/ofw01.doc  |  29 
> >  >   testsuites/libtests/ofw01/ofw01.scn  |   2 +
> >  >   testsuites/libtests/ofw01/some.c |  72 +
> >  >   testsuites/libtests/ofw01/some.dts   |  76 +
> >  >   testsuites/libtests/ofw01/some.h |  15 ++
> >  >   8 files changed, 414 insertions(+)
> >  >   create mode 100644 spec/build/testsuites/libtests/ofw01.yml
> >  >   create mode 100644 testsuites/libtests/ofw01/init.c
> >  >   create mode 100644 testsuites/libtests/ofw01/ofw01.doc
> >  >   create mode 100644 testsuites/libtests/ofw01/ofw01.scn
> >  >   create mode 100644 testsuites/libtests/ofw01/some.c
> >  >   create mode 100644 testsuites/libtests/ofw01/some.dts
> >  >   create mode 100644 testsuites/libtests/ofw01/some.h
> >  >
> >  > diff --git a/spec/build/testsuites/libtests/grp.yml
> >  > b/spec/build/testsuites/libtests/grp.yml
> >  > index aff46c9f8f..82c2288e2f 100644
> >  > --- a/spec/build/testsuites/libtests/grp.yml
> >  > +++ b/spec/build/testsuites/libtests/grp.yml
> >  > @@ -316,6 +316,8 @@ links:
> >  > uid: write
> >  >   - role: build-dependency
> >  > uid: writev
> >  > +- role: build-dependency
> >  > +  uid: ofw01
> >  >   type: build
> >  >   use-after:
> >  >   - rtemstest
> >  > diff --git a/spec/build/testsuites/libtests/ofw01.yml
> >  > b/spec/build/testsuites/libtests/ofw01.yml
> >  > new file mode 100644
> >  > index 00..8517c58bad
> >  > --- /dev/null
> >  > +++ b/spec/build/testsuites/libtests/ofw01.yml
> >  > @@ -0,0 +1,21 @@
> >  > +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
> >  > +build-type: test-program
> >  > +cflags: []
> >  > +copyrights:
> >  > +- Copyright (C) 2020 Niteesh G S
> >  > +cppflags: []
> >  > +cxxflags: []
> >  > +enabled-by: true
> >  > +features: c cprogram
> >  > +includes: []
> >  > +ldflags:
> >  > +- -Wl,--wrap=bsp_fdt_get
> >  > +links: []
> >  > +source:
> >  > +- testsuites/libtests/ofw01/init.c
> >  > +- testsuites/libtests/ofw01/some.c
> >  > +stlib: []
> >  > +target: testsuites/libtests/ofw01.exe
> >  > +type: build
> >  > +use-after: []
> >  > +use-before: []
> >  > diff --git 

Re: [PATCH v3 2/2] libtests/ofw01: Added a test for RTEMS OFW

2020-12-22 Thread Christian Mauderer

Hello Niteesh,

On 19/12/2020 16:57, Niteesh G. S. wrote:

Hello Christian,

On Sat, Dec 19, 2020 at 7:11 PM Christian Mauderer > wrote:


Hello Niteesh,

sorry, I somehow forget to check that patch set. I'll do it in the next
few days.

No problem, please take your time :).


I have a problem with the patches on a non-fdt-BSP: The test doesn't 
link. I tried it with the xilinx_zynq_a9_qemu BSP.


Basically the bsp_fdt_get() is missing on that BSP. To work arround 
that, it is possible to change the return statement in the 
__wrap_bsp_fdt_get to:



#ifdef BSP_FDT_IS_SUPPORTED
  return __real_bsp_fdt_get();
#else
 return some_bin;
#endif

Note that in the no-fdt-bsp-case, it has to return a valid FDT because 
otherwise the ofw initialization fails.


I tested that modified version on xilinx_zynq_a9_qemu and on BBB and it 
seems to work fine. If you are OK with this modification (and no one 
objects in the next two days) I'll push the patches with this modification.




If you are on vacation, enjoy your vacations :)


Thanks. It wouldn't be reasonable to travel during a pandemic and I 
don't like traveling anyway. Therefore it's a quiet and relaxing 
vacation ;-)


Best regards

Christian



Thanks,
Niteesh.


Best regards

Christian

On 17/12/2020 12:15, Niteesh G. S. wrote:
 > ping.
 >
 >
 > On Fri, Dec 4, 2020 at 1:41 PM G S Niteesh Babu
mailto:niteesh...@gmail.com>
 > >> wrote:
 >
 >     This commit adds a basic test that tests all the implemented
 >     RTEMS OFW functions.
 >     ---
 >       spec/build/testsuites/libtests/grp.yml   |   2 +
 >       spec/build/testsuites/libtests/ofw01.yml |  21 +++
 >       testsuites/libtests/ofw01/init.c         | 197
+++
 >       testsuites/libtests/ofw01/ofw01.doc      |  29 
 >       testsuites/libtests/ofw01/ofw01.scn      |   2 +
 >       testsuites/libtests/ofw01/some.c         |  72 +
 >       testsuites/libtests/ofw01/some.dts       |  76 +
 >       testsuites/libtests/ofw01/some.h         |  15 ++
 >       8 files changed, 414 insertions(+)
 >       create mode 100644 spec/build/testsuites/libtests/ofw01.yml
 >       create mode 100644 testsuites/libtests/ofw01/init.c
 >       create mode 100644 testsuites/libtests/ofw01/ofw01.doc
 >       create mode 100644 testsuites/libtests/ofw01/ofw01.scn
 >       create mode 100644 testsuites/libtests/ofw01/some.c
 >       create mode 100644 testsuites/libtests/ofw01/some.dts
 >       create mode 100644 testsuites/libtests/ofw01/some.h
 >
 >     diff --git a/spec/build/testsuites/libtests/grp.yml
 >     b/spec/build/testsuites/libtests/grp.yml
 >     index aff46c9f8f..82c2288e2f 100644
 >     --- a/spec/build/testsuites/libtests/grp.yml
 >     +++ b/spec/build/testsuites/libtests/grp.yml
 >     @@ -316,6 +316,8 @@ links:
 >         uid: write
 >       - role: build-dependency
 >         uid: writev
 >     +- role: build-dependency
 >     +  uid: ofw01
 >       type: build
 >       use-after:
 >       - rtemstest
 >     diff --git a/spec/build/testsuites/libtests/ofw01.yml
 >     b/spec/build/testsuites/libtests/ofw01.yml
 >     new file mode 100644
 >     index 00..8517c58bad
 >     --- /dev/null
 >     +++ b/spec/build/testsuites/libtests/ofw01.yml
 >     @@ -0,0 +1,21 @@
 >     +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
 >     +build-type: test-program
 >     +cflags: []
 >     +copyrights:
 >     +- Copyright (C) 2020 Niteesh G S
 >     +cppflags: []
 >     +cxxflags: []
 >     +enabled-by: true
 >     +features: c cprogram
 >     +includes: []
 >     +ldflags:
 >     +- -Wl,--wrap=bsp_fdt_get
 >     +links: []
 >     +source:
 >     +- testsuites/libtests/ofw01/init.c
 >     +- testsuites/libtests/ofw01/some.c
 >     +stlib: []
 >     +target: testsuites/libtests/ofw01.exe
 >     +type: build
 >     +use-after: []
 >     +use-before: []
 >     diff --git a/testsuites/libtests/ofw01/init.c
 >     b/testsuites/libtests/ofw01/init.c
 >     new file mode 100644
 >     index 00..105c52c50e
 >     --- /dev/null
 >     +++ b/testsuites/libtests/ofw01/init.c
 >     @@ -0,0 +1,197 @@
 >     +/* SPDX-License-Identifier: BSD-2-Clause */
 >     +
 >     +/*
 >     + * Copyright (C) <2020> Niteesh G S mailto:niteesh...@gmail.com>
 >     >>
 >     + *
 >     + * Redistribution and use in source and binary forms, with
or without
 >     + * modification, are permitted provided that the following
conditions
 >     + * are met:
 

Re: [PATCH v3 2/2] libtests/ofw01: Added a test for RTEMS OFW

2020-12-19 Thread Niteesh G. S.
Hello Christian,

On Sat, Dec 19, 2020 at 7:11 PM Christian Mauderer 
wrote:

> Hello Niteesh,
>
> sorry, I somehow forget to check that patch set. I'll do it in the next
> few days.
>
No problem, please take your time :).

If you are on vacation, enjoy your vacations :)

Thanks,
Niteesh.

>
> Best regards
>
> Christian
>
> On 17/12/2020 12:15, Niteesh G. S. wrote:
> > ping.
> >
> >
> > On Fri, Dec 4, 2020 at 1:41 PM G S Niteesh Babu  > > wrote:
> >
> > This commit adds a basic test that tests all the implemented
> > RTEMS OFW functions.
> > ---
> >   spec/build/testsuites/libtests/grp.yml   |   2 +
> >   spec/build/testsuites/libtests/ofw01.yml |  21 +++
> >   testsuites/libtests/ofw01/init.c | 197
> +++
> >   testsuites/libtests/ofw01/ofw01.doc  |  29 
> >   testsuites/libtests/ofw01/ofw01.scn  |   2 +
> >   testsuites/libtests/ofw01/some.c |  72 +
> >   testsuites/libtests/ofw01/some.dts   |  76 +
> >   testsuites/libtests/ofw01/some.h |  15 ++
> >   8 files changed, 414 insertions(+)
> >   create mode 100644 spec/build/testsuites/libtests/ofw01.yml
> >   create mode 100644 testsuites/libtests/ofw01/init.c
> >   create mode 100644 testsuites/libtests/ofw01/ofw01.doc
> >   create mode 100644 testsuites/libtests/ofw01/ofw01.scn
> >   create mode 100644 testsuites/libtests/ofw01/some.c
> >   create mode 100644 testsuites/libtests/ofw01/some.dts
> >   create mode 100644 testsuites/libtests/ofw01/some.h
> >
> > diff --git a/spec/build/testsuites/libtests/grp.yml
> > b/spec/build/testsuites/libtests/grp.yml
> > index aff46c9f8f..82c2288e2f 100644
> > --- a/spec/build/testsuites/libtests/grp.yml
> > +++ b/spec/build/testsuites/libtests/grp.yml
> > @@ -316,6 +316,8 @@ links:
> > uid: write
> >   - role: build-dependency
> > uid: writev
> > +- role: build-dependency
> > +  uid: ofw01
> >   type: build
> >   use-after:
> >   - rtemstest
> > diff --git a/spec/build/testsuites/libtests/ofw01.yml
> > b/spec/build/testsuites/libtests/ofw01.yml
> > new file mode 100644
> > index 00..8517c58bad
> > --- /dev/null
> > +++ b/spec/build/testsuites/libtests/ofw01.yml
> > @@ -0,0 +1,21 @@
> > +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
> > +build-type: test-program
> > +cflags: []
> > +copyrights:
> > +- Copyright (C) 2020 Niteesh G S
> > +cppflags: []
> > +cxxflags: []
> > +enabled-by: true
> > +features: c cprogram
> > +includes: []
> > +ldflags:
> > +- -Wl,--wrap=bsp_fdt_get
> > +links: []
> > +source:
> > +- testsuites/libtests/ofw01/init.c
> > +- testsuites/libtests/ofw01/some.c
> > +stlib: []
> > +target: testsuites/libtests/ofw01.exe
> > +type: build
> > +use-after: []
> > +use-before: []
> > diff --git a/testsuites/libtests/ofw01/init.c
> > b/testsuites/libtests/ofw01/init.c
> > new file mode 100644
> > index 00..105c52c50e
> > --- /dev/null
> > +++ b/testsuites/libtests/ofw01/init.c
> > @@ -0,0 +1,197 @@
> > +/* SPDX-License-Identifier: BSD-2-Clause */
> > +
> > +/*
> > + * Copyright (C) <2020> Niteesh G S  > >
> > + *
> > + * 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 COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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.

Re: [PATCH v3 2/2] libtests/ofw01: Added a test for RTEMS OFW

2020-12-19 Thread Christian Mauderer

Hello Niteesh,

sorry, I somehow forget to check that patch set. I'll do it in the next 
few days.


Best regards

Christian

On 17/12/2020 12:15, Niteesh G. S. wrote:

ping.


On Fri, Dec 4, 2020 at 1:41 PM G S Niteesh Babu > wrote:


This commit adds a basic test that tests all the implemented
RTEMS OFW functions.
---
  spec/build/testsuites/libtests/grp.yml   |   2 +
  spec/build/testsuites/libtests/ofw01.yml |  21 +++
  testsuites/libtests/ofw01/init.c         | 197 +++
  testsuites/libtests/ofw01/ofw01.doc      |  29 
  testsuites/libtests/ofw01/ofw01.scn      |   2 +
  testsuites/libtests/ofw01/some.c         |  72 +
  testsuites/libtests/ofw01/some.dts       |  76 +
  testsuites/libtests/ofw01/some.h         |  15 ++
  8 files changed, 414 insertions(+)
  create mode 100644 spec/build/testsuites/libtests/ofw01.yml
  create mode 100644 testsuites/libtests/ofw01/init.c
  create mode 100644 testsuites/libtests/ofw01/ofw01.doc
  create mode 100644 testsuites/libtests/ofw01/ofw01.scn
  create mode 100644 testsuites/libtests/ofw01/some.c
  create mode 100644 testsuites/libtests/ofw01/some.dts
  create mode 100644 testsuites/libtests/ofw01/some.h

diff --git a/spec/build/testsuites/libtests/grp.yml
b/spec/build/testsuites/libtests/grp.yml
index aff46c9f8f..82c2288e2f 100644
--- a/spec/build/testsuites/libtests/grp.yml
+++ b/spec/build/testsuites/libtests/grp.yml
@@ -316,6 +316,8 @@ links:
    uid: write
  - role: build-dependency
    uid: writev
+- role: build-dependency
+  uid: ofw01
  type: build
  use-after:
  - rtemstest
diff --git a/spec/build/testsuites/libtests/ofw01.yml
b/spec/build/testsuites/libtests/ofw01.yml
new file mode 100644
index 00..8517c58bad
--- /dev/null
+++ b/spec/build/testsuites/libtests/ofw01.yml
@@ -0,0 +1,21 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+build-type: test-program
+cflags: []
+copyrights:
+- Copyright (C) 2020 Niteesh G S
+cppflags: []
+cxxflags: []
+enabled-by: true
+features: c cprogram
+includes: []
+ldflags:
+- -Wl,--wrap=bsp_fdt_get
+links: []
+source:
+- testsuites/libtests/ofw01/init.c
+- testsuites/libtests/ofw01/some.c
+stlib: []
+target: testsuites/libtests/ofw01.exe
+type: build
+use-after: []
+use-before: []
diff --git a/testsuites/libtests/ofw01/init.c
b/testsuites/libtests/ofw01/init.c
new file mode 100644
index 00..105c52c50e
--- /dev/null
+++ b/testsuites/libtests/ofw01/init.c
@@ -0,0 +1,197 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/*
+ * Copyright (C) <2020> Niteesh G S mailto:niteesh...@gmail.com>>
+ *
+ * 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 COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "some.h"
+
+#define BUF_SIZE 100
+
+const char rtems_test_name[] = "OFW 01";
+static const void *test_bin = NULL;
+
+const void *__wrap_bsp_fdt_get(void);
+const void *__real_bsp_fdt_get(void);
+
+const void *__wrap_bsp_fdt_get(void)
+{
+  if (test_bin != NULL) {
+    return test_bin;
+  }
+
+  return __real_bsp_fdt_get();
+}
+
+static void 

Re: [PATCH v3 2/2] libtests/ofw01: Added a test for RTEMS OFW

2020-12-17 Thread Niteesh G. S.
ping.


On Fri, Dec 4, 2020 at 1:41 PM G S Niteesh Babu 
wrote:

> This commit adds a basic test that tests all the implemented
> RTEMS OFW functions.
> ---
>  spec/build/testsuites/libtests/grp.yml   |   2 +
>  spec/build/testsuites/libtests/ofw01.yml |  21 +++
>  testsuites/libtests/ofw01/init.c | 197 +++
>  testsuites/libtests/ofw01/ofw01.doc  |  29 
>  testsuites/libtests/ofw01/ofw01.scn  |   2 +
>  testsuites/libtests/ofw01/some.c |  72 +
>  testsuites/libtests/ofw01/some.dts   |  76 +
>  testsuites/libtests/ofw01/some.h |  15 ++
>  8 files changed, 414 insertions(+)
>  create mode 100644 spec/build/testsuites/libtests/ofw01.yml
>  create mode 100644 testsuites/libtests/ofw01/init.c
>  create mode 100644 testsuites/libtests/ofw01/ofw01.doc
>  create mode 100644 testsuites/libtests/ofw01/ofw01.scn
>  create mode 100644 testsuites/libtests/ofw01/some.c
>  create mode 100644 testsuites/libtests/ofw01/some.dts
>  create mode 100644 testsuites/libtests/ofw01/some.h
>
> diff --git a/spec/build/testsuites/libtests/grp.yml
> b/spec/build/testsuites/libtests/grp.yml
> index aff46c9f8f..82c2288e2f 100644
> --- a/spec/build/testsuites/libtests/grp.yml
> +++ b/spec/build/testsuites/libtests/grp.yml
> @@ -316,6 +316,8 @@ links:
>uid: write
>  - role: build-dependency
>uid: writev
> +- role: build-dependency
> +  uid: ofw01
>  type: build
>  use-after:
>  - rtemstest
> diff --git a/spec/build/testsuites/libtests/ofw01.yml
> b/spec/build/testsuites/libtests/ofw01.yml
> new file mode 100644
> index 00..8517c58bad
> --- /dev/null
> +++ b/spec/build/testsuites/libtests/ofw01.yml
> @@ -0,0 +1,21 @@
> +SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
> +build-type: test-program
> +cflags: []
> +copyrights:
> +- Copyright (C) 2020 Niteesh G S
> +cppflags: []
> +cxxflags: []
> +enabled-by: true
> +features: c cprogram
> +includes: []
> +ldflags:
> +- -Wl,--wrap=bsp_fdt_get
> +links: []
> +source:
> +- testsuites/libtests/ofw01/init.c
> +- testsuites/libtests/ofw01/some.c
> +stlib: []
> +target: testsuites/libtests/ofw01.exe
> +type: build
> +use-after: []
> +use-before: []
> diff --git a/testsuites/libtests/ofw01/init.c
> b/testsuites/libtests/ofw01/init.c
> new file mode 100644
> index 00..105c52c50e
> --- /dev/null
> +++ b/testsuites/libtests/ofw01/init.c
> @@ -0,0 +1,197 @@
> +/* SPDX-License-Identifier: BSD-2-Clause */
> +
> +/*
> + * Copyright (C) <2020> Niteesh G S 
> + *
> + * 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 COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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.
> + */
> +
> +#ifdef HAVE_CONFIG_H
> +#include "config.h"
> +#endif
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include "some.h"
> +
> +#define BUF_SIZE 100
> +
> +const char rtems_test_name[] = "OFW 01";
> +static const void *test_bin = NULL;
> +
> +const void *__wrap_bsp_fdt_get(void);
> +const void *__real_bsp_fdt_get(void);
> +
> +const void *__wrap_bsp_fdt_get(void)
> +{
> +  if (test_bin != NULL) {
> +return test_bin;
> +  }
> +
> +  return __real_bsp_fdt_get();
> +}
> +
> +static void Init(rtems_task_argument arg)
> +{
> +  int rv;
> +  phandle_t d;
> +  phandle_t l;
> +  phandle_t t;
> +  phandle_t c;
> +  phandle_t a;
> +  phandle_t b;
> +  phandle_t q;
> +  phandle_t root;
> +  phandle_t temp;
> +  uint32_t *arr;
> +  char buf[BUF_SIZE];
> +  char *bufp;
> +  ssize_t buf_len;
> +  rtems_ofw_memory_area reg;
> +  rtems_ofw_memory_area regs[2];
> +  rtems_vector_number intr;
> +  rtems_vector_number intrs[2];
> +  TEST_BEGIN();
> +  buf_len = sizeof(buf);
> +
> +  /*
> +   * Reinitializing the OFW API to use the test

[PATCH v3 2/2] libtests/ofw01: Added a test for RTEMS OFW

2020-12-04 Thread G S Niteesh Babu
This commit adds a basic test that tests all the implemented
RTEMS OFW functions.
---
 spec/build/testsuites/libtests/grp.yml   |   2 +
 spec/build/testsuites/libtests/ofw01.yml |  21 +++
 testsuites/libtests/ofw01/init.c | 197 +++
 testsuites/libtests/ofw01/ofw01.doc  |  29 
 testsuites/libtests/ofw01/ofw01.scn  |   2 +
 testsuites/libtests/ofw01/some.c |  72 +
 testsuites/libtests/ofw01/some.dts   |  76 +
 testsuites/libtests/ofw01/some.h |  15 ++
 8 files changed, 414 insertions(+)
 create mode 100644 spec/build/testsuites/libtests/ofw01.yml
 create mode 100644 testsuites/libtests/ofw01/init.c
 create mode 100644 testsuites/libtests/ofw01/ofw01.doc
 create mode 100644 testsuites/libtests/ofw01/ofw01.scn
 create mode 100644 testsuites/libtests/ofw01/some.c
 create mode 100644 testsuites/libtests/ofw01/some.dts
 create mode 100644 testsuites/libtests/ofw01/some.h

diff --git a/spec/build/testsuites/libtests/grp.yml 
b/spec/build/testsuites/libtests/grp.yml
index aff46c9f8f..82c2288e2f 100644
--- a/spec/build/testsuites/libtests/grp.yml
+++ b/spec/build/testsuites/libtests/grp.yml
@@ -316,6 +316,8 @@ links:
   uid: write
 - role: build-dependency
   uid: writev
+- role: build-dependency
+  uid: ofw01
 type: build
 use-after:
 - rtemstest
diff --git a/spec/build/testsuites/libtests/ofw01.yml 
b/spec/build/testsuites/libtests/ofw01.yml
new file mode 100644
index 00..8517c58bad
--- /dev/null
+++ b/spec/build/testsuites/libtests/ofw01.yml
@@ -0,0 +1,21 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+build-type: test-program
+cflags: []
+copyrights:
+- Copyright (C) 2020 Niteesh G S
+cppflags: []
+cxxflags: []
+enabled-by: true
+features: c cprogram
+includes: []
+ldflags:
+- -Wl,--wrap=bsp_fdt_get
+links: []
+source:
+- testsuites/libtests/ofw01/init.c
+- testsuites/libtests/ofw01/some.c
+stlib: []
+target: testsuites/libtests/ofw01.exe
+type: build
+use-after: []
+use-before: []
diff --git a/testsuites/libtests/ofw01/init.c b/testsuites/libtests/ofw01/init.c
new file mode 100644
index 00..105c52c50e
--- /dev/null
+++ b/testsuites/libtests/ofw01/init.c
@@ -0,0 +1,197 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/*
+ * Copyright (C) <2020> Niteesh G S 
+ *
+ * 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 COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "some.h"
+
+#define BUF_SIZE 100
+
+const char rtems_test_name[] = "OFW 01";
+static const void *test_bin = NULL;
+
+const void *__wrap_bsp_fdt_get(void);
+const void *__real_bsp_fdt_get(void);
+
+const void *__wrap_bsp_fdt_get(void)
+{
+  if (test_bin != NULL) {
+return test_bin;
+  }
+
+  return __real_bsp_fdt_get();
+}
+
+static void Init(rtems_task_argument arg)
+{
+  int rv;
+  phandle_t d;
+  phandle_t l;
+  phandle_t t;
+  phandle_t c;
+  phandle_t a;
+  phandle_t b;
+  phandle_t q;
+  phandle_t root;
+  phandle_t temp;
+  uint32_t *arr;
+  char buf[BUF_SIZE];
+  char *bufp;
+  ssize_t buf_len;
+  rtems_ofw_memory_area reg;
+  rtems_ofw_memory_area regs[2];
+  rtems_vector_number intr;
+  rtems_vector_number intrs[2];
+  TEST_BEGIN();
+  buf_len = sizeof(buf);
+
+  /*
+   * Reinitializing the OFW API to use the test
+   * FDT instead of the original FDT.
+   */
+  test_bin = some_bin;
+  rtems_ofw_init();
+
+  /*
+   * Cannot use fdt_path_offset to compare because
+   * the OF interface uses the offset from the ftdp
+   * to the node as phandle.
+   */
+  root = rtems_ofw_find_device("/");
+  rtems_test_assert(root == 56);
+
+  root = rtems_ofw_peer(0);
+  rtems_test_assert(root == 56);
+