summaryrefslogtreecommitdiffstats
path: root/arch/blackfin
Commit message (Expand)AuthorAgeFilesLines
* aout: remove unnecessary inclusions of {asm, linux}/a.out.hDavid Howells2008-02-081-1/+0
* Introduce flags for reserve_bootmem()Bernhard Walle2008-02-071-1/+1
* Rename: linux/pata_platform.h to linux/ata_platform.hJeff Garzik2008-02-0611-11/+11
* timerfd: new timerfd APIDavide Libenzi2008-02-051-1/+1
* Move Kconfig.instrumentation to arch/Kconfig and init/KconfigMathieu Desnoyers2008-02-031-2/+0
* Add HAVE_OPROFILEMathieu Desnoyers2008-02-031-0/+1
* Suspend: Clean up Kconfig (V2)Johannes Berg2008-02-011-0/+4
* all archs: consolidate init and exit sections in vmlinux.lds.hSam Ravnborg2008-01-281-4/+4
* [Blackfin] arch: Add the semtimedop syscall. Upstream uClibc doesn't compile...Bernd Schmidt2008-01-271-0/+1
* [Blackfin] arch: fix bug kernel boot message: memory information is not reaso...Yi Li2008-01-272-6/+24
* [Blackfin] arch: use common flash driver to setup partitions rather than the ...Mike Frysinger2008-01-245-10/+174
* [Blackfin] arch: Fix bug - kernel build with Debug option enabled fails to bo...Michael Hennerich2008-01-221-0/+2
* [Blackfin] arch: Fix bug Only RTC interrupt can wake up deeper sleep core.Sonic Zhang2008-01-221-4/+4
* [Blackfin] arch: Add proper SW System Reset delay sequenceMichael Hennerich2008-01-221-3/+12
* [Blackfin] arch: Update copyright dateMichael Hennerich2008-01-223-3/+3
* [Blackfin] arch: GPIO API cleanup and anomaly updateMichael Hennerich2008-01-221-35/+28
* [Blackfin] arch: Fix BUG gpio_direction_output API is not compatitable with G...Michael Hennerich2008-01-225-35/+46
* [Blackfin] arch: Initial checkin of the memory protection support.Bernd Schmidt2008-01-2710-2/+689
* [Blackfin] arch: set_bfin_dma_config shouldnt set SYNC or RESTART by default ...Michael Hennerich2008-01-221-2/+2
* [Blackfin] arch: Add some comments - fix semicolonsMichael Hennerich2008-01-111-17/+15
* [Blackfin] arch: move all code related to CPLB handling into a new subdirecto...Bernd Schmidt2008-01-119-3/+12
* [Blackfin] arch: print out list of modules if kernel is crashing and tell peo...Robin Getz2008-01-111-1/+2
* [Blackfin] arch: enable generic GPIO based I2C driver in STAMP-BF533, EZKIT-B...Bryan Wu2008-01-243-0/+72
* [Blackfin] arch: Don't oops_in_progress if single step is comming from the ke...Robin Getz2008-01-101-2/+2
* [Blackfin] arch: Fix BUG - kernel sometimes would stuck with KEYBOARD_GPIO onMichael Hennerich2007-12-241-0/+2
* [Blackfin] arch: Spelling fixesJoe Perches2007-12-242-2/+2
* [Blackfin] arch: fix bug when DMA operation related core B of BF561Enrik Berkhan2007-12-241-4/+8
* [Blackfin] arch: Restore default DMA priority over core on bf54x.Sonic Zhang2007-12-241-1/+0
* [Blackfin] arch: pull in linux/etherdevice.h for random_ether_addr() used in ...Mike Frysinger2007-12-243-0/+3
* [Blackfin] arch: disable bfin_get_ether_addr fucntion for boards when do not ...Martin Strubel2007-12-241-0/+2
* [Blackfin] arch: Enable both edge triggered GPIO IRQs on BF54x and use irq_to...Michael Hennerich2007-12-241-21/+46
* [Blackfin] arch: added Minotaur BSPMartin Strubel2008-01-273-0/+324
* [Blackfin] arch: replace current blackfin specific pfbutton driver with kerne...Michael Hennerich2008-01-275-0/+140
* [Blackfin] arch: append IRQ Number to label stringMichael Hennerich2007-12-242-8/+19
* [Blackfin] arch: Fix gpio label handlingMichael Hennerich2007-12-241-13/+18
* [Blackfin] arch: add support for BF523/BF524/BF526Mike Frysinger2007-12-243-3/+63
* [Blackfin] arch: scrub dead alive/idle LED codeMike Frysinger2007-12-244-172/+0
* [Blackfin] arch: set default value of DEB_DMA_URGENT to YES to avoid DMA abor...Cliff Cai2007-12-241-1/+1
* [Blackfin] arch: Added support for OpenCores Keyboard Controller to H8606 boardJavier Herrero2008-01-271-0/+32
* [Blackfin] arch: Fix if/def BUG - and define is multipoint NOBryan Wu2007-12-241-4/+4
* [Blackfin] arch: The BF527 EZkit connects UART1/PORTFMichael Hennerich2007-12-241-1/+1
* [Blackfin] arch: update defconfig of boardsBryan Wu2008-01-246-111/+134
* [Blackfin] arch: Trash bf54x-hcd driver - we use the musb driverMichael Hennerich2007-12-241-21/+0
* [Blackfin] arch: Enable peripheral platform resources on the BF527 EZkitMichael Hennerich2007-12-241-0/+98
* [Blackfin] arch: Fix bug to Enable bf548 to Re-program Clocks while Kernel bo...Sonic Zhang2008-01-272-2/+64
* [Blackfin] arch: Clean up dump_bfin_memRobin Getz2007-12-233-49/+86
* [Blackfin] arch: add Hitachi TX09D70VM1CDA TFT LCD driver resource to Blackfi...Michael Hennerich2008-01-272-0/+21
* [Blackfin] arch: Fix bug to Enable kernel to build for bf548 with PM.Sonic Zhang2007-12-235-13/+61
* [Blackfin] arch: fix bug - make memcpy return the dest addr.Yi Li2007-12-211-6/+2
* [Blackfin] arch: Added support for 8250-class UARTs in HV Sistemas H8606 boar...Javier Herrero2007-12-211-2/+49
should be removed. """ root_logger.debug("Saving Index File to '%s'", self._index) if len(self.files) == 0: root_logger.debug(" -> no files, removing file") if os.path.exists(self._index): os.remove(self._index) return p = ConfigParser.SafeConfigParser() p.add_section('files') for (key, value) in self.files.items(): p.set('files', key, str(value)) f = file(self._index, "w") p.write(f) f.close() def backup_file(self, path): """Create a copy of the file at @path - so long as a copy does not already exist - which will be restored to its original location by restore_files(). """ root_logger.debug("Backing up system configuration file '%s'", path) if not os.path.isabs(path): raise ValueError("Absolute path required") if not os.path.isfile(path): root_logger.debug(" -> Not backing up - '%s' doesn't exist", path) return (reldir, backupfile) = os.path.split(path) filename = "" for i in range(8): h = "%02x" % self.random.randint(0,255) filename += h filename += "-"+backupfile backup_path = os.path.join(self._path, filename) if os.path.exists(backup_path): root_logger.debug(" -> Not backing up - already have a copy of '%s'", path) return shutil.copy2(path, backup_path) stat = os.stat(path) self.files[filename] = string.join([str(stat.st_mode),str(stat.st_uid),str(stat.st_gid),path], ',') self.save() def has_file(self, path): """Checks whether file at @path was added to the file store Returns #True if the file exists in the file store, #False otherwise """ result = False for (key, value) in self.files.items(): (mode,uid,gid,filepath) = string.split(value, ',', 3) if (filepath == path): result = True break return result def restore_file(self, path, new_path = None): """Restore the copy of a file at @path to its original location and delete the copy. Takes optional parameter @new_path which specifies the location where the file is to be restored. Returns #True if the file was restored, #False if there was no backup file to restore """ if new_path is None: root_logger.debug("Restoring system configuration file '%s'", path) else: root_logger.debug("Restoring system configuration file '%s' to '%s'", path, new_path) if not os.path.isabs(path): raise ValueError("Absolute path required") if new_path is not None and not os.path.isabs(new_path): raise ValueError("Absolute new path required") mode = None uid = None gid = None filename = None for (key, value) in self.files.items(): (mode,uid,gid,filepath) = string.split(value, ',', 3) if (filepath == path): filename = key break if not filename: raise ValueError("No such file name in the index") backup_path = os.path.join(self._path, filename) if not os.path.exists(backup_path): root_logger.debug(" -> Not restoring - '%s' doesn't exist", backup_path) return False if new_path is not None: path = new_path shutil.move(backup_path, path) os.chown(path, int(uid), int(gid)) os.chmod(path, int(mode)) ipaservices.restore_context(path) del self.files[filename] self.save() return True def restore_all_files(self): """Restore the files in the inbdex to their original location and delete the copy. Returns #True if the file was restored, #False if there was no backup file to restore """ if len(self.files) == 0: return False for (filename, value) in self.files.items(): (mode,uid,gid,path) = string.split(value, ',', 3) backup_path = os.path.join(self._path, filename) if not os.path.exists(backup_path): root_logger.debug(" -> Not restoring - '%s' doesn't exist", backup_path) continue shutil.move(backup_path, path) os.chown(path, int(uid), int(gid)) os.chmod(path, int(mode)) ipaservices.restore_context(path) #force file to be deleted self.files = {} self.save() return True def has_files(self): """Return True or False if there are any files in the index Can be used to determine if a program is configured. """ return len(self.files) > 0 def untrack_file(self, path): """Remove file at path @path from list of backed up files. Does not remove any files from the filesystem. Returns #True if the file was untracked, #False if there was no backup file to restore """ root_logger.debug("Untracking system configuration file '%s'", path) if not os.path.isabs(path): raise ValueError("Absolute path required") mode = None uid = None gid = None filename = None for (key, value) in self.files.items(): (mode,uid,gid,filepath) = string.split(value, ',', 3) if (filepath == path): filename = key break if not filename: raise ValueError("No such file name in the index") backup_path = os.path.join(self._path, filename) if not os.path.exists(backup_path): root_logger.debug(" -> Not restoring - '%s' doesn't exist", backup_path) return False try: os.unlink(backup_path) except Exception, e: root_logger.error('Error removing %s: %s' % (backup_path, str(e))) del self.files[filename] self.save() return True class StateFile: """A metadata file for recording system state which can be backed up and later restored. The format is something like: [httpd] running=True enabled=False """ def __init__(self, path = SYSRESTORE_PATH, state_file = SYSRESTORE_STATEFILE): """Create a StateFile object, loading from @path. The dictionary @modules, a member of the returned object, is where the state can be modified. @modules is indexed using a module name to return another dictionary containing key/value pairs with the saved state of that module. The keys in these latter dictionaries are arbitrary strings and the values may either be strings or booleans. """ self._path = os.path.join(path, state_file) self.modules = {} self._load() def _load(self): """Load the modules from the file @_path. @modules will be an empty dictionary if the file doesn't exist. """ root_logger.debug("Loading StateFile from '%s'", self._path) self.modules = {} p = ConfigParser.SafeConfigParser() p.read(self._path) for module in p.sections(): self.modules[module] = {} for (key, value) in p.items(module): if value == str(True): value = True elif value == str(False): value = False self.modules[module][key] = value def save(self): """Save the modules to @_path. If @modules is an empty dict, then @_path should be removed. """ root_logger.debug("Saving StateFile to '%s'", self._path) for module in self.modules.keys(): if len(self.modules[module]) == 0: del self.modules[module] if len(self.modules) == 0: root_logger.debug(" -> no modules, removing file") if os.path.exists(self._path): os.remove(self._path) return p = ConfigParser.SafeConfigParser() for module in self.modules.keys(): p.add_section(module) for (key, value) in self.modules[module].items(): p.set(module, key, str(value)) f = file(self._path, "w") p.write(f) f.close() def backup_state(self, module, key, value): """Backup an item of system state from @module, identified by the string @key and with the value @value. @value may be a string or boolean. """ if not isinstance(value, (str, bool, unicode)): raise ValueError("Only strings, booleans or unicode strings are supported") if not self.modules.has_key(module): self.modules[module] = {} if not self.modules.has_key(key): self.modules[module][key] = value self.save() def get_state(self, module, key): """Return the value of an item of system state from @module, identified by the string @key. If the item doesn't exist, #None will be returned, otherwise the original string or boolean value is returned. """ if not self.modules.has_key(module): return None return self.modules[module].get(key, None) def delete_state(self, module, key): """Delete system state from @module, identified by the string @key. If the item doesn't exist, no change is done. """ try: del self.modules[module][key] except KeyError: pass else: self.save() def restore_state(self, module, key): """Return the value of an item of system state from @module, identified by the string @key, and remove it from the backed up system state. If the item doesn't exist, #None will be returned, otherwise the original string or boolean value is returned. """ value = self.get_state(module, key) if value is not None: self.delete_state(module, key) return value def has_state(self, module): """Return True or False if there is any state stored for @module. Can be used to determine if a service is configured. """ if self.modules.has_key(module): return True else: return False