Commit f12e840c authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mattst88/alpha

Pull alpha architecture updates from Matt Turner:
 "A few small changes for alpha as well as the new system call table
  generation support from Firoz Khan"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mattst88/alpha:
  alpha: Remove some unused variables
  alpha: rtc: simplify alpha_rtc_init
  alpha: Fix a typo on ptrace.h
  alpha: fix spelling mistake QSD_PORT_ACTUVE -> QSD_PORT_ACTIVE
  alpha: generate uapi header and syscall table header files
  alpha: add system call table generation support
  alpha: add __NR_syscalls along with NR_SYSCALLS
  alpha: remove CONFIG_OSF4_COMPAT flag from syscall table
  alpha: move __IGNORE* entries to non uapi header
parents e3ed513b 1c3243f6
...@@ -61,6 +61,9 @@ bootimage bootpfile bootpzfile: vmlinux ...@@ -61,6 +61,9 @@ bootimage bootpfile bootpzfile: vmlinux
archclean: archclean:
$(Q)$(MAKE) $(clean)=$(boot) $(Q)$(MAKE) $(clean)=$(boot)
archheaders:
$(Q)$(MAKE) $(build)=arch/alpha/kernel/syscalls all
define archhelp define archhelp
echo '* boot - Compressed kernel image (arch/alpha/boot/vmlinux.gz)' echo '* boot - Compressed kernel image (arch/alpha/boot/vmlinux.gz)'
echo ' bootimage - SRM bootable image (arch/alpha/boot/bootimage)' echo ' bootimage - SRM bootable image (arch/alpha/boot/bootimage)'
......
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
generated-y += syscall_table.h
generic-y += compat.h generic-y += compat.h
generic-y += exec.h generic-y += exec.h
generic-y += export.h generic-y += export.h
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#include <uapi/asm/unistd.h> #include <uapi/asm/unistd.h>
#define NR_SYSCALLS 523 #define NR_SYSCALLS __NR_syscalls
#define __ARCH_WANT_NEW_STAT #define __ARCH_WANT_NEW_STAT
#define __ARCH_WANT_OLD_READDIR #define __ARCH_WANT_OLD_READDIR
...@@ -19,4 +19,25 @@ ...@@ -19,4 +19,25 @@
#define __ARCH_WANT_SYS_VFORK #define __ARCH_WANT_SYS_VFORK
#define __ARCH_WANT_SYS_CLONE #define __ARCH_WANT_SYS_CLONE
/*
* Ignore legacy syscalls that we don't use.
*/
#define __IGNORE_alarm
#define __IGNORE_creat
#define __IGNORE_getegid
#define __IGNORE_geteuid
#define __IGNORE_getgid
#define __IGNORE_getpid
#define __IGNORE_getppid
#define __IGNORE_getuid
#define __IGNORE_pause
#define __IGNORE_time
#define __IGNORE_utime
#define __IGNORE_umount2
/* Alpha doesn't have protection keys. */
#define __IGNORE_pkey_mprotect
#define __IGNORE_pkey_alloc
#define __IGNORE_pkey_free
#endif /* _ALPHA_UNISTD_H */ #endif /* _ALPHA_UNISTD_H */
# UAPI Header export list # UAPI Header export list
include include/uapi/asm-generic/Kbuild.asm include include/uapi/asm-generic/Kbuild.asm
generated-y += unistd_32.h
generic-y += bpf_perf_event.h generic-y += bpf_perf_event.h
generic-y += ipcbuf.h generic-y += ipcbuf.h
generic-y += msgbuf.h generic-y += msgbuf.h
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* kernel stack during a system call or other kernel entry * kernel stack during a system call or other kernel entry
* *
* NOTE! I want to minimize the overhead of system calls, so this * NOTE! I want to minimize the overhead of system calls, so this
* struct has as little information as possible. I does not have * struct has as little information as possible. It does not have
* *
* - floating point regs: the kernel doesn't change those * - floating point regs: the kernel doesn't change those
* - r9-15: saved by the C compiler * - r9-15: saved by the C compiler
......
This diff is collapsed.
...@@ -559,7 +559,7 @@ wildfire_dump_qsd_regs(int qbbno) ...@@ -559,7 +559,7 @@ wildfire_dump_qsd_regs(int qbbno)
printk(KERN_ERR " QSD_REV: 0x%16lx\n", qsd->qsd_rev.csr); printk(KERN_ERR " QSD_REV: 0x%16lx\n", qsd->qsd_rev.csr);
printk(KERN_ERR " QSD_PORT_PRESENT: 0x%16lx\n", printk(KERN_ERR " QSD_PORT_PRESENT: 0x%16lx\n",
qsd->qsd_port_present.csr); qsd->qsd_port_present.csr);
printk(KERN_ERR " QSD_PORT_ACTUVE: 0x%16lx\n", printk(KERN_ERR " QSD_PORT_ACTIVE: 0x%16lx\n",
qsd->qsd_port_active.csr); qsd->qsd_port_active.csr);
printk(KERN_ERR " QSD_FAULT_ENA: 0x%16lx\n", printk(KERN_ERR " QSD_FAULT_ENA: 0x%16lx\n",
qsd->qsd_fault_ena.csr); qsd->qsd_fault_ena.csr);
......
...@@ -529,7 +529,6 @@ SYSCALL_DEFINE4(osf_mount, unsigned long, typenr, const char __user *, path, ...@@ -529,7 +529,6 @@ SYSCALL_DEFINE4(osf_mount, unsigned long, typenr, const char __user *, path,
SYSCALL_DEFINE1(osf_utsname, char __user *, name) SYSCALL_DEFINE1(osf_utsname, char __user *, name)
{ {
int error;
char tmp[5 * 32]; char tmp[5 * 32];
down_read(&uts_sem); down_read(&uts_sem);
...@@ -560,7 +559,7 @@ SYSCALL_DEFINE0(getdtablesize) ...@@ -560,7 +559,7 @@ SYSCALL_DEFINE0(getdtablesize)
*/ */
SYSCALL_DEFINE2(osf_getdomainname, char __user *, name, int, namelen) SYSCALL_DEFINE2(osf_getdomainname, char __user *, name, int, namelen)
{ {
int len, err = 0; int len;
char *kname; char *kname;
char tmp[32]; char tmp[32];
...@@ -1343,7 +1342,6 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, ...@@ -1343,7 +1342,6 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
} }
#ifdef CONFIG_OSF4_COMPAT #ifdef CONFIG_OSF4_COMPAT
/* Clear top 32 bits of iov_len in the user's buffer for /* Clear top 32 bits of iov_len in the user's buffer for
compatibility with old versions of OSF/1 where iov_len compatibility with old versions of OSF/1 where iov_len
was defined as int. */ was defined as int. */
...@@ -1360,27 +1358,31 @@ osf_fix_iov_len(const struct iovec __user *iov, unsigned long count) ...@@ -1360,27 +1358,31 @@ osf_fix_iov_len(const struct iovec __user *iov, unsigned long count)
} }
return 0; return 0;
} }
#endif
SYSCALL_DEFINE3(osf_readv, unsigned long, fd, SYSCALL_DEFINE3(osf_readv, unsigned long, fd,
const struct iovec __user *, vector, unsigned long, count) const struct iovec __user *, vector, unsigned long, count)
{ {
#ifdef CONFIG_OSF4_COMPAT
if (unlikely(personality(current->personality) == PER_OSF4)) if (unlikely(personality(current->personality) == PER_OSF4))
if (osf_fix_iov_len(vector, count)) if (osf_fix_iov_len(vector, count))
return -EFAULT; return -EFAULT;
#endif
return sys_readv(fd, vector, count); return sys_readv(fd, vector, count);
} }
SYSCALL_DEFINE3(osf_writev, unsigned long, fd, SYSCALL_DEFINE3(osf_writev, unsigned long, fd,
const struct iovec __user *, vector, unsigned long, count) const struct iovec __user *, vector, unsigned long, count)
{ {
#ifdef CONFIG_OSF4_COMPAT
if (unlikely(personality(current->personality) == PER_OSF4)) if (unlikely(personality(current->personality) == PER_OSF4))
if (osf_fix_iov_len(vector, count)) if (osf_fix_iov_len(vector, count))
return -EFAULT; return -EFAULT;
#endif
return sys_writev(fd, vector, count); return sys_writev(fd, vector, count);
} }
#endif
SYSCALL_DEFINE2(osf_getpriority, int, which, int, who) SYSCALL_DEFINE2(osf_getpriority, int, which, int, who)
{ {
int prio = sys_getpriority(which, who); int prio = sys_getpriority(which, who);
......
...@@ -198,26 +198,24 @@ static const struct rtc_class_ops remote_rtc_ops = { ...@@ -198,26 +198,24 @@ static const struct rtc_class_ops remote_rtc_ops = {
static int __init static int __init
alpha_rtc_init(void) alpha_rtc_init(void)
{ {
const struct rtc_class_ops *ops;
struct platform_device *pdev; struct platform_device *pdev;
struct rtc_device *rtc; struct rtc_device *rtc;
const char *name;
init_rtc_epoch(); init_rtc_epoch();
name = "rtc-alpha";
ops = &alpha_rtc_ops;
#ifdef HAVE_REMOTE_RTC pdev = platform_device_register_simple("rtc-alpha", -1, NULL, 0);
if (alpha_mv.rtc_boot_cpu_only) rtc = devm_rtc_allocate_device(&pdev->dev);
ops = &remote_rtc_ops;
#endif
pdev = platform_device_register_simple(name, -1, NULL, 0);
rtc = devm_rtc_device_register(&pdev->dev, name, ops, THIS_MODULE);
if (IS_ERR(rtc)) if (IS_ERR(rtc))
return PTR_ERR(rtc); return PTR_ERR(rtc);
platform_set_drvdata(pdev, rtc); platform_set_drvdata(pdev, rtc);
return 0; rtc->ops = &alpha_rtc_ops;
#ifdef HAVE_REMOTE_RTC
if (alpha_mv.rtc_boot_cpu_only)
rtc->ops = &remote_rtc_ops;
#endif
return rtc_register_device(rtc);
} }
device_initcall(alpha_rtc_init); device_initcall(alpha_rtc_init);
# SPDX-License-Identifier: GPL-2.0
kapi := arch/$(SRCARCH)/include/generated/asm
uapi := arch/$(SRCARCH)/include/generated/uapi/asm
_dummy := $(shell [ -d '$(uapi)' ] || mkdir -p '$(uapi)') \
$(shell [ -d '$(kapi)' ] || mkdir -p '$(kapi)')
syscall := $(srctree)/$(src)/syscall.tbl
syshdr := $(srctree)/$(src)/syscallhdr.sh
systbl := $(srctree)/$(src)/syscalltbl.sh
quiet_cmd_syshdr = SYSHDR $@
cmd_syshdr = $(CONFIG_SHELL) '$(syshdr)' '$<' '$@' \
'$(syshdr_abis_$(basetarget))' \
'$(syshdr_pfx_$(basetarget))' \
'$(syshdr_offset_$(basetarget))'
quiet_cmd_systbl = SYSTBL $@
cmd_systbl = $(CONFIG_SHELL) '$(systbl)' '$<' '$@' \
'$(systbl_abis_$(basetarget))' \
'$(systbl_abi_$(basetarget))' \
'$(systbl_offset_$(basetarget))'
$(uapi)/unistd_32.h: $(syscall) $(syshdr)
$(call if_changed,syshdr)
$(kapi)/syscall_table.h: $(syscall) $(systbl)
$(call if_changed,systbl)
uapisyshdr-y += unistd_32.h
kapisyshdr-y += syscall_table.h
targets += $(uapisyshdr-y) $(kapisyshdr-y)
PHONY += all
all: $(addprefix $(uapi)/,$(uapisyshdr-y))
all: $(addprefix $(kapi)/,$(kapisyshdr-y))
@:
This diff is collapsed.
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
in="$1"
out="$2"
my_abis=`echo "($3)" | tr ',' '|'`
prefix="$4"
offset="$5"
fileguard=_UAPI_ASM_ALPHA_`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 */" "${fileguard}"
) > "$out"
#!/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"
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment