diff options
| author | Geert Uytterhoeven <geert@linux-m68k.org> | 2013-06-29 04:40:20 -0400 |
|---|---|---|
| committer | Geert Uytterhoeven <geert@linux-m68k.org> | 2013-11-26 05:09:03 -0500 |
| commit | c293738e6d8dfb9c941759855b5161fde449644d (patch) | |
| tree | 3c2d4b2041af3e2fe5a8a4702cdfe49fca3e1f7f /include/linux | |
| parent | 1ea636eb68322198e08aebdede141244d98e8299 (diff) | |
zorro: Do not allocate zorro_autocon[] statically
Currently the array of Zorro devices is allocated statically, wasting
up to 4.5 KiB when running an Amiga or multi-platform kernel on a machine
with no or a handful of Zorro expansion cards. Convert it to conditional
dynamic memory allocation to fix this.
amiga_parse_bootinfo() still needs to store some information about the
detected Zorro devices, at a time even the bootmem allocator is not yet
available. This is now handled using a much smaller array (typically less
than 0.5 KiB), which is __initdata and thus freed later.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/zorro.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/include/linux/zorro.h b/include/linux/zorro.h index dff42025649b..661cbd2a86ee 100644 --- a/include/linux/zorro.h +++ b/include/linux/zorro.h | |||
| @@ -175,7 +175,23 @@ static inline struct zorro_driver *zorro_dev_driver(const struct zorro_dev *z) | |||
| 175 | 175 | ||
| 176 | 176 | ||
| 177 | extern unsigned int zorro_num_autocon; /* # of autoconfig devices found */ | 177 | extern unsigned int zorro_num_autocon; /* # of autoconfig devices found */ |
| 178 | extern struct zorro_dev zorro_autocon[ZORRO_NUM_AUTO]; | 178 | extern struct zorro_dev *zorro_autocon; |
| 179 | |||
| 180 | |||
| 181 | /* | ||
| 182 | * Minimal information about a Zorro device, passed from bootinfo | ||
| 183 | * Only available temporarily, i.e. until initmem has been freed! | ||
| 184 | */ | ||
| 185 | |||
| 186 | struct zorro_dev_init { | ||
| 187 | struct ExpansionRom rom; | ||
| 188 | u16 slotaddr; | ||
| 189 | u16 slotsize; | ||
| 190 | u32 boardaddr; | ||
| 191 | u32 boardsize; | ||
| 192 | }; | ||
| 193 | |||
| 194 | extern struct zorro_dev_init zorro_autocon_init[ZORRO_NUM_AUTO] __initdata; | ||
| 179 | 195 | ||
| 180 | 196 | ||
| 181 | /* | 197 | /* |
