summaryrefslogtreecommitdiffstats
path: root/commands/mem.c
Commit message (Collapse)AuthorAgeFilesLines
* lseek: return -1 instead of -errnoSascha Hauer2012-05-181-2/+2
| | | | | | | | | | The patch making errno a positive value has another bug: lseek was switched to return -errno instead of -1. This does not work since we can lseek we can address the whole 4G address space, have of which has a negative offset when interpreted as a signed integer. Let lseek return -1 on failure again instead. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Make errno a positive valueSascha Hauer2012-05-141-6/+4
| | | | | | | | | Normally errno contains a positive error value. A certain unnamed developer mixed this up while implementing U-Boot-v2. Also, normally errno is never set to zero by any library function. This patch fixes this. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: remove struct command pointer from commandsSascha Hauer2012-02-271-5/+5
| | | | | | This is unused in all commands and thus can be removed. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Fix spelling of "omitted"; found by lintianLoïc Minier2011-10-141-1/+1
| | | | | Signed-off-by: Loïc Minier <loic.minier@linaro.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* memcpy command: allow to interruptSascha Hauer2011-08-031-0/+3
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* add a add_mem_device functionSascha Hauer2011-07-181-24/+8
| | | | | | | | | | | Add a helper function for boards to register their memory devices. This makes the board code smaller and also helps getting rid of map_base and struct memory_platform_data. And switch all of the memory to it Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* mem: replace DEVFS_RDWR by IORESOURCE_MEM_WRITEABLEJean-Christophe PLAGNIOL-VILLARD2011-07-181-1/+1
| | | | | | | we keep struct memory_platform_data for now on we will switch off the memories resources to struct resource Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* memcpy command: do not set read/write sizeSascha Hauer2011-04-041-1/+1
| | | | | | | The memcpy command can be much faster if we do not copy in byte mode. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands/mem.c: make locally used function staticSascha Hauer2010-10-211-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* driver: use id as -1 for auto assigned idJean-Christophe PLAGNIOL-VILLARD2010-09-201-0/+1
| | | | | | | | before if you specify id = 0 the next available id will be taken otherwise fail if already registered now as in linux we use -1 Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'next'Sascha Hauer2010-08-301-1/+3
|\
| * mw: fix help textBaruch Siach2010-08-061-1/+3
| | | | | | | | | | Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | md: fix help textBaruch Siach2010-08-041-1/+0
|/ | | | | Signed-off-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* memcpy cmd: Do not expect to read/write the whole chunk at onceSascha Hauer2010-06-241-11/+19
| | | | | | | read() does not necessarily return the number of bytes we want to read, so deal with less bytes. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* remove typedef cmd_tbl_t and replace it with struct commandSascha Hauer2010-02-011-5/+5
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* rename U-Boot-v2 project to bareboxSascha Hauer2009-12-151-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | This has been done with the following script: find -path ./.git -prune -o -type f -print0 | xargs -0 -r sed -i \ -e 's/u2boot/barebox/g' \ -e 's/U2Boot/barebox/g' \ -e 's/U-boot V2/barebox/g' \ -e 's/u-boot v2/barebox/g' \ -e 's/U-Boot V2/barebox/g' \ -e 's/U-Boot-v2/barebox/g' \ -e 's/U_BOOT/BAREBOX/g' \ -e 's/UBOOT/BAREBOX/g' \ -e 's/uboot/barebox/g' \ -e 's/u-boot/barebox/g' \ -e 's/u_boot/barebox/g' \ -e 's/U-Boot/barebox/g' \ -e 's/U-boot/barebox/g' \ -e 's/U-BOOT/barebox/g' find -path ./.git -prune -o \( -name "*u-boot*" -o -name "*uboot*" -o -name "*u_boot*" \) -print0 | \ xargs -0 -r rename 's/u[-_]?boot/barebox/' It needs some manual fixup following in the next patch Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: remove maxargsSascha Hauer2009-10-191-5/+0
| | | | | | | No need to check for maximum argument counts. The commands are safe to be called with more arguments, so lets safe some bytes. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* call getopt_reset only onceSascha Hauer2009-10-191-2/+0
| | | | | | | instead of calling getopt_reset in each command, call it only once before calling the command. Signed-off-by: Sascha Hauer <sha@pengutronix.de>
* commands: return COMMAND_ERROR_USAGESascha Hauer2009-10-191-16/+8
| | | | | | | instead of calling u_boot_cmd_usage in each command to safe space. Signed-off-by: Sascha Hauer <sha@pengutronix.de>
* add memset command to u-bootSascha Hauer2009-07-311-0/+68
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* implement /dev/zeroSascha Hauer2009-07-301-0/+28
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* introduce cdevSascha Hauer2009-07-211-33/+34
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* memory commands: allow for kMG suffixesSascha Hauer2008-12-171-6/+6
| | | | | | Allow for kMG suffixes in memcpy and memcmp Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* implement memmap for mem driverSascha Hauer2008-08-141-0/+3
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ups, some debug printf slipped inSascha Hauer2008-08-141-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* lseek: return -1 for errors and check for that return valueSascha Hauer2008-08-011-5/+5
| | | | | | We cannot check for < 0 in lseek, otherwise we get problems with files > 0x7fffffff Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* - introduce ioctl callSascha Hauer2008-06-061-0/+12
| | | | - pass open/close/lseek through to drivers
* Subject: [PATCH] [general] Fixed constant strings in data section issueSascha Hauer2008-04-041-4/+4
| | | | | | | | For practical reasons I changed all string literals assumed to be constant to reside in .rodata subsection at end of .text section. Signed-off-by: Carsten Schlote <schlote@vahanus.net> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* md command: Close filedescriptor after useSascha Hauer2008-03-141-0/+2
|
* memory_display() used to show the ascii output on theSascha Hauer2008-03-011-6/+9
| | | | last line not exactly under the other lines. fix it.
* Revert "separating memory commands"Marc Kleine-Budde2007-11-271-0/+557
| | | | | | | | | | | | This reverts commit d59c600c656d08410ea862c582fbd77432c3ca47. Conflicts: commands/Makefile common/Kconfig common/Makefile Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
* separating memory commandsJuergen Beisert2007-11-121-557/+0
| | | | Signed-off-by: Juergen Beisert <j.beisert@pengutronix.de>
* mem.c: allow memcpy and memcmp to handle files.sascha2007-10-161-99/+198
|
* fix area parsing for erase/protect, add error parsingSascha Hauer2007-10-091-1/+4
|
* declare lots of functions staticSascha Hauer2007-09-281-3/+3
|
* activate memcmp and memcpySascha Hauer2007-09-271-139/+86
|
* remove u-boot command paramter flagSascha Hauer2007-09-241-4/+4
|
* - putc is now putchar for better standard conformitySascha Hauer2007-09-211-2/+2
| | | | - make printf return int
* whitespace cleanupSascha Hauer2007-09-131-33/+33
|
* add rom driverSascha Hauer2007-09-131-0/+7
|
* svn_rev_680Sascha Hauer2007-07-051-105/+0
| | | | remove crc32 (extra file now)
* svn_rev_664Sascha Hauer2007-07-051-7/+11
|
* svn_rev_653Sascha Hauer2007-07-051-103/+0
| | | | restructure tree, add reginfo command
* svn_rev_643Sascha Hauer2007-07-051-0/+705
structure cleanup