[tools 2/2] linkers: Print a proper 0x-hex number

2023-10-16 Thread Sebastian Huber
It is so easy in standard C++.
---
 linkers/rtems-syms.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/linkers/rtems-syms.cpp b/linkers/rtems-syms.cpp
index f6b207f..88ee970 100644
--- a/linkers/rtems-syms.cpp
+++ b/linkers/rtems-syms.cpp
@@ -305,7 +305,8 @@ output_sym::operator ()(const 
rld::symbols::symtab::value_type& value)
 val = sym.name ();
   } else {
 std::stringstream oss;
-oss << std::hex << std::setfill ('0') << std::setw (8) << 
sym.value ();
+oss << std::hex << std::showbase << std::internal <<
+  std::setfill ('0') << std::setw (10) << sym.value ();
 val = oss.str ();
   }
 }
-- 
2.35.3

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


[tools 1/2] linker: Fix typo in symbol table generator

2023-10-16 Thread Sebastian Huber
Updates #4920.
---
 linkers/rtems-syms.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/linkers/rtems-syms.cpp b/linkers/rtems-syms.cpp
index c72ee55..f6b207f 100644
--- a/linkers/rtems-syms.cpp
+++ b/linkers/rtems-syms.cpp
@@ -142,7 +142,7 @@ static const char* c_rtl_call_body[] =
   "{",
   "  rtems_rtl_base_sym_global_add (&rtems__rtl_base_globals[0],",
   " rtems__rtl_base_globals_size[0],",
-  " NULL",
+  " NULL,",
   " 0);",
   "}",
   0
-- 
2.35.3

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


device tree loading from uboot.

2023-10-16 Thread Sam Price
i want to test the device tree loading stuff in qemu.
I don't see a way to set the r5 register on startup via command line in qemu.


void bsp_fdt_copy(const void *src)
{
  const volatile uint32_t *s = (const uint32_t *) src;

im tempted to either hard code the src location rather than passing it in via r5
or add a check if the passed in value is null then use a hard coded address.
if(src == 0x0)
{
  s = BSP_START_COPY_FDT_ADDRESS;
}

qemu can then take a address for the device tree file and place it in
the proper memory address

-device loader,file=$DTB_FILE,addr=$BSP_START_COPY_FDT_ADDRESS,force-raw=true \

Does this seem reasonable or is there a way people are testing device
tree support in qemu by setting the r5 register on startup?

-- 
Sincerely,

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


Re: [tools 1/2] linker: Fix typo in symbol table generator

2023-10-16 Thread Chris Johns
OK

Thanks
Chris

On 16/10/2023 9:47 pm, Sebastian Huber wrote:
> Updates #4920.
> ---
>  linkers/rtems-syms.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/linkers/rtems-syms.cpp b/linkers/rtems-syms.cpp
> index c72ee55..f6b207f 100644
> --- a/linkers/rtems-syms.cpp
> +++ b/linkers/rtems-syms.cpp
> @@ -142,7 +142,7 @@ static const char* c_rtl_call_body[] =
>"{",
>"  rtems_rtl_base_sym_global_add (&rtems__rtl_base_globals[0],",
>" rtems__rtl_base_globals_size[0],",
> -  " NULL",
> +  " NULL,",
>" 0);",
>"}",
>0
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel