Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0707ad30 authored by Chris Metcalf's avatar Chris Metcalf
Browse files

arch/tile: Miscellaneous cleanup changes.



This commit is primarily changes caused by reviewing "sparse"
and "checkpatch" output on our sources, so is somewhat noisy, since
things like "printk() -> pr_err()" (or whatever) throughout the
codebase tend to get tedious to read.  Rather than trying to tease
apart precisely which things changed due to which type of code
review, this commit includes various cleanups in the code:

- sparse: Add declarations in headers for globals.
- sparse: Fix __user annotations.
- sparse: Using gfp_t consistently instead of int.
- sparse: removing functions not actually used.
- checkpatch: Clean up printk() warnings by using pr_info(), etc.;
  also avoid partial-line printks except in bootup code.
  - checkpatch: Use exposed structs rather than typedefs.
  - checkpatch: Change some C99 comments to C89 comments.

In addition, a couple of minor other changes are rolled in
to this commit:

- Add support for a "raise" instruction to cause SIGFPE, etc., to be raised.
- Remove some compat code that is unnecessary when we fully eliminate
  some of the deprecated syscalls from the generic syscall ABI.
- Update the tile_defconfig to reflect current config contents.

Signed-off-by: default avatarChris Metcalf <cmetcalf@tilera.com>
Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
parent c78095bd
Loading
Loading
Loading
Loading
+8 −7
Original line number Diff line number Diff line
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.34
# Fri May 28 17:51:43 2010
# Thu Jun  3 13:20:05 2010
#
CONFIG_MMU=y
CONFIG_GENERIC_CSUM=y
@@ -9,16 +9,13 @@ CONFIG_GENERIC_HARDIRQS=y
CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
CONFIG_GENERIC_IRQ_PROBE=y
CONFIG_GENERIC_PENDING_IRQ=y
CONFIG_ZONE_DMA=y
CONFIG_SEMAPHORE_SLEEPERS=y
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
CONFIG_HAVE_ARCH_ALLOC_REMAP=y
CONFIG_HAVE_SETUP_PER_CPU_AREA=y
CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y
CONFIG_SYS_SUPPORTS_HUGETLBFS=y
CONFIG_GENERIC_TIME=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_CLOCKSOURCE_WATCHDOG=y
CONFIG_RWSEM_GENERIC_SPINLOCK=y
CONFIG_DEFAULT_MIGRATION_COST=10000000
CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y
@@ -32,7 +29,6 @@ CONFIG_STRICT_DEVMEM=y
CONFIG_SMP=y
CONFIG_WERROR=y
# CONFIG_DEBUG_COPY_FROM_USER is not set
CONFIG_SERIAL_CONSOLE=y
CONFIG_HVC_TILE=y
CONFIG_TILE=y
# CONFIG_TILEGX is not set
@@ -86,6 +82,7 @@ CONFIG_INITRAMFS_COMPRESSION_NONE=y
# CONFIG_INITRAMFS_COMPRESSION_BZIP2 is not set
# CONFIG_INITRAMFS_COMPRESSION_LZMA is not set
# CONFIG_INITRAMFS_COMPRESSION_LZO is not set
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
CONFIG_SYSCTL=y
CONFIG_ANON_INODES=y
CONFIG_EMBEDDED=y
@@ -220,7 +217,7 @@ CONFIG_PAGEFLAGS_EXTENDED=y
CONFIG_SPLIT_PTLOCK_CPUS=4
CONFIG_MIGRATION=y
CONFIG_PHYS_ADDR_T_64BIT=y
CONFIG_ZONE_DMA_FLAG=1
CONFIG_ZONE_DMA_FLAG=0
CONFIG_BOUNCE=y
CONFIG_VIRT_TO_BUS=y
# CONFIG_KSM is not set
@@ -232,10 +229,11 @@ CONFIG_FEEDBACK_USE=""
CONFIG_VMALLOC_RESERVE=0x1000000
CONFIG_HARDWALL=y
CONFIG_MEMPROF=y
CONFIG_XGBE_MAIN=y
CONFIG_XGBE=y
CONFIG_NET_TILE=y
CONFIG_PSEUDO_NAPI=y
CONFIG_TILEPCI_ENDP=y
CONFIG_TILEPCI_HOST_SUBSET=m
CONFIG_TILE_IDE_GPIO=y
CONFIG_TILE_SOFTUART=y

@@ -244,6 +242,8 @@ CONFIG_TILE_SOFTUART=y
#
CONFIG_PCI=y
CONFIG_PCI_DOMAINS=y
# CONFIG_NO_IOMEM is not set
# CONFIG_NO_IOPORT is not set
# CONFIG_ARCH_SUPPORTS_MSI is not set
CONFIG_PCI_DEBUG=y
# CONFIG_PCI_STUB is not set
@@ -742,6 +742,7 @@ CONFIG_HVC_DRIVER=y
#
# CONFIG_RAW_DRIVER is not set
# CONFIG_TCG_TPM is not set
CONFIG_DEVPORT=y
CONFIG_I2C=y
CONFIG_I2C_BOARDINFO=y
CONFIG_I2C_COMPAT=y
+37 −32
Original line number Diff line number Diff line
// Copyright 2010 Tilera Corporation. All Rights Reserved.
//
//   This program is free software; you can redistribute it and/or
//   modify it under the terms of the GNU General Public License
//   as published by the Free Software Foundation, version 2.
//
//   This program is distributed in the hope that it will be useful, but
//   WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
//   NON INFRINGEMENT.  See the GNU General Public License for
//   more details.

//! @file
//!
//! ABI-related register definitions helpful when writing assembly code.
//!
/*
 * Copyright 2010 Tilera Corporation. All Rights Reserved.
 *
 *   This program is free software; you can redistribute it and/or
 *   modify it under the terms of the GNU General Public License
 *   as published by the Free Software Foundation, version 2.
 *
 *   This program is distributed in the hope that it will be useful, but
 *   WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
 *   NON INFRINGEMENT.  See the GNU General Public License for
 *   more details.
 */

/**
 * @file
 *
 * ABI-related register definitions helpful when writing assembly code.
 */

#ifndef __ARCH_ABI_H__
#define __ARCH_ABI_H__

#include <arch/chip.h>

// Registers 0 - 55 are "normal", but some perform special roles.
/* Registers 0 - 55 are "normal", but some perform special roles. */

#define TREG_FP       52   /**< Frame pointer. */
#define TREG_TP       53   /**< Thread pointer. */
@@ -30,7 +33,7 @@
/** Index of last normal general-purpose register. */
#define TREG_LAST_GPR 55

// Registers 56 - 62 are "special" network registers.
/* Registers 56 - 62 are "special" network registers. */

#define TREG_SN       56   /**< Static network access. */
#define TREG_IDN0     57   /**< IDN demux 0 access. */
@@ -40,7 +43,7 @@
#define TREG_UDN2     61   /**< UDN demux 2 access. */
#define TREG_UDN3     62   /**< UDN demux 3 access. */

// Register 63 is the "special" zero register.
/* Register 63 is the "special" zero register. */

#define TREG_ZERO     63   /**< "Zero" register; always reads as "0". */

@@ -52,42 +55,44 @@
#define TREG_SYSCALL_NR_NAME r10


//! The ABI requires callers to allocate a caller state save area of
//! this many bytes at the bottom of each stack frame.
//!
/**
 * The ABI requires callers to allocate a caller state save area of
 * this many bytes at the bottom of each stack frame.
 */
#ifdef __tile__
#define C_ABI_SAVE_AREA_SIZE (2 * __SIZEOF_POINTER__)
#endif

//! The operand to an 'info' opcode directing the backtracer to not
//! try to find the calling frame.
//!
/**
 * The operand to an 'info' opcode directing the backtracer to not
 * try to find the calling frame.
 */
#define INFO_OP_CANNOT_BACKTRACE 2

#ifndef __ASSEMBLER__
#if CHIP_WORD_SIZE() > 32

//! Unsigned type that can hold a register.
/** Unsigned type that can hold a register. */
typedef unsigned long long uint_reg_t;

//! Signed type that can hold a register.
/** Signed type that can hold a register. */
typedef long long int_reg_t;

//! String prefix to use for printf().
/** String prefix to use for printf(). */
#define INT_REG_FMT "ll"

#elif !defined(__LP64__)   /* avoid confusion with LP64 cross-build tools */

//! Unsigned type that can hold a register.
/** Unsigned type that can hold a register. */
typedef unsigned long uint_reg_t;

//! Signed type that can hold a register.
/** Signed type that can hold a register. */
typedef long int_reg_t;

//! String prefix to use for printf().
/** String prefix to use for printf(). */
#define INT_REG_FMT "l"

#endif
#endif /* __ASSEMBLER__ */

#endif // !__ARCH_ABI_H__
#endif /* !__ARCH_ABI_H__ */
+1 −1
Original line number Diff line number Diff line
@@ -301,4 +301,4 @@
    INT_MASK(INT_DOUBLE_FAULT) | \
    INT_MASK(INT_AUX_PERF_COUNT) | \
    0)
#endif // !__ARCH_INTERRUPTS_H__
#endif /* !__ARCH_INTERRUPTS_H__ */
+17 −0
Original line number Diff line number Diff line
@@ -348,6 +348,23 @@ void __init_atomic_per_cpu(void);
/* Support releasing the atomic lock in do_page_fault_ics(). */
void __atomic_fault_unlock(int *lock_ptr);
#endif

/* Private helper routines in lib/atomic_asm_32.S */
extern struct __get_user __atomic_cmpxchg(volatile int *p,
					  int *lock, int o, int n);
extern struct __get_user __atomic_xchg(volatile int *p, int *lock, int n);
extern struct __get_user __atomic_xchg_add(volatile int *p, int *lock, int n);
extern struct __get_user __atomic_xchg_add_unless(volatile int *p,
						  int *lock, int o, int n);
extern struct __get_user __atomic_or(volatile int *p, int *lock, int n);
extern struct __get_user __atomic_andn(volatile int *p, int *lock, int n);
extern struct __get_user __atomic_xor(volatile int *p, int *lock, int n);
extern u64 __atomic64_cmpxchg(volatile u64 *p, int *lock, u64 o, u64 n);
extern u64 __atomic64_xchg(volatile u64 *p, int *lock, u64 n);
extern u64 __atomic64_xchg_add(volatile u64 *p, int *lock, u64 n);
extern u64 __atomic64_xchg_add_unless(volatile u64 *p,
				      int *lock, u64 o, u64 n);

#endif /* !__ASSEMBLY__ */

#endif /* _ASM_TILE_ATOMIC_32_H */
+2 −53
Original line number Diff line number Diff line
@@ -70,48 +70,7 @@ struct compat_timeval {
	s32		tv_usec;
};

struct compat_stat {
	unsigned int	st_dev;
	unsigned int	st_ino;
	unsigned int	st_mode;
	unsigned int	st_nlink;
	unsigned int	st_uid;
	unsigned int	st_gid;
	unsigned int	st_rdev;
	unsigned int    __pad1;
	int		st_size;
	int		st_blksize;
	int		__pad2;
	int		st_blocks;
	int		st_atime;
	unsigned int	st_atime_nsec;
	int		st_mtime;
	unsigned int	st_mtime_nsec;
	int		st_ctime;
	unsigned int	st_ctime_nsec;
	unsigned int	__unused[2];
};

struct compat_stat64 {
	unsigned long	st_dev;
	unsigned long	st_ino;
	unsigned int	st_mode;
	unsigned int	st_nlink;
	unsigned int	st_uid;
	unsigned int	st_gid;
	unsigned long	st_rdev;
	long		st_size;
	unsigned int	st_blksize;
	unsigned long	st_blocks __attribute__((packed));
	unsigned int	st_atime;
	unsigned int	st_atime_nsec;
	unsigned int	st_mtime;
	unsigned int	st_mtime_nsec;
	unsigned int	st_ctime;
	unsigned int	st_ctime_nsec;
	unsigned int	__unused8;
};

#define compat_stat stat
#define compat_statfs statfs

struct compat_sysctl {
@@ -233,7 +192,7 @@ static inline compat_uptr_t ptr_to_compat(void __user *uptr)
/* Sign-extend when storing a kernel pointer to a user's ptregs. */
static inline unsigned long ptr_to_compat_reg(void __user *uptr)
{
	return (long)(int)(long)uptr;
	return (long)(int)(long __force)uptr;
}

static inline void __user *compat_alloc_user_space(long len)
@@ -278,17 +237,8 @@ long compat_sys_sync_file_range2(int fd, unsigned int flags,
long compat_sys_fallocate(int fd, int mode,
			  u32 offset_lo, u32 offset_hi,
			  u32 len_lo, u32 len_hi);
long compat_sys_stat64(char __user *filename,
		       struct compat_stat64 __user *statbuf);
long compat_sys_lstat64(char __user *filename,
			struct compat_stat64 __user *statbuf);
long compat_sys_fstat64(unsigned int fd, struct compat_stat64 __user *statbuf);
long compat_sys_fstatat64(int dfd, char __user *filename,
			  struct compat_stat64 __user *statbuf, int flag);
long compat_sys_sched_rr_get_interval(compat_pid_t pid,
				      struct compat_timespec __user *interval);
ssize_t compat_sys_sendfile(int out_fd, int in_fd, compat_off_t __user *offset,
			    size_t count);

/* Versions of compat functions that differ from generic Linux. */
struct compat_msgbuf;
@@ -302,7 +252,6 @@ long tile_compat_sys_ptrace(compat_long_t request, compat_long_t pid,
			    compat_long_t addr, compat_long_t data);

/* Tilera Linux syscalls that don't have "compat" versions. */
#define compat_sys_raise_fpe sys_raise_fpe
#define compat_sys_flush_cache sys_flush_cache

#endif /* _ASM_TILE_COMPAT_H */
Loading