diff options
Diffstat (limited to 'arch/parisc/kernel/setup.c')
-rw-r--r-- | arch/parisc/kernel/setup.c | 80 |
1 files changed, 0 insertions, 80 deletions
diff --git a/arch/parisc/kernel/setup.c b/arch/parisc/kernel/setup.c index cd227f1cf629..2b108ee3b217 100644 --- a/arch/parisc/kernel/setup.c +++ b/arch/parisc/kernel/setup.c | |||
@@ -305,86 +305,6 @@ static int __init parisc_init_resources(void) | |||
305 | return 0; | 305 | return 0; |
306 | } | 306 | } |
307 | 307 | ||
308 | static int no_alternatives __initdata; | ||
309 | static int __init setup_no_alternatives(char *str) | ||
310 | { | ||
311 | no_alternatives = 1; | ||
312 | return 1; | ||
313 | } | ||
314 | __setup("no-alternatives", setup_no_alternatives); | ||
315 | |||
316 | static void __init apply_alternatives_all(void) | ||
317 | { | ||
318 | struct alt_instr *entry; | ||
319 | int index = 0, applied = 0; | ||
320 | |||
321 | |||
322 | pr_info("alternatives: %spatching kernel code\n", | ||
323 | no_alternatives ? "NOT " : ""); | ||
324 | if (no_alternatives) | ||
325 | return; | ||
326 | |||
327 | set_kernel_text_rw(1); | ||
328 | |||
329 | for (entry = (struct alt_instr *) &__alt_instructions; | ||
330 | entry < (struct alt_instr *) &__alt_instructions_end; | ||
331 | entry++, index++) { | ||
332 | |||
333 | u32 *from, len, cond, replacement; | ||
334 | |||
335 | from = (u32 *)((ulong)&entry->orig_offset + entry->orig_offset); | ||
336 | len = entry->len; | ||
337 | cond = entry->cond; | ||
338 | replacement = entry->replacement; | ||
339 | |||
340 | WARN_ON(!cond); | ||
341 | pr_debug("Check %d: Cond 0x%x, Replace %02d instructions @ 0x%px with 0x%08x\n", | ||
342 | index, cond, len, from, replacement); | ||
343 | |||
344 | if ((cond & ALT_COND_NO_SMP) && (num_online_cpus() != 1)) | ||
345 | continue; | ||
346 | if ((cond & ALT_COND_NO_DCACHE) && (cache_info.dc_size != 0)) | ||
347 | continue; | ||
348 | if ((cond & ALT_COND_NO_ICACHE) && (cache_info.ic_size != 0)) | ||
349 | continue; | ||
350 | |||
351 | /* | ||
352 | * If the PDC_MODEL capabilities has Non-coherent IO-PDIR bit | ||
353 | * set (bit #61, big endian), we have to flush and sync every | ||
354 | * time IO-PDIR is changed in Ike/Astro. | ||
355 | */ | ||
356 | if ((cond & ALT_COND_NO_IOC_FDC) && | ||
357 | (boot_cpu_data.pdc.capabilities & PDC_MODEL_IOPDIR_FDC)) | ||
358 | continue; | ||
359 | |||
360 | /* Want to replace pdtlb by a pdtlb,l instruction? */ | ||
361 | if (replacement == INSN_PxTLB) { | ||
362 | replacement = *from; | ||
363 | if (boot_cpu_data.cpu_type >= pcxu) /* >= pa2.0 ? */ | ||
364 | replacement |= (1 << 10); /* set el bit */ | ||
365 | } | ||
366 | |||
367 | /* | ||
368 | * Replace instruction with NOPs? | ||
369 | * For long distance insert a branch instruction instead. | ||
370 | */ | ||
371 | if (replacement == INSN_NOP && len > 1) | ||
372 | replacement = 0xe8000002 + (len-2)*8; /* "b,n .+8" */ | ||
373 | |||
374 | pr_debug("Do %d: Cond 0x%x, Replace %02d instructions @ 0x%px with 0x%08x\n", | ||
375 | index, cond, len, from, replacement); | ||
376 | |||
377 | /* Replace instruction */ | ||
378 | *from = replacement; | ||
379 | applied++; | ||
380 | } | ||
381 | |||
382 | pr_info("alternatives: applied %d out of %d patches\n", applied, index); | ||
383 | |||
384 | set_kernel_text_rw(0); | ||
385 | } | ||
386 | |||
387 | |||
388 | extern void gsc_init(void); | 308 | extern void gsc_init(void); |
389 | extern void processor_init(void); | 309 | extern void processor_init(void); |
390 | extern void ccio_init(void); | 310 | extern void ccio_init(void); |