m68k: merge mmu and non-mmu bitops.h
Subsystems (3)
PATCH 1/1 m68k: merge mmu and non-mmu bitops.h
From: Greg Ungerer <[email protected]>
The following patch merges the mmu and non-mmu versions of the m68k bitops.h files. Now there is a good deal of difference between the two files, but none of it is actually an mmu specific difference. It is all about the specific m68k/coldfire varient we are targeting. So it makes an awful lot of sense to merge these into a single bitops.h.
This is more an RFC than anything else. There is a number of ways I can see to factor this code. The approach in this first attempt is to keep the various versions of each macro/function type together. But this means that there is some ifdefery with each to handle each CPU type. The ifdefs could be grouped - but this will move the macro definitions away from the inline functions they reference.
I have added some comments in a couple of appropriate places to try and make it clear what the differences we are dealing with are. Specifically the instruction and addressing mode differences we have to deal with.
The merged form keeps the same underlying optimizations for each CPU type for all the general bit clear/set/change and find bit operations. It does switch to using the generic le operations though, instead of any local varients.
Build tested on ColdFire, 68328, 68360 (which is cpu32) and 68020+. Run tested on ColdFire and ARAnyM.
Thoughts? Comments?
--- arch/m68k/Kconfig | 4 + arch/m68k/include/asm/bitops.h | 517 ++++++++++++++++++++++++++++++++++++- arch/m68k/include/asm/bitops_mm.h | 466 --------------------------------- arch/m68k/include/asm/bitops_no.h | 329 ----------------------- 4 files changed, 518 insertions(+), 798 deletions(-) delete mode 100644 arch/m68k/include/asm/bitops_mm.h delete mode 100644 arch/m68k/include/asm/bitops_no.h
arch/m68k/Kconfig +4 -0
@@ -24,6 +24,10 @@ config GENERIC_HWEIGHT bool default y +config GENERIC_FIND_BIT_LE + bool + default y + config GENERIC_CALIBRATE_DELAY bool default y
arch/m68k/include/asm/bitops.h +514 -3
519 lines not on this page · raw message
arch/m68k/include/asm/bitops_mm.h deleted +0 -466
466 lines not on this page · raw message
arch/m68k/include/asm/bitops_no.h deleted +0 -329
329 lines not on this page · raw message
Signature · 1 line
1.7.0.4
Quoted 7 lines · On Wed, May 18, 2011 at 03:32:27PM +1000, [email protected] wrote:
From: Greg Ungerer <[email protected]>
The following patch merges the mmu and non-mmu versions of the m68k
bitops.hfiles. Now there is a good deal of difference between the two files, but none of it is actually an mmu specific difference. It is all about the specific m68k/coldfire varient we are targeting. So it makes an awful lot of sense to merge these into a singlebitops.h.
Thanks for taking care of that. Fork was easy (but ugly), but merge is a tedious job.
Philippe
Quoted 11 lines · Philippe De Muyter
Quoted 7 lines · On Wed, May 18, 2011 at 03:32:27PM +1000, [email protected] wrote:
From: Greg Ungerer<[email protected]>
The following patch merges the mmu and non-mmu versions of the m68k
bitops.hfiles. Now there is a good deal of difference between the two files, but none of it is actually an mmu specific difference. It is all about the specific m68k/coldfire varient we are targeting. So it makes an awful lot of sense to merge these into a singlebitops.h.Thanks for taking care of that. Fork was easy (but ugly), but merge is a tedious job.
Sure is :-)
------------------------------------------------------------------------
Greg Ungerer -- Principal Engineer EMAIL: [email protected] SnapGear Group, McAfee PHONE: +61 7 3435 2888 8 Gardner Close, FAX: +61 7 3891 3630 Milton, QLD, 4064, Australia WEB: http://www.SnapGear.com