diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2008-06-23 21:32:36 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-06-30 21:28:24 -0400 |
commit | 51c52e86694f19e84600a40f6156889feafd8ae9 (patch) | |
tree | 3a1d532ba5c210c4ad4c0d2c9eee24c23b53e677 /arch/powerpc/kernel/cputable.c | |
parent | b7bcda631e87eb3466d0baa9885650ba7d7ed89d (diff) |
powerpc: Split out do_feature_fixups() from cputable.c
The logic to patch CPU feature sections lives in cputable.c, but these days
it's used for CPU features as well as firmware features. Move it into
it's own file for neatness and as preparation for some additions.
While we're moving the code, we pull the loop body logic into a separate
routine, and remove a comment which doesn't apply anymore.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Acked-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/cputable.c')
-rw-r--r-- | arch/powerpc/kernel/cputable.c | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c index ba5b23f54764..817cea1b5ad3 100644 --- a/arch/powerpc/kernel/cputable.c +++ b/arch/powerpc/kernel/cputable.c | |||
@@ -17,7 +17,6 @@ | |||
17 | #include <linux/module.h> | 17 | #include <linux/module.h> |
18 | 18 | ||
19 | #include <asm/oprofile_impl.h> | 19 | #include <asm/oprofile_impl.h> |
20 | #include <asm/code-patching.h> | ||
21 | #include <asm/cputable.h> | 20 | #include <asm/cputable.h> |
22 | #include <asm/prom.h> /* for PTRRELOC on ARCH=ppc */ | 21 | #include <asm/prom.h> /* for PTRRELOC on ARCH=ppc */ |
23 | 22 | ||
@@ -1638,38 +1637,3 @@ struct cpu_spec * __init identify_cpu(unsigned long offset, unsigned int pvr) | |||
1638 | BUG(); | 1637 | BUG(); |
1639 | return NULL; | 1638 | return NULL; |
1640 | } | 1639 | } |
1641 | |||
1642 | void do_feature_fixups(unsigned long value, void *fixup_start, void *fixup_end) | ||
1643 | { | ||
1644 | struct fixup_entry { | ||
1645 | unsigned long mask; | ||
1646 | unsigned long value; | ||
1647 | long start_off; | ||
1648 | long end_off; | ||
1649 | } *fcur, *fend; | ||
1650 | |||
1651 | fcur = fixup_start; | ||
1652 | fend = fixup_end; | ||
1653 | |||
1654 | for (; fcur < fend; fcur++) { | ||
1655 | unsigned int *pstart, *pend, *p; | ||
1656 | |||
1657 | if ((value & fcur->mask) == fcur->value) | ||
1658 | continue; | ||
1659 | |||
1660 | /* These PTRRELOCs will disappear once the new scheme for | ||
1661 | * modules and vdso is implemented | ||
1662 | */ | ||
1663 | pstart = ((unsigned int *)fcur) + (fcur->start_off / 4); | ||
1664 | pend = ((unsigned int *)fcur) + (fcur->end_off / 4); | ||
1665 | |||
1666 | for (p = pstart; p < pend; p++) { | ||
1667 | *p = PPC_NOP_INSTR; | ||
1668 | asm volatile ("dcbst 0, %0" : : "r" (p)); | ||
1669 | } | ||
1670 | asm volatile ("sync" : : : "memory"); | ||
1671 | for (p = pstart; p < pend; p++) | ||
1672 | asm volatile ("icbi 0,%0" : : "r" (p)); | ||
1673 | asm volatile ("sync; isync" : : : "memory"); | ||
1674 | } | ||
1675 | } | ||