This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
ARM - Minor macro fix
- From: Gary Thomas <gary at mlbassoc dot com>
- To: eCos patches <ecos-patches at sources dot redhat dot com>
- Date: 13 Feb 2003 07:28:48 -0700
- Subject: ARM - Minor macro fix
Index: hal/arm/arch/current/src/redboot_linux_exec.c
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/hal/arm/arch/current/src/redboot_linux_exec.c,v
retrieving revision 1.7
diff -u -5 -p -r1.7 redboot_linux_exec.c
--- hal/arm/arch/current/src/redboot_linux_exec.c 12 Feb 2003 21:05:24 -0000 1.7
+++ hal/arm/arch/current/src/redboot_linux_exec.c 13 Feb 2003 14:17:59 -0000
@@ -250,20 +250,22 @@ struct tag {
// Default memory layout - can be overridden by platform, typically in
// <cyg/hal/plf_io.h>
#ifndef CYGHWR_REDBOOT_LINUX_ATAG_MEM
#define CYGHWR_REDBOOT_LINUX_ATAG_MEM(_p_) \
+ CYG_MACRO_START \
/* Next ATAG_MEM. */ \
_p_->hdr.size = (sizeof(struct tag_mem32) + sizeof(struct tag_header))/sizeof(long); \
_p_->hdr.tag = ATAG_MEM; \
/* 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. \
*/ \
_p_->u.mem.size = 1<<hal_msbindex(CYGMEM_REGION_ram_SIZE); \
if (_p_->u.mem.size < CYGMEM_REGION_ram_SIZE) \
_p_->u.mem.size <<= 1; \
- _p_->u.mem.start = CYGARC_PHYSICAL_ADDRESS(CYGMEM_REGION_ram);
+ _p_->u.mem.start = CYGARC_PHYSICAL_ADDRESS(CYGMEM_REGION_ram); \
+ CYG_MACRO_END
#endif
// Round up a quantity to a longword (32 bit) length
#define ROUNDUP(n) (((n)+3)&~3)
@@ -318,12 +320,14 @@ do_exec(int argc, char *argv[])
params->hdr.tag = ATAG_CORE;
params->u.core.flags = 0;
params->u.core.pagesize = 0;
params->u.core.rootdev = 0;
params = (struct tag *)((long *)params + params->hdr.size);
-
+
+ // Fill in the details of the memory layout
CYGHWR_REDBOOT_LINUX_ATAG_MEM(params)
+
params = (struct tag *)((long *)params + params->hdr.size);
if (ramdisk_addr_set) {
params->hdr.size = (sizeof(struct tag_initrd) + sizeof(struct tag_header))/sizeof(long);
params->hdr.tag = ATAG_INITRD2;
params->u.initrd.start = CYGARC_PHYSICAL_ADDRESS(ramdisk_addr);
@@ -360,11 +364,11 @@ do_exec(int argc, char *argv[])
}
}
if (!base_addr_set) {
if ((base_addr == 0) || (length == 0)) {
// Probably not valid - don't try it
- diag_printf("No default base address set!\n");
+ diag_printf("Base address unknown - use \"-b\" option\n");
return;
}
diag_printf("Using base address %p and length %p\n",
(void*)base_addr, (void*)length);
} else if (base_addr_set && !length_set) {
--
------------------------------------------------------------
Gary Thomas |
MLB Associates | Consulting for the
+1 (970) 229-1963 | Embedded world
http://www.mlbassoc.com/ |
email: <gary@mlbassoc.com> |
gpg: http://www.chez-thomas.org/gary/gpg_key.asc
------------------------------------------------------------