1 // flash.h - Class declaration for a generic flash memory component.
2 // The generic part is modelled on the assumption that a flash memory
3 // is like a conventional memory, only it has restrictions on how you
4 // can write to it. The memory is divided into "sectors" or "zones".
7 // Copyright (C) 1999, 2000 Red Hat.
8 // This file is part of SID and is licensed under the GPL.
9 // See the file COPYING.SID for conditions for redistribution.
16 class flash_memory: public generic_memory
19 // Returns true if a write is allowed to proceed. Some flash
20 // memories have a data protection mechanism to prevent garbage
21 // being written to the memory when the memory is in a transient
23 virtual bool write_ok(host_int_4 address) = 0;
27 class flash_uniform_sector_memory: public flash_memory
30 flash_uniform_sector_memory();
33 host_int_4 sector_size;
34 string get_sector_size_attr();
35 component::status set_sector_size_attr(const string& s);
37 void stream_state (ostream&) const;
38 void destream_state (istream&);