summaryrefslogtreecommitdiffstats
path: root/flash.h
diff options
context:
space:
mode:
authorMathias Krause <mathias.krause@secunet.com>2011-01-17 07:50:42 +0000
committerMathias Krause <mathias.krause@secunet.com>2011-01-17 07:50:42 +0000
commita60faab83ef86bcf2884311db07cf13f445d7f47 (patch)
tree9de9787987eb6a3374e18835b196b7ac6cb9ad19 /flash.h
parent2c3afa34fcfc72abe6b3e0fd034632226fa75522 (diff)
downloadflashrom-a60faab83ef86bcf2884311db07cf13f445d7f47.tar.gz
flashrom-a60faab83ef86bcf2884311db07cf13f445d7f47.tar.bz2
flashrom-a60faab83ef86bcf2884311db07cf13f445d7f47.zip
Convince compilers to put constant data into the .rodata section
This patch reduces the stack usage by declaring 'const' stack variables as 'static const' so they end up in the .rodata section instead of being copied from there to the stack for every invocation of the corresponding function. As a plus we end up in having a smaller binary as the "copy from .rodata to stack" code isn't emitted by the compiler any more (roughly -100 bytes). Corresponding to flashrom svn r1252. Signed-off-by: Mathias Krause <mathias.krause@secunet.com> Acked-by: Stefan Reinauer <stepan@coreboot.org>
Diffstat (limited to 'flash.h')
-rw-r--r--flash.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/flash.h b/flash.h
index 250482fc0..91c4cf3a1 100644
--- a/flash.h
+++ b/flash.h
@@ -188,7 +188,7 @@ enum write_granularity {
};
extern enum chipbustype buses_supported;
extern int verbose;
-extern const char * const flashrom_version;
+extern const char flashrom_version[];
extern char *chip_to_probe;
void map_flash_registers(struct flashchip *flash);
int read_memmapped(struct flashchip *flash, uint8_t *buf, int start, int len);