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

Merge tag 'microblaze-v5.13' of git://git.monstr.eu/linux-2.6-microblaze

Pull Microblaze updates from Michal Simek:
 "No new features, just about cleaning up some code and moving to
  generic syscall solution used by other architectures:

   - Switch to generic syscall scripts

   - Some small fixes"

* tag 'microblaze-v5.13' of git://git.monstr.eu/linux-2.6-microblaze:
  microblaze: add 'fallthrough' to memcpy/memset/memmove
  microblaze: Fix a typo
  microblaze: tag highmem_setup() with __meminit
  microblaze: syscalls: switch to generic syscallhdr.sh
  microblaze: syscalls: switch to generic syscalltbl.sh
parents 77d51337 47de4477
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0 */

#define __SYSCALL(nr, entry, nargs) .long entry
#define __SYSCALL(nr, entry) .long entry
ENTRY(sys_call_table)
#include <asm/syscall_table.h>
#undef __SYSCALL
+4 −10
Original line number Diff line number Diff line
@@ -6,20 +6,14 @@ _dummy := $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)') \
	  $(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)')

syscall := $(src)/syscall.tbl
syshdr := $(srctree)/$(src)/syscallhdr.sh
systbl := $(srctree)/$(src)/syscalltbl.sh
syshdr := $(srctree)/scripts/syscallhdr.sh
systbl := $(srctree)/scripts/syscalltbl.sh

quiet_cmd_syshdr = SYSHDR  $@
      cmd_syshdr = $(CONFIG_SHELL) '$(syshdr)' '$<' '$@'	\
		   '$(syshdr_abis_$(basetarget))'		\
		   '$(syshdr_pfx_$(basetarget))'		\
		   '$(syshdr_offset_$(basetarget))'
      cmd_syshdr = $(CONFIG_SHELL) $(syshdr) --emit-nr $< $@

quiet_cmd_systbl = SYSTBL  $@
      cmd_systbl = $(CONFIG_SHELL) '$(systbl)' '$<' '$@'	\
		   '$(systbl_abis_$(basetarget))'		\
		   '$(systbl_abi_$(basetarget))'		\
		   '$(systbl_offset_$(basetarget))'
      cmd_systbl = $(CONFIG_SHELL) $(systbl) $< $@

$(uapi)/unistd_32.h: $(syscall) $(syshdr) FORCE
	$(call if_changed,syshdr)
+0 −36
Original line number Diff line number Diff line
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0

in="$1"
out="$2"
my_abis=`echo "($3)" | tr ',' '|'`
prefix="$4"
offset="$5"

fileguard=_UAPI_ASM_MICROBLAZE_`basename "$out" | sed \
	-e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \
	-e 's/[^A-Z0-9_]/_/g' -e 's/__/_/g'`
grep -E "^[0-9A-Fa-fXx]+[[:space:]]+${my_abis}" "$in" | sort -n | (
	printf "#ifndef %s\n" "${fileguard}"
	printf "#define %s\n" "${fileguard}"
	printf "\n"

	nxt=0
	while read nr abi name entry ; do
		if [ -z "$offset" ]; then
			printf "#define __NR_%s%s\t%s\n" \
				"${prefix}" "${name}" "${nr}"
		else
			printf "#define __NR_%s%s\t(%s + %s)\n" \
				"${prefix}" "${name}" "${offset}" "${nr}"
		fi
		nxt=$((nr+1))
	done

	printf "\n"
	printf "#ifdef __KERNEL__\n"
	printf "#define __NR_syscalls\t%s\n" "${nxt}"
	printf "#endif\n"
	printf "\n"
	printf "#endif /* %s */\n" "${fileguard}"
) > "$out"
+0 −32
Original line number Diff line number Diff line
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0

in="$1"
out="$2"
my_abis=`echo "($3)" | tr ',' '|'`
my_abi="$4"
offset="$5"

emit() {
	t_nxt="$1"
	t_nr="$2"
	t_entry="$3"

	while [ $t_nxt -lt $t_nr ]; do
		printf "__SYSCALL(%s, sys_ni_syscall, )\n" "${t_nxt}"
		t_nxt=$((t_nxt+1))
	done
	printf "__SYSCALL(%s, %s, )\n" "${t_nxt}" "${t_entry}"
}

grep -E "^[0-9A-Fa-fXx]+[[:space:]]+${my_abis}" "$in" | sort -n | (
	nxt=0
	if [ -z "$offset" ]; then
		offset=0
	fi

	while read nr abi name entry ; do
		emit $((nxt+offset)) $((nr+offset)) $entry
		nxt=$((nr+1))
	done
) > "$out"
+4 −0
Original line number Diff line number Diff line
@@ -68,9 +68,11 @@ void *memcpy(void *v_dst, const void *v_src, __kernel_size_t c)
		case 1:
			*dst++ = *src++;
			--c;
			fallthrough;
		case 2:
			*dst++ = *src++;
			--c;
			fallthrough;
		case 3:
			*dst++ = *src++;
			--c;
@@ -176,8 +178,10 @@ void *memcpy(void *v_dst, const void *v_src, __kernel_size_t c)
	switch (c) {
	case 3:
		*dst++ = *src++;
		fallthrough;
	case 2:
		*dst++ = *src++;
		fallthrough;
	case 1:
		*dst++ = *src++;
	}
Loading