[Tinyos-2-commits] CVS: tinyos-2.x/tos/chips/at45db At45dbStorageManagerC.nc, NONE, 1.1.2.1 At45dbVolume.nc, 1.1.2.4, 1.1.2.5 BlockStorageC.nc, 1.1.2.6, 1.1.2.7 BlockStorageP.nc, 1.1.2.13, 1.1.2.14 ConfigStorageC.nc, 1.1.2.4, 1.1.2.5 LogStorageC.nc, 1.1.2.3, 1.1.2.4 StorageManagerP.nc, 1.1.2.4, NONE

David Gay idgay at users.sourceforge.net
Fri Jun 2 09:36:25 PDT 2006


Update of /cvsroot/tinyos/tinyos-2.x/tos/chips/at45db
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv12021

Modified Files:
      Tag: tinyos-2_0_devel-BRANCH
	At45dbVolume.nc BlockStorageC.nc BlockStorageP.nc 
	ConfigStorageC.nc LogStorageC.nc 
Added Files:
      Tag: tinyos-2_0_devel-BRANCH
	At45dbStorageManagerC.nc 
Removed Files:
      Tag: tinyos-2_0_devel-BRANCH
	StorageManagerP.nc 
Log Message:
make volume management public


--- NEW FILE: At45dbStorageManagerC.nc ---
/*
 * Copyright (c) 2006 Intel Corporation
 * All rights reserved.
 *
 * This file is distributed under the terms in the attached INTEL-LICENSE     
 * file. If you do not find these files, copies can be found by writing to
 * Intel Research Berkeley, 2150 Shattuck Avenue, Suite 1300, Berkeley, CA, 
 * 94704.  Attention:  Intel License Inquiry.
 */

/**
 * HAL component providing information on the flash volumes.
 *
 * @author: David Gay <dgay at acm.org>
 */

module At45dbStorageManagerC {
  provides interface At45dbVolume[volume_id_t volid];
}
implementation {
  command at45page_t At45dbVolume.remap[volume_id_t volid](at45page_t volumePage) {
    switch (volid)
      {
#define VB(id, base) case id: return volumePage + base;
#include "StorageVolumes.h"
      default: return AT45_MAX_PAGES;
      }
  }

  command at45page_t At45dbVolume.volumeSize[volume_id_t volid]() {
    switch (volid)
      {
#define VS(id, size) case id: return size;
#include "StorageVolumes.h"
      default: return 0;
      }
  }
}

Index: At45dbVolume.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/at45db/Attic/At45dbVolume.nc,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -C2 -d -r1.1.2.4 -r1.1.2.5
*** At45dbVolume.nc	30 May 2006 21:36:27 -0000	1.1.2.4
--- At45dbVolume.nc	2 Jun 2006 16:36:23 -0000	1.1.2.5
***************
*** 12,16 ****
  
  /**
!  * Internal AT45DB interface for managing flash volumes.
   *
   * @author David Gay
--- 12,16 ----
  
  /**
!  * AT45DB interface for managing flash volumes.
   *
   * @author David Gay
***************
*** 20,24 ****
     * Map a volume page to the corresponding page in the whole flash
     * @return What flash page this volume page maps to, or 
!    *   AT45_MAX_PAGES for invalid requests (out of volume)
     */
    command at45page_t remap(at45page_t volumePage);
--- 20,24 ----
     * Map a volume page to the corresponding page in the whole flash
     * @return What flash page this volume page maps to, or 
!    *   AT45_MAX_PAGES for invalid volumes
     */
    command at45page_t remap(at45page_t volumePage);

Index: BlockStorageC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/at45db/Attic/BlockStorageC.nc,v
retrieving revision 1.1.2.6
retrieving revision 1.1.2.7
diff -C2 -d -r1.1.2.6 -r1.1.2.7
*** BlockStorageC.nc	25 May 2006 22:57:19 -0000	1.1.2.6
--- BlockStorageC.nc	2 Jun 2006 16:36:23 -0000	1.1.2.7
***************
*** 31,40 ****
    };
      
!   components BlockStorageP, WireBlockStorageP, StorageManagerP, At45dbC;
  
    BlockWrite = BlockStorageP.BlockWrite[BLOCK_ID];
    BlockRead = BlockStorageP.BlockRead[BLOCK_ID];
  
!   BlockStorageP.At45dbVolume[BLOCK_ID] -> StorageManagerP.At45dbVolume[volid];
    BlockStorageP.Resource[BLOCK_ID] -> At45dbC.Resource[RESOURCE_ID];
  }
--- 31,40 ----
    };
      
!   components BlockStorageP, WireBlockStorageP, At45dbStorageManagerC, At45dbC;
  
    BlockWrite = BlockStorageP.BlockWrite[BLOCK_ID];
    BlockRead = BlockStorageP.BlockRead[BLOCK_ID];
  
!   BlockStorageP.At45dbVolume[BLOCK_ID] -> At45dbStorageManagerC.At45dbVolume[volid];
    BlockStorageP.Resource[BLOCK_ID] -> At45dbC.Resource[RESOURCE_ID];
  }

Index: BlockStorageP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/at45db/Attic/BlockStorageP.nc,v
retrieving revision 1.1.2.13
retrieving revision 1.1.2.14
diff -C2 -d -r1.1.2.13 -r1.1.2.14
*** BlockStorageP.nc	30 May 2006 23:46:35 -0000	1.1.2.13
--- BlockStorageP.nc	2 Jun 2006 16:36:23 -0000	1.1.2.14
***************
*** 54,57 ****
--- 54,77 ----
  implementation 
  {
+   /* The AT45DB block storage implementation simply provides direct
+      read/write access to the underlying pages of the volume. Random
+      writes to the block storage will thus lead to pages being 
+      erased/programmed many times (there is a 2 page cache, but
+      random writes are unlikely to hit in it).
+ 
+      The cache is only flushed on commit.
+ 
+      The first page of a block storage volume stores the maximum address
+      written in the block and a CRC of the block's contents (up to that
+      maximum address). This CRC is written at commit time and verified at
+      validate time.
+ 
+      This BlockStorage code is reused in the implementation of
+      ConfigStorage.  See the ConfigStorageP component and the
+      At45dbBlockConfig interface for more discussion. If there are m
+      ConfigStorage volumes and n BlockStorage volumes, the ids 0..m-1 are
+      for ConfigStorage and m..m+n-1 are for BlockStorage.
+   */
+ 
    enum {
      R_IDLE,

Index: ConfigStorageC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/at45db/Attic/ConfigStorageC.nc,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -C2 -d -r1.1.2.4 -r1.1.2.5
*** ConfigStorageC.nc	30 May 2006 21:36:27 -0000	1.1.2.4
--- ConfigStorageC.nc	2 Jun 2006 16:36:23 -0000	1.1.2.5
***************
*** 31,35 ****
    };
      
!   components ConfigStorageP, WireConfigStorageP, StorageManagerP, At45dbC;
    components BlockStorageP, WireBlockStorageP;
  
--- 31,35 ----
    };
      
!   components ConfigStorageP, WireConfigStorageP, At45dbStorageManagerC, At45dbC;
    components BlockStorageP, WireBlockStorageP;
  
***************
*** 37,41 ****
    ConfigStorage = ConfigStorageP.ConfigStorage[CONFIG_ID];
  
!   BlockStorageP.At45dbVolume[CONFIG_ID] -> StorageManagerP.At45dbVolume[volid];
    BlockStorageP.Resource[CONFIG_ID] -> At45dbC.Resource[RESOURCE_ID];
  }
--- 37,41 ----
    ConfigStorage = ConfigStorageP.ConfigStorage[CONFIG_ID];
  
!   BlockStorageP.At45dbVolume[CONFIG_ID] -> At45dbStorageManagerC.At45dbVolume[volid];
    BlockStorageP.Resource[CONFIG_ID] -> At45dbC.Resource[RESOURCE_ID];
  }

Index: LogStorageC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/at45db/Attic/LogStorageC.nc,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -C2 -d -r1.1.2.3 -r1.1.2.4
*** LogStorageC.nc	1 Jun 2006 16:53:13 -0000	1.1.2.3
--- LogStorageC.nc	2 Jun 2006 16:36:23 -0000	1.1.2.4
***************
*** 32,41 ****
    };
      
!   components LogStorageP, WireLogStorageP, StorageManagerP, At45dbC;
  
    LogWrite = LogStorageP.LogWrite[INTF_ID];
    LogRead = LogStorageP.LogRead[INTF_ID];
  
!   LogStorageP.At45dbVolume[LOG_ID] -> StorageManagerP.At45dbVolume[volid];
    LogStorageP.Resource[LOG_ID] -> At45dbC.Resource[RESOURCE_ID];
  }
--- 32,41 ----
    };
      
!   components LogStorageP, WireLogStorageP, At45dbStorageManagerC, At45dbC;
  
    LogWrite = LogStorageP.LogWrite[INTF_ID];
    LogRead = LogStorageP.LogRead[INTF_ID];
  
!   LogStorageP.At45dbVolume[LOG_ID] -> At45dbStorageManagerC.At45dbVolume[volid];
    LogStorageP.Resource[LOG_ID] -> At45dbC.Resource[RESOURCE_ID];
  }

--- StorageManagerP.nc DELETED ---



More information about the Tinyos-2-commits mailing list