Commit 59010373 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'for-linus' of https://github.com/openrisc/linux

Pull OpenRISC updates from Stafford Horne:
 "A few cleanups and fixups from me:

   - Add a few missing relocations to fix module loading

   - Cleanup FPU state save and restore to be more efficient

   - Cleanups to traps handling and logging

   - Fix issue with poweroff being broken after recent power driver
     refactorings"

* tag 'for-linus' of https://github.com/openrisc/linux:
  openrisc: Move FPU state out of pt_regs
  openrisc: Add FPU config
  openrisc: traps: Don't send signals to kernel mode threads
  openrisc: traps: Remove calls to show_registers before die
  openrisc: traps: Convert printks to pr_<level> macros
  openrisc: Add support for more module relocations
  openrisc: Define openrisc relocation types
  openrisc: Use do_kernel_power_off()
parents c59cebe8 4dc70e1a
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -188,6 +188,15 @@ config SMP

	  If you don't know what to do here, say N.

config FPU
	bool "FPU support"
	default y
	help
	  Say N here if you want to disable all floating-point related procedures
	  in the kernel and reduce binary size.

	  If you don't know what to do here, say Y.

source "kernel/Kconfig.hz"

config OPENRISC_NO_SPR_SR_DSX
+22 −0
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __ASM_OPENRISC_FPU_H
#define __ASM_OPENRISC_FPU_H

struct task_struct;

#ifdef CONFIG_FPU
static inline void save_fpu(struct task_struct *task)
{
	task->thread.fpcsr = mfspr(SPR_FPCSR);
}

static inline void restore_fpu(struct task_struct *task)
{
	mtspr(SPR_FPCSR, task->thread.fpcsr);
}
#else
#define save_fpu(tsk)			do { } while (0)
#define restore_fpu(tsk)		do { } while (0)
#endif

#endif /* __ASM_OPENRISC_FPU_H */
+1 −0
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@
struct task_struct;

struct thread_struct {
	long fpcsr;		/* Floating point control status register. */
};

/*
+1 −2
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@ struct pt_regs {
	 * -1 for all other exceptions.
	 */
	long  orig_gpr11;	/* For restarting system calls */
	long fpcsr;		/* Floating point control status register. */
	long dummy;		/* Cheap alignment fix */
	long dummy2;		/* Cheap alignment fix */
};

@@ -115,6 +115,5 @@ static inline long regs_return_value(struct pt_regs *regs)
#define PT_GPR31      124
#define PT_PC	      128
#define PT_ORIG_GPR11 132
#define PT_FPCSR      136

#endif /* __ASM_OPENRISC_PTRACE_H */
+66 −9
Original line number Diff line number Diff line
@@ -34,15 +34,72 @@
#include <asm/ptrace.h>

/* The OR1K relocation types... not all relevant for module loader */
#define R_OR32_NONE	0
#define R_OR32_32	1
#define R_OR32_16	2
#define R_OR32_8	3
#define R_OR32_CONST	4
#define R_OR32_CONSTH	5
#define R_OR32_JUMPTARG	6
#define R_OR32_VTINHERIT 7
#define R_OR32_VTENTRY	8
#define R_OR1K_NONE		0
#define R_OR1K_32		1
#define R_OR1K_16		2
#define R_OR1K_8		3
#define R_OR1K_LO_16_IN_INSN	4
#define R_OR1K_HI_16_IN_INSN	5
#define R_OR1K_INSN_REL_26	6
#define R_OR1K_GNU_VTENTRY	7
#define R_OR1K_GNU_VTINHERIT	8
#define R_OR1K_32_PCREL		9
#define R_OR1K_16_PCREL		10
#define R_OR1K_8_PCREL		11
#define R_OR1K_GOTPC_HI16	12
#define R_OR1K_GOTPC_LO16	13
#define R_OR1K_GOT16		14
#define R_OR1K_PLT26		15
#define R_OR1K_GOTOFF_HI16	16
#define R_OR1K_GOTOFF_LO16	17
#define R_OR1K_COPY		18
#define R_OR1K_GLOB_DAT		19
#define R_OR1K_JMP_SLOT		20
#define R_OR1K_RELATIVE		21
#define R_OR1K_TLS_GD_HI16	22
#define R_OR1K_TLS_GD_LO16	23
#define R_OR1K_TLS_LDM_HI16	24
#define R_OR1K_TLS_LDM_LO16	25
#define R_OR1K_TLS_LDO_HI16	26
#define R_OR1K_TLS_LDO_LO16	27
#define R_OR1K_TLS_IE_HI16	28
#define R_OR1K_TLS_IE_LO16	29
#define R_OR1K_TLS_LE_HI16	30
#define R_OR1K_TLS_LE_LO16	31
#define R_OR1K_TLS_TPOFF	32
#define R_OR1K_TLS_DTPOFF	33
#define R_OR1K_TLS_DTPMOD	34
#define R_OR1K_AHI16		35
#define R_OR1K_GOTOFF_AHI16	36
#define R_OR1K_TLS_IE_AHI16	37
#define R_OR1K_TLS_LE_AHI16	38
#define R_OR1K_SLO16		39
#define R_OR1K_GOTOFF_SLO16	40
#define R_OR1K_TLS_LE_SLO16	41
#define R_OR1K_PCREL_PG21	42
#define R_OR1K_GOT_PG21		43
#define R_OR1K_TLS_GD_PG21	44
#define R_OR1K_TLS_LDM_PG21	45
#define R_OR1K_TLS_IE_PG21	46
#define R_OR1K_LO13		47
#define R_OR1K_GOT_LO13		48
#define R_OR1K_TLS_GD_LO13	49
#define R_OR1K_TLS_LDM_LO13	50
#define R_OR1K_TLS_IE_LO13	51
#define R_OR1K_SLO13		52
#define R_OR1K_PLTA26		53
#define R_OR1K_GOT_AHI16	54

/* Old relocation names */
#define R_OR32_NONE	R_OR1K_NONE
#define R_OR32_32	R_OR1K_32
#define R_OR32_16	R_OR1K_16
#define R_OR32_8	R_OR1K_8
#define R_OR32_CONST	R_OR1K_LO_16_IN_INSN
#define R_OR32_CONSTH	R_OR1K_HI_16_IN_INSN
#define R_OR32_JUMPTARG	R_OR1K_INSN_REL_26
#define R_OR32_VTENTRY	R_OR1K_GNU_VTENTRY
#define R_OR32_VTINHERIT R_OR1K_GNU_VTINHERIT

typedef unsigned long elf_greg_t;

Loading