This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RedBoot - arm-linux ATAG_MEM


2002-07-16  Robin Farine  <robin.farine@acn-group.ch>

	* redboot_linux_exec.c: CYGHW_REDBOOT_LINUX_ATAG_MEM(params) hook
	for platform specific ATAG_MEM setup

Index: packages/hal/arm/arch/current/src/redboot_linux_exec.c
===================================================================
RCS file: /home/cvs/eCos/base/packages/hal/arm/arch/current/src/redboot_linux_exec.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- packages/hal/arm/arch/current/src/redboot_linux_exec.c	5 Jun 2002 16:20:21 -0000	1.1.1.1
+++ packages/hal/arm/arch/current/src/redboot_linux_exec.c	16 Jul 2002 11:27:49 -0000	1.2
@@ -76,6 +76,23 @@
 # define CYGARC_PHYSICAL_ADDRESS(x) (x)
 #endif
 
+#ifndef CYGHW_REDBOOT_LINUX_ATAG_MEM
+#define CYGHW_REDBOOT_LINUX_ATAG_MEM(_p_)                               \
+    CYG_MACRO_START                                                     \
+    _p_->hdr.size = (sizeof(struct tag_mem32) +                         \
+                     sizeof(struct tag_header))/sizeof(long);           \
+    _p_->hdr.tag = ATAG_MEM;                                            \
+    _p_->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.          \
+     */                                                                 \
+    _p_->u.mem.size  = 1<<hal_msbindex(CYGMEM_REGION_ram_SIZE);         \
+    if (_p_->u.mem.size < CYGMEM_REGION_ram_SIZE << 1)                  \
+	    _p_->u.mem.size <<= 1;                                      \
+    _p_ = (struct tag *)((long *)_p_ + _p_->hdr.size);                  \
+    CYG_MACRO_END
+#endif // CYGHW_REDBOOT_LINUX_ATAG_MEM
+
 // FIXME: This should be a CDL variable, and CYGSEM_REDBOOT_ARM_LINUX_BOOT
 //        active_if  CYGHWR_HAL_ARM_REDBOOT_MACHINE_TYPE>0
 #ifdef HAL_PLATFORM_MACHINE_TYPE
@@ -294,16 +311,7 @@
     params = (struct tag *)((long *)params + params->hdr.size);
     
     /* 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);
+    CYGHW_REDBOOT_LINUX_ATAG_MEM(params);
 
     if (ramdisk_addr_set) {
         params->hdr.size = (sizeof(struct tag_initrd) + sizeof(struct tag_header))/sizeof(long);



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]