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]

Re: i386: allow platforms to override HAL_MEM_REAL_REGION_TOP


Andrew Lunn wrote:
> 
> So Ian's suggestion to move hal_i386_mem_real_region_top into the PC
> package is correct?

Something like this?

David Vrabel
-- 
David Vrabel, Design Engineer

Arcom, Clifton Road           Tel: +44 (0)1223 411200 ext. 3233
Cambridge CB1 7EA, UK         Web: http://www.arcom.com/
Index: ecos-working/packages/hal/i386/pc/current/cdl/hal_i386_pc.cdl
===================================================================
--- ecos-working.orig/packages/hal/i386/pc/current/cdl/hal_i386_pc.cdl	2005-04-17 13:11:13.000000000 +0100
+++ ecos-working/packages/hal/i386/pc/current/cdl/hal_i386_pc.cdl	2005-04-25 11:39:07.000000000 +0100
@@ -76,6 +76,31 @@
         puts $::cdl_header ""
     }
 
+    cdl_component CYGPKG_HAL_I386_PC_MEMSIZE {
+        display       "How to discover the size of available RAM."
+        flavor        data
+        legal_values  {"BIOS" "HARDCODE"}
+        default_value {"BIOS"}
+        description   "It is possible for the HAL to discover the 
+                       size of RAM In several ways. Currently this
+                        can be done by querying the BIOS or by 
+                        hardcoding the values into the executable."
+ 
+        cdl_option CYGNUM_HAL_I386_PC_MEMSIZE_BASE {
+            display       "Amount of Base RAM available."
+            flavor        data
+            default_value 0x000F0000
+            active_if     { CYGPKG_HAL_I386_PC_MEMSIZE == "HARDCODE" }
+        }
+ 
+        cdl_option CYGNUM_HAL_I386_PC_MEMSIZE_EXTENDED {
+            display       "Amount of Extended RAM available."
+            flavor        data
+            default_value 0x00100000
+            active_if     { CYGPKG_HAL_I386_PC_MEMSIZE == "HARDCODE" }
+        }
+    }
+
     cdl_component CYG_HAL_STARTUP {
         display       "Startup type"
         flavor        data
Index: ecos-working/packages/hal/i386/pc/current/src/plf_misc.c
===================================================================
--- ecos-working.orig/packages/hal/i386/pc/current/src/plf_misc.c	2002-12-01 15:48:35.000000000 +0000
+++ ecos-working/packages/hal/i386/pc/current/src/plf_misc.c	2005-04-25 11:50:38.000000000 +0100
@@ -87,6 +87,9 @@
 __externC void cyg_hal_smp_init(void);
 #endif
 
+CYG_ADDRWORD cyg_hal_pc_memsize_base;
+CYG_ADDRWORD cyg_hal_pc_memsize_extended;
+
 //----------------------------------------------------------------------------
 // ISR tables
 
@@ -117,6 +120,33 @@
     HAL_DCACHE_INVALIDATE_ALL();
     HAL_DCACHE_ENABLE();
 
+#ifdef CYGPKG_HAL_I386_PC_MEMSIZE_HARDCODE
+    cyg_hal_pc_memsize_base = CYGNUM_HAL_I386_PC_MEMSIZE_BASE;
+    cyg_hal_pc_memsize_extended = CYGNUM_HAL_I386_PC_MEMSIZE_EXTENDED;
+#endif
+
+#ifdef CYGPKG_HAL_I386_PC_MEMSIZE_BIOS
+    cyg_uint8 lo,hi;
+    
+    HAL_READ_CMOS( 0x15, lo );
+    HAL_READ_CMOS( 0x16, hi );
+
+    cyg_hal_pc_memsize_base = ((hi<<8)+lo)*1024;
+
+#ifndef CYG_HAL_STARTUP_ROM
+    // If we started up under a BIOS, then it will have put
+    // the discovered extended memory size in CMOS bytes 30/31.
+    HAL_READ_CMOS( 0x30, lo );
+    HAL_READ_CMOS( 0x31, hi );
+#else
+    // 
+    HAL_READ_CMOS( 0x17, lo );
+    HAL_READ_CMOS( 0x18, hi );
+#endif
+
+    cyg_hal_pc_memsize_extended = ((hi<<8)+lo)*1024;
+#endif
+
     // Call motherboard init function
     hal_pcmb_init();
     
@@ -174,6 +204,19 @@
     
 }
 
+cyg_uint8 *hal_i386_mem_real_region_top( cyg_uint8 *regionend )
+{
+    CYG_ASSERT( cyg_hal_pc_memsize_base > 0 , "No base RAM size set!");
+    CYG_ASSERT( cyg_hal_pc_memsize_extended > 0 , "No extended RAM size set!");
+
+    if( (CYG_ADDRESS)regionend <= 0x000A0000 )
+        regionend = (cyg_uint8 *)cyg_hal_pc_memsize_base;
+    else if( (CYG_ADDRESS)regionend >= 0x00100000 )
+        regionend = (cyg_uint8 *)cyg_hal_pc_memsize_extended+0x00100000;
+
+    return regionend;
+}
+
 /*------------------------------------------------------------------------*/
 
 void hal_pc_reset(void)
Index: ecos-working/packages/hal/i386/pcmb/current/cdl/hal_i386_pcmb.cdl
===================================================================
--- ecos-working.orig/packages/hal/i386/pcmb/current/cdl/hal_i386_pcmb.cdl	2005-03-21 15:05:37.000000000 +0000
+++ ecos-working/packages/hal/i386/pcmb/current/cdl/hal_i386_pcmb.cdl	2005-04-25 11:37:41.000000000 +0100
@@ -97,31 +97,6 @@
         }
     }
 
-    cdl_component CYGPKG_HAL_I386_PCMB_MEMSIZE {
-        display       "How to discover the size of available RAM."
-        flavor        data
-        legal_values  {"BIOS" "HARDCODE"}
-        default_value {"BIOS"}
-        description   "It is possible for the HAL to discover the 
-                       size of RAM In several ways. Currently this
-                        can be done by querying the BIOS or by 
-                        hardcoding the values into the executable."
- 
-        cdl_option CYGNUM_HAL_I386_PCMB_MEMSIZE_BASE {
-            display       "Amount of Base RAM available."
-            flavor        data
-            default_value 0x000F0000
-            active_if     { CYGPKG_HAL_I386_PCMB_MEMSIZE == "HARDCODE" }
-        }
- 
-        cdl_option CYGNUM_HAL_I386_PCMB_MEMSIZE_EXTENDED {
-            display       "Amount of Extended RAM available."
-            flavor        data
-            default_value 0x00100000
-            active_if     { CYGPKG_HAL_I386_PCMB_MEMSIZE == "HARDCODE" }
-        }
-    }
-
     cdl_option CYGSEM_HAL_I386_PC_LARGE_PCI_SPACE {
 	display           "Search entire PCI space"
 	flavor            bool
Index: ecos-working/packages/hal/i386/pcmb/current/src/pcmb_misc.c
===================================================================
--- ecos-working.orig/packages/hal/i386/pcmb/current/src/pcmb_misc.c	2005-03-21 15:05:36.000000000 +0000
+++ ecos-working/packages/hal/i386/pcmb/current/src/pcmb_misc.c	2005-04-25 11:45:56.000000000 +0100
@@ -75,41 +75,11 @@
 /*------------------------------------------------------------------------*/
 // Static variables
 
-CYG_ADDRWORD cyg_hal_pcmb_memsize_base;
-CYG_ADDRWORD cyg_hal_pcmb_memsize_extended;
-
 /*------------------------------------------------------------------------*/
 // Initializer
 
 void hal_pcmb_init(void)
 {
-#ifdef CYGPKG_HAL_I386_PCMB_MEMSIZE_HARDCODE
-    cyg_hal_pcmb_memsize_base = CYGNUM_HAL_I386_PCMB_MEMSIZE_BASE;
-    cyg_hal_pcmb_memsize_extended = CYGNUM_HAL_I386_PCMB_MEMSIZE_EXTENDED;
-#endif
-
-#ifdef CYGPKG_HAL_I386_PCMB_MEMSIZE_BIOS
-    cyg_uint8 lo,hi;
-    
-    HAL_READ_CMOS( 0x15, lo );
-    HAL_READ_CMOS( 0x16, hi );
-
-    cyg_hal_pcmb_memsize_base = ((hi<<8)+lo)*1024;
-
-#ifndef CYG_HAL_STARTUP_ROM
-    // If we started up under a BIOS, then it will have put
-    // the discovered extended memory size in CMOS bytes 30/31.
-    HAL_READ_CMOS( 0x30, lo );
-    HAL_READ_CMOS( 0x31, hi );
-#else
-    // 
-    HAL_READ_CMOS( 0x17, lo );
-    HAL_READ_CMOS( 0x18, hi );
-#endif
-
-    cyg_hal_pcmb_memsize_extended = ((hi<<8)+lo)*1024;
-#endif
-
     // Disable NMI - this can be reenabled later, once a proper handler
     // is registered and ready to handle events
     HAL_WRITE_UINT8(0x70, 0x80);
@@ -117,19 +87,6 @@
 
 /*------------------------------------------------------------------------*/
 
-cyg_uint8 *hal_i386_mem_real_region_top( cyg_uint8 *regionend )
-{
-    CYG_ASSERT( cyg_hal_pcmb_memsize_base > 0 , "No base RAM size set!");
-    CYG_ASSERT( cyg_hal_pcmb_memsize_extended > 0 , "No extended RAM size set!");
-
-    if( (CYG_ADDRESS)regionend <= 0x000A0000 )
-        regionend = (cyg_uint8 *)cyg_hal_pcmb_memsize_base;
-    else if( (CYG_ADDRESS)regionend >= 0x00100000 )
-        regionend = (cyg_uint8 *)cyg_hal_pcmb_memsize_extended+0x00100000;
-
-    return regionend;
-}
-
 /*------------------------------------------------------------------------*/
 // Clock initialization and access
 

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