Skip to content

Commit

Permalink
linux-user: Clean up target_syscall.h header guards
Browse files Browse the repository at this point in the history
Some of them use guard symbol TARGET_SYSCALL_H, but we also have
CRIS_SYSCALL_H, MICROBLAZE_SYSCALLS_H, TILEGX_SYSCALLS_H and
__UC32_SYSCALL_H__.  They all upset scripts/clean-header-guards.pl.

Reuse of the same guard symbol TARGET_SYSCALL_H in multiple headers is
okay as long as they cannot be included together.  The script can't
tell, so it warns.

The script dislikes the other guard symbols, too.  They don't match
their file name (they should, to make guard collisions less likely),
and __UC32_SYSCALL_H__ is a reserved identifier.

Clean them all up: use guard symbol $target_TARGET_SYSCALL_H for
linux-user/$target/target_sycall.h.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
  • Loading branch information
Markus Armbruster committed Jul 12, 2016
1 parent 07f5a25 commit 3622634
Show file tree
Hide file tree
Showing 18 changed files with 53 additions and 51 deletions.
6 changes: 3 additions & 3 deletions linux-user/aarch64/target_syscall.h
@@ -1,5 +1,5 @@
#ifndef TARGET_SYSCALL_H
#define TARGET_SYSCALL_H
#ifndef AARCH64_TARGET_SYSCALL_H
#define AARCH64_TARGET_SYSCALL_H

struct target_pt_regs {
uint64_t regs[31];
Expand All @@ -15,4 +15,4 @@ struct target_pt_regs {
#define TARGET_MLOCKALL_MCL_CURRENT 1
#define TARGET_MLOCKALL_MCL_FUTURE 2

#endif /* TARGET_SYSCALL_H */
#endif /* AARCH64_TARGET_SYSCALL_H */
6 changes: 3 additions & 3 deletions linux-user/alpha/target_syscall.h
@@ -1,5 +1,5 @@
#ifndef TARGET_SYSCALL_H
#define TARGET_SYSCALL_H
#ifndef ALPHA_TARGET_SYSCALL_H
#define ALPHA_TARGET_SYSCALL_H

/* default linux values for the selectors */
#define __USER_DS (1)
Expand Down Expand Up @@ -259,4 +259,4 @@ struct target_pt_regs {
#define TARGET_MLOCKALL_MCL_CURRENT 0x2000
#define TARGET_MLOCKALL_MCL_FUTURE 0x4000

#endif /* TARGET_SYSCALL_H */
#endif /* ALPHA_TARGET_SYSCALL_H */
6 changes: 3 additions & 3 deletions linux-user/arm/target_syscall.h
@@ -1,5 +1,5 @@
#ifndef TARGET_SYSCALL_H
#define TARGET_SYSCALL_H
#ifndef ARM_TARGET_SYSCALL_H
#define ARM_TARGET_SYSCALL_H

/* this struct defines the way the registers are stored on the
stack during a system call. */
Expand Down Expand Up @@ -33,4 +33,4 @@ struct target_pt_regs {
#define TARGET_MLOCKALL_MCL_CURRENT 1
#define TARGET_MLOCKALL_MCL_FUTURE 2

#endif /* TARGET_SYSCALL_H */
#endif /* ARM_TARGET_SYSCALL_H */
4 changes: 2 additions & 2 deletions linux-user/cris/target_syscall.h
@@ -1,5 +1,5 @@
#ifndef CRIS_SYSCALL_H
#define CRIS_SYSCALL_H 1
#ifndef CRIS_TARGET_SYSCALL_H
#define CRIS_TARGET_SYSCALL_H

#define UNAME_MACHINE "cris"
#define UNAME_MINIMUM_RELEASE "2.6.32"
Expand Down
6 changes: 3 additions & 3 deletions linux-user/i386/target_syscall.h
@@ -1,5 +1,5 @@
#ifndef TARGET_SYSCALL_H
#define TARGET_SYSCALL_H
#ifndef I386_TARGET_SYSCALL_H
#define I386_TARGET_SYSCALL_H

/* default linux values for the selectors */
#define __USER_CS (0x23)
Expand Down Expand Up @@ -154,4 +154,4 @@ struct target_vm86plus_struct {
#define TARGET_MLOCKALL_MCL_CURRENT 1
#define TARGET_MLOCKALL_MCL_FUTURE 2

#endif /* TARGET_SYSCALL_H */
#endif /* I386_TARGET_SYSCALL_H */
6 changes: 3 additions & 3 deletions linux-user/m68k/target_syscall.h
@@ -1,5 +1,5 @@
#ifndef TARGET_SYSCALL_H
#define TARGET_SYSCALL_H
#ifndef M68K_TARGET_SYSCALL_H
#define M68K_TARGET_SYSCALL_H

/* this struct defines the way the registers are stored on the
stack during a system call. */
Expand All @@ -26,4 +26,4 @@ struct target_pt_regs {

void do_m68k_simcall(CPUM68KState *, int);

#endif /* TARGET_SYSCALL_H */
#endif /* M68K_TARGET_SYSCALL_H */
4 changes: 2 additions & 2 deletions linux-user/microblaze/target_syscall.h
@@ -1,5 +1,5 @@
#ifndef MICROBLAZE_SYSCALLS_H
#define MICROBLAZE_SYSCALLS_H 1
#ifndef MICROBLAZE_TARGET_SYSCALL_H
#define MICROBLAZE_TARGET_SYSCALL_H

#define UNAME_MACHINE "microblaze"
#define UNAME_MINIMUM_RELEASE "2.6.32"
Expand Down
6 changes: 3 additions & 3 deletions linux-user/mips/target_syscall.h
@@ -1,5 +1,5 @@
#ifndef TARGET_SYSCALL_H
#define TARGET_SYSCALL_H
#ifndef MIPS_TARGET_SYSCALL_H
#define MIPS_TARGET_SYSCALL_H

/* this struct defines the way the registers are stored on the
stack during a system call. */
Expand Down Expand Up @@ -230,4 +230,4 @@ struct target_pt_regs {
#define TARGET_MLOCKALL_MCL_CURRENT 1
#define TARGET_MLOCKALL_MCL_FUTURE 2

#endif /* TARGET_SYSCALL_H */
#endif /* MIPS_TARGET_SYSCALL_H */
6 changes: 3 additions & 3 deletions linux-user/mips64/target_syscall.h
@@ -1,5 +1,5 @@
#ifndef TARGET_SYSCALL_H
#define TARGET_SYSCALL_H
#ifndef MIPS64_TARGET_SYSCALL_H
#define MIPS64_TARGET_SYSCALL_H

/* this struct defines the way the registers are stored on the
stack during a system call. */
Expand Down Expand Up @@ -227,4 +227,4 @@ struct target_pt_regs {
#define TARGET_MLOCKALL_MCL_CURRENT 1
#define TARGET_MLOCKALL_MCL_FUTURE 2

#endif /* TARGET_SYSCALL_H */
#endif /* MIPS64_TARGET_SYSCALL_H */
6 changes: 3 additions & 3 deletions linux-user/openrisc/target_syscall.h
@@ -1,5 +1,5 @@
#ifndef TARGET_SYSCALL_H
#define TARGET_SYSCALL_H
#ifndef OPENRISC_TARGET_SYSCALL_H
#define OPENRISC_TARGET_SYSCALL_H

struct target_pt_regs {
union {
Expand Down Expand Up @@ -31,4 +31,4 @@ struct target_pt_regs {
#define TARGET_MLOCKALL_MCL_CURRENT 1
#define TARGET_MLOCKALL_MCL_FUTURE 2

#endif /* TARGET_SYSCALL_H */
#endif /* OPENRISC_TARGET_SYSCALL_H */
6 changes: 3 additions & 3 deletions linux-user/ppc/target_syscall.h
Expand Up @@ -17,8 +17,8 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/

#ifndef TARGET_SYSCALL_H
#define TARGET_SYSCALL_H
#ifndef PPC_TARGET_SYSCALL_H
#define PPC_TARGET_SYSCALL_H

/* XXX: ABSOLUTELY BUGGY:
* for now, this is quite just a cut-and-paste from i386 target...
Expand Down Expand Up @@ -75,4 +75,4 @@ struct target_revectored_struct {
#define TARGET_MLOCKALL_MCL_CURRENT 0x2000
#define TARGET_MLOCKALL_MCL_FUTURE 0x4000

#endif /* TARGET_SYSCALL_H */
#endif /* PPC_TARGET_SYSCALL_H */
6 changes: 3 additions & 3 deletions linux-user/s390x/target_syscall.h
@@ -1,5 +1,5 @@
#ifndef TARGET_SYSCALL_H
#define TARGET_SYSCALL_H
#ifndef S390X_TARGET_SYSCALL_H
#define S390X_TARGET_SYSCALL_H

/* this typedef defines how a Program Status Word looks like */
typedef struct {
Expand Down Expand Up @@ -31,4 +31,4 @@ struct target_pt_regs {
#define TARGET_MLOCKALL_MCL_CURRENT 1
#define TARGET_MLOCKALL_MCL_FUTURE 2

#endif /* TARGET_SYSCALL_H */
#endif /* S390X_TARGET_SYSCALL_H */
6 changes: 3 additions & 3 deletions linux-user/sh4/target_syscall.h
@@ -1,5 +1,5 @@
#ifndef TARGET_SYSCALL_H
#define TARGET_SYSCALL_H
#ifndef SH4_TARGET_SYSCALL_H
#define SH4_TARGET_SYSCALL_H

struct target_pt_regs {
unsigned long regs[16];
Expand All @@ -19,4 +19,4 @@ struct target_pt_regs {
#define TARGET_MLOCKALL_MCL_CURRENT 1
#define TARGET_MLOCKALL_MCL_FUTURE 2

#endif /* TARGET_SYSCALL_H */
#endif /* SH4_TARGET_SYSCALL_H */
6 changes: 3 additions & 3 deletions linux-user/sparc/target_syscall.h
@@ -1,5 +1,5 @@
#ifndef TARGET_SYSCALL_H
#define TARGET_SYSCALL_H
#ifndef SPARC_TARGET_SYSCALL_H
#define SPARC_TARGET_SYSCALL_H

struct target_pt_regs {
abi_ulong psr;
Expand All @@ -22,4 +22,4 @@ struct target_pt_regs {
#define TARGET_MLOCKALL_MCL_CURRENT 0x2000
#define TARGET_MLOCKALL_MCL_FUTURE 0x4000

#endif /* TARGET_SYSCALL_H */
#endif /* SPARC_TARGET_SYSCALL_H */
6 changes: 3 additions & 3 deletions linux-user/sparc64/target_syscall.h
@@ -1,5 +1,5 @@
#ifndef TARGET_SYSCALL_H
#define TARGET_SYSCALL_H
#ifndef SPARC64_TARGET_SYSCALL_H
#define SPARC64_TARGET_SYSCALL_H

struct target_pt_regs {
abi_ulong u_regs[16];
Expand All @@ -23,4 +23,4 @@ struct target_pt_regs {
#define TARGET_MLOCKALL_MCL_CURRENT 0x2000
#define TARGET_MLOCKALL_MCL_FUTURE 0x4000

#endif /* TARGET_SYSCALL_H */
#endif /* SPARC64_TARGET_SYSCALL_H */
4 changes: 2 additions & 2 deletions linux-user/tilegx/target_syscall.h
@@ -1,5 +1,5 @@
#ifndef TILEGX_SYSCALLS_H
#define TILEGX_SYSCALLS_H
#ifndef TILEGX_TARGET_SYSCALL_H
#define TILEGX_TARGET_SYSCALL_H

#define UNAME_MACHINE "tilegx"
#define UNAME_MINIMUM_RELEASE "3.19"
Expand Down
8 changes: 5 additions & 3 deletions linux-user/unicore32/target_syscall.h
Expand Up @@ -5,8 +5,10 @@
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#ifndef __UC32_SYSCALL_H__
#define __UC32_SYSCALL_H__

#ifndef UNICORE32_TARGET_SYSCALL_H
#define UNICORE32_TARGET_SYSCALL_H

struct target_pt_regs {
abi_ulong uregs[34];
};
Expand Down Expand Up @@ -57,4 +59,4 @@ struct target_pt_regs {
#define TARGET_MLOCKALL_MCL_CURRENT 1
#define TARGET_MLOCKALL_MCL_FUTURE 2

#endif /* __UC32_SYSCALL_H__ */
#endif /* UNICORE32_TARGET_SYSCALL_H */
6 changes: 3 additions & 3 deletions linux-user/x86_64/target_syscall.h
@@ -1,5 +1,5 @@
#ifndef TARGET_SYSCALL_H
#define TARGET_SYSCALL_H
#ifndef X86_64_TARGET_SYSCALL_H
#define X86_64_TARGET_SYSCALL_H

#define __USER_CS (0x33)
#define __USER_DS (0x2B)
Expand Down Expand Up @@ -104,4 +104,4 @@ struct target_msqid64_ds {
#define TARGET_MLOCKALL_MCL_CURRENT 1
#define TARGET_MLOCKALL_MCL_FUTURE 2

#endif /* TARGET_SYSCALL_H */
#endif /* X86_64_TARGET_SYSCALL_H */

0 comments on commit 3622634

Please sign in to comment.