forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'riscv-for-linus-4.20-rc4' of git://git.kernel.org/pub/scm/…
…linux/kernel/git/palmer/riscv-linux Pull RISC-V fixes from Palmer Dabbelt: "This week is a bit bigger than I expected. That's my fault, as I missed a few patches while I was at Plumbers last week. We have: - A fix to a quite embarassing issue where raw_copy_to_user() was implemented with asm_copy_from_user() (and vice versa). - Improvements to our makefile to allow flat binaries to be generated. - A build fix that predeclares "struct module" at the top of <asm/module.h>, which triggers warnings later in that header. - The addition of our own <uapi/asm/unistd> header, which is necessary to align our stat ABI on 32-bit systems. - A fix to avoid printing a warning when the S or U bits are set in print_isa(). I already have one patch in the queue for next week" * tag 'riscv-for-linus-4.20-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/palmer/riscv-linux: RISC-V: recognize S/U mode bits in print_isa riscv: add asm/unistd.h UAPI header riscv: fix warning in arch/riscv/include/asm/module.h RISC-V: Build flat and compressed kernel images RISC-V: Fix raw_copy_{to,from}_user()
- Loading branch information
Showing
11 changed files
with
150 additions
and
17 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,2 @@ | ||
Image | ||
Image.gz |
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,33 @@ | ||
# | ||
# arch/riscv/boot/Makefile | ||
# | ||
# This file is included by the global makefile so that you can add your own | ||
# architecture-specific flags and dependencies. | ||
# | ||
# 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) 2018, Anup Patel. | ||
# Author: Anup Patel <[email protected]> | ||
# | ||
# Based on the ia64 and arm64 boot/Makefile. | ||
# | ||
|
||
OBJCOPYFLAGS_Image :=-O binary -R .note -R .note.gnu.build-id -R .comment -S | ||
|
||
targets := Image | ||
|
||
$(obj)/Image: vmlinux FORCE | ||
$(call if_changed,objcopy) | ||
|
||
$(obj)/Image.gz: $(obj)/Image FORCE | ||
$(call if_changed,gzip) | ||
|
||
install: | ||
$(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \ | ||
$(obj)/Image System.map "$(INSTALL_PATH)" | ||
|
||
zinstall: | ||
$(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \ | ||
$(obj)/Image.gz System.map "$(INSTALL_PATH)" |
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,60 @@ | ||
#!/bin/sh | ||
# | ||
# arch/riscv/boot/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/i386/boot/Makefile by H. Peter Anvin | ||
# Adapted from code in arch/i386/boot/install.sh by Russell King | ||
# | ||
# "make install" script for the RISC-V Linux port | ||
# | ||
# Arguments: | ||
# $1 - kernel version | ||
# $2 - kernel image file | ||
# $3 - kernel map file | ||
# $4 - default install path (blank if root directory) | ||
# | ||
|
||
verify () { | ||
if [ ! -f "$1" ]; then | ||
echo "" 1>&2 | ||
echo " *** Missing file: $1" 1>&2 | ||
echo ' *** You need to run "make" before "make install".' 1>&2 | ||
echo "" 1>&2 | ||
exit 1 | ||
fi | ||
} | ||
|
||
# Make sure the files actually exist | ||
verify "$2" | ||
verify "$3" | ||
|
||
# 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 | ||
|
||
if [ "$(basename $2)" = "Image.gz" ]; then | ||
# Compressed install | ||
echo "Installing compressed kernel" | ||
base=vmlinuz | ||
else | ||
# Normal install | ||
echo "Installing normal kernel" | ||
base=vmlinux | ||
fi | ||
|
||
if [ -f $4/$base-$1 ]; then | ||
mv $4/$base-$1 $4/$base-$1.old | ||
fi | ||
cat $2 > $4/$base-$1 | ||
|
||
# Install system map file | ||
if [ -f $4/System.map-$1 ]; then | ||
mv $4/System.map-$1 $4/System.map-$1.old | ||
fi | ||
cp $3 $4/System.map-$1 |
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
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
26 changes: 19 additions & 7 deletions
26
arch/riscv/include/uapi/asm/syscalls.h → arch/riscv/include/uapi/asm/unistd.h
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 |
---|---|---|
@@ -1,13 +1,25 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 */ | ||
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ | ||
/* | ||
* Copyright (C) 2017-2018 SiFive | ||
* Copyright (C) 2018 David Abdurachmanov <[email protected]> | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2 as | ||
* published by the Free Software Foundation. | ||
* | ||
* 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. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
/* | ||
* There is explicitly no include guard here because this file is expected to | ||
* be included multiple times in order to define the syscall macros via | ||
* __SYSCALL. | ||
*/ | ||
#ifdef __LP64__ | ||
#define __ARCH_WANT_NEW_STAT | ||
#endif /* __LP64__ */ | ||
|
||
#include <asm-generic/unistd.h> | ||
|
||
/* | ||
* Allows the instruction cache to be flushed from userspace. Despite RISC-V | ||
|
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
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