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

Commit d70b1e06 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull Hexagon fixes from Richard Kuo:
 "Changes for the Hexagon architecture (and one touching OpenRISC).

  They include various fixes to make use of additional arch features and
  cleanups.  The largest functional change is a cleanup of the signal
  and event return paths"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rkuo/linux-hexagon-kernel: (32 commits)
  Hexagon: add v4 CS regs to core copyout macro
  Hexagon: use correct translation for VMALLOC_START
  Hexagon: use correct translations for DMA mappings
  Hexagon: fix return value for notify_resume case in do_work_pending
  Hexagon: fix signal number for user mem faults
  Hexagon: remove two Kconfig entries
  arch: remove CONFIG_GENERIC_FIND_NEXT_BIT again
  Hexagon: update copyright dates
  Hexagon: add translation types for __vmnewmap
  Hexagon: fix signal.c compile error
  Hexagon: break up user fn/arg register setting
  Hexagon: use generic sys_fork, sys_vfork, and sys_clone
  Hexagon: fix psp/sp macro
  Hexagon: fix up int enable/disable at ret_from_fork
  Hexagon: add IOMEM and _relaxed IO macros
  Hexagon: switch to using the device type for IO mappings
  Hexagon: don't print info for offline CPU's
  Hexagon: add support for single-stepping (v4+)
  Hexagon: use correct work mask when checking for more work
  Hexagon: add support for additional exceptions
  ...
parents b0b88565 426d29cc
Loading
Loading
Loading
Loading
+10 −23
Original line number Diff line number Diff line
@@ -29,21 +29,17 @@ config HEXAGON
	select GENERIC_CLOCKEVENTS
	select GENERIC_CLOCKEVENTS_BROADCAST
	select MODULES_USE_ELF_RELA
	select GENERIC_CPU_DEVICES
	select GENERIC_KERNEL_THREAD
	select GENERIC_KERNEL_EXECVE
	---help---
	  Qualcomm Hexagon is a processor architecture designed for high
	  performance and low power across a wide variety of applications.

config HEXAGON_ARCH_V1
	bool

config HEXAGON_ARCH_V2
	bool

config HEXAGON_ARCH_V3
	bool

config HEXAGON_ARCH_V4
	bool
config HEXAGON_PHYS_OFFSET
	def_bool y
	---help---
	  Platforms that don't load the kernel at zero set this.

config FRAME_POINTER
	def_bool y
@@ -81,9 +77,6 @@ config RWSEM_GENERIC_SPINLOCK
config RWSEM_XCHGADD_ALGORITHM
	def_bool y

config GENERIC_FIND_NEXT_BIT
	def_bool y

config GENERIC_HWEIGHT
	def_bool y

@@ -103,14 +96,14 @@ choice

config HEXAGON_COMET
	bool "Comet Board"
	select HEXAGON_ARCH_V2
	---help---
	  Support for the Comet platform.

endchoice

config HEXAGON_VM
	def_bool y
config HEXAGON_ARCH_VERSION
	int "Architecture version"
	default 2

config CMDLINE
	string "Default kernel command string"
@@ -122,12 +115,6 @@ config CMDLINE
	  minimum, you should specify the memory size and the root device
	  (e.g., mem=64M root=/dev/nfs).

config HEXAGON_ANGEL_TRAPS
	bool "Use Angel Traps"
	default n
	---help---
	  Enable angel debug traps (for printk's).

config SMP
	bool "Multi-Processing support"
	---help---
+3 −14
Original line number Diff line number Diff line
@@ -15,20 +15,9 @@ KBUILD_CFLAGS += -fno-short-enums
# LDFLAGS_MODULE += -shared
CFLAGS_MODULE += -mlong-calls

cflags-$(CONFIG_HEXAGON_ARCH_V1) += $(call cc-option,-mv1)
cflags-$(CONFIG_HEXAGON_ARCH_V2) += $(call cc-option,-mv2)
cflags-$(CONFIG_HEXAGON_ARCH_V3) += $(call cc-option,-mv3)
cflags-$(CONFIG_HEXAGON_ARCH_V4) += $(call cc-option,-mv4)

aflags-$(CONFIG_HEXAGON_ARCH_V1) += $(call cc-option,-mv1)
aflags-$(CONFIG_HEXAGON_ARCH_V2) += $(call cc-option,-mv2)
aflags-$(CONFIG_HEXAGON_ARCH_V3) += $(call cc-option,-mv3)
aflags-$(CONFIG_HEXAGON_ARCH_V4) += $(call cc-option,-mv4)

ldflags-$(CONFIG_HEXAGON_ARCH_V1) += $(call cc-option,-mv1)
ldflags-$(CONFIG_HEXAGON_ARCH_V2) += $(call cc-option,-mv2)
ldflags-$(CONFIG_HEXAGON_ARCH_V3) += $(call cc-option,-mv3)
ldflags-$(CONFIG_HEXAGON_ARCH_V4) += $(call cc-option,-mv4)
cflags-y += $(call cc-option,-mv${CONFIG_HEXAGON_ARCH_VERSION})
aflags-y += $(call cc-option,-mv${CONFIG_HEXAGON_ARCH_VERSION})
ldflags-y += $(call cc-option,-mv${CONFIG_HEXAGON_ARCH_VERSION})

KBUILD_CFLAGS += $(cflags-y)
KBUILD_AFLAGS += $(aflags-y)
+1 −1
Original line number Diff line number Diff line
@@ -25,7 +25,6 @@ generic-y += kdebug.h
generic-y += kmap_types.h
generic-y += local64.h
generic-y += local.h
generic-y += local.h
generic-y += mman.h
generic-y += msgbuf.h
generic-y += pci.h
@@ -41,6 +40,7 @@ generic-y += sembuf.h
generic-y += shmbuf.h
generic-y += shmparam.h
generic-y += siginfo.h
generic-y += sizes.h
generic-y += socket.h
generic-y += sockios.h
generic-y += statfs.h
+12 −10
Original line number Diff line number Diff line
/*
 * Atomic operations for the Hexagon architecture
 *
 * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
 * Copyright (c) 2010-2013, The Linux Foundation. All rights reserved.
 *
 *
 * This program is free software; you can redistribute it and/or modify
@@ -117,35 +117,37 @@ static inline int atomic_sub_return(int i, atomic_t *v)
#define atomic_sub(i, v) atomic_sub_return(i, (v))

/**
 * atomic_add_unless - add unless the number is a given value
 * __atomic_add_unless - add unless the number is a given value
 * @v: pointer to value
 * @a: amount to add
 * @u: unless value is equal to u
 *
 * Returns 1 if the add happened, 0 if it didn't.
 * Returns old value.
 *
 */

static inline int __atomic_add_unless(atomic_t *v, int a, int u)
{
	int output, __oldval;
	int __oldval;
	register int tmp;

	asm volatile(
		"1:	%0 = memw_locked(%2);"
		"	{"
		"		p3 = cmp.eq(%0, %4);"
		"		if (p3.new) jump:nt 2f;"
		"		%0 = add(%0, %3);"
		"		%1 = #0;"
		"		%1 = add(%0, %3);"
		"	}"
		"	memw_locked(%2, p3) = %0;"
		"	memw_locked(%2, p3) = %1;"
		"	{"
		"		if !p3 jump 1b;"
		"		%1 = #1;"
		"	}"
		"2:"
		: "=&r" (__oldval), "=&r" (output)
		: "=&r" (__oldval), "=&r" (tmp)
		: "r" (v), "r" (a), "r" (u)
		: "memory", "p3"
	);
	return output;
	return __oldval;
}

#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
+16 −7
Original line number Diff line number Diff line
/*
 * ELF definitions for the Hexagon architecture
 *
 * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
 * Copyright (c) 2010-2012, The Linux Foundation. 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 version 2 and
@@ -104,6 +104,16 @@ typedef unsigned long elf_fpregset_t;
 * Bypass the whole "regsets" thing for now and use the define.
 */

#if CONFIG_HEXAGON_ARCH_VERSION >= 4
#define CS_COPYREGS(DEST,REGS) \
do {\
	DEST.cs0 = REGS->cs0;\
	DEST.cs1 = REGS->cs1;\
} while (0)
#else
#define CS_COPYREGS(DEST,REGS)
#endif

#define ELF_CORE_COPY_REGS(DEST, REGS)	\
do {					\
	DEST.r0 = REGS->r00;		\
@@ -148,13 +158,12 @@ do { \
	DEST.p3_0 = REGS->preds;	\
	DEST.gp = REGS->gp;		\
	DEST.ugp = REGS->ugp;		\
	CS_COPYREGS(DEST,REGS);		\
	DEST.pc = pt_elr(REGS);		\
	DEST.cause = pt_cause(REGS);	\
	DEST.badva = pt_badva(REGS);	\
} while (0);



/*
 * This is used to ensure we don't load something for the wrong architecture.
 * Checks the machine and ABI type.
@@ -168,15 +177,15 @@ do { \
#define ELF_DATA	ELFDATA2LSB
#define ELF_ARCH	EM_HEXAGON

#ifdef CONFIG_HEXAGON_ARCH_V2
#if CONFIG_HEXAGON_ARCH_VERSION == 2
#define ELF_CORE_EFLAGS 0x1
#endif

#ifdef CONFIG_HEXAGON_ARCH_V3
#if CONFIG_HEXAGON_ARCH_VERSION == 3
#define ELF_CORE_EFLAGS 0x2
#endif

#ifdef CONFIG_HEXAGON_ARCH_V4
#if CONFIG_HEXAGON_ARCH_VERSION == 4
#define ELF_CORE_EFLAGS 0x3
#endif

Loading