[ECOS] Size of memory in ATAG_MEM (hal/arm/arch/.../redboot_linux_exec.c)

Xavier Debreuil xavier.debreuil@inventel.fr
Tue Nov 26 04:38:00 GMT 2002


I don't understand why the kernel does not receive the size of ram we 
assigned to CYGMEM_REGION_ram_SIZE.
For a simple implementation, one SDRAM bank of 32Mbytes, 
redboot_linux_exec.c tells the kernel that mem.size is 64Mbytes.

     /* Next ATAG_MEM. */
     params->hdr.size = (sizeof(struct tag_mem32) + sizeof(struct 
tag_header))/sizeof(long);
     params->hdr.tag = ATAG_MEM;
     params->u.mem.start = CYGARC_PHYSICAL_ADDRESS(CYGMEM_REGION_ram);
     /* Round up so there's only one bit set in the memory size.
      * Don't double it if it's already a power of two, though.
      */
     params->u.mem.size  = 1<<hal_msbindex(CYGMEM_REGION_ram_SIZE);
-->    if (params->u.mem.size < CYGMEM_REGION_ram_SIZE << 1)
-->            params->u.mem.size <<= 1;
     params = (struct tag *)((long *)params + params->hdr.size);

If it's already a power of two, params->u.mem.size is equal to 
CYGMEM_REGION_ram_SIZE.

But, I think the previous test is always true.
Don''t you think it should be :

-->    if (params->u.mem.size < CYGMEM_REGION_ram_SIZE)
-->            params->u.mem.size <<= 1;

At least, it would solve the problem for simple architecture like mine, but 
perhaps it is wrong for others.

Xavier


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss



More information about the Ecos-discuss mailing list