Author: wmb Date: 2008-02-04 10:39:55 +0100 (Mon, 04 Feb 2008) New Revision: 811
Modified: dev/mmc/sdhci/sdhci.fth Log: OLPC trac 6230 - Added count of simultaneous opens to sdhci.fth so that multiple files can be open without losing the host controller when one file is closed.
Modified: dev/mmc/sdhci/sdhci.fth =================================================================== --- dev/mmc/sdhci/sdhci.fth 2008-02-02 20:52:14 UTC (rev 810) +++ dev/mmc/sdhci/sdhci.fth 2008-02-04 09:39:55 UTC (rev 811) @@ -587,17 +587,24 @@ dma-len /block / ;
+0 value open-count : open ( -- ) - map-regs - setup-host + open-count 0= if + map-regs + setup-host + then + open-count 1+ to open-count true ;
: close ( -- ) - wait-write-done - card-clock-off - card-power-off - unmap-regs + open-count 1 = if + wait-write-done + card-clock-off + card-power-off + unmap-regs + then + open-count 1- 0 max to open-count ;
: init ( -- )