sparc: copy sparc64 header files to asm-sparc
PATCH 20/21 sparc: copy sparc64 header files to asm-sparc
Several header files had non-trivial differences between the 32 and 64 bit version.
To better support further unification create a _32.h file for the orginal 32 bit version and likewise a _64.h for the original 64 bit version.
To spot potential unification is now a simple:
--- include/asm-sparc/asi.h | 119 +----------- include/asm-sparc/asi_32.h | 111 +++++++++++ include/asm-sparc/asi_64.h | 160 +++++++++++++++ include/asm-sparc/ipcbuf.h | 39 +--- include/asm-sparc/ipcbuf_32.h | 31 +++ include/asm-sparc/ipcbuf_64.h | 28 +++ include/asm-sparc/openprom.h | 265 +------------------------ include/asm-sparc/openprom_32.h | 257 ++++++++++++++++++++++++ include/asm-sparc/openprom_64.h | 280 ++++++++++++++++++++++++++ include/asm-sparc/posix_types.h | 124 +----------- include/asm-sparc/posix_types_32.h | 118 +++++++++++ include/asm-sparc/posix_types_64.h | 122 ++++++++++++ include/asm-sparc/ptrace.h | 179 +---------------- include/asm-sparc/ptrace_32.h | 175 ++++++++++++++++ include/asm-sparc/ptrace_64.h | 346 ++++++++++++++++++++++++++++++++ include/asm-sparc/reg.h | 87 +-------- include/asm-sparc/reg_32.h | 79 ++++++++ include/asm-sparc/reg_64.h | 56 ++++++ include/asm-sparc/sigcontext.h | 70 +------ include/asm-sparc/sigcontext_32.h | 62 ++++++ include/asm-sparc/sigcontext_64.h | 87 ++++++++ include/asm-sparc/siginfo.h | 25 +-- include/asm-sparc/siginfo_32.h | 17 ++ include/asm-sparc/siginfo_64.h | 32 +++ include/asm-sparc/signal.h | 209 +------------------- include/asm-sparc/signal_32.h | 207 +++++++++++++++++++ include/asm-sparc/signal_64.h | 194 ++++++++++++++++++ include/asm-sparc/stat.h | 82 +------- include/asm-sparc/stat_32.h | 76 +++++++ include/asm-sparc/stat_64.h | 47 +++++ include/asm-sparc/statfs.h | 12 +- include/asm-sparc/statfs_32.h | 6 + include/asm-sparc/statfs_64.h | 54 +++++ include/asm-sparc/unistd.h | 386 +----------------------------------- include/asm-sparc/unistd_32.h | 378 +++++++++++++++++++++++++++++++++++ include/asm-sparc/unistd_64.h | 373 ++++++++++++++++++++++++++++++++++ include/asm-sparc64/asi.h | 161 +--------------- include/asm-sparc64/ipcbuf.h | 29 +--- include/asm-sparc64/openprom.h | 281 +-------------------------- include/asm-sparc64/posix_types.h | 123 +------------ include/asm-sparc64/ptrace.h | 347 +-------------------------------- include/asm-sparc64/reg.h | 57 +------ include/asm-sparc64/sigcontext.h | 88 +-------- include/asm-sparc64/siginfo.h | 33 +--- include/asm-sparc64/signal.h | 195 +------------------ include/asm-sparc64/stat.h | 48 +----- include/asm-sparc64/statfs.h | 55 +----- include/asm-sparc64/unistd.h | 374 +---------------------------------- 48 files changed, 3396 insertions(+), 3288 deletions(-) create mode 100644 include/asm-sparc/asi_32.h create mode 100644 include/asm-sparc/asi_64.h create mode 100644 include/asm-sparc/ipcbuf_32.h create mode 100644 include/asm-sparc/ipcbuf_64.h create mode 100644 include/asm-sparc/openprom_32.h create mode 100644 include/asm-sparc/openprom_64.h create mode 100644 include/asm-sparc/posix_types_32.h create mode 100644 include/asm-sparc/posix_types_64.h create mode 100644 include/asm-sparc/ptrace_32.h create mode 100644 include/asm-sparc/ptrace_64.h create mode 100644 include/asm-sparc/reg_32.h create mode 100644 include/asm-sparc/reg_64.h create mode 100644 include/asm-sparc/sigcontext_32.h create mode 100644 include/asm-sparc/sigcontext_64.h create mode 100644 include/asm-sparc/siginfo_32.h create mode 100644 include/asm-sparc/siginfo_64.h create mode 100644 include/asm-sparc/signal_32.h create mode 100644 include/asm-sparc/signal_64.h create mode 100644 include/asm-sparc/stat_32.h create mode 100644 include/asm-sparc/stat_64.h create mode 100644 include/asm-sparc/statfs_32.h create mode 100644 include/asm-sparc/statfs_64.h create mode 100644 include/asm-sparc/unistd_32.h create mode 100644 include/asm-sparc/unistd_64.h
include/asm-sparc/asi.h +8 -111
@@ -1,111 +1,8 @@ -#ifndef _SPARC_ASI_H -#define _SPARC_ASI_H - -/* asi.h: Address Space Identifier values for the sparc. -* -* Copyright (C) 1995 David S. Miller ([email protected]) -* -* Pioneer work for sun4m: Paul Hatchman ([email protected]) -* Joint edition for sun4c+sun4m: Pete A. Zaitcev <[email protected]> -*/ - -/* The first batch are for the sun4c. */ - -#define ASI_NULL1 0x00 -#define ASI_NULL2 0x01 - -/* sun4c and sun4 control registers and mmu/vac ops */ -#define ASI_CONTROL 0x02 -#define ASI_SEGMAP 0x03 -#define ASI_PTE 0x04 -#define ASI_HWFLUSHSEG 0x05 -#define ASI_HWFLUSHPAGE 0x06 -#define ASI_REGMAP 0x06 -#define ASI_HWFLUSHCONTEXT 0x07 - -#define ASI_USERTXT 0x08 -#define ASI_KERNELTXT 0x09 -#define ASI_USERDATA 0x0a -#define ASI_KERNELDATA 0x0b - -/* VAC Cache flushing on sun4c and sun4 */ -#define ASI_FLUSHSEG 0x0c -#define ASI_FLUSHPG 0x0d -#define ASI_FLUSHCTX 0x0e - -/* SPARCstation-5: only 6 bits are decoded. */ -/* wo = Write Only, rw = Read Write; */ -/* ss = Single Size, as = All Sizes; */ -#define ASI_M_RES00 0x00/* Don't touch... */ -#define ASI_M_UNA01 0x01/* Same here... */ -#define ASI_M_MXCC 0x02/* Access to TI VIKING MXCC registers */ -#define ASI_M_FLUSH_PROBE 0x03/* Reference MMU Flush/Probe; rw, ss */ -#define ASI_M_MMUREGS 0x04/* MMU Registers; rw, ss */ -#define ASI_M_TLBDIAG 0x05/* MMU TLB only Diagnostics */ -#define ASI_M_DIAGS 0x06/* Reference MMU Diagnostics */ -#define ASI_M_IODIAG 0x07/* MMU I/O TLB only Diagnostics */ -#define ASI_M_USERTXT 0x08/* Same as ASI_USERTXT; rw, as */ -#define ASI_M_KERNELTXT 0x09/* Same as ASI_KERNELTXT; rw, as */ -#define ASI_M_USERDATA 0x0A/* Same as ASI_USERDATA; rw, as */ -#define ASI_M_KERNELDATA 0x0B/* Same as ASI_KERNELDATA; rw, as */ -#define ASI_M_TXTC_TAG 0x0C/* Instruction Cache Tag; rw, ss */ -#define ASI_M_TXTC_DATA 0x0D/* Instruction Cache Data; rw, ss */ -#define ASI_M_DATAC_TAG 0x0E/* Data Cache Tag; rw, ss */ -#define ASI_M_DATAC_DATA 0x0F/* Data Cache Data; rw, ss */ - -/* The following cache flushing ASIs work only with the 'sta' -* instruction. Results are unpredictable for 'swap' and 'ldstuba', -* so don't do it. -*/ - -/* These ASI flushes affect external caches too. */ -#define ASI_M_FLUSH_PAGE 0x10/* Flush I&D Cache Line (page); wo, ss */ -#define ASI_M_FLUSH_SEG 0x11/* Flush I&D Cache Line (seg); wo, ss */ -#define ASI_M_FLUSH_REGION 0x12/* Flush I&D Cache Line (region); wo, ss */ -#define ASI_M_FLUSH_CTX 0x13/* Flush I&D Cache Line (context); wo, ss */ -#define ASI_M_FLUSH_USER 0x14/* Flush I&D Cache Line (user); wo, ss */ - -/* Block-copy operations are available only on certain V8 cpus. */ -#define ASI_M_BCOPY 0x17/* Block copy */ - -/* These affect only the ICACHE and are Ross HyperSparc and TurboSparc specific. */ -#define ASI_M_IFLUSH_PAGE 0x18/* Flush I Cache Line (page); wo, ss */ -#define ASI_M_IFLUSH_SEG 0x19/* Flush I Cache Line (seg); wo, ss */ -#define ASI_M_IFLUSH_REGION 0x1A/* Flush I Cache Line (region); wo, ss */ -#define ASI_M_IFLUSH_CTX 0x1B/* Flush I Cache Line (context); wo, ss */ -#define ASI_M_IFLUSH_USER 0x1C/* Flush I Cache Line (user); wo, ss */ - -/* Block-fill operations are available on certain V8 cpus */ -#define ASI_M_BFILL 0x1F - -/* This allows direct access to main memory, actually 0x20 to 0x2f are -* the available ASI's for physical ram pass-through, but I don't have -* any idea what the other ones do.... -*/ - -#define ASI_M_BYPASS 0x20/* Reference MMU bypass; rw, as */ -#define ASI_M_FBMEM 0x29/* Graphics card frame buffer access */ -#define ASI_M_VMEUS 0x2A/* VME user 16-bit access */ -#define ASI_M_VMEPS 0x2B/* VME priv 16-bit access */ -#define ASI_M_VMEUT 0x2C/* VME user 32-bit access */ -#define ASI_M_VMEPT 0x2D/* VME priv 32-bit access */ -#define ASI_M_SBUS 0x2E/* Direct SBus access */ -#define ASI_M_CTL 0x2F/* Control Space (ECC and MXCC are here) */ - - -/* This is ROSS HyperSparc only. */ -#define ASI_M_FLUSH_IWHOLE 0x31/* Flush entire ICACHE; wo, ss */ - -/* Tsunami/Viking/TurboSparc i/d cache flash clear. */ -#define ASI_M_IC_FLCLEAR 0x36 -#define ASI_M_DC_FLCLEAR 0x37 - -#define ASI_M_DCDR 0x39/* Data Cache Diagnostics Register rw, ss */ - -#define ASI_M_VIKING_TMP1 0x40/* Emulation temporary 1 on Viking */ -/* only available on SuperSparc I */ -/* #define ASI_M_VIKING_TMP2 0x41 */ /* Emulation temporary 2 on Viking */ - -#define ASI_M_ACTION 0x4c/* Breakpoint Action Register (GNU/Viking) */ - -#endif /* _SPARC_ASI_H */ +#ifndef _ASM_SPARC_ASI_H +#define _ASM_SPARC_ASI_H +#if defined(__sparc__) && defined(__arch64__) +#include <asm-sparc/asi_64.h> +#else +#include <asm-sparc/asi_32.h> +#endif +#endif
include/asm-sparc/asi_32.h new file +111 -0
111 lines not on this page · raw message
include/asm-sparc/asi_64.h new file +160 -0
160 lines not on this page · raw message
include/asm-sparc/ipcbuf.h +8 -31
@@ -1,31 +1,8 @@ -#ifndef _SPARC_IPCBUF_H -#define _SPARC_IPCBUF_H - -/* -* The ipc64_perm structure for sparc architecture. -* Note extra padding because this structure is passed back and forth -* between kernel and user space. -* -* Pad space is left for: -* - 32-bit mode -* - 32-bit seq -* - 2 miscellaneous 64-bit values (so that this structure matches -* sparc64 ipc64_perm) -*/ - -struct ipc64_perm -{ -__kernel_key_t key; -__kernel_uid32_t uid; -__kernel_gid32_t gid; -__kernel_uid32_t cuid; -__kernel_gid32_t cgid; -unsigned short __pad1; -__kernel_mode_t mode; -unsigned short __pad2; -unsigned short seq; -unsigned long long __unused1; -unsigned long long __unused2; -}; - -#endif /* _SPARC_IPCBUF_H */ +#ifndef _ASM_SPARC_IPCBUF_H +#define _ASM_SPARC_IPCBUF_H +#if defined(__sparc__) && defined(__arch64__) +#include <asm-sparc/ipcbuf_64.h> +#else +#include <asm-sparc/ipcbuf_32.h> +#endif +#endif
include/asm-sparc/ipcbuf_32.h new file +31 -0
@@ -0,0 +1,31 @@ +#ifndef _SPARC_IPCBUF_H +#define _SPARC_IPCBUF_H + +/* +* The ipc64_perm structure for sparc architecture. +* Note extra padding because this structure is passed back and forth +* between kernel and user space. +* +* Pad space is left for: +* - 32-bit mode +* - 32-bit seq +* - 2 miscellaneous 64-bit values (so that this structure matches +* sparc64 ipc64_perm) +*/ + +struct ipc64_perm +{ +__kernel_key_t key; +__kernel_uid32_t uid; +__kernel_gid32_t gid; +__kernel_uid32_t cuid; +__kernel_gid32_t cgid; +unsigned short __pad1; +__kernel_mode_t mode; +unsigned short __pad2; +unsigned short seq; +unsigned long long __unused1; +unsigned long long __unused2; +}; + +#endif /* _SPARC_IPCBUF_H */
include/asm-sparc/ipcbuf_64.h new file +28 -0
@@ -0,0 +1,28 @@ +#ifndef _SPARC64_IPCBUF_H +#define _SPARC64_IPCBUF_H + +/* +* The ipc64_perm structure for sparc64 architecture. +* Note extra padding because this structure is passed back and forth +* between kernel and user space. +* +* Pad space is left for: +* - 32-bit seq +* - 2 miscellaneous 64-bit values +*/ + +struct ipc64_perm +{ +__kernel_key_t key; +__kernel_uid_t uid; +__kernel_gid_t gid; +__kernel_uid_t cuid; +__kernel_gid_t cgid; +__kernel_mode_t mode; +unsigned short __pad1; +unsigned short seq; +unsigned long __unused1; +unsigned long __unused2; +}; + +#endif /* _SPARC64_IPCBUF_H */
include/asm-sparc/openprom.h +8 -257
265 lines not on this page · raw message
include/asm-sparc/openprom_32.h new file +257 -0
257 lines not on this page · raw message
include/asm-sparc/openprom_64.h new file +280 -0
280 lines not on this page · raw message
include/asm-sparc/posix_types.h +7 -117
125 lines not on this page · raw message
include/asm-sparc/posix_types_32.h new file +118 -0
118 lines not on this page · raw message
include/asm-sparc/posix_types_64.h new file +122 -0
122 lines not on this page · raw message
include/asm-sparc/ptrace.h +6 -173
181 lines not on this page · raw message
include/asm-sparc/ptrace_32.h new file +175 -0
175 lines not on this page · raw message
include/asm-sparc/ptrace_64.h new file +346 -0
346 lines not on this page · raw message
include/asm-sparc/reg.h +8 -79
87 lines not on this page · raw message
include/asm-sparc/reg_32.h new file +79 -0
79 lines not on this page · raw message
include/asm-sparc/reg_64.h new file +56 -0
56 lines not on this page · raw message
include/asm-sparc/sigcontext.h +8 -62
70 lines not on this page · raw message
include/asm-sparc/sigcontext_32.h new file +62 -0
62 lines not on this page · raw message
include/asm-sparc/sigcontext_64.h new file +87 -0
87 lines not on this page · raw message
include/asm-sparc/siginfo.h +8 -17
@@ -1,17 +1,8 @@ -#ifndef _SPARC_SIGINFO_H -#define _SPARC_SIGINFO_H - -#define __ARCH_SI_UID_T unsigned int -#define __ARCH_SI_TRAPNO - -#include <asm-generic/siginfo.h> - -#define SI_NOINFO 32767/* no information in siginfo_t */ - -/* -* SIGEMT si_codes -*/ -#define EMT_TAGOVF (__SI_FAULT|1)/* tag overflow */ -#define NSIGEMT 1 - -#endif /* !(_SPARC_SIGINFO_H) */ +#ifndef _ASM_SPARC_SIGINFO_H +#define _ASM_SPARC_SIGINFO_H +#if defined(__sparc__) && defined(__arch64__) +#include <asm-sparc/siginfo_64.h> +#else +#include <asm-sparc/siginfo_32.h> +#endif +#endif
include/asm-sparc/siginfo_32.h new file +17 -0
@@ -0,0 +1,17 @@ +#ifndef _SPARC_SIGINFO_H +#define _SPARC_SIGINFO_H + +#define __ARCH_SI_UID_T unsigned int +#define __ARCH_SI_TRAPNO + +#include <asm-generic/siginfo.h> + +#define SI_NOINFO 32767/* no information in siginfo_t */ + +/* +* SIGEMT si_codes +*/ +#define EMT_TAGOVF (__SI_FAULT|1)/* tag overflow */ +#define NSIGEMT 1 + +#endif /* !(_SPARC_SIGINFO_H) */
include/asm-sparc/siginfo_64.h new file +32 -0
@@ -0,0 +1,32 @@ +#ifndef _SPARC64_SIGINFO_H +#define _SPARC64_SIGINFO_H + +#define SI_PAD_SIZE32 ((SI_MAX_SIZE/sizeof(int)) - 3) + +#define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int)) +#define __ARCH_SI_TRAPNO +#define __ARCH_SI_BAND_T int + +#include <asm-generic/siginfo.h> + +#ifdef __KERNEL__ + +#include <linux/compat.h> + +#ifdef CONFIG_COMPAT + +struct compat_siginfo ; + +#endif /* CONFIG_COMPAT */ + +#endif /* __KERNEL__ */ + +#define SI_NOINFO 32767/* no information in siginfo_t */ + +/* +* SIGEMT si_codes +*/ +#define EMT_TAGOVF (__SI_FAULT|1)/* tag overflow */ +#define NSIGEMT 1 + +#endif
include/asm-sparc/signal.h +5 -204
128 lines not on this page · raw message
include/asm-sparc/signal_32.h new file +207 -0
207 lines not on this page · raw message
include/asm-sparc/signal_64.h new file +194 -0
194 lines not on this page · raw message
include/asm-sparc/stat.h +7 -75
82 lines not on this page · raw message
include/asm-sparc/stat_32.h new file +76 -0
76 lines not on this page · raw message
include/asm-sparc/stat_64.h new file +47 -0
47 lines not on this page · raw message
include/asm-sparc/statfs_64.h new file +54 -0
54 lines not on this page · raw message
include/asm-sparc/unistd.h +8 -378
386 lines not on this page · raw message
include/asm-sparc/unistd_32.h new file +378 -0
378 lines not on this page · raw message
include/asm-sparc/unistd_64.h new file +373 -0
373 lines not on this page · raw message
include/asm-sparc64/asi.h +1 -160
161 lines not on this page · raw message
include/asm-sparc64/openprom.h +1 -280
281 lines not on this page · raw message
include/asm-sparc64/posix_types.h +1 -122
123 lines not on this page · raw message
include/asm-sparc64/ptrace.h +1 -346
347 lines not on this page · raw message
include/asm-sparc64/reg.h +1 -56
57 lines not on this page · raw message
include/asm-sparc64/sigcontext.h +1 -87
88 lines not on this page · raw message
include/asm-sparc64/signal.h +1 -194
195 lines not on this page · raw message
include/asm-sparc64/stat.h +1 -47
48 lines not on this page · raw message
include/asm-sparc64/statfs.h +1 -54
55 lines not on this page · raw message
include/asm-sparc64/unistd.h +1 -373
374 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
1.5.4.1.143.ge7e51
Part of the diff is not shown here. View the raw message.
Quoted 6 lines · Sam Ravnborg
Several header files had non-trivial differences between the 32 and 64 bit version.
To better support further unification create a _32.h file for the orginal 32 bit version and likewise a _64.h for the original 64 bit version.
To spot potential unification is now a simple:
I lost most of my changelog here.
I will repost this patch.
Sam
PATCH 20/21 sparc: copy sparc64 header files to asm-sparc
In reply to Sam RavnborgSeveral header files had non-trivial differences between the 32 and 64 bit version.
To better support further unification create a _32.h file for the orginal 32 bit version and likewise a _64.h for the original 64 bit version.
To spot potential unification is now a simple:
$ diff -u file_32.h file_64.h
The follwing script were used to create the copies:
FILES="asi.h openprom.h reg.h ipcbuf.h posix_types.h ptrace.h statfs.h sigcontext.h siginfo.h signal.h stat.h unistd.h"
for FILE in ${FILES}; do
BASE=echo $FILE | cut -d '.' -f 1 FN32=${BASE}_32.h
FN64=${BASE}_64.h
GUARD=_ASM_SPARC_echo $BASE | tr [:lower:] [:upper:]_H git mv include/asm-sparc/$FILE include/asm-sparc/$FN32 git mv include/asm-sparc64/$FILE include/asm-sparc/$FN64
printf "#ifndef %s\n" $GUARD > include/asm-sparc/$FILE
printf "#define %s\n" $GUARD >> include/asm-sparc/$FILE
printf "#if defined(__sparc__) && defined(__arch64__)\n" >> include/asm-sparc/$FILE
printf "#include <asm-sparc/%s>\n" $FN64 >> include/asm-sparc/$FILE
printf "#else\n" >> include/asm-sparc/$FILE
printf "#include <asm-sparc/%s>\n" $FN32 >> include/asm-sparc/$FILE
printf "#endif\n" >> include/asm-sparc/$FILE
printf "#endif\n" >> include/asm-sparc/$FILE
git add include/asm-sparc/$FILE
printf "#include <asm-sparc/%s>\n" $FILE > include/asm-sparc64/$FILE
git add include/asm-sparc64/$FILE
done
It was checked that none of the *_32.h *_64.h files contains a guard named "_ASM_SPARC_*".
--- include/asm-sparc/Kbuild | 10 ++++++++++ include/asm-sparc64/Kbuild | 23 ----------------------- 2 files changed, 10 insertions(+), 23 deletions(-) delete mode 100644 include/asm-sparc64/Kbuild
include/asm-sparc/Kbuild +10 -0
@@ -1,13 +1,23 @@ include include/asm-generic/Kbuild.asm +header-y += apb.h header-y += apc.h header-y += asi.h +header-y += bbc.h header-y += bpp.h +header-y += display7seg.h +header-y += envctrl.h header-y += jsflash.h +header-y += openprom.h header-y += openpromio.h +header-y += psrcompat.h +header-y += pstate.h header-y += reg.h header-y += traps.h +header-y += uctx.h +header-y += utrap.h header-y += vfc_ioctls.h +header-y += watchdog.h unifdef-y += fbio.h unifdef-y += perfctr.h
include/asm-sparc64/Kbuild deleted +0 -23
@@ -1,23 +0,0 @@ -include include/asm-generic/Kbuild.asm - -ALTARCH := sparc -ARCHDEF := defined __sparc__ && defined __arch64__ -ALTARCHDEF := defined __sparc__ && !defined __arch64__ - -header-y += apb.h -header-y += asi.h -header-y += bbc.h -header-y += bpp.h -header-y += display7seg.h -header-y += envctrl.h -header-y += openprom.h -header-y += openpromio.h -header-y += psrcompat.h -header-y += pstate.h -header-y += reg.h -header-y += uctx.h -header-y += utrap.h -header-y += watchdog.h - -unifdef-y += fbio.h -unifdef-y += perfctr.h
Signature · 1 line
1.5.4.1.143.ge7e51
Quoted 4 lines · Sam Ravnborg
...
include/asm-sparc/Kbuild | 10 ++++++++++ include/asm-sparc64/Kbuild | 23 -----------------------...
You've reposted patch 21 instead of a corrected patch 20.
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