Skip to contentSkip to conversation

unify sparc header files

GIT PULL Sam Ravnborg 3 participants 25 messages Jun 28, 2008 – Jul 15, 2008

lore
Share & tools
lore
#0 lore raw

Hi David.

I have now redone the sparc header unification and in the end I decided to unify them all so we have only one set of header files for sparc and sparc64.

The unification is 25 commits on top of:
20c51e668d2443385c1ac0e2b38b70d064a61d21 ("sparc64 Kbuild: apb.h and bbc.h should not be exported to userspace")
[This drops one commit from Adrian - see below]

I have redone the changelogs to comply with traditional patch so it does no longer confuse patch (thanks to Andrew).

The patchset basically does the following:
- Copy all sparc64 only files to asm-sparc
- When sparc and sparc64 files were equal use on the sparc version
- Unify a number of almost equal files
- The remaining files were changed so we have a <file>_32.h and <file>_64.h for sparc and sparc64. The <file>.h file include the correct version depending on the actual target.
- Drop exporting all sparc files to userspace to avoid breaking make headers_check. To be reintroduced later (see below)

This was all initiated to kill the use of ALTARCH and in the end I decided to go the long way to really fix it.
So what I have prepared now if a full unification of the sparc{,64} header files and the next step is to move them all to arch/sparc/include/asm

To do so we need proper kbuild support which is present in kbuild-next.git but not yet upstream.
So what I plan is that:

- You merge this set of commits in sparc-next
- We merge sparc-next.git and kbuild-next.git in the upcoming merge window The merge order does not matter - no build breakage
- Move the header files to arch/sparc/include/asm with the necessary fixups (And delete the include/asm-saprc{,64} directories).
- Reenable the header export (update the Kbuild file)
I plan to do the latter two steps - and I have prepared a patch already.

We will end up with:
- Unified header files for sparc and sparc64 in a single directory
- Working headers_export for sparc amd sparc64
- The first architecture to utilize the arch/$ARCH/include support in kbuild

When we are this far we should aim at unifying the obvious header file candidates and Adrian's old patches is a first step here (but they need to be adjusted a little).

The shortlog:

sparc: copy exported sparc64 specific header files to asm-sparc
sparc: Merge asm-sparc{,64}/ioctl.h
sparc: Merge asm-sparc{,64}/ioctls.h
sparc: Merge asm-sparc{,64}/param.h
sparc: Merge asm-sparc{,64}/poll.h
sparc: Merge asm-sparc{,64}/socket.h
sparc: Merge asm-sparc{,64}/sockios.h
sparc: Merge asm-sparc{,64}/fcntl.h
sparc: Merge asm-sparc{,64}/msgbuf.h
sparc: Merge asm-sparc{,64}/sembuf.h
sparc: Merge asm-sparc{,64}/shmbuf.h
sparc: Merge asm-sparc{,64}/mman.h
sparc: copy asm-sparc64/fbio.h to asm-sparc
sparc: Merge asm-sparc{,64}/fbio.h
sparc: Merge asm-sparc{,64}/resource.h
sparc: Merge asm-sparc{,64}/setup.h
sparc: Merge asm-sparc{,64}/termbits.h
sparc: Merge asm-sparc{,64}/termios.h
sparc: Merge asm-sparc{,64}/types.h
sparc: export openprom.h to userspace
sparc: Merge asm-sparc{,64}/asi.h
sparc: copy sparc64 specific files to asm-sparc
sparc: when header files are equal use asm-sparc version
sparc: merge header files with trivial differences
sparc: join the remaining header files

The set could hae been done in much smaller steps but I could not see any benefit of it as they are all simple. The ones that actually changes something are small anyway.

I have tested that sparc and sparc64 defconfig builds after each individual patch including a headers_check run.

The patches can be pulled here:

ssh://master.kernel.org/pub/scm/linux/kernel/git/sam/sparc.git master

Note that the commit: 878e7a6e498bec55f10a163197c41554fb078416 ("sparc: remove CONFIG_SUN4") is not included.
I did not include it as this was independent of my work and I did not like to Sign-off something I really had not looked at. So please apply this commit by other means.

Patches will follow.

Sam

Diffstat:

Note:

406 files changed, 1986 insertions(+), 26505 deletions(-)

This is wrong - we do not end up with 26505 less lines. Seems that git diff forget to add lines for copied files.

git diff --stat -C -M -B HEAD~25..HEAD

 arch/sparc/kernel/entry.S                          |    1 +
 arch/sparc64/kernel/sys_sparc.c                    |    6 +-
 arch/sparc64/kernel/sys_sparc32.c                  |    4 +-
 include/asm-sparc/Kbuild                           |   15 +-
 include/{asm-sparc64 => asm-sparc}/agp.h           |    0 
 include/{asm-sparc64 => asm-sparc}/apb.h           |    0 
 include/asm-sparc/asi.h                            |  153 +-
 include/asm-sparc/atomic.h                         |  173 +--
 include/asm-sparc/{atomic.h => atomic_32.h}        |    0 
 .../atomic.h => asm-sparc/atomic_64.h}             |    0 
 include/asm-sparc/auxio.h                          |   97 +-
 include/asm-sparc/{auxio.h => auxio_32.h}          |    0 
 .../{asm-sparc64/auxio.h => asm-sparc/auxio_64.h}  |    0 
 include/{asm-sparc64 => asm-sparc}/backoff.h       |    0 
 include/{asm-sparc64 => asm-sparc}/bbc.h           |    0 
 include/asm-sparc/bitops.h                         |  119 +-
 include/asm-sparc/{bitops.h => bitops_32.h}        |    0 
 .../bitops.h => asm-sparc/bitops_64.h}             |    0 
 include/asm-sparc/cacheflush.h                     |   93 +-
 .../asm-sparc/{cacheflush.h => cacheflush_32.h}    |    0 
 .../cacheflush.h => asm-sparc/cacheflush_64.h}     |    0 
 include/{asm-sparc64 => asm-sparc}/chafsr.h        |    0 
 include/asm-sparc/checksum.h                       |  249 +--
 include/asm-sparc/{checksum.h => checksum_32.h}    |    0 
 .../checksum.h => asm-sparc/checksum_64.h}         |    0 
 include/{asm-sparc64 => asm-sparc}/chmctrl.h       |    0 
 include/{asm-sparc64 => asm-sparc}/cmt.h           |    0 
 include/{asm-sparc64 => asm-sparc}/compat.h        |    0 
 include/{asm-sparc64 => asm-sparc}/compat_signal.h |    0 
 include/asm-sparc/cpudata.h                        |   35 +-
 include/asm-sparc/{cpudata.h => cpudata_32.h}      |    0 
 .../cpudata.h => asm-sparc/cpudata_64.h}           |    0 
 include/{asm-sparc64 => asm-sparc}/dcr.h           |    0 
 include/{asm-sparc64 => asm-sparc}/dcu.h           |    0 
 include/asm-sparc/delay.h                          |   42 +-
 include/asm-sparc/{delay.h => delay_32.h}          |    0 
 include/asm-sparc/delay_64.h                       |   17 +
 include/{asm-sparc64 => asm-sparc}/display7seg.h   |    0 
 include/asm-sparc/dma-mapping.h                    |   17 +-
 include/asm-sparc/dma-mapping_32.h                 |   11 +
 .../dma-mapping.h => asm-sparc/dma-mapping_64.h}   |    0 
 include/asm-sparc/dma.h                            |  296 +--
 include/asm-sparc/{dma.h => dma_32.h}              |    0 
 include/{asm-sparc64/dma.h => asm-sparc/dma_64.h}  |    0 
 include/asm-sparc/ebus.h                           |  107 +-
 include/asm-sparc/{ebus.h => ebus_32.h}            |    0 
 .../{asm-sparc64/ebus.h => asm-sparc/ebus_64.h}    |    0 
 include/asm-sparc/elf.h                            |  153 +-
 include/asm-sparc/{elf.h => elf_32.h}              |    0 
 include/{asm-sparc64/elf.h => asm-sparc/elf_64.h}  |    0 
 include/{asm-sparc64 => asm-sparc}/envctrl.h       |    0 
 include/{asm-sparc64 => asm-sparc}/estate.h        |    0 
 include/asm-sparc/fbio.h                           |   37 +-
 include/asm-sparc/fcntl.h                          |    4 +
 include/{asm-sparc64 => asm-sparc}/fhc.h           |    0 
 include/asm-sparc/floppy.h                         |  396 +---
 include/asm-sparc/{floppy.h => floppy_32.h}        |    0 
 .../floppy.h => asm-sparc/floppy_64.h}             |    0 
 include/{asm-sparc64 => asm-sparc}/fpumacro.h      |    0 
 include/asm-sparc/futex.h                          |   12 +-
 include/asm-sparc/futex_32.h                       |    6 +
 .../{asm-sparc64/futex.h => asm-sparc/futex_64.h}  |    0 
 include/asm-sparc/hardirq.h                        |   31 +-
 include/asm-sparc/{hardirq.h => hardirq_32.h}      |    0 
 .../hardirq.h => asm-sparc/hardirq_64.h}           |    0 
 include/asm-sparc/head.h                           |  110 +-
 include/asm-sparc/{head.h => head_32.h}            |    0 
 .../{asm-sparc64/head.h => asm-sparc/head_64.h}    |    0 
 include/{asm-sparc64 => asm-sparc}/hugetlb.h       |    0 
 include/{asm-sparc64 => asm-sparc}/hvtramp.h       |    0 
 include/{asm-sparc64 => asm-sparc}/hypervisor.h    |    0 
 include/asm-sparc/ide.h                            |  103 +-
 include/asm-sparc/{ide.h => ide_32.h}              |    0 
 include/{asm-sparc64/ide.h => asm-sparc/ide_64.h}  |    0 
 include/asm-sparc/idprom.h                         |    2 +-
 include/{asm-sparc64 => asm-sparc}/intr_queue.h    |    0 
 include/asm-sparc/io.h                             |  333 +---
 include/asm-sparc/{io.h => io_32.h}                |    0 
 include/{asm-sparc64/io.h => asm-sparc/io_64.h}    |    0 
 include/asm-sparc/ioctls.h                         |    4 +-
 include/asm-sparc/iommu.h                          |  129 +-
 include/asm-sparc/{iommu.h => iommu_32.h}          |    0 
 .../{asm-sparc64/iommu.h => asm-sparc/iommu_64.h}  |    0 
 include/asm-sparc/ipcbuf.h                         |   39 +-
 include/asm-sparc/{ipcbuf.h => ipcbuf_32.h}        |    0 
 .../ipcbuf.h => asm-sparc/ipcbuf_64.h}             |    0 
 include/asm-sparc/irq.h                            |   21 +-
 include/asm-sparc/irq_32.h                         |   15 +
 include/{asm-sparc64/irq.h => asm-sparc/irq_64.h}  |    0 
 include/asm-sparc/irqflags.h                       |   47 +-
 include/asm-sparc/{irqflags.h => irqflags_32.h}    |    0 
 .../irqflags.h => asm-sparc/irqflags_64.h}         |    0 
 include/asm-sparc/kdebug.h                         |   81 +-
 include/asm-sparc/{kdebug.h => kdebug_32.h}        |    0 
 include/asm-sparc/kdebug_64.h                      |   19 +
 include/asm-sparc/kmap_types.h                     |    4 +
 include/{asm-sparc64 => asm-sparc}/kprobes.h       |    0 
 include/{asm-sparc64 => asm-sparc}/ldc.h           |    0 
 include/asm-sparc/lmb.h                            |   10 +
 include/{asm-sparc64 => asm-sparc}/lsu.h           |    0 
 include/asm-sparc/mc146818rtc.h                    |   37 +-
 .../asm-sparc/{mc146818rtc.h => mc146818rtc_32.h}  |    0 
 .../mc146818rtc.h => asm-sparc/mc146818rtc_64.h}   |    0 
 include/{asm-sparc64 => asm-sparc}/mdesc.h         |    0 
 include/asm-sparc/mmu.h                            |   13 +-
 include/asm-sparc/mmu_32.h                         |    7 +
 include/{asm-sparc64/mmu.h => asm-sparc/mmu_64.h}  |    0 
 include/asm-sparc/mmu_context.h                    |   50 +-
 .../asm-sparc/{mmu_context.h => mmu_context_32.h}  |    0 
 .../mmu_context.h => asm-sparc/mmu_context_64.h}   |    0 
 include/{asm-sparc64 => asm-sparc}/mmzone.h        |    0 
 include/asm-sparc/module.h                         |   15 +-
 include/asm-sparc/module_32.h                      |    7 +
 include/asm-sparc/module_64.h                      |    7 +
 include/asm-sparc/mostek.h                         |  179 +--
 include/asm-sparc/{mostek.h => mostek_32.h}        |    0 
 .../mostek.h => asm-sparc/mostek_64.h}             |    0 
 include/asm-sparc/msgbuf.h                         |   23 +-
 include/asm-sparc/namei.h                          |   21 +-
 include/asm-sparc/namei_32.h                       |   13 +
 include/asm-sparc/namei_64.h                       |   13 +
 include/{asm-sparc64 => asm-sparc}/ns87303.h       |    0 
 include/asm-sparc/of_platform.h                    |   32 +-
 .../asm-sparc/{of_platform.h => of_platform_32.h}  |    0 
 .../of_platform.h => asm-sparc/of_platform_64.h}   |    0 
 include/asm-sparc/openprom.h                       |  265 +--
 include/asm-sparc/openprom_32.h                    |  255 ++
 .../openprom.h => asm-sparc/openprom_64.h}         |    0 
 include/asm-sparc/oplib.h                          |  280 +--
 include/asm-sparc/{oplib.h => oplib_32.h}          |    0 
 .../{asm-sparc64/oplib.h => asm-sparc/oplib_64.h}  |    0 
 include/asm-sparc/page.h                           |  171 +--
 include/asm-sparc/{page.h => page_32.h}            |    0 
 .../{asm-sparc64/page.h => asm-sparc/page_64.h}    |    0 
 include/{asm-sparc64 => asm-sparc}/parport.h       |    0 
 include/asm-sparc/pci.h                            |  178 +--
 include/asm-sparc/{pci.h => pci_32.h}              |    0 
 include/{asm-sparc64/pci.h => asm-sparc/pci_64.h}  |    0 
 include/asm-sparc/percpu.h                         |   14 +-
 include/asm-sparc/percpu_32.h                      |    6 +
 .../percpu.h => asm-sparc/percpu_64.h}             |    0 
 include/asm-sparc/pgalloc.h                        |   76 +-
 include/asm-sparc/{pgalloc.h => pgalloc_32.h}      |    0 
 .../pgalloc.h => asm-sparc/pgalloc_64.h}           |    0 
 include/asm-sparc/pgtable.h                        |  483 +----
 include/asm-sparc/pgtable_32.h                     |  480 ++++
 .../pgtable.h => asm-sparc/pgtable_64.h}           |    0 
 include/{asm-sparc64 => asm-sparc}/pil.h           |    0 
 include/asm-sparc/posix_types.h                    |  126 +-
 .../asm-sparc/{posix_types.h => posix_types_32.h}  |    0 
 .../posix_types.h => asm-sparc/posix_types_64.h}   |    0 
 include/asm-sparc/processor.h                      |  136 +-
 include/asm-sparc/{processor.h => processor_32.h}  |    0 
 .../processor.h => asm-sparc/processor_64.h}       |    0 
 include/{asm-sparc64 => asm-sparc}/psrcompat.h     |    0 
 include/{asm-sparc64 => asm-sparc}/pstate.h        |    0 
 include/asm-sparc/ptrace.h                         |  183 +--
 include/asm-sparc/{ptrace.h => ptrace_32.h}        |    0 
 .../ptrace.h => asm-sparc/ptrace_64.h}             |    0 
 include/asm-sparc/reboot.h                         |    6 +
 include/asm-sparc/reg.h                            |   87 +-
 include/asm-sparc/{reg.h => reg_32.h}              |    0 
 include/{asm-sparc64/reg.h => asm-sparc/reg_64.h}  |    0 
 include/asm-sparc/resource.h                       |    6 +-
 include/{asm-sparc64 => asm-sparc}/rwsem-const.h   |    0 
 include/{asm-sparc64 => asm-sparc}/rwsem.h         |    0 
 include/asm-sparc/sbus.h                           |  161 +-
 include/asm-sparc/{sbus.h => sbus_32.h}            |    0 
 .../{asm-sparc64/sbus.h => asm-sparc/sbus_64.h}    |    0 
 include/asm-sparc/scatterlist.h                    |   34 +-
 .../asm-sparc/{scatterlist.h => scatterlist_32.h}  |    0 
 .../scatterlist.h => asm-sparc/scatterlist_64.h}   |    0 
 include/{asm-sparc64 => asm-sparc}/scratchpad.h    |    0 
 include/{asm-sparc64 => asm-sparc}/seccomp.h       |    0 
 include/asm-sparc/sections.h                       |   12 +-
 include/asm-sparc/sections_32.h                    |    6 +
 include/asm-sparc/sections_64.h                    |    9 +
 include/asm-sparc/sembuf.h                         |   12 +-
 include/asm-sparc/setup.h                          |    6 +-
 include/{asm-sparc64 => asm-sparc}/sfafsr.h        |    0 
 include/asm-sparc/sfp-machine.h                    |  220 +--
 .../asm-sparc/{sfp-machine.h => sfp-machine_32.h}  |    0 
 .../sfp-machine.h => asm-sparc/sfp-machine_64.h}   |    0 
 include/asm-sparc/shmbuf.h                         |   14 +-
 include/asm-sparc/shmparam.h                       |   19 +-
 include/asm-sparc/shmparam_32.h                    |   11 +
 include/asm-sparc/shmparam_64.h                    |   10 +
 include/asm-sparc/sigcontext.h                     |   70 +-
 .../asm-sparc/{sigcontext.h => sigcontext_32.h}    |    0 
 .../sigcontext.h => asm-sparc/sigcontext_64.h}     |    0 
 include/asm-sparc/siginfo.h                        |   25 +-
 include/asm-sparc/siginfo_32.h                     |   17 +
 .../siginfo.h => asm-sparc/siginfo_64.h}           |    0 
 include/asm-sparc/signal.h                         |  215 +--
 include/asm-sparc/{signal.h => signal_32.h}        |    0 
 .../signal.h => asm-sparc/signal_64.h}             |    0 
 include/asm-sparc/smp.h                            |  181 +--
 include/asm-sparc/{smp.h => smp_32.h}              |    0 
 include/{asm-sparc64/smp.h => asm-sparc/smp_64.h}  |    0 
 include/asm-sparc/sparsemem.h                      |   12 +
 include/asm-sparc/spinlock.h                       |  200 +--
 include/asm-sparc/{spinlock.h => spinlock_32.h}    |    0 
 .../spinlock.h => asm-sparc/spinlock_64.h}         |    0 
 include/asm-sparc/spinlock_types.h                 |    2 +-
 include/{asm-sparc64 => asm-sparc}/spitfire.h      |    0 
 include/asm-sparc/sstate.h                         |   13 +
 include/asm-sparc/stacktrace.h                     |    6 +
 include/{asm-sparc64 => asm-sparc}/starfire.h      |    0 
 include/asm-sparc/stat.h                           |   84 +-
 include/asm-sparc/{stat.h => stat_32.h}            |    0 
 .../{asm-sparc64/stat.h => asm-sparc/stat_64.h}    |    0 
 include/asm-sparc/statfs.h                         |   12 +-
 include/asm-sparc/statfs_32.h                      |    6 +
 .../statfs.h => asm-sparc/statfs_64.h}             |    0 
 include/asm-sparc/string.h                         |  213 +--
 include/asm-sparc/{string.h => string_32.h}        |    0 
 .../string.h => asm-sparc/string_64.h}             |    0 
 include/asm-sparc/syscalls.h                       |   13 +
 include/asm-sparc/system.h                         |  296 +--
 include/asm-sparc/{system.h => system_32.h}        |    0 
 .../system.h => asm-sparc/system_64.h}             |    0 
 include/asm-sparc/termbits.h                       |    5 +
 include/asm-sparc/termios.h                        |   79 +-
 include/asm-sparc/thread_info.h                    |  159 +-
 .../asm-sparc/{thread_info.h => thread_info_32.h}  |    0 
 .../thread_info.h => asm-sparc/thread_info_64.h}   |    0 
 include/asm-sparc/timer.h                          |  115 +-
 include/asm-sparc/{timer.h => timer_32.h}          |    0 
 .../{asm-sparc64/timer.h => asm-sparc/timer_64.h}  |    0 
 include/asm-sparc/timex.h                          |   21 +-
 include/asm-sparc/timex_32.h                       |   15 +
 include/asm-sparc/timex_64.h                       |   19 +
 include/asm-sparc/tlb.h                            |   32 +-
 include/asm-sparc/{tlb.h => tlb_32.h}              |    0 
 include/{asm-sparc64/tlb.h => asm-sparc/tlb_64.h}  |    0 
 include/asm-sparc/tlbflush.h                       |   68 +-
 include/asm-sparc/{tlbflush.h => tlbflush_32.h}    |    0 
 .../tlbflush.h => asm-sparc/tlbflush_64.h}         |    0 
 include/asm-sparc/topology.h                       |   14 +-
 include/asm-sparc/topology_32.h                    |    6 +
 .../topology.h => asm-sparc/topology_64.h}         |    0 
 include/{asm-sparc64 => asm-sparc}/tsb.h           |    0 
 include/{asm-sparc64 => asm-sparc}/ttable.h        |    0 
 include/asm-sparc/types.h                          |   32 +-
 include/asm-sparc/uaccess.h                        |  344 +---
 include/asm-sparc/{uaccess.h => uaccess_32.h}      |    0 
 .../uaccess.h => asm-sparc/uaccess_64.h}           |    0 
 include/{asm-sparc64 => asm-sparc}/uctx.h          |    0 
 include/asm-sparc/unistd.h                         |  386 +---
 include/asm-sparc/{unistd.h => unistd_32.h}        |    0 
 .../unistd.h => asm-sparc/unistd_64.h}             |    0 
 include/{asm-sparc64 => asm-sparc}/upa.h           |    0 
 include/{asm-sparc64 => asm-sparc}/utrap.h         |    0 
 include/asm-sparc/vaddrs.h                         |    5 -
 include/{asm-sparc64 => asm-sparc}/vio.h           |    0 
 include/{asm-sparc64 => asm-sparc}/visasm.h        |    0 
 include/{asm-sparc64 => asm-sparc}/watchdog.h      |    0 
 include/asm-sparc/xor.h                            |  277 +--
 include/asm-sparc/{xor.h => xor_32.h}              |    0 
 include/{asm-sparc64/xor.h => asm-sparc/xor_64.h}  |    0 
 include/asm-sparc64/Kbuild                         |   22 +-
 include/asm-sparc64/agp.h                          |   21 +-
 include/asm-sparc64/apb.h                          |   37 +-
 include/asm-sparc64/asi.h                          |  161 +--
 include/asm-sparc64/atomic.h                       |  129 +-
 include/asm-sparc64/auxio.h                        |  101 +-
 include/asm-sparc64/backoff.h                      |   32 +-
 include/asm-sparc64/bbc.h                          |  226 +--
 include/asm-sparc64/bitops.h                       |  108 +-
 include/asm-sparc64/cacheflush.h                   |   77 +-
 include/asm-sparc64/chafsr.h                       |  242 +--
 include/asm-sparc64/checksum.h                     |  168 +--
 include/asm-sparc64/chmctrl.h                      |  184 +--
 include/asm-sparc64/cmt.h                          |   60 +-
 include/asm-sparc64/compat.h                       |  244 +--
 include/asm-sparc64/compat_signal.h                |   30 +-
 include/asm-sparc64/cpudata.h                      |  241 +--
 include/asm-sparc64/dcr.h                          |   15 +-
 include/asm-sparc64/dcu.h                          |   28 +-
 include/asm-sparc64/delay.h                        |   18 +-
 include/asm-sparc64/display7seg.h                  |   80 +-
 include/asm-sparc64/dma-mapping.h                  |  155 +-
 include/asm-sparc64/dma.h                          |  206 +--
 include/asm-sparc64/ebus.h                         |   95 +-
 include/asm-sparc64/elf.h                          |  218 +--
 include/asm-sparc64/envctrl.h                      |  104 +-
 include/asm-sparc64/estate.h                       |   50 +-
 include/asm-sparc64/fbio.h                         |  331 +---
 include/asm-sparc64/fcntl.h                        |   36 +-
 include/asm-sparc64/fhc.h                          |  122 +-
 include/asm-sparc64/floppy.h                       |  783 +------
 include/asm-sparc64/fpumacro.h                     |   34 +-
 include/asm-sparc64/futex.h                        |  111 +-
 include/asm-sparc64/hardirq.h                      |   20 +-
 include/asm-sparc64/head.h                         |   77 +-
 include/asm-sparc64/hugetlb.h                      |   85 +-
 include/asm-sparc64/hvtramp.h                      |   38 +-
 include/asm-sparc64/hw_irq.h                       |    5 +-
 include/asm-sparc64/hypervisor.h                   | 2946 +-------------------
 include/asm-sparc64/ide.h                          |  119 +-
 include/asm-sparc64/idprom.h                       |   26 +-
 include/asm-sparc64/intr_queue.h                   |   16 +-
 include/asm-sparc64/io.h                           |  512 +----
 include/asm-sparc64/ioctl.h                        |   68 +-
 include/asm-sparc64/ioctls.h                       |  137 +-
 include/asm-sparc64/iommu.h                        |   63 +-
 include/asm-sparc64/ipcbuf.h                       |   29 +-
 include/asm-sparc64/irq.h                          |   94 +-
 include/asm-sparc64/irq_regs.h                     |    2 +-
 include/asm-sparc64/irqflags.h                     |   90 +-
 include/asm-sparc64/kdebug.h                       |   20 +-
 include/asm-sparc64/kmap_types.h                   |   26 +-
 include/asm-sparc64/kprobes.h                      |   50 +-
 include/asm-sparc64/kvm.h                          |    7 +-
 include/asm-sparc64/ldc.h                          |  139 +-
 include/asm-sparc64/linkage.h                      |    7 +-
 include/asm-sparc64/lmb.h                          |   11 +-
 include/asm-sparc64/lsu.h                          |   20 +-
 include/asm-sparc64/mc146818rtc.h                  |   35 +-
 include/asm-sparc64/mdesc.h                        |   79 +-
 include/asm-sparc64/mman.h                         |   32 +-
 include/asm-sparc64/mmu.h                          |  128 +-
 include/asm-sparc64/mmu_context.h                  |  156 +-
 include/asm-sparc64/mmzone.h                       |   18 +-
 include/asm-sparc64/module.h                       |    8 +-
 include/asm-sparc64/mostek.h                       |  144 +-
 include/asm-sparc64/msgbuf.h                       |   28 +-
 include/asm-sparc64/mutex.h                        |   10 +-
 include/asm-sparc64/namei.h                        |   14 +-
 include/asm-sparc64/ns87303.h                      |  119 +-
 include/asm-sparc64/of_platform.h                  |   26 +-
 include/asm-sparc64/openprom.h                     |  281 +--
 include/asm-sparc64/oplib.h                        |  323 +---
 include/asm-sparc64/page.h                         |  143 +-
 include/asm-sparc64/param.h                        |   24 +-
 include/asm-sparc64/parport.h                      |  247 +--
 include/asm-sparc64/pci.h                          |  210 +--
 include/asm-sparc64/percpu.h                       |   29 +-
 include/asm-sparc64/pgalloc.h                      |   82 +-
 include/asm-sparc64/pgtable.h                      |  782 +------
 include/asm-sparc64/pil.h                          |   22 +-
 include/asm-sparc64/poll.h                         |   13 +-
 include/asm-sparc64/posix_types.h                  |  123 +-
 include/asm-sparc64/processor.h                    |  238 +--
 include/asm-sparc64/psrcompat.h                    |   46 +-
 include/asm-sparc64/pstate.h                       |   92 +-
 include/asm-sparc64/ptrace.h                       |  347 +---
 include/asm-sparc64/reboot.h                       |    7 +-
 include/asm-sparc64/reg.h                          |   57 +-
 include/asm-sparc64/resource.h                     |   20 +-
 include/asm-sparc64/rtc.h                          |   27 +-
 include/asm-sparc64/rwsem-const.h                  |   13 +-
 include/asm-sparc64/rwsem.h                        |   85 +-
 include/asm-sparc64/sbus.h                         |  191 +--
 include/asm-sparc64/scatterlist.h                  |   28 +-
 include/asm-sparc64/scratchpad.h                   |   15 +-
 include/asm-sparc64/seccomp.h                      |   22 +-
 include/asm-sparc64/sections.h                     |   10 +-
 include/asm-sparc64/semaphore.h                    |    2 +-
 include/asm-sparc64/sembuf.h                       |   23 +-
 include/asm-sparc64/setup.h                        |   11 +-
 include/asm-sparc64/sfafsr.h                       |   83 +-
 include/asm-sparc64/sfp-machine.h                  |   94 +-
 include/asm-sparc64/shmbuf.h                       |   39 +-
 include/asm-sparc64/shmparam.h                     |   11 +-
 include/asm-sparc64/sigcontext.h                   |   88 +-
 include/asm-sparc64/siginfo.h                      |   33 +-
 include/asm-sparc64/signal.h                       |  195 +--
 include/asm-sparc64/smp.h                          |   65 +-
 include/asm-sparc64/socket.h                       |   58 +-
 include/asm-sparc64/sockios.h                      |   15 +-
 include/asm-sparc64/sparsemem.h                    |   13 +-
 include/asm-sparc64/spinlock.h                     |  251 +--
 include/asm-sparc64/spinlock_types.h               |   21 +-
 include/asm-sparc64/spitfire.h                     |  343 +---
 include/asm-sparc64/sstate.h                       |   14 +-
 include/asm-sparc64/stacktrace.h                   |    7 +-
 include/asm-sparc64/starfire.h                     |   22 +-
 include/asm-sparc64/stat.h                         |   48 +-
 include/asm-sparc64/statfs.h                       |   55 +-
 include/asm-sparc64/string.h                       |   84 +-
 include/asm-sparc64/sunbpp.h                       |   81 +-
 include/asm-sparc64/syscalls.h                     |   14 +-
 include/asm-sparc64/system.h                       |  356 +---
 include/asm-sparc64/termbits.h                     |  261 +--
 include/asm-sparc64/termios.h                      |  187 +--
 include/asm-sparc64/thread_info.h                  |  278 +--
 include/asm-sparc64/timer.h                        |   31 +-
 include/asm-sparc64/timex.h                        |   20 +-
 include/asm-sparc64/tlb.h                          |  112 +-
 include/asm-sparc64/tlbflush.h                     |   45 +-
 include/asm-sparc64/topology.h                     |   87 +-
 include/asm-sparc64/tsb.h                          |  284 +--
 include/asm-sparc64/ttable.h                       |  659 +-----
 include/asm-sparc64/types.h                        |   35 +-
 include/asm-sparc64/uaccess.h                      |  274 +--
 include/asm-sparc64/uctx.h                         |   72 +-
 include/asm-sparc64/unaligned.h                    |   11 +-
 include/asm-sparc64/unistd.h                       |  374 +---
 include/asm-sparc64/upa.h                          |  110 +-
 include/asm-sparc64/utrap.h                        |   52 +-
 include/asm-sparc64/vga.h                          |   34 +-
 include/asm-sparc64/vio.h                          |  407 +---
 include/asm-sparc64/visasm.h                       |   63 +-
 include/asm-sparc64/watchdog.h                     |   32 +-
 include/asm-sparc64/xor.h                          |   71 +-
 406 files changed, 1986 insertions(+), 26505 deletions(-)
#1 lore raw
Quoted 5 lines

Note:

406 files changed, 1986 insertions(+), 26505 deletions(-)

This is wrong - we do not end up with 26505 less lines. Seems that git diff forget to add lines for copied files.

Tried to upgrade git and now I got:

406 files changed, 977 insertions(+), 26508 deletions(-)

So slightly different numbers - I did not dig into why. But the "insertions" count seem still too low.

Sam

#3 lore raw
In reply to Sam Ravnborg
Quoted 5 lines · Sam Ravnborg

...
When we are this far we should aim at unifying the obvious header file candidates and Adrian's old patches is a first step here (but they need to be adjusted a little).
...

As soon as David applies them I'll work on this.

Quoted 2 lines

Sam
...

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#4 lore raw
In reply to Sam Ravnborg

From: Sam Ravnborg <[email protected]>
Date: Sun, 29 Jun 2008 00:02:35 +0200

Quoted 9 lines

The patches can be pulled here:

ssh://master.kernel.org/pub/scm/linux/kernel/git/sam/sparc.git master

Note that the commit: 878e7a6e498bec55f10a163197c41554fb078416 ("sparc: remove CONFIG_SUN4") is not included.
I did not include it as this was independent of my work and I did not like to Sign-off something I really had not looked at. So please apply this commit by other means.

Ok, I've pulled all of this into my sparc-next-2.6 tree.

Thanks a lot Sam!

#5 lore raw
In reply to Sam Ravnborg

From: David Miller <[email protected]>
Date: Thu, 03 Jul 2008 00:50:52 -0700 (PDT)

Quoted 7 lines

From: Sam Ravnborg <[email protected]>
Date: Sun, 29 Jun 2008 00:02:35 +0200

Quoted 4 lines

The patches can be pulled here:

ssh://master.kernel.org/pub/scm/linux/kernel/git/sam/sparc.git master

Quoted 7 lines
Quoted 5 lines

Note that the commit: 878e7a6e498bec55f10a163197c41554fb078416 ("sparc: remove CONFIG_SUN4") is not included.
I did not include it as this was independent of my work and I did not like to Sign-off something I really had not looked at. So please apply this commit by other means.

Ok, I've pulled all of this into my sparc-next-2.6 tree.

Unfortunately, this explodes. I wonder what your build environment was when testing this with on sparc64, because I can't see how this could possibly work.

In file included from include/asm-sparc/page.h:6,
from include/asm/page.h:1,
from arch/sparc64/kernel/vmlinux.lds.S:3:
include/asm-sparc/page_32.h:24:25: error: asm/btfixup.h: No such file or directory

When we run vmlinux.lds.S through CPP, it undefines things like "sparc" with the '-Usparc -Usparc64' options that get passed in. So the ifdef tests in asm-sparc/page.h do not work.

Is it expected that this will only build with your kbuild bits pulled in too?

#6 lore raw
In reply to Sam Ravnborg

From: David Miller <[email protected]>
Date: Thu, 03 Jul 2008 01:12:53 -0700 (PDT)

Quoted 7 lines

From: David Miller <[email protected]>
Date: Thu, 03 Jul 2008 00:50:52 -0700 (PDT)

In file included from include/asm-sparc/page.h:6,
from include/asm/page.h:1,
from arch/sparc64/kernel/vmlinux.lds.S:3:
include/asm-sparc/page_32.h:24:25: error: asm/btfixup.h: No such file or directory

Sam, because of this, I'm reverting the tree back to
20c51e6 ("sparc64 Kbuild: apb.h and bbc.h should not be exported to userspace")

#7 lore raw
In reply to Sam Ravnborg
Quoted 16 lines · David Miller

From: David Miller <[email protected]>
Date: Thu, 03 Jul 2008 00:50:52 -0700 (PDT)

Quoted 13 lines

From: Sam Ravnborg <[email protected]>
Date: Sun, 29 Jun 2008 00:02:35 +0200

Quoted 9 lines

The patches can be pulled here:

ssh://master.kernel.org/pub/scm/linux/kernel/git/sam/sparc.git master

Note that the commit: 878e7a6e498bec55f10a163197c41554fb078416 ("sparc: remove CONFIG_SUN4") is not included.
I did not include it as this was independent of my work and I did not like to Sign-off something I really had not looked at. So please apply this commit by other means.

Quoted 5 lines
Quoted 1 line

Ok, I've pulled all of this into my sparc-next-2.6 tree.

Unfortunately, this explodes. I wonder what your build environment was when testing this with on sparc64, because I can't see how this could possibly work.

Hmmm, I have a crosstool build sparc64 toolchain. And I did do a defconfig build for each patch applied for both sparc and spac64. But despite this something is obviously bad. I will look at it later this week as time permits.

Quoted 6 lines

In file included from include/asm-sparc/page.h:6,
from include/asm/page.h:1,
from arch/sparc64/kernel/vmlinux.lds.S:3:
include/asm-sparc/page_32.h:24:25: error: asm/btfixup.h: No such file or directory

Quoted 6 lines

When we run vmlinux.lds.S through CPP, it undefines things like "sparc" with the '-Usparc -Usparc64' options that get passed in. So the ifdef tests in asm-sparc/page.h do not work.

Is it expected that this will only build with your kbuild bits pulled in too?

Nope - it is independent of that.

Sam

#8 lore raw
In reply to Sam Ravnborg
Quoted 27 lines · David Miller

From: David Miller <[email protected]>
Date: Thu, 03 Jul 2008 00:50:52 -0700 (PDT)

Quoted 7 lines

From: Sam Ravnborg <[email protected]>
Date: Sun, 29 Jun 2008 00:02:35 +0200

Quoted 4 lines

The patches can be pulled here:

ssh://master.kernel.org/pub/scm/linux/kernel/git/sam/sparc.git master

Quoted 7 lines
Quoted 5 lines

Note that the commit: 878e7a6e498bec55f10a163197c41554fb078416 ("sparc: remove CONFIG_SUN4") is not included.
I did not include it as this was independent of my work and I did not like to Sign-off something I really had not looked at. So please apply this commit by other means.

Ok, I've pulled all of this into my sparc-next-2.6 tree.

Unfortunately, this explodes. I wonder what your build environment was when testing this with on sparc64, because I can't see how this could possibly work.

In file included from include/asm-sparc/page.h:6,
from include/asm/page.h:1,
from arch/sparc64/kernel/vmlinux.lds.S:3:
include/asm-sparc/page_32.h:24:25: error: asm/btfixup.h: No such file or directory

Quoted 4 lines

When we run vmlinux.lds.S through CPP, it undefines things like "sparc" with the '-Usparc -Usparc64' options that get passed in. So the ifdef tests in asm-sparc/page.h do not work.
...

It also builds for me (gcc 4.3.1) since -Usparc is not -U__sparc__ (if I add the latter I get your build error).

Did gcc's behavior change in this area?

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#9 lore raw
In reply to Sam Ravnborg

From: Adrian Bunk <[email protected]>
Date: Thu, 3 Jul 2008 23:02:07 +0300

Quoted 14 lines · David Miller
Quoted 8 lines

From: David Miller <[email protected]>
Date: Thu, 03 Jul 2008 00:50:52 -0700 (PDT)

In file included from include/asm-sparc/page.h:6,
from include/asm/page.h:1,
from arch/sparc64/kernel/vmlinux.lds.S:3:
include/asm-sparc/page_32.h:24:25: error: asm/btfixup.h: No such file or directory

Quoted 4 lines

When we run vmlinux.lds.S through CPP, it undefines things like "sparc" with the '-Usparc -Usparc64' options that get passed in. So the ifdef tests in asm-sparc/page.h do not work.
...

Quoted 4 lines

It also builds for me (gcc 4.3.1) since -Usparc is not -U__sparc__ (if I add the latter I get your build error).

Did gcc's behavior change in this area?

Strange, I'll look more closely at this.

#10 lore raw
In reply to Sam Ravnborg
Quoted 17 lines · David Miller

From: Adrian Bunk <[email protected]>
Date: Thu, 3 Jul 2008 23:02:07 +0300

Quoted 14 lines · David Miller
Quoted 12 lines

From: David Miller <[email protected]>
Date: Thu, 03 Jul 2008 00:50:52 -0700 (PDT)

In file included from include/asm-sparc/page.h:6,
from include/asm/page.h:1,
from arch/sparc64/kernel/vmlinux.lds.S:3:
include/asm-sparc/page_32.h:24:25: error: asm/btfixup.h: No such file or directory

When we run vmlinux.lds.S through CPP, it undefines things like "sparc" with the '-Usparc -Usparc64' options that get passed in. So the ifdef tests in asm-sparc/page.h do not work.
...

Quoted 6 lines
Quoted 4 lines

It also builds for me (gcc 4.3.1) since -Usparc is not -U__sparc__ (if I add the latter I get your build error).

Did gcc's behavior change in this area?

Strange, I'll look more closely at this.

I have tried different scenarios here to reproduce it - so far without luck. As in "build for me with my toolchain".

What I have concentrated on has been to build a kernel, apply patches, build kernel again. But everything just works.

And to be sure I did a fresh pull from sam/sparc.git so I should have the same stuff as you are testing.

Sam

#11 lore raw
In reply to Sam Ravnborg
Quoted 33 lines · Adrian Bunk
Quoted 27 lines · David Miller

From: David Miller <[email protected]>
Date: Thu, 03 Jul 2008 00:50:52 -0700 (PDT)

Quoted 7 lines

From: Sam Ravnborg <[email protected]>
Date: Sun, 29 Jun 2008 00:02:35 +0200

Quoted 4 lines

The patches can be pulled here:

ssh://master.kernel.org/pub/scm/linux/kernel/git/sam/sparc.git master

Quoted 7 lines
Quoted 5 lines

Note that the commit: 878e7a6e498bec55f10a163197c41554fb078416 ("sparc: remove CONFIG_SUN4") is not included.
I did not include it as this was independent of my work and I did not like to Sign-off something I really had not looked at. So please apply this commit by other means.

Ok, I've pulled all of this into my sparc-next-2.6 tree.

Unfortunately, this explodes. I wonder what your build environment was when testing this with on sparc64, because I can't see how this could possibly work.

In file included from include/asm-sparc/page.h:6,
from include/asm/page.h:1,
from arch/sparc64/kernel/vmlinux.lds.S:3:
include/asm-sparc/page_32.h:24:25: error: asm/btfixup.h: No such file or directory

Quoted 4 lines

When we run vmlinux.lds.S through CPP, it undefines things like "sparc" with the '-Usparc -Usparc64' options that get passed in. So the ifdef tests in asm-sparc/page.h do not work.
...

Quoted 4 lines

It also builds for me (gcc 4.3.1) since -Usparc is not -U__sparc__ (if I add the latter I get your build error).

Did gcc's behavior change in this area?

Thanks for testing Adrian.

Sam

#12 lore raw
In reply to Sam Ravnborg
Quoted 18 lines · David Miller

From: David Miller <[email protected]>
Date: Thu, 03 Jul 2008 00:50:52 -0700 (PDT)

Quoted 7 lines

From: Sam Ravnborg <[email protected]>
Date: Sun, 29 Jun 2008 00:02:35 +0200

Quoted 4 lines

The patches can be pulled here:

ssh://master.kernel.org/pub/scm/linux/kernel/git/sam/sparc.git master

Quoted 7 lines
Quoted 5 lines

Note that the commit: 878e7a6e498bec55f10a163197c41554fb078416 ("sparc: remove CONFIG_SUN4") is not included.
I did not include it as this was independent of my work and I did not like to Sign-off something I really had not looked at. So please apply this commit by other means.

Ok, I've pulled all of this into my sparc-next-2.6 tree.

Quoted 9 lines

Unfortunately, this explodes. I wonder what your build environment was when testing this with on sparc64, because I can't see how this could possibly work.

In file included from include/asm-sparc/page.h:6,
from include/asm/page.h:1,
from arch/sparc64/kernel/vmlinux.lds.S:3:
include/asm-sparc/page_32.h:24:25: error: asm/btfixup.h: No such file or directory

Trying to analyse the above a bit more.

vmlinux.lds.S:3
#include <asm/page.h>

include/asm/page.h:1
#include <asm-sparc/page.h>

include/asm-sparc/page.h:6
#include <asm-sparc/page_32.h>

So this looks correct except that we include the wrong header file. So the test:
#if defined(__sparc__) && defined(__arch64__)

is the bad one.

Can you try to check the output of:
touch foo.h; gcc -dM foo.h

It should produce a list of all defines used by the preprocessor. I will expect that __arch64__ is in between as this is the bug I presume.

If __arch64__ is not defined do you then have any good idea how to do this check without involving any CONFIG_ options as this shall work reliable also in user space.

We can fix the -Usparc64 for the vmlinux.lds file if the right check is:
#if defined(__sparc__) && defined(sparc64)

Another suspisicion I have is that you use a self-build gcc that supports both 32 and 64 bit and that gcc fails to define __arch64__ in the sparc64 case despite being passed '-m64'.
But this is just a suspision and I have noting to back it up.

Sam

#13 lore raw
In reply to Sam Ravnborg
Quoted 6 lines

So this looks correct except that we include the wrong header file. So the test:
#if defined(__sparc__) && defined(__arch64__)

is the bad one.

....

Quoted 3 lines

We can fix the -Usparc64 for the vmlinux.lds file if the right check is:
#if defined(__sparc__) && defined(sparc64)

I think this is the right way to go so I have locally committed the following patch.
I will adjust the other 25 patches and then drop you another mail.
It may take a few days as I'm busy with other stuff.

Sam

commit 642a206ead6b3dc47a3152c428241d542c079461

Author: Sam Ravnborg <[email protected]>
Date:   Sat Jul 5 22:47:22 2008 +0200

sparc: allow use of sparc64 in header files

Move the undefine of sparc64 down into the .lds file thus allowing use of the following conditional in header files:

:#ifdef sparc64
: here goes 64 bit stuff
:#else
: here goes 32 bit stuff
:#endif

We will use the above when unifying sparc and sparc64.

arch/sparc64/Makefile +0 -2
index 4b8f2b0..3e897c5 100644
@@ -9,8 +9,6 @@
 
 CHECKFLAGS	+= -D__sparc__ -D__sparc_v9__ -m64
 
-CPPFLAGS_vmlinux.lds += -Usparc
-
 LDFLAGS		:= -m elf64_sparc
 
 KBUILD_CFLAGS += -m64 -pipe -mno-fpu -mcpu=ultrasparc -mcmodel=medlow \
arch/sparc64/kernel/Makefile +3 -0
index ec4f5eb..f9273c8 100644
@@ -5,6 +5,9 @@
 EXTRA_AFLAGS := -ansi
 EXTRA_CFLAGS := -Werror
 
+# Override default CPPFLAGS to avoid undef of sparc64
+CPPFLAGS_vmlinux.lds += -P -C
+
 extra-y		:= head.o init_task.o vmlinux.lds
 
 obj-y		:= process.o setup.o cpu.o idprom.o \
arch/sparc64/kernel/vmlinux.lds.S +3 -0
index 01f8096..907282f 100644
@@ -3,6 +3,9 @@
 #include <asm/page.h>
 #include <asm-generic/vmlinux.lds.h>
 
+/* We use sparc symbol below so override the gcc define of sparc */
+#undef sparc
+
 OUTPUT_FORMAT("elf64-sparc", "elf64-sparc", "elf64-sparc")
 OUTPUT_ARCH(sparc:v9a)
 ENTRY(_start)
#14 lore raw
In reply to Sam Ravnborg
Quoted 5 lines · Sam Ravnborg
Quoted 5 lines

So this looks correct except that we include the wrong header file. So the test:
#if defined(__sparc__) && defined(__arch64__)

Quoted 8 lines
Quoted 1 line

is the bad one.

....

Quoted 3 lines

We can fix the -Usparc64 for the vmlinux.lds file if the right check is:
#if defined(__sparc__) && defined(sparc64)

I think this is the right way to go so I have locally committed the following patch.

Hmm, I was fooled by something else. My sparc64 gcc does NOT define the sparc64 symbol.
I defines:
__sparc_v9__
and
__arch64__

to say this is sparc64.

So I really need the output of:
touch foo.c; cpp -dM foo.c

to select the right combination of options before I can proceed.

Sam

#15 lore raw
In reply to Sam Ravnborg

From: Sam Ravnborg <[email protected]>
Date: Sun, 6 Jul 2008 01:03:48 +0200

Quoted 2 lines

Hmm, I was fooled by something else. My sparc64 gcc does NOT define the sparc64 symbol.

And it should not :-)

Quoted 5 lines

I defines:
__sparc_v9__
and
__arch64__

Quoted 7 lines

to say this is sparc64.

So I really need the output of:
touch foo.c; cpp -dM foo.c

to select the right combination of options before I can proceed.

As I stated from the beginning, the correct test is "__sparc__ && __arch64__" which is what you are using.

Of course, you want me to provide "cpp -m64..." not just "cpp" output. Because otherwise it will produce a list of 32-bit CPP predefines. As you can see in the sparc64 Makefiles we add "-m64" to the CFLAGS.

Maybe that's the problem? Normal CFLAGS are not being propagated to the CPP's CFLAGS. And you guys don't see it because you are using cross compilers which default to 64-bit output. That would explain everything.

davem@sunset:~/src/GIT/net-2.6$ cpp -m64 -dM foo.c
#define __DBL_MIN_EXP__ (-1021)
#define __FLT_MIN__ 1.17549435e-38F
#define __CHAR_BIT__ 8
#define __WCHAR_MAX__ 2147483647
#define __DBL_DENORM_MIN__ 4.9406564584124654e-324
#define __FLT_EVAL_METHOD__ 0
#define __DBL_MIN_10_EXP__ (-307)
#define __FINITE_MATH_ONLY__ 0
#define __GNUC_PATCHLEVEL__ 3
#define sparc 1
#define __SHRT_MAX__ 32767
#define __LDBL_MAX__ 1.18973149535723176508575932662800702e+4932L
#define __UINTMAX_TYPE__ long unsigned int
#define __linux 1
#define __unix 1
#define __LDBL_MAX_EXP__ 16384
#define __linux__ 1
#define __SCHAR_MAX__ 127
#define __USER_LABEL_PREFIX__ 
#define __STDC_HOSTED__ 1
#define __LDBL_HAS_INFINITY__ 1
#define __DBL_DIG__ 15
#define __FLT_EPSILON__ 1.19209290e-7F
#define __LDBL_MIN__ 3.36210314311209350626267781732175260e-4932L
#define __unix__ 1
#define __DECIMAL_DIG__ 36
#define __gnu_linux__ 1
#define __LDBL_HAS_QUIET_NAN__ 1
#define __GNUC__ 4
#define __DBL_MAX__ 1.7976931348623157e+308
#define __DBL_HAS_INFINITY__ 1
#define __DBL_MAX_EXP__ 1024
#define __LONG_LONG_MAX__ 9223372036854775807LL
#define __sparc__ 1
#define __GXX_ABI_VERSION 1002
#define __FLT_MIN_EXP__ (-125)
#define __DBL_MIN__ 2.2250738585072014e-308
#define __LP64__ 1
#define __DBL_HAS_QUIET_NAN__ 1
#define __REGISTER_PREFIX__ 
#define __NO_INLINE__ 1
#define __FLT_MANT_DIG__ 24
#define __VERSION__ "4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)"
#define __sparc 1
#define unix 1
#define __SIZE_TYPE__ long unsigned int
#define __ELF__ 1
#define __FLT_RADIX__ 2
#define __LDBL_EPSILON__ 1.92592994438723585305597794258492732e-34L
#define __LDBL_DIG__ 33
#define __FLT_HAS_QUIET_NAN__ 1
#define __FLT_MAX_10_EXP__ 38
#define __LONG_MAX__ 9223372036854775807L
#define __FLT_HAS_INFINITY__ 1
#define linux 1
#define __LDBL_MANT_DIG__ 113
#define _LONGLONG 1
#define __WCHAR_TYPE__ int
#define __FLT_DIG__ 6
#define __INT_MAX__ 2147483647
#define __FLT_MAX_EXP__ 128
#define __DBL_MANT_DIG__ 53
#define __WINT_TYPE__ unsigned int
#define __LDBL_MIN_EXP__ (-16381)
#define __LDBL_MAX_10_EXP__ 4932
#define __DBL_EPSILON__ 2.2204460492503131e-16
#define _LP64 1
#define __INTMAX_MAX__ 9223372036854775807L
#define __FLT_DENORM_MIN__ 1.40129846e-45F
#define __FLT_MAX__ 3.40282347e+38F
#define __FLT_MIN_10_EXP__ (-37)
#define __INTMAX_TYPE__ long int
#define __GNUC_MINOR__ 1
#define __DBL_MAX_10_EXP__ 308
#define __LDBL_DENORM_MIN__ 6.47517511943802511092443895822764655e-4966L
#define __STDC__ 1
#define __PTRDIFF_TYPE__ long int
#define __arch64__ 1
#define __LDBL_MIN_10_EXP__ (-4931)
#define __GNUC_GNU_INLINE__ 1
davem@sunset:~/src/GIT/net-2.6$ 
#16 lore raw
In reply to Sam Ravnborg

From: Sam Ravnborg <[email protected]>
Date: Thu, 3 Jul 2008 15:45:10 +0200

Quoted 4 lines

Hmmm, I have a crosstool build sparc64 toolchain. And I did do a defconfig build for each patch applied for both sparc and spac64. But despite this something is obviously bad. I will look at it later this week as time permits.

As I mentioned in another reply, I think the cross tool is the reason why you don't see the problem.

Natively, we use a bi-arch compiler which defaults to 32-bit output, whereas your cross compiler is outputting 64-bit by default.

So you won't see problems involving a lost "-m64" option on the command line.

#17 lore raw
In reply to Sam Ravnborg
Quoted 8 lines

Of course, you want me to provide "cpp -m64..." not just "cpp" output. Because otherwise it will produce a list of 32-bit CPP predefines. As you can see in the sparc64 Makefiles we add "-m64" to the CFLAGS.

Maybe that's the problem? Normal CFLAGS are not being propagated to the CPP's CFLAGS. And you guys don't see it because you are using cross compilers which default to 64-bit output. That would explain everything.

That makes perfect sense. I should have deduced that myself if I had just thought a bit longer about it.
In almost all uses of CPP we do not need -m64 but with unified headers it is obviously needed.

I have now added the appended commit and the full series can be pulled from:

ssh://master.kernel.org/pub/scm/linux/kernel/git/sam/sparc2.git master

I have tested that sparc64 continue to build and that we indeed add the -m64 option to gcc when we build vmlinux.lds iLet me know if this series is better.

Sam

Shortlog:

Sam Ravnborg (26):
sparc: add -m64 when building vmlinux.lds
sparc: copy exported sparc64 specific header files to asm-sparc
sparc: Merge asm-sparc{,64}/ioctl.h
sparc: Merge asm-sparc{,64}/ioctls.h
sparc: Merge asm-sparc{,64}/param.h
sparc: Merge asm-sparc{,64}/poll.h
sparc: Merge asm-sparc{,64}/socket.h
sparc: Merge asm-sparc{,64}/sockios.h
sparc: Merge asm-sparc{,64}/fcntl.h
sparc: Merge asm-sparc{,64}/msgbuf.h
sparc: Merge asm-sparc{,64}/sembuf.h
sparc: Merge asm-sparc{,64}/shmbuf.h
sparc: Merge asm-sparc{,64}/mman.h
sparc: copy asm-sparc64/fbio.h to asm-sparc
sparc: Merge asm-sparc{,64}/fbio.h
sparc: Merge asm-sparc{,64}/resource.h
sparc: Merge asm-sparc{,64}/setup.h
sparc: Merge asm-sparc{,64}/termbits.h
sparc: Merge asm-sparc{,64}/termios.h
sparc: Merge asm-sparc{,64}/types.h
sparc: export openprom.h to userspace
sparc: Merge asm-sparc{,64}/asi.h
sparc: copy sparc64 specific files to asm-sparc
sparc: when header files are equal use asm-sparc version
sparc: merge header files with trivial differences
sparc: join the remaining header files

Diffstat has not changed (except for the commit below - so omitted.

The commit to fix up -m64 usage:

commit 9fe10bc6fd5aafee2934e35614689e6e905228f7

Author: Sam Ravnborg <[email protected]>
Date:   Sun Jul 6 21:41:51 2008 +0200

sparc: add -m64 when building vmlinux.lds

David Miller noticed that the build of vmlinux.lds failed to use the -m64 specifier.
This caused the build to break with a bi-arch gcc with unified headers.

Add the -m64 option to KBUILD_CPPFLAGS so all of CC, AS, CPP will use them.

arch/sparc64/Makefile +6 -2
index 4b8f2b0..0c135c7 100644
@@ -9,15 +9,19 @@
 
 CHECKFLAGS	+= -D__sparc__ -D__sparc_v9__ -m64
 
+# We always build for 64 bit
+KBUILD_CPPFLAGS += -m64
+
+# Undefine sparc for vmlinux.lds as the linker uses this symbol
 CPPFLAGS_vmlinux.lds += -Usparc
 
 LDFLAGS		:= -m elf64_sparc
 
-KBUILD_CFLAGS += -m64 -pipe -mno-fpu -mcpu=ultrasparc -mcmodel=medlow \
+KBUILD_CFLAGS += -pipe -mno-fpu -mcpu=ultrasparc -mcmodel=medlow \
 	-ffixed-g4 -ffixed-g5 -fcall-used-g7 -Wno-sign-compare \
 	-Wa,--undeclared-regs
 KBUILD_CFLAGS += $(call cc-option,-mtune=ultrasparc3)
-KBUILD_AFLAGS += -m64 -mcpu=ultrasparc -Wa,--undeclared-regs
+KBUILD_AFLAGS += -mcpu=ultrasparc -Wa,--undeclared-regs
 
 ifeq ($(CONFIG_MCOUNT),y)
   KBUILD_CFLAGS += -pg
#18 lore raw
In reply to Sam Ravnborg

From: Sam Ravnborg <[email protected]>
Date: Sun, 6 Jul 2008 22:06:37 +0200

Quoted 8 lines

I have now added the appended commit and the full series can be pulled from:

ssh://master.kernel.org/pub/scm/linux/kernel/git/sam/sparc2.git master

I have tested that sparc64 continue to build and that we indeed add the -m64 option to gcc when we build vmlinux.lds iLet me know if this series is better.

Something is still messed up, the whole build now complains about things like:

init/initramfs.c: In function 'flush_window':
init/initramfs.c:433: warning: pointer targets in passing argument 1 of 'flush_buffer' differ in signedness init/initramfs.c: In function 'unpack_to_rootfs':
init/initramfs.c:474: warning: pointer targets in assignment differ in signedness

So things are still busted with bi-arch compilers.

It seems that adding "-m64" to the kbuild CPPFLAGS does not propagate "-m64" to the kbuild CFLAGS. So your "fix" changeset idea to remove "-m64" from the kbuild CFLAGS does not aparently work.

Please build a bi-arch compiler that defaults to -m32 ;-) Or at least, look at the command line with some higher verbosity levels. You know how to do that right? :-)))

#19 lore raw
In reply to Sam Ravnborg
Quoted 20 lines · David Miller

From: Sam Ravnborg <[email protected]>
Date: Sun, 6 Jul 2008 22:06:37 +0200

Quoted 8 lines

I have now added the appended commit and the full series can be pulled from:

ssh://master.kernel.org/pub/scm/linux/kernel/git/sam/sparc2.git master

I have tested that sparc64 continue to build and that we indeed add the -m64 option to gcc when we build vmlinux.lds iLet me know if this series is better.

Something is still messed up, the whole build now complains about things like:

init/initramfs.c: In function 'flush_window':
init/initramfs.c:433: warning: pointer targets in passing argument 1 of 'flush_buffer' differ in signedness init/initramfs.c: In function 'unpack_to_rootfs':
init/initramfs.c:474: warning: pointer targets in assignment differ in signedness

Quoted 5 lines

So things are still busted with bi-arch compilers.

It seems that adding "-m64" to the kbuild CPPFLAGS does not propagate "-m64" to the kbuild CFLAGS. So your "fix" changeset idea to remove "-m64" from the kbuild CFLAGS does not aparently work.

I actually checked it.

Quoted 4 lines

Please build a bi-arch compiler that defaults to -m32 ;-) Or at least, look at the command line with some higher verbosity levels. You know how to do that right? :-)))

I checked that and it is present so we need to look somewhere else.

In top-level Makefile we do:

include arch/sparc64/Makefile

....

# disable pointer signed / unsigned warnings in gcc 4.0
KBUILD_CFLAGS += $(call cc-option,-Wno-pointer-sign,)

When we do the above check we use KBUILD_CFLAGS direct and does not include KBUILD_CPPFLAGS - thus missing -m64.

So I think that your bi-arch sparc gcc only accepts -Wno-pointer-sign if -m64 is specified and that this option is missing with current patchset.
At least that is my best explanation so far.

I will upload a new patchset tonight where I am less smart in setting -m64.

Note: On my cross compiled 64 bit sparc gcc I do not
have the -Wno-pointer-sign option so I cannot see if -m64 matters or not.

Sam

#20 lore raw
In reply to Sam Ravnborg

From: Sam Ravnborg <[email protected]>
Date: Mon, 7 Jul 2008 09:46:00 +0200

Quoted 10 lines
# disable pointer signed / unsigned warnings in gcc 4.0
KBUILD_CFLAGS += $(call cc-option,-Wno-pointer-sign,)

When we do the above check we use KBUILD_CFLAGS direct and does not include KBUILD_CPPFLAGS - thus missing -m64.

So I think that your bi-arch sparc gcc only accepts -Wno-pointer-sign if -m64 is specified and that this option is missing with current patchset.
At least that is my best explanation so far.

Yep, that the source of the problem.

What is happening is that the other sparc64 KBUILD_CFLAGS (such as -mcmodel=medlow, etc.) are only legal during a 64-bit compile. When compiling 32-bit those options are not allowed.

#21 lore raw
In reply to Sam Ravnborg
Quoted 14 lines · David Miller

From: Sam Ravnborg <[email protected]>
Date: Mon, 7 Jul 2008 09:46:00 +0200

Quoted 10 lines
# disable pointer signed / unsigned warnings in gcc 4.0
KBUILD_CFLAGS += $(call cc-option,-Wno-pointer-sign,)

When we do the above check we use KBUILD_CFLAGS direct and does not include KBUILD_CPPFLAGS - thus missing -m64.

So I think that your bi-arch sparc gcc only accepts -Wno-pointer-sign if -m64 is specified and that this option is missing with current patchset.
At least that is my best explanation so far.

Quoted 5 lines

Yep, that the source of the problem.

What is happening is that the other sparc64 KBUILD_CFLAGS (such as -mcmodel=medlow, etc.) are only legal during a 64-bit compile. When compiling 32-bit those options are not allowed.

So I once again updated the patchset - they can be pulled here:

ssh://master.kernel.org/pub/scm/linux/kernel/git/sam/sparc2.git master

The only change is the replacement of the patch adding -m64.
The new commit is appended.
Diffstat and shortlog omitted - they did not change except for appended patch.

I have checked that:
1) We pass -m64 to gcc when building vmlinux.lds
2) that a defconfig builds here
3) that we continue to pass -m64 to gcc

Sam

commit bab6038071f446e2e6d57eb83028b21959276e84

Author: Sam Ravnborg <[email protected]>
Date:   Mon Jul 7 22:30:35 2008 +0200

sparc: add -m64 when building vmlinux.lds

David Miller noticed that the build of vmlinux.lds failed to use the -m64 specifier.
This caused the build to break with a bi-arch gcc with unified headers.

Add the -m64 option to CPPFLAGS_vmlinux.lds so we have the correct defines available when building vmliux.lds.

arch/sparc64/Makefile +3 -1
index 4b8f2b0..b785a39 100644
@@ -9,7 +9,9 @@
 
 CHECKFLAGS	+= -D__sparc__ -D__sparc_v9__ -m64
 
-CPPFLAGS_vmlinux.lds += -Usparc
+# Undefine sparc when processing vmlinux.lds - it is used
+# And teach CPP we are doing 64 bit builds (for this case)
+CPPFLAGS_vmlinux.lds += -m64 -Usparc
 
 LDFLAGS		:= -m elf64_sparc
 
#22 lore raw
In reply to Sam Ravnborg

From: Sam Ravnborg <[email protected]>
Date: Mon, 7 Jul 2008 22:54:31 +0200

Quoted 9 lines

So I once again updated the patchset - they can be pulled here:

ssh://master.kernel.org/pub/scm/linux/kernel/git/sam/sparc2.git master

The only change is the replacement of the patch adding -m64.
The new commit is appended.
Diffstat and shortlog omitted - they did not change except for appended patch.

Quoted 4 lines

I have checked that:
1) We pass -m64 to gcc when building vmlinux.lds
2) that a defconfig builds here
3) that we continue to pass -m64 to gcc

Ok this is a lot better, but check headers fails.

--------------------
CHECK include/asm-generic/siginfo.h
/home/davem/src/GIT/sparc-next-2.6/usr/include/video/sisfb.h requires asm/ioctl.h, which does not exist in exported headers
CHECK include/sound/sb16_csp.h
make[3]: *** [/home/davem/src/GIT/sparc-next-2.6/usr/include/video/.check.sisfb.h] Error 1
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [video] Error 2
make[2]: *** Waiting for unfinished jobs.... /home/davem/src/GIT/sparc-next-2.6/usr/include/linux/dvb/net.h requires asm/types.h, which does not exist in exported headers /home/davem/src/GIT/sparc-next-2.6/usr/include/linux/dvb/dmx.h requires asm/types.h, which does not exist in exported headers /home/davem/src/GIT/sparc-next-2.6/usr/include/linux/dvb/video.h requires asm/types.h, which does not exist in exported headers
--------------------

etc. etc.

Is this expected?

#23 lore raw
In reply to Sam Ravnborg
Quoted 32 lines · David Miller

From: Sam Ravnborg <[email protected]>
Date: Mon, 7 Jul 2008 22:54:31 +0200

Quoted 9 lines

So I once again updated the patchset - they can be pulled here:

ssh://master.kernel.org/pub/scm/linux/kernel/git/sam/sparc2.git master

The only change is the replacement of the patch adding -m64.
The new commit is appended.
Diffstat and shortlog omitted - they did not change except for appended patch.

Quoted 4 lines

I have checked that:
1) We pass -m64 to gcc when building vmlinux.lds
2) that a defconfig builds here
3) that we continue to pass -m64 to gcc

Ok this is a lot better, but check headers fails.

--------------------
CHECK include/asm-generic/siginfo.h
/home/davem/src/GIT/sparc-next-2.6/usr/include/video/sisfb.h requires asm/ioctl.h, which does not exist in exported headers
CHECK include/sound/sb16_csp.h
make[3]: *** [/home/davem/src/GIT/sparc-next-2.6/usr/include/video/.check.sisfb.h] Error 1
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [video] Error 2
make[2]: *** Waiting for unfinished jobs.... /home/davem/src/GIT/sparc-next-2.6/usr/include/linux/dvb/net.h requires asm/types.h, which does not exist in exported headers /home/davem/src/GIT/sparc-next-2.6/usr/include/linux/dvb/dmx.h requires asm/types.h, which does not exist in exported headers /home/davem/src/GIT/sparc-next-2.6/usr/include/linux/dvb/video.h requires asm/types.h, which does not exist in exported headers
--------------------

Quoted 3 lines

etc. etc.

Is this expected?

Nope - sort of.

I ran defconfig for all patches (including headers_check) with success. But it seems I hit a headers_check limitation - it simply did not re-ran in include/video/* et al because we do not store dependency information.

Dropping the top-most commit fixes it: ("sparc: join the remaining header files") The commit is almost 100% scripted so I can just re-ran it when we have the kbuild stuff merged and I combine the two header file sets under arch/sparc/include/..

Sorry for all the troubles this simple patch-set gives you.

Sam

#24 lore raw
In reply to Sam Ravnborg

From: Sam Ravnborg <[email protected]>
Date: Wed, 9 Jul 2008 06:27:59 +0200

Quoted 4 lines

Dropping the top-most commit fixes it: ("sparc: join the remaining header files") The commit is almost 100% scripted so I can just re-ran it when we have the kbuild stuff merged and I combine the two header file sets under arch/sparc/include/..

I think I'll just leave it in there since your kbuild bits will fix it up.

Thanks Sam.