aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68k
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert@linux-m68k.org>2013-06-25 14:33:44 -0400
committerGeert Uytterhoeven <geert@linux-m68k.org>2013-11-26 05:08:59 -0500
commit7b3e8de9b3e9c0ffd5cb1600e6075bede4272868 (patch)
treefda9c0cccaaa02498e675a1b8188a50a10ee604c /arch/m68k
parenta4df02a217e9787a4b967197d9d9030c3e3c1088 (diff)
m68k/sun3: Dynamically allocate the table to track IOMMU use
As Sun 3 kernels cannot be multi-platform due to the different Sun 3 MMU type, it made sense to statically allocate the table to track IOMMU use. However, Sun 3x kernels can be multi-platform. Furthermore, Sun 3x uses a larger table than Sun 3 (8192 bytes instead of 512 bytes). Hence switch to dynamic allocation of this table using the bootmem allocator to avoid wasting 8192 bytes when not running on a Sun 3x. As this allocator returns zeroed memory, there's no need to explicitly initialize the table to zeroes. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Diffstat (limited to 'arch/m68k')
-rw-r--r--arch/m68k/sun3/sun3dvma.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/m68k/sun3/sun3dvma.c b/arch/m68k/sun3/sun3dvma.c
index ca57966ec3a2..b37521a5259d 100644
--- a/arch/m68k/sun3/sun3dvma.c
+++ b/arch/m68k/sun3/sun3dvma.c
@@ -6,6 +6,7 @@
6 * Contains common routines for sun3/sun3x DVMA management. 6 * Contains common routines for sun3/sun3x DVMA management.
7 */ 7 */
8 8
9#include <linux/bootmem.h>
9#include <linux/init.h> 10#include <linux/init.h>
10#include <linux/module.h> 11#include <linux/module.h>
11#include <linux/kernel.h> 12#include <linux/kernel.h>
@@ -31,7 +32,7 @@ static inline void dvma_unmap_iommu(unsigned long a, int b)
31extern void sun3_dvma_init(void); 32extern void sun3_dvma_init(void);
32#endif 33#endif
33 34
34static unsigned long iommu_use[IOMMU_TOTAL_ENTRIES]; 35static unsigned long *iommu_use;
35 36
36#define dvma_index(baddr) ((baddr - DVMA_START) >> DVMA_PAGE_SHIFT) 37#define dvma_index(baddr) ((baddr - DVMA_START) >> DVMA_PAGE_SHIFT)
37 38
@@ -266,7 +267,7 @@ void __init dvma_init(void)
266 267
267 list_add(&(hole->list), &hole_list); 268 list_add(&(hole->list), &hole_list);
268 269
269 memset(iommu_use, 0, sizeof(iommu_use)); 270 iommu_use = alloc_bootmem(IOMMU_TOTAL_ENTRIES * sizeof(unsigned long));
270 271
271 dvma_unmap_iommu(DVMA_START, DVMA_SIZE); 272 dvma_unmap_iommu(DVMA_START, DVMA_SIZE);
272 273