Commit 4ec5e293 authored by David S. Miller's avatar David S. Miller

Merge nuts.ninka.net:/home/davem/src/BK/sparcwork-2.5

into nuts.ninka.net:/home/davem/src/BK/sparc-2.5
parents 6b29059a 518bdf3e
...@@ -316,6 +316,14 @@ static unsigned long __srmmu_get_nocache(int size, int align) ...@@ -316,6 +316,14 @@ static unsigned long __srmmu_get_nocache(int size, int align)
unsigned long va_tmp, phys_tmp; unsigned long va_tmp, phys_tmp;
int lowest_failed = 0; int lowest_failed = 0;
if (size < SRMMU_NOCACHE_BITMAP_SHIFT) {
printk("Size 0x%x too small for nocache request\n", size);
size = SRMMU_NOCACHE_BITMAP_SHIFT;
}
if (size & (SRMMU_NOCACHE_BITMAP_SHIFT-1)) {
printk("Size 0x%x unaligned int nocache request\n", size);
size += SRMMU_NOCACHE_BITMAP_SHIFT-1;
}
size = size >> SRMMU_NOCACHE_BITMAP_SHIFT; size = size >> SRMMU_NOCACHE_BITMAP_SHIFT;
spin_lock(&srmmu_nocache_spinlock); spin_lock(&srmmu_nocache_spinlock);
...@@ -376,8 +384,32 @@ unsigned inline long srmmu_get_nocache(int size, int align) ...@@ -376,8 +384,32 @@ unsigned inline long srmmu_get_nocache(int size, int align)
void srmmu_free_nocache(unsigned long vaddr, int size) void srmmu_free_nocache(unsigned long vaddr, int size)
{ {
int offset = (vaddr - SRMMU_NOCACHE_VADDR) >> SRMMU_NOCACHE_BITMAP_SHIFT; int offset;
if (vaddr < SRMMU_NOCACHE_VADDR) {
printk("Vaddr %x is smaller than nocache base 0x%x\n",
vaddr, SRMMU_NOCACHE_VADDR);
BUG();
}
if (vaddr >= SRMMU_NOCACHE_END) {
printk("Vaddr %x is bigger than nocache end 0x%x\n",
vaddr, SRMMU_NOCACHE_END);
BUG();
}
if (size & (size-1)) {
printk("Size 0x%x is not a power of 2\n", size);
BUG();
}
if (size < SRMMU_NOCACHE_BITMAP_SHIFT) {
printk("Size 0x%x is too small\n", size);
BUG();
}
if (vaddr & (size-1)) {
printk("Vaddr 0x%x is not aligned to size 0x%x\n", vaddr, size);
BUG();
}
offset = (vaddr - SRMMU_NOCACHE_VADDR) >> SRMMU_NOCACHE_BITMAP_SHIFT;
size = size >> SRMMU_NOCACHE_BITMAP_SHIFT; size = size >> SRMMU_NOCACHE_BITMAP_SHIFT;
spin_lock(&srmmu_nocache_spinlock); spin_lock(&srmmu_nocache_spinlock);
...@@ -501,9 +533,13 @@ static void srmmu_free_pte_fast(pte_t *pte) ...@@ -501,9 +533,13 @@ static void srmmu_free_pte_fast(pte_t *pte)
static void srmmu_pte_free(struct page *pte) static void srmmu_pte_free(struct page *pte)
{ {
unsigned long p = (unsigned long)page_address(pte); unsigned long p;
p = (unsigned long)page_address(pte); /* Cached address (for test) */
if (p == 0) if (p == 0)
BUG(); BUG();
p = ((pte - mem_map) << PAGE_SHIFT); /* Physical address */
p = (unsigned long) __nocache_va(p); /* Nocached virtual */
srmmu_free_nocache(p, SRMMU_PTE_SZ_SOFT); srmmu_free_nocache(p, SRMMU_PTE_SZ_SOFT);
} }
......
...@@ -151,7 +151,7 @@ int prom_callback(long *args) ...@@ -151,7 +151,7 @@ int prom_callback(long *args)
pmd_t *pmdp; pmd_t *pmdp;
pte_t *ptep; pte_t *ptep;
for_each_task(p) { for_each_process(p) {
mm = p->mm; mm = p->mm;
if (CTX_HWBITS(mm->context) == ctx) if (CTX_HWBITS(mm->context) == ctx)
break; break;
......
...@@ -363,7 +363,6 @@ EXPORT_SYMBOL_NOVERS(VISenter); ...@@ -363,7 +363,6 @@ EXPORT_SYMBOL_NOVERS(VISenter);
EXPORT_SYMBOL(sun_do_break); EXPORT_SYMBOL(sun_do_break);
EXPORT_SYMBOL(serial_console); EXPORT_SYMBOL(serial_console);
EXPORT_SYMBOL(stop_a_enabled); EXPORT_SYMBOL(stop_a_enabled);
EXPORT_SYMBOL(kbd_pt_regs);
#ifdef CONFIG_DEBUG_BUGVERBOSE #ifdef CONFIG_DEBUG_BUGVERBOSE
EXPORT_SYMBOL(do_BUG); EXPORT_SYMBOL(do_BUG);
......
...@@ -612,7 +612,7 @@ void bbc_envctrl_cleanup(void) ...@@ -612,7 +612,7 @@ void bbc_envctrl_cleanup(void)
int found = 0; int found = 0;
read_lock(&tasklist_lock); read_lock(&tasklist_lock);
for_each_task(p) { for_each_process(p) {
if (p == kenvctrld_task) { if (p == kenvctrld_task) {
found = 1; found = 1;
break; break;
......
...@@ -1141,7 +1141,7 @@ static void __exit envctrl_cleanup(void) ...@@ -1141,7 +1141,7 @@ static void __exit envctrl_cleanup(void)
int found = 0; int found = 0;
read_lock(&tasklist_lock); read_lock(&tasklist_lock);
for_each_task(p) { for_each_process(p) {
if (p == kenvctrld_task) { if (p == kenvctrld_task) {
found = 1; found = 1;
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment