imgtools/imaker/src/imaker_odp.mk
changeset 596 9f25be3da657
parent 584 56dd7656a965
--- a/imgtools/imaker/src/imaker_odp.mk	Fri Jun 18 13:49:03 2010 +0300
+++ b/imgtools/imaker/src/imaker_odp.mk	Thu Jun 24 10:35:05 2010 +0300
@@ -18,46 +18,71 @@
 
 USE_PAGING = 0
 
-USE_PAGEDROM  = $(if $(filter rom code code:%,$(call lcase,$(USE_PAGING))),1,0)
+USE_PAGEDROM  = $(if $(or $(call true,$(USE_PAGEDCODE)$(USE_PAGEDDATA)),$(filter rom,$(call lcase,$(USE_PAGING)))),1,0)
 USE_PAGEDCODE = $(call _getcodedp)
+USE_PAGEDDATA = $(if $(filter data,$(call lcase,$(USE_PAGING))),1,0)
 
 ODP_CONFDIR  = $(E32ROM)/configpaging
-ODP_PAGEFILE = configpaging.cfg
+ODP_PAGEFILE = $(call iif,$(USE_PAGEDDATA),configpaging_wdp.cfg,configpaging.cfg)
 ODP_CODECOMP = bytepair
 
-#             Min    Max    Young/Old   NAND page read  NAND page read
-#             live   live   page ratio  delay           CPU overhead
-#             pages  pages              (microseconds)  (microseconds)
-ODP_ROMCONF = 1024   2048     3           0               0
+ODP_ROMCONF =\
+  $(or $(SYMBIAN_ODP_NUMBER_OF_MIN_LIVE_PAGES),1024)\
+  $(or $(SYMBIAN_ODP_NUMBER_OF_MAX_LIVE_PAGES),2048)\
+  $(or $(SYMBIAN_ODP_YOUNG_OLD_PAGE_RATIO),3)\
+  $(or $(SYMBIAN_ODP_NAND_PAGE_READ_DELAY),0)\
+  $(or $(SYMBIAN_ODP_NAND_PAGE_NAND_PAGE_READ_CPU_OVERHEAD),0)
 
-# Section for Rombuild phase on all Demand Paging builds
+# Section for Rombuild on all Demand Paging builds
 #
 define ODP_ROMINFO
+  $(call iif,$(USE_PAGEDDATA),
+    #if defined(FF_WDP_EMMC) && defined(FF_WDP_NAND)
+      #error ERROR: Both of the flags FF_WDP_EMMC and FF_WDP_NAND are defined!
+    #elif !defined(FF_WDP_EMMC) && !defined(FF_WDP_NAND)
+      #error ERROR: One of the flags FF_WDP_EMMC or FF_WDP_NAND should be defined!
+    #endif
+    ,
+    #undef FF_WDP_EMMC
+    #undef FF_WDP_NAND
+  )
   $(call iif,$(USE_PAGEDROM),
     #define PAGED_ROM
     ROMBUILD_OPTION -geninc
-    demandpagingconfig $(strip $(ODP_ROMCONF))
-    pagingoverride defaultpaged
     pagedrom
     compress
+    demandpagingconfig $(strip $(ODP_ROMCONF))
+    codepagingoverride defaultpaged
+    $(call iif,$(USE_PAGEDDATA),
+      datapagingoverride defaultunpaged
+      ,
+      datapagingoverride nopaging)
   )
   $(if $(filter 1,$(USE_PAGEDCODE)),
     #define PAGED_CODE
-    pagingpolicy defaultpaged
+    codepagingpolicy defaultpaged
+    $(call iif,$(USE_PAGEDDATA),
+      datapagingpolicy defaultunpaged
+      ,
+      datapagingpolicy nopaging)
   )
   $(if $(CORE_PAGEFILE),$(call iif,$(USE_PAGEDROM)$(filter 1,$(USE_PAGEDCODE)),
-    externaltool=configpaging:$(CORE_PAGEFILE))
-  )
+    externaltool=configpaging:$(CORE_PAGEFILE)))
 endef
 
-# Section for Rofsbuild phase on Code DP enabled builds
+# Section for Rofsbuild on Code/Data DP enabled builds
 #
-define ODP_CODEINFO
-  $(if $(filter $1,$(USE_PAGEDCODE)),
+define ODP_ROFSINFO
+  $(if $(filter $(IMAGE_ID),$(USE_PAGEDCODE)),
     #define PAGED_CODE
-    $(if $(ROFS$1_PAGEFILE),
-      externaltool=configpaging:$(ROFS$1_PAGEFILE))
-    pagingoverride defaultpaged
+    codepagingoverride defaultpaged
+    $(call iif,$(USE_PAGEDDATA),
+      datapagingoverride defaultunpaged
+      ,
+      datapagingoverride nopaging
+    )
+    $(if $(ROFS$(IMAGE_ID)_PAGEFILE),
+      externaltool=configpaging:$(ROFS$(IMAGE_ID)_PAGEFILE))
   )
 endef
 
@@ -66,10 +91,11 @@
 # Internal stuff
 
 _getcodedp = $(or $(strip\
-  $(if $(filter code code:,$(eval __i_paging := $(call lcase,$(call sstrip,$(USE_PAGING))))$(__i_paging)),\
-    $(foreach rofs,1 2 3 4 5 6,$(call iif,$(USE_ROFS$(rofs)),$(rofs))),\
-    $(if $(filter code:%,$(__i_paging)),\
-      $(foreach rofs,1 2 3 4 5 6,$(findstring $(rofs),$(__i_paging)))))),0)
+  $(eval __i_paging := $(call lcase,$(USE_PAGING)))\
+  $(foreach rofs,$(if $(filter code:%,$(__i_paging)),\
+    $(foreach rofs,1 2 3 4 5 6,$(findstring $(rofs),$(__i_paging))),\
+    $(if $(or $(call true,$(USE_PAGEDDATA)),$(filter code,$(__i_paging))),1 2 3 4 5 6)),\
+      $(call iif,$(USE_ROFS$(rofs)),$(rofs)))),0)
 
 
 # END OF IMAKER_ODP.MK