Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #35148.
- Loading branch information
Showing
7 changed files
with
165 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ stdenv, buildPackages, hostPlatform, fetchFromGitHub, perl, buildLinux, libelf, utillinux, ... } @ args: | ||
|
||
buildLinux (args // rec { | ||
version = "4.16-rc1"; | ||
modDirVersion = "4.16.0-rc1"; | ||
extraMeta.branch = "4.16"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "riscv"; | ||
repo ="riscv-linux"; | ||
rev = "a31991a9c6ce2c86fd676cf458a0ec10edc20d37"; | ||
sha256 = "0n97wfbi3pnp5c70xfj7s0fk8zjjkjz6ldxh7n54kbf64l4in01f"; | ||
}; | ||
|
||
# Should the testing kernels ever be built on Hydra? | ||
extraMeta.hydraPlatforms = []; | ||
|
||
} // (args.argsOverride or {})) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
commit 365fc1312f4911bfae25c5914c398f9aca21948f | ||
Author: Shea Levy <shea@shealevy.com> | ||
Date: Mon Feb 19 10:50:58 2018 -0500 | ||
|
||
riscv: Add install target to Makefile. | ||
|
||
Signed-off-by: Shea Levy <shea@shealevy.com> | ||
|
||
diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile | ||
index 6719dd30ec5b..26892daefa05 100644 | ||
--- a/arch/riscv/Makefile | ||
+++ b/arch/riscv/Makefile | ||
@@ -70,3 +70,7 @@ core-y += arch/riscv/kernel/ arch/riscv/mm/ | ||
libs-y += arch/riscv/lib/ | ||
|
||
all: vmlinux | ||
+ | ||
+PHONY += install | ||
+install: vmlinux | ||
+ sh $(srctree)/arch/riscv/install.sh $(KERNELRELEASE) $< System.map "$(INSTALL_PATH)" | ||
diff --git a/arch/riscv/install.sh b/arch/riscv/install.sh | ||
new file mode 100644 | ||
index 000000000000..8b3155a11a4a | ||
--- /dev/null | ||
+++ b/arch/riscv/install.sh | ||
@@ -0,0 +1,39 @@ | ||
+#!/bin/sh | ||
+# | ||
+# arch/riscv/install.sh | ||
+# | ||
+# This file is subject to the terms and conditions of the GNU General Public | ||
+# License. See the file "COPYING" in the main directory of this archive | ||
+# for more details. | ||
+# | ||
+# Copyright (C) 1995 by Linus Torvalds | ||
+# | ||
+# Adapted from code in arch/ia64/Makefile by Shea Levy | ||
+# | ||
+# "make install" script for riscv architecture | ||
+# | ||
+# Arguments: | ||
+# $1 - kernel version | ||
+# $2 - kernel image file | ||
+# $3 - kernel map file | ||
+# $4 - default install path (blank if root directory) | ||
+# | ||
+ | ||
+# User may have a custom install script | ||
+ | ||
+if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi | ||
+if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi | ||
+ | ||
+# Default install - no bootloader configuration (yet?) | ||
+base=$(basename $2) | ||
+ | ||
+if [ -f $4/$base ]; then | ||
+ mv $4/$base $4/$base.old | ||
+fi | ||
+ | ||
+if [ -f $4/System.map ]; then | ||
+ mv $4/System.map $4/System.old | ||
+fi | ||
+ | ||
+cat $2 > $4/$base | ||
+cp $3 $4/System.map |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
commit 2603e6087b26e9428b806b267aee6bcb919abcea | ||
Author: Shea Levy <shea@shealevy.com> | ||
Date: Sun Feb 18 20:08:30 2018 -0500 | ||
|
||
set_handle_irq: Return EBUSY if the handler has already been registered. | ||
|
||
This is what's expected by the comments and at least by irq-riscv-intc.c | ||
|
||
Signed-off-by: Shea Levy <shea@shealevy.com> | ||
|
||
diff --git a/include/linux/irq.h b/include/linux/irq.h | ||
index 2930fd2572e4..77e97872a13e 100644 | ||
--- a/include/linux/irq.h | ||
+++ b/include/linux/irq.h | ||
@@ -1179,7 +1179,7 @@ int ipi_send_mask(unsigned int virq, const struct cpumask *dest); | ||
* Returns 0 on success, or -EBUSY if an IRQ handler has already been | ||
* registered. | ||
*/ | ||
-void __init set_handle_irq(void (*handle_irq)(struct pt_regs *)); | ||
+int __init set_handle_irq(void (*handle_irq)(struct pt_regs *)); | ||
|
||
/* | ||
* Allows interrupt handlers to find the irqchip that's been registered as the | ||
diff --git a/kernel/irq/handle.c b/kernel/irq/handle.c | ||
index dee4f9a172ca..3570c715c3e7 100644 | ||
--- a/kernel/irq/handle.c | ||
+++ b/kernel/irq/handle.c | ||
@@ -213,11 +213,12 @@ irqreturn_t handle_irq_event(struct irq_desc *desc) | ||
} | ||
|
||
#ifdef CONFIG_GENERIC_IRQ_MULTI_HANDLER | ||
-void __init set_handle_irq(void (*handle_irq)(struct pt_regs *)) | ||
+int __init set_handle_irq(void (*handle_irq)(struct pt_regs *)) | ||
{ | ||
if (handle_arch_irq) | ||
- return; | ||
+ return -EBUSY; | ||
|
||
handle_arch_irq = handle_irq; | ||
+ return 0; | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
diff -Naur linux-4.15.4-orig/arch/riscv/configs/defconfig linux-4.15.4/arch/riscv/configs/defconfig | ||
--- linux-4.15.4-orig/arch/riscv/configs/defconfig 2018-02-16 14:07:01.000000000 -0500 | ||
+++ linux-4.15.4/arch/riscv/configs/defconfig 2018-02-18 18:33:09.488431900 -0500 | ||
@@ -12,6 +12,7 @@ | ||
CONFIG_NAMESPACES=y | ||
CONFIG_USER_NS=y | ||
CONFIG_BLK_DEV_INITRD=y | ||
+CONFIG_MODULES=y | ||
CONFIG_EXPERT=y | ||
CONFIG_CHECKPOINT_RESTORE=y | ||
CONFIG_BPF_SYSCALL=y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters