X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=blobdiff_plain;f=arch%2Fsparc%2Fmm%2Fio-unit.c;h=4ccda77d08d6bf7d180036f09d452b2813784676;hp=eefffa1dc5de137c4fe6da103c419633ca4b0252;hb=b361735043e3001eadb1d40916fd1a4fca1a9363;hpb=1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 diff --git a/arch/sparc/mm/io-unit.c b/arch/sparc/mm/io-unit.c index eefffa1dc5de..4ccda77d08d6 100644 --- a/arch/sparc/mm/io-unit.c +++ b/arch/sparc/mm/io-unit.c @@ -4,7 +4,6 @@ * Copyright (C) 1997,1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) */ -#include #include #include #include @@ -23,6 +22,7 @@ #include #include #include +#include /* #define IOUNIT_DEBUG */ #ifdef IOUNIT_DEBUG @@ -42,9 +42,12 @@ iounit_init(int sbi_node, int io_node, struct sbus_bus *sbus) struct linux_prom_registers iommu_promregs[PROMREG_MAX]; struct resource r; - iounit = kmalloc(sizeof(struct iounit_struct), GFP_ATOMIC); + iounit = kzalloc(sizeof(struct iounit_struct), GFP_ATOMIC); + if (!iounit) { + prom_printf("SUN4D: Cannot alloc iounit, halting.\n"); + prom_halt(); + } - memset(iounit, 0, sizeof(*iounit)); iounit->limit[0] = IOUNIT_BMAP1_START; iounit->limit[1] = IOUNIT_BMAP2_START; iounit->limit[2] = IOUNIT_BMAPM_START; @@ -65,6 +68,7 @@ iounit_init(int sbi_node, int io_node, struct sbus_bus *sbus) sbus->iommu = (struct iommu_struct *)iounit; iounit->page_table = xpt; + spin_lock_init(&iounit->lock); for (xptend = iounit->page_table + (16 * PAGE_SIZE) / sizeof(iopte_t); xpt < xptend;)