svn commit: r319549 - in projects/clang500-import: . bin/dd/tests contrib/compiler-rt/lib/tsan/rtl contrib/xz/src/liblzma/check lib/libc/sys lib/libsysdecode share/man/man7 share/mk sys/amd64/amd64...
Dimitry Andric
dim at FreeBSD.org
Sat Jun 3 18:21:55 UTC 2017
Author: dim
Date: Sat Jun 3 18:21:50 2017
New Revision: 319549
URL: https://svnweb.freebsd.org/changeset/base/319549
Log:
Merge ^/head r319480 through r319547.
Deleted:
projects/clang500-import/sys/arm/versatile/versatile_timer.c
Modified:
projects/clang500-import/Makefile.inc1
projects/clang500-import/ObsoleteFiles.inc
projects/clang500-import/bin/dd/tests/dd2_test.sh
projects/clang500-import/contrib/compiler-rt/lib/tsan/rtl/tsan_rtl_aarch64.S
projects/clang500-import/contrib/xz/src/liblzma/check/crc32_x86.S
projects/clang500-import/contrib/xz/src/liblzma/check/crc64_x86.S
projects/clang500-import/lib/libc/sys/Makefile.inc
projects/clang500-import/lib/libsysdecode/Makefile
projects/clang500-import/lib/libsysdecode/flags.c
projects/clang500-import/lib/libsysdecode/mktables
projects/clang500-import/lib/libsysdecode/sysdecode.3
projects/clang500-import/lib/libsysdecode/sysdecode.h
projects/clang500-import/lib/libsysdecode/sysdecode_enum.3
projects/clang500-import/share/man/man7/ascii.7
projects/clang500-import/share/mk/local.meta.sys.mk
projects/clang500-import/share/mk/sys.mk
projects/clang500-import/sys/amd64/amd64/pmap.c
projects/clang500-import/sys/arm/annapurna/alpine/files.alpine
projects/clang500-import/sys/arm/arm/machdep.c
projects/clang500-import/sys/arm/arm/mpcore_timer.c
projects/clang500-import/sys/arm/conf/AML8726
projects/clang500-import/sys/arm/conf/ARMADAXP
projects/clang500-import/sys/arm/conf/BEAGLEBONE
projects/clang500-import/sys/arm/conf/EFIKA_MX
projects/clang500-import/sys/arm/conf/IMX53
projects/clang500-import/sys/arm/conf/RT1310
projects/clang500-import/sys/arm/freescale/imx/imx51_machdep.c
projects/clang500-import/sys/arm/freescale/imx/imx53_machdep.c
projects/clang500-import/sys/arm/versatile/files.versatile
projects/clang500-import/sys/arm/versatile/sp804.c
projects/clang500-import/sys/arm64/arm64/pmap.c
projects/clang500-import/sys/compat/linuxkpi/common/src/linux_compat.c
projects/clang500-import/sys/conf/files.amd64
projects/clang500-import/sys/conf/files.i386
projects/clang500-import/sys/dev/cxgbe/t4_sge.c
projects/clang500-import/sys/dev/etherswitch/e6000sw/e6000sw.c
projects/clang500-import/sys/dev/etherswitch/e6000sw/e6000swreg.h
projects/clang500-import/sys/dev/uart/uart_bus_fdt.c
projects/clang500-import/sys/dev/xen/netfront/netfront.c
projects/clang500-import/sys/fs/msdosfs/denode.h
projects/clang500-import/sys/fs/msdosfs/msdosfs_conv.c
projects/clang500-import/sys/fs/msdosfs/msdosfs_denode.c
projects/clang500-import/sys/fs/msdosfs/msdosfs_fat.c
projects/clang500-import/sys/fs/msdosfs/msdosfs_vnops.c
projects/clang500-import/sys/kern/kern_proc.c
projects/clang500-import/sys/kern/kern_sendfile.c
projects/clang500-import/sys/kern/uipc_accf.c
projects/clang500-import/sys/kern/uipc_socket.c
projects/clang500-import/sys/kern/uipc_usrreq.c
projects/clang500-import/sys/kern/vfs_default.c
projects/clang500-import/sys/kern/vfs_subr.c
projects/clang500-import/sys/kern/vnode_if.src
projects/clang500-import/sys/sys/sockopt.h
projects/clang500-import/sys/sys/unpcb.h
projects/clang500-import/sys/sys/vnode.h
projects/clang500-import/sys/ufs/ffs/ffs_softdep.c
projects/clang500-import/sys/ufs/ffs/ffs_vfsops.c
projects/clang500-import/sys/ufs/ffs/softdep.h
projects/clang500-import/usr.bin/diff/diff.c
projects/clang500-import/usr.bin/kdump/kdump.c
projects/clang500-import/usr.bin/last/last.c
projects/clang500-import/usr.bin/truss/syscall.h
projects/clang500-import/usr.bin/truss/syscalls.c
projects/clang500-import/usr.sbin/bhyve/Makefile
projects/clang500-import/usr.sbin/bhyve/bhyve.8
projects/clang500-import/usr.sbin/bhyve/pci_fbuf.c (contents, props changed)
projects/clang500-import/usr.sbin/bhyve/rfb.c (contents, props changed)
projects/clang500-import/usr.sbin/bhyve/rfb.h (contents, props changed)
projects/clang500-import/usr.sbin/makefs/ffs/buf.c
projects/clang500-import/usr.sbin/newsyslog/tests/legacy_test.sh
Directory Properties:
projects/clang500-import/ (props changed)
projects/clang500-import/contrib/compiler-rt/ (props changed)
projects/clang500-import/contrib/xz/ (props changed)
Modified: projects/clang500-import/Makefile.inc1
==============================================================================
--- projects/clang500-import/Makefile.inc1 Sat Jun 3 18:20:23 2017 (r319548)
+++ projects/clang500-import/Makefile.inc1 Sat Jun 3 18:21:50 2017 (r319549)
@@ -2019,6 +2019,7 @@ native-xtools: .PHONY
${_gcc_tools} \
${_clang_libs} \
${_clang} \
+ ${_lld} \
sbin/md5 \
sbin/sysctl \
usr.bin/diff \
Modified: projects/clang500-import/ObsoleteFiles.inc
==============================================================================
--- projects/clang500-import/ObsoleteFiles.inc Sat Jun 3 18:20:23 2017 (r319548)
+++ projects/clang500-import/ObsoleteFiles.inc Sat Jun 3 18:21:50 2017 (r319549)
@@ -150,6 +150,8 @@ OLD_FILES+=usr/lib/clang/4.0.0/lib/freebsd/libclang_rt
OLD_DIRS+=usr/lib/clang/4.0.0/lib/freebsd
OLD_DIRS+=usr/lib/clang/4.0.0/lib
OLD_DIRS+=usr/lib/clang/4.0.0
+# 20170601: remove stale manpage
+OLD_FILES+=usr/share/man/man2/cap_rights_get.2.gz
# 20170601: old libifconfig and libifc
OLD_FILES+=usr/lib/libifc.a
OLD_FILES+=usr/lib/libifc_p.a
Modified: projects/clang500-import/bin/dd/tests/dd2_test.sh
==============================================================================
--- projects/clang500-import/bin/dd/tests/dd2_test.sh Sat Jun 3 18:20:23 2017 (r319548)
+++ projects/clang500-import/bin/dd/tests/dd2_test.sh Sat Jun 3 18:21:50 2017 (r319549)
@@ -27,10 +27,14 @@
atf_test_case seek_overflow
-seek_overflow_head() {
+seek_overflow_head()
+{
atf_set "descr" "dd(1) should reject too-large seek values"
}
-seek_overflow_body() {
+seek_overflow_body()
+{
+ atf_expect_fail "fails with 'dd: truncating f.out: File too large' - bug 219757"
+
touch f.in
# Positive tests
seek=`echo "2^63 / 4096 - 1" | bc`
Modified: projects/clang500-import/contrib/compiler-rt/lib/tsan/rtl/tsan_rtl_aarch64.S
==============================================================================
--- projects/clang500-import/contrib/compiler-rt/lib/tsan/rtl/tsan_rtl_aarch64.S Sat Jun 3 18:20:23 2017 (r319548)
+++ projects/clang500-import/contrib/compiler-rt/lib/tsan/rtl/tsan_rtl_aarch64.S Sat Jun 3 18:21:50 2017 (r319549)
@@ -252,7 +252,7 @@ __sigsetjmp:
CFI_ENDPROC
.size __sigsetjmp, .-__sigsetjmp
-#if defined(__linux__)
+#if defined(__FreeBSD__) || defined(__linux__)
/* We do not need executable stack. */
.section .note.GNU-stack,"", at progbits
#endif
Modified: projects/clang500-import/contrib/xz/src/liblzma/check/crc32_x86.S
==============================================================================
--- projects/clang500-import/contrib/xz/src/liblzma/check/crc32_x86.S Sat Jun 3 18:20:23 2017 (r319548)
+++ projects/clang500-import/contrib/xz/src/liblzma/check/crc32_x86.S Sat Jun 3 18:21:50 2017 (r319549)
@@ -299,6 +299,6 @@ LZMA_CRC32:
* use __linux__ here, but I don't know a way to detect when
* we are using GNU assembler.
*/
-#if defined(__ELF__) && defined(__linux__)
+#if defined(__ELF__) && (defined(__FreeBSD__) || defined(__linux__))
.section .note.GNU-stack,"", at progbits
#endif
Modified: projects/clang500-import/contrib/xz/src/liblzma/check/crc64_x86.S
==============================================================================
--- projects/clang500-import/contrib/xz/src/liblzma/check/crc64_x86.S Sat Jun 3 18:20:23 2017 (r319548)
+++ projects/clang500-import/contrib/xz/src/liblzma/check/crc64_x86.S Sat Jun 3 18:21:50 2017 (r319549)
@@ -282,6 +282,6 @@ LZMA_CRC64:
* use __linux__ here, but I don't know a way to detect when
* we are using GNU assembler.
*/
-#if defined(__ELF__) && defined(__linux__)
+#if defined(__ELF__) && (defined(__FreeBSD__) || defined(__linux__))
.section .note.GNU-stack,"", at progbits
#endif
Modified: projects/clang500-import/lib/libc/sys/Makefile.inc
==============================================================================
--- projects/clang500-import/lib/libc/sys/Makefile.inc Sat Jun 3 18:20:23 2017 (r319548)
+++ projects/clang500-import/lib/libc/sys/Makefile.inc Sat Jun 3 18:21:50 2017 (r319549)
@@ -350,7 +350,6 @@ MLINKS+=brk.2 sbrk.2
MLINKS+=cap_enter.2 cap_getmode.2
MLINKS+=cap_fcntls_limit.2 cap_fcntls_get.2
MLINKS+=cap_ioctls_limit.2 cap_ioctls_get.2
-MLINKS+=cap_rights_limit.2 cap_rights_get.2
MLINKS+=chdir.2 fchdir.2
MLINKS+=chflags.2 chflagsat.2 \
chflags.2 fchflags.2 \
Modified: projects/clang500-import/lib/libsysdecode/Makefile
==============================================================================
--- projects/clang500-import/lib/libsysdecode/Makefile Sat Jun 3 18:20:23 2017 (r319548)
+++ projects/clang500-import/lib/libsysdecode/Makefile Sat Jun 3 18:21:50 2017 (r319549)
@@ -32,6 +32,7 @@ MLINKS+=sysdecode_enum.3 sysdecode_acltype.3 \
sysdecode_enum.3 sysdecode_fadvice.3 \
sysdecode_enum.3 sysdecode_fcntl_cmd.3 \
sysdecode_enum.3 sysdecode_getfsstat_mode.3 \
+ sysdecode_enum.3 sysdecode_getrusage_who.3 \
sysdecode_enum.3 sysdecode_idtype.3 \
sysdecode_enum.3 sysdecode_ipproto.3 \
sysdecode_enum.3 sysdecode_kldsym_cmd.3 \
Modified: projects/clang500-import/lib/libsysdecode/flags.c
==============================================================================
--- projects/clang500-import/lib/libsysdecode/flags.c Sat Jun 3 18:20:23 2017 (r319548)
+++ projects/clang500-import/lib/libsysdecode/flags.c Sat Jun 3 18:21:50 2017 (r319549)
@@ -487,6 +487,13 @@ sysdecode_getfsstat_mode(int mode)
}
const char *
+sysdecode_getrusage_who(int who)
+{
+
+ return (lookup_value(rusage, who));
+}
+
+const char *
sysdecode_kldsym_cmd(int cmd)
{
Modified: projects/clang500-import/lib/libsysdecode/mktables
==============================================================================
--- projects/clang500-import/lib/libsysdecode/mktables Sat Jun 3 18:20:23 2017 (r319548)
+++ projects/clang500-import/lib/libsysdecode/mktables Sat Jun 3 18:21:50 2017 (r319549)
@@ -114,6 +114,7 @@ gen_table "quotactlcmds" "Q_[A-Z]+[[:space:]]+0x[0-
gen_table "rebootopt" "RB_[A-Z]+[[:space:]]+0x[0-9]+" "sys/reboot.h"
gen_table "rforkflags" "RF[A-Z]+[[:space:]]+\([0-9]+<<[0-9]+\)" "sys/unistd.h"
gen_table "rlimit" "RLIMIT_[A-Z]+[[:space:]]+[0-9]+" "sys/resource.h"
+gen_table "rusage" "RUSAGE_[A-Z]+[[:space:]]+[-0-9]+" "sys/resource.h"
gen_table "schedpolicy" "SCHED_[A-Z]+[[:space:]]+[0-9]+" "sched.h"
gen_table "sendfileflags" "SF_[A-Z]+[[:space:]]+[0-9]+" "sys/socket.h"
gen_table "shmatflags" "SHM_[A-Z]+[[:space:]]+[0-9]{6}+" "sys/shm.h"
Modified: projects/clang500-import/lib/libsysdecode/sysdecode.3
==============================================================================
--- projects/clang500-import/lib/libsysdecode/sysdecode.3 Sat Jun 3 18:20:23 2017 (r319548)
+++ projects/clang500-import/lib/libsysdecode/sysdecode.3 Sat Jun 3 18:21:50 2017 (r319549)
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd October 17, 2016
+.Dd June 3, 2017
.Dt SYSDECODE 3
.Os
.Sh NAME
@@ -76,6 +76,7 @@ A placeholder for use when the ABI is not known.
.Xr sysdecode_mask 3 ,
.Xr sysdecode_quotactl_cmd 3 ,
.Xr sysdecode_sigcode 3 ,
+.Xr sysdecode_socket_protocol 3 ,
.Xr sysdecode_sockopt_name 3 ,
.Xr sysdecode_syscallnames 3 ,
.Xr sysdecode_utrace 3
Modified: projects/clang500-import/lib/libsysdecode/sysdecode.h
==============================================================================
--- projects/clang500-import/lib/libsysdecode/sysdecode.h Sat Jun 3 18:20:23 2017 (r319548)
+++ projects/clang500-import/lib/libsysdecode/sysdecode.h Sat Jun 3 18:21:50 2017 (r319549)
@@ -55,6 +55,7 @@ bool sysdecode_filemode(FILE *_fp, int _mode, int *_re
bool sysdecode_flock_operation(FILE *_fp, int _operation, int *_rem);
int sysdecode_freebsd_to_abi_errno(enum sysdecode_abi _abi, int _error);
const char *sysdecode_getfsstat_mode(int _mode);
+const char *sysdecode_getrusage_who(int _who);
const char *sysdecode_idtype(int _idtype);
const char *sysdecode_ioctlname(unsigned long _val);
const char *sysdecode_ipproto(int _protocol);
Modified: projects/clang500-import/lib/libsysdecode/sysdecode_enum.3
==============================================================================
--- projects/clang500-import/lib/libsysdecode/sysdecode_enum.3 Sat Jun 3 18:20:23 2017 (r319548)
+++ projects/clang500-import/lib/libsysdecode/sysdecode_enum.3 Sat Jun 3 18:21:50 2017 (r319549)
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd January 2, 2017
+.Dd June 3, 2017
.Dt sysdecode_enum 3
.Os
.Sh NAME
@@ -36,6 +36,7 @@
.Nm sysdecode_fadvice ,
.Nm sysdecode_fcntl_cmd ,
.Nm sysdecode_getfsstat_mode ,
+.Nm sysdecode_getrusage_who ,
.Nm sysdecode_idtype ,
.Nm sysdecode_ipproto ,
.Nm sysdecode_kldsym_cmd ,
@@ -89,6 +90,8 @@
.Ft const char *
.Fn sysdecode_getfsstat_mode "int mode"
.Ft const char *
+.Fn sysdecode_getrusage_who "int who"
+.Ft const char *
.Fn sysdecode_idtype "int idtype"
.Ft const char *
.Fn sysdecode_ipproto "int protocol"
@@ -188,6 +191,7 @@ Most of these functions decode an argument passed to a
.It Fn sysdecode_ptrace_request Ta Xr ptrace 2 Ta Fa request
.It Fn sysdecode_rlimit Ta Xr getrlimit 2 Ta Fa resource
.It Fn sysdecode_rtprio_function Ta Xr rtprio 2 Ta Fa function
+.It Fn sysdecode_getrusage_who Ta Xr getrusage 2 Ta Fa who
.It Fn sysdecode_scheduler_policy Ta Xr sched_setscheduler 2 Ta Fa policy
.It Fn sysdecode_semctl_cmd Ta Xr semctl 2 Ta Fa cmd
.It Fn sysdecode_shmctl_cmd Ta Xr shmctl 2 Ta Fa cmd
Modified: projects/clang500-import/share/man/man7/ascii.7
==============================================================================
--- projects/clang500-import/share/man/man7/ascii.7 Sat Jun 3 18:20:23 2017 (r319548)
+++ projects/clang500-import/share/man/man7/ascii.7 Sat Jun 3 18:21:50 2017 (r319549)
@@ -64,9 +64,9 @@ The
set:
.Bd -literal -offset left
00 NUL 01 SOH 02 STX 03 ETX 04 EOT 05 ENQ 06 ACK 07 BEL
-08 BS 09 HT 0A LF 0B VT 0C FF 0D CR 0E SO 0F SI
+08 BS 09 HT 0a LF 0b VT 0c FF 0d CR 0e SO 0f SI
10 DLE 11 DC1 12 DC2 13 DC3 14 DC4 15 NAK 16 SYN 17 ETB
-18 CAN 19 EM 1A SUB 1B ESC 1C FS 1D GS 1E RS 1F US
+18 CAN 19 EM 1a SUB 1b ESC 1c FS 1d GS 1e RS 1f US
20 SP 21 ! 22 " 23 # 24 $ 25 % 26 & 27 '
28 ( 29 ) 2a * 2b + 2c , 2d - 2e . 2f /
30 0 31 1 32 2 33 3 34 4 35 5 36 6 37 7
Modified: projects/clang500-import/share/mk/local.meta.sys.mk
==============================================================================
--- projects/clang500-import/share/mk/local.meta.sys.mk Sat Jun 3 18:20:23 2017 (r319548)
+++ projects/clang500-import/share/mk/local.meta.sys.mk Sat Jun 3 18:21:50 2017 (r319549)
@@ -283,6 +283,3 @@ META_MODE+= missing-meta=yes
.if empty(META_MODE:Mnofilemon)
META_MODE+= missing-filemon=yes
.endif
-# We do not want everything out-of-date just because
-# some unrelated shared lib updated this.
-.MAKE.META.IGNORE_PATHS+= /usr/local/etc/libmap.d
Modified: projects/clang500-import/share/mk/sys.mk
==============================================================================
--- projects/clang500-import/share/mk/sys.mk Sat Jun 3 18:20:23 2017 (r319548)
+++ projects/clang500-import/share/mk/sys.mk Sat Jun 3 18:21:50 2017 (r319549)
@@ -91,7 +91,11 @@ META_MODE?= normal
/usr/share \
.endif
-
+.if !empty(.MAKE.MODE:Mmeta)
+# We do not want everything out-of-date just because
+# some unrelated shared lib updated this.
+.MAKE.META.IGNORE_PATHS+= /usr/local/etc/libmap.d
+.endif
.if ${MK_AUTO_OBJ} == "yes"
# This needs to be done early - before .PATH is computed
Modified: projects/clang500-import/sys/amd64/amd64/pmap.c
==============================================================================
--- projects/clang500-import/sys/amd64/amd64/pmap.c Sat Jun 3 18:20:23 2017 (r319548)
+++ projects/clang500-import/sys/amd64/amd64/pmap.c Sat Jun 3 18:21:50 2017 (r319549)
@@ -4313,6 +4313,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v
pv_entry_t pv;
vm_paddr_t opa, pa;
vm_page_t mpte, om;
+ int rv;
boolean_t nosleep;
PG_A = pmap_accessed_bit(pmap);
@@ -4387,10 +4388,8 @@ retry:
mpte = _pmap_allocpte(pmap, pmap_pde_pindex(va),
nosleep ? NULL : &lock);
if (mpte == NULL && nosleep) {
- if (lock != NULL)
- rw_wunlock(lock);
- PMAP_UNLOCK(pmap);
- return (KERN_RESOURCE_SHORTAGE);
+ rv = KERN_RESOURCE_SHORTAGE;
+ goto out;
}
goto retry;
} else
@@ -4516,10 +4515,12 @@ unchanged:
vm_reserv_level_iffullpop(m) == 0)
pmap_promote_pde(pmap, pde, va, &lock);
+ rv = KERN_SUCCESS;
+out:
if (lock != NULL)
rw_wunlock(lock);
PMAP_UNLOCK(pmap);
- return (KERN_SUCCESS);
+ return (rv);
}
/*
Modified: projects/clang500-import/sys/arm/annapurna/alpine/files.alpine
==============================================================================
--- projects/clang500-import/sys/arm/annapurna/alpine/files.alpine Sat Jun 3 18:20:23 2017 (r319548)
+++ projects/clang500-import/sys/arm/annapurna/alpine/files.alpine Sat Jun 3 18:21:50 2017 (r319549)
@@ -3,7 +3,6 @@
kern/kern_clocksource.c standard
arm/versatile/sp804.c standard
-arm/versatile/versatile_timer.c standard
dev/uart/uart_dev_ns8250.c optional uart
arm/annapurna/alpine/common.c standard
Modified: projects/clang500-import/sys/arm/arm/machdep.c
==============================================================================
--- projects/clang500-import/sys/arm/arm/machdep.c Sat Jun 3 18:20:23 2017 (r319548)
+++ projects/clang500-import/sys/arm/arm/machdep.c Sat Jun 3 18:21:50 2017 (r319549)
@@ -103,6 +103,10 @@ __FBSDID("$FreeBSD$");
#error FreeBSD/arm doesn't provide compatibility with releases prior to 10
#endif
+#if __ARM_ARCH >= 6 && !defined(INTRNG)
+#error armv6 requires INTRNG
+#endif
+
struct pcpu __pcpu[MAXCPU];
struct pcpu *pcpup = &__pcpu[0];
@@ -297,6 +301,7 @@ cpu_idle_wakeup(int cpu)
return (0);
}
+#ifdef NO_EVENTTIMERS
/*
* Most ARM platforms don't need to do anything special to init their clocks
* (they get intialized during normal device attachment), and by not defining a
@@ -307,8 +312,14 @@ cpu_idle_wakeup(int cpu)
void
arm_generic_initclocks(void)
{
+}
+__weak_reference(arm_generic_initclocks, cpu_initclocks);
-#ifndef NO_EVENTTIMERS
+#else
+void
+cpu_initclocks(void)
+{
+
#ifdef SMP
if (PCPU_GET(cpuid) == 0)
cpu_initclocks_bsp();
@@ -317,9 +328,8 @@ arm_generic_initclocks(void)
#else
cpu_initclocks_bsp();
#endif
-#endif
}
-__weak_reference(arm_generic_initclocks, cpu_initclocks);
+#endif
#ifdef MULTIDELAY
void
Modified: projects/clang500-import/sys/arm/arm/mpcore_timer.c
==============================================================================
--- projects/clang500-import/sys/arm/arm/mpcore_timer.c Sat Jun 3 18:20:23 2017 (r319548)
+++ projects/clang500-import/sys/arm/arm/mpcore_timer.c Sat Jun 3 18:21:50 2017 (r319549)
@@ -59,6 +59,10 @@ __FBSDID("$FreeBSD$");
#include <machine/cpu.h>
#include <machine/intr.h>
+#ifdef MULTIDELAY
+#include <machine/machdep.h> /* For arm_set_delay */
+#endif
+
#include <dev/ofw/openfirm.h>
#include <dev/ofw/ofw_bus.h>
#include <dev/ofw/ofw_bus_subr.h>
@@ -115,6 +119,8 @@ static boolean_t arm_tmr_freq_varies;
#define tmr_gbl_read_4(sc, reg) bus_read_4((sc)->gbl_mem, reg)
#define tmr_gbl_write_4(sc, reg, val) bus_write_4((sc)->gbl_mem, reg, val)
+static void arm_tmr_delay(int, void *);
+
static timecounter_get_t arm_tmr_get_timecount;
static struct timecounter arm_tmr_timecount = {
@@ -431,6 +437,11 @@ arm_tmr_attach(device_t dev)
if (tc_err != 0 && et_err != 0) {
return (ENXIO);
}
+
+#ifdef MULTIDELAY
+ arm_set_delay(arm_tmr_delay, sc);
+#endif
+
return (0);
}
@@ -482,37 +493,14 @@ arm_tmr_change_frequency(uint64_t newfreq)
et_change_frequency(arm_tmr_et, newfreq);
}
-/**
- * DELAY - Delay for at least usec microseconds.
- * @usec: number of microseconds to delay by
- *
- * This function is called all over the kernel and is suppose to provide a
- * consistent delay. This function may also be called before the console
- * is setup so no printf's can be called here.
- *
- * RETURNS:
- * nothing
- */
-static void __used /* Must emit function code for the weak ref below. */
-arm_tmr_DELAY(int usec)
+static void
+arm_tmr_delay(int usec, void *arg)
{
- struct arm_tmr_softc *sc;
+ struct arm_tmr_softc *sc = arg;
int32_t counts_per_usec;
int32_t counts;
uint32_t first, last;
- /* Check the timers are setup, if not just use a for loop for the meantime */
- if (arm_tmr_tc == NULL || arm_tmr_timecount.tc_frequency == 0) {
- for (; usec > 0; usec--)
- for (counts = 200; counts > 0; counts--)
- cpufunc_nullop(); /* Prevent gcc from optimizing
- * out the loop
- */
- return;
- }
-
- sc = arm_tmr_tc->tc_priv;
-
/* Get the number of times to count */
counts_per_usec = ((arm_tmr_timecount.tc_frequency / 1000000) + 1);
@@ -536,10 +524,34 @@ arm_tmr_DELAY(int usec)
}
}
-/*
- * Supply a DELAY() implementation via weak linkage. A platform may want to use
- * the mpcore per-cpu eventtimers but provide its own DELAY() routine,
- * especially when the core frequency can change on the fly.
+#ifndef MULTIDELAY
+/**
+ * DELAY - Delay for at least usec microseconds.
+ * @usec: number of microseconds to delay by
+ *
+ * This function is called all over the kernel and is suppose to provide a
+ * consistent delay. This function may also be called before the console
+ * is setup so no printf's can be called here.
+ *
+ * RETURNS:
+ * nothing
*/
-__weak_reference(arm_tmr_DELAY, DELAY);
+void
+DELAY(int usec)
+{
+ struct arm_tmr_softc *sc;
+ int32_t counts;
+ /* Check the timers are setup, if not just use a for loop for the meantime */
+ if (arm_tmr_tc == NULL || arm_tmr_timecount.tc_frequency == 0) {
+ for (; usec > 0; usec--)
+ for (counts = 200; counts > 0; counts--)
+ cpufunc_nullop(); /* Prevent gcc from optimizing
+ * out the loop
+ */
+ } else {
+ sc = arm_tmr_tc->tc_priv;
+ arm_tmr_delay(usec, sc);
+ }
+}
+#endif
Modified: projects/clang500-import/sys/arm/conf/AML8726
==============================================================================
--- projects/clang500-import/sys/arm/conf/AML8726 Sat Jun 3 18:20:23 2017 (r319548)
+++ projects/clang500-import/sys/arm/conf/AML8726 Sat Jun 3 18:21:50 2017 (r319549)
@@ -18,6 +18,9 @@
#
# $FreeBSD$
+# TODO: Port to INTRNG
+#NO_UNIVERSE
+
ident AML8726
include "std.armv6"
Modified: projects/clang500-import/sys/arm/conf/ARMADAXP
==============================================================================
--- projects/clang500-import/sys/arm/conf/ARMADAXP Sat Jun 3 18:20:23 2017 (r319548)
+++ projects/clang500-import/sys/arm/conf/ARMADAXP Sat Jun 3 18:21:50 2017 (r319549)
@@ -18,6 +18,9 @@
#
# $FreeBSD$
+# TODO: Port to INTRNG
+#NO_UNIVERSE
+
ident MV-88F78XX0
include "std.armv6"
Modified: projects/clang500-import/sys/arm/conf/BEAGLEBONE
==============================================================================
--- projects/clang500-import/sys/arm/conf/BEAGLEBONE Sat Jun 3 18:20:23 2017 (r319548)
+++ projects/clang500-import/sys/arm/conf/BEAGLEBONE Sat Jun 3 18:21:50 2017 (r319549)
@@ -29,6 +29,7 @@ include "../ti/am335x/std.am335x"
makeoptions MODULES_EXTRA="dtb/am335x am335x_dmtpps"
options INTRNG
+options MULTIDELAY
options SCHED_4BSD # 4BSD scheduler
options PLATFORM
Modified: projects/clang500-import/sys/arm/conf/EFIKA_MX
==============================================================================
--- projects/clang500-import/sys/arm/conf/EFIKA_MX Sat Jun 3 18:20:23 2017 (r319548)
+++ projects/clang500-import/sys/arm/conf/EFIKA_MX Sat Jun 3 18:21:50 2017 (r319549)
@@ -31,6 +31,7 @@ options SCHED_4BSD # 4BSD scheduler
#options MD_ROOT # MD is a potential root device
#options NFSD # Network Filesystem Server
options PLATFORM
+options MULTIDELAY
options INCLUDE_CONFIG_FILE # Include this file in kernel
# NFS root from boopt/dhcp
Modified: projects/clang500-import/sys/arm/conf/IMX53
==============================================================================
--- projects/clang500-import/sys/arm/conf/IMX53 Sat Jun 3 18:20:23 2017 (r319548)
+++ projects/clang500-import/sys/arm/conf/IMX53 Sat Jun 3 18:21:50 2017 (r319549)
@@ -28,6 +28,7 @@ options SOC_IMX53
options SCHED_4BSD # 4BSD scheduler
#options NFSD # Network Filesystem Server
options PLATFORM
+options MULTIDELAY
options INCLUDE_CONFIG_FILE # Include this file in kernel
# kernel/memory size reduction
Modified: projects/clang500-import/sys/arm/conf/RT1310
==============================================================================
--- projects/clang500-import/sys/arm/conf/RT1310 Sat Jun 3 18:20:23 2017 (r319548)
+++ projects/clang500-import/sys/arm/conf/RT1310 Sat Jun 3 18:21:50 2017 (r319549)
@@ -3,6 +3,8 @@
#
# $FreeBSD$
#
+# TODO: This fails to build under universe, irnore it until it's fixed
+#NO_UNIVERSE
ident RT1310
include "std.arm"
Modified: projects/clang500-import/sys/arm/freescale/imx/imx51_machdep.c
==============================================================================
--- projects/clang500-import/sys/arm/freescale/imx/imx51_machdep.c Sat Jun 3 18:20:23 2017 (r319548)
+++ projects/clang500-import/sys/arm/freescale/imx/imx51_machdep.c Sat Jun 3 18:21:50 2017 (r319549)
@@ -99,4 +99,4 @@ static platform_method_t imx51_methods[] = {
PLATFORMMETHOD_END,
};
-FDT_PLATFORM_DEF(imx51, "i.MX51", 0, "fsl,imx51", 0);
+FDT_PLATFORM_DEF(imx51, "i.MX51", 0, "fsl,imx51", 100);
Modified: projects/clang500-import/sys/arm/freescale/imx/imx53_machdep.c
==============================================================================
--- projects/clang500-import/sys/arm/freescale/imx/imx53_machdep.c Sat Jun 3 18:20:23 2017 (r319548)
+++ projects/clang500-import/sys/arm/freescale/imx/imx53_machdep.c Sat Jun 3 18:21:50 2017 (r319549)
@@ -95,5 +95,4 @@ static platform_method_t imx53_methods[] = {
PLATFORMMETHOD_END,
};
-FDT_PLATFORM_DEF(imx53, "i.MX53", 0, "fsl,imx53", 0);
-
+FDT_PLATFORM_DEF(imx53, "i.MX53", 0, "fsl,imx53", 100);
Modified: projects/clang500-import/sys/arm/versatile/files.versatile
==============================================================================
--- projects/clang500-import/sys/arm/versatile/files.versatile Sat Jun 3 18:20:23 2017 (r319548)
+++ projects/clang500-import/sys/arm/versatile/files.versatile Sat Jun 3 18:21:50 2017 (r319549)
@@ -8,6 +8,5 @@ arm/versatile/versatile_common.c standard
arm/versatile/versatile_pci.c optional pci
arm/versatile/versatile_scm.c standard
arm/versatile/versatile_sic.c standard
-arm/versatile/versatile_timer.c standard
kern/kern_clocksource.c standard
Modified: projects/clang500-import/sys/arm/versatile/sp804.c
==============================================================================
--- projects/clang500-import/sys/arm/versatile/sp804.c Sat Jun 3 18:20:23 2017 (r319548)
+++ projects/clang500-import/sys/arm/versatile/sp804.c Sat Jun 3 18:21:50 2017 (r319549)
@@ -42,6 +42,10 @@ __FBSDID("$FreeBSD$");
#include <machine/cpu.h>
#include <machine/intr.h>
+#ifdef MULTIDELAY
+#include <machine/machdep.h> /* For arm_set_delay */
+#endif
+
#include <dev/ofw/openfirm.h>
#include <dev/ofw/ofw_bus.h>
#include <dev/ofw/ofw_bus_subr.h>
@@ -109,6 +113,7 @@ struct sp804_timer_softc {
bus_space_write_4(sc->bst, sc->bsh, reg, val)
static unsigned sp804_timer_tc_get_timecount(struct timecounter *);
+static void sp804_timer_delay(int, void *);
static unsigned
sp804_timer_tc_get_timecount(struct timecounter *tc)
@@ -287,6 +292,10 @@ sp804_timer_attach(device_t dev)
(sp804_timer_tc_read_4(SP804_PRIMECELL_ID0 + i*4) & 0xff);
}
+#ifdef MULTIDELAY
+ arm_set_delay(sp804_timer_delay, sc);
+#endif
+
device_printf(dev, "PrimeCell ID: %08x\n", id);
sc->timer_initialized = 1;
@@ -310,11 +319,36 @@ static devclass_t sp804_timer_devclass;
DRIVER_MODULE(sp804_timer, simplebus, sp804_timer_driver, sp804_timer_devclass, 0, 0);
+static void
+sp804_timer_delay(int usec, void *arg)
+{
+ struct sp804_timer_softc *sc = arg;
+ int32_t counts;
+ uint32_t first, last;
+
+ /* Get the number of times to count */
+ counts = usec * ((sc->tc.tc_frequency / 1000000) + 1);
+
+ first = sp804_timer_tc_get_timecount(&sc->tc);
+
+ while (counts > 0) {
+ last = sp804_timer_tc_get_timecount(&sc->tc);
+ if (last == first)
+ continue;
+ if (last > first) {
+ counts -= (int32_t)(last - first);
+ } else {
+ counts -= (int32_t)((0xFFFFFFFF - first) + last);
+ }
+ first = last;
+ }
+}
+
+#ifndef MULTIDELAY
void
DELAY(int usec)
{
int32_t counts;
- uint32_t first, last;
device_t timer_dev;
struct sp804_timer_softc *sc;
int timer_initialized = 0;
@@ -336,23 +370,8 @@ DELAY(int usec)
for (counts = 200; counts > 0; counts--)
/* Prevent gcc from optimizing out the loop */
cpufunc_nullop();
- return;
+ } else {
+ sp804_timer_delay(usec, sc);
}
-
- /* Get the number of times to count */
- counts = usec * ((sc->tc.tc_frequency / 1000000) + 1);
-
- first = sp804_timer_tc_get_timecount(&sc->tc);
-
- while (counts > 0) {
- last = sp804_timer_tc_get_timecount(&sc->tc);
- if (last == first)
- continue;
- if (last>first) {
- counts -= (int32_t)(last - first);
- } else {
- counts -= (int32_t)((0xFFFFFFFF - first) + last);
- }
- first = last;
- }
}
+#endif
Modified: projects/clang500-import/sys/arm64/arm64/pmap.c
==============================================================================
--- projects/clang500-import/sys/arm64/arm64/pmap.c Sat Jun 3 18:20:23 2017 (r319548)
+++ projects/clang500-import/sys/arm64/arm64/pmap.c Sat Jun 3 18:21:50 2017 (r319549)
@@ -495,14 +495,6 @@ pmap_get_tables(pmap_t pmap, vm_offset_t va, pd_entry_
}
static __inline int
-pmap_is_current(pmap_t pmap)
-{
-
- return ((pmap == pmap_kernel()) ||
- (pmap == curthread->td_proc->p_vmspace->vm_map.pmap));
-}
-
-static __inline int
pmap_l3_valid(pt_entry_t l3)
{
@@ -510,24 +502,8 @@ pmap_l3_valid(pt_entry_t l3)
}
-/* Is a level 1 or 2entry a valid block and cacheable */
CTASSERT(L1_BLOCK == L2_BLOCK);
-static __inline int
-pmap_pte_valid_cacheable(pt_entry_t pte)
-{
- return (((pte & ATTR_DESCR_MASK) == L1_BLOCK) &&
- ((pte & ATTR_IDX_MASK) == ATTR_IDX(CACHED_MEMORY)));
-}
-
-static __inline int
-pmap_l3_valid_cacheable(pt_entry_t l3)
-{
-
- return (((l3 & ATTR_DESCR_MASK) == L3_PAGE) &&
- ((l3 & ATTR_IDX_MASK) == ATTR_IDX(CACHED_MEMORY)));
-}
-
#define PTE_SYNC(pte) cpu_dcache_wb_range((vm_offset_t)pte, sizeof(*pte))
/*
@@ -1180,8 +1156,6 @@ pmap_kremove(vm_offset_t va)
KASSERT(pte != NULL, ("pmap_kremove: Invalid address"));
KASSERT(lvl == 3, ("pmap_kremove: Invalid pte level %d", lvl));
- if (pmap_l3_valid_cacheable(pmap_load(pte)))
- cpu_dcache_wb_range(va, L3_SIZE);
pmap_load_clear(pte);
PTE_SYNC(pte);
pmap_invalidate_page(kernel_pmap, va);
@@ -1292,8 +1266,6 @@ pmap_qremove(vm_offset_t sva, int count)
KASSERT(lvl == 3,
("Invalid device pagetable level: %d != 3", lvl));
if (pte != NULL) {
- if (pmap_l3_valid_cacheable(pmap_load(pte)))
- cpu_dcache_wb_range(va, L3_SIZE);
pmap_load_clear(pte);
PTE_SYNC(pte);
}
@@ -2295,8 +2267,6 @@ pmap_remove_l3(pmap_t pmap, pt_entry_t *l3, vm_offset_
vm_page_t m;
PMAP_LOCK_ASSERT(pmap, MA_OWNED);
- if (pmap_is_current(pmap) && pmap_l3_valid_cacheable(pmap_load(l3)))
- cpu_dcache_wb_range(va, L3_SIZE);
old_l3 = pmap_load_clear(l3);
PTE_SYNC(l3);
pmap_invalidate_page(pmap, va);
@@ -2518,9 +2488,6 @@ retry:
pte = pmap_l2_to_l3(pde, pv->pv_va);
tpte = pmap_load(pte);
- if (pmap_is_current(pmap) &&
- pmap_l3_valid_cacheable(tpte))
- cpu_dcache_wb_range(pv->pv_va, L3_SIZE);
pmap_load_clear(pte);
PTE_SYNC(pte);
pmap_invalidate_page(pmap, pv->pv_va);
@@ -3004,10 +2971,6 @@ havel3:
}
goto validate;
}
-
- /* Flush the cache, there might be uncommitted data in it */
- if (pmap_is_current(pmap) && pmap_l3_valid_cacheable(orig_l3))
- cpu_dcache_wb_range(va, L3_SIZE);
} else {
/*
* Increment the counters.
@@ -3673,20 +3636,8 @@ pmap_remove_pages(pmap_t pmap)
("pmap_remove_pages: bad pte %#jx",
(uintmax_t)tpte));
- if (pmap_is_current(pmap)) {
- if (lvl == 2 &&
- pmap_l3_valid_cacheable(tpte)) {
- cpu_dcache_wb_range(pv->pv_va,
- L3_SIZE);
- } else if (lvl == 1 &&
- pmap_pte_valid_cacheable(tpte)) {
- cpu_dcache_wb_range(pv->pv_va,
- L2_SIZE);
- }
- }
pmap_load_clear(pte);
PTE_SYNC(pte);
- pmap_invalidate_page(pmap, pv->pv_va);
/*
* Update the vm_page_t clean/reference bits.
Modified: projects/clang500-import/sys/compat/linuxkpi/common/src/linux_compat.c
==============================================================================
--- projects/clang500-import/sys/compat/linuxkpi/common/src/linux_compat.c Sat Jun 3 18:20:23 2017 (r319548)
+++ projects/clang500-import/sys/compat/linuxkpi/common/src/linux_compat.c Sat Jun 3 18:21:50 2017 (r319549)
@@ -438,7 +438,7 @@ linux_kq_lock_unowned(void *arg)
}
static void
-linux_dev_kqfilter_poll(struct linux_file *);
+linux_dev_kqfilter_poll(struct linux_file *, int);
struct linux_file *
linux_file_alloc(void)
@@ -826,6 +826,10 @@ linux_dev_ioctl(struct cdev *dev, u_long cmd, caddr_t
return (error);
filp->f_flags = file->f_flag;
+ /* the LinuxKPI supports blocking and non-blocking I/O */
+ if (cmd == FIONBIO || cmd == FIOASYNC)
+ return (0);
+
linux_set_current(td);
size = IOCPARM_LEN(cmd);
/* refer to logic in sys_ioctl() */
@@ -852,9 +856,11 @@ linux_dev_ioctl(struct cdev *dev, u_long cmd, caddr_t
current->bsd_ioctl_len = 0;
}
- if (error == EWOULDBLOCK)
- linux_dev_kqfilter_poll(filp);
- else if (error == ERESTARTSYS)
+ if (error == EWOULDBLOCK) {
+ /* update kqfilter status, if any */
+ linux_dev_kqfilter_poll(filp,
+ LINUX_KQ_FLAG_HAS_READ | LINUX_KQ_FLAG_HAS_WRITE);
+ } else if (error == ERESTARTSYS)
error = ERESTART;
return (error);
}
@@ -889,14 +895,15 @@ linux_dev_read(struct cdev *dev, struct uio *uio, int
uio->uio_resid -= bytes;
} else {
error = -bytes;
- if (error == EWOULDBLOCK)
- linux_dev_kqfilter_poll(filp);
- else if (error == ERESTARTSYS)
+ if (error == ERESTARTSYS)
error = ERESTART;
}
} else
error = ENXIO;
+ /* update kqfilter status, if any */
+ linux_dev_kqfilter_poll(filp, LINUX_KQ_FLAG_HAS_READ);
+
return (error);
}
@@ -930,14 +937,15 @@ linux_dev_write(struct cdev *dev, struct uio *uio, int
uio->uio_resid -= bytes;
} else {
error = -bytes;
- if (error == EWOULDBLOCK)
- linux_dev_kqfilter_poll(filp);
- else if (error == ERESTARTSYS)
+ if (error == ERESTARTSYS)
error = ERESTART;
}
} else
error = ENXIO;
+ /* update kqfilter status, if any */
+ linux_dev_kqfilter_poll(filp, LINUX_KQ_FLAG_HAS_WRITE);
+
return (error);
}
@@ -1028,21 +1036,20 @@ static struct filterops linux_dev_kqfiltops_write = {
};
static void
-linux_dev_kqfilter_poll(struct linux_file *filp)
+linux_dev_kqfilter_poll(struct linux_file *filp, int kqflags)
{
int temp;
- spin_lock(&filp->f_kqlock);
- temp = (filp->f_kqflags & (LINUX_KQ_FLAG_HAS_READ | LINUX_KQ_FLAG_HAS_WRITE));
- filp->f_kqflags &= ~(LINUX_KQ_FLAG_NEED_READ | LINUX_KQ_FLAG_NEED_WRITE);
- spin_unlock(&filp->f_kqlock);
-
- if (temp != 0) {
+ if (filp->f_kqflags & kqflags) {
/* get the latest polling state */
temp = filp->f_op->poll(filp, NULL);
+ spin_lock(&filp->f_kqlock);
+ /* clear kqflags */
+ filp->f_kqflags &= ~(LINUX_KQ_FLAG_NEED_READ |
+ LINUX_KQ_FLAG_NEED_WRITE);
+ /* update kqflags */
if (temp & (POLLIN | POLLOUT)) {
- spin_lock(&filp->f_kqlock);
if (temp & POLLIN)
filp->f_kqflags |= LINUX_KQ_FLAG_NEED_READ;
if (temp & POLLOUT)
@@ -1050,8 +1057,8 @@ linux_dev_kqfilter_poll(struct linux_file *filp)
/* make sure the "knote" gets woken up */
KNOTE_LOCKED(&filp->f_selinfo.si_note, 0);
- spin_unlock(&filp->f_kqlock);
}
+ spin_unlock(&filp->f_kqlock);
}
}
@@ -1095,7 +1102,10 @@ linux_dev_kqfilter(struct cdev *dev, struct knote *kn)
if (error == 0) {
linux_set_current(td);
- linux_dev_kqfilter_poll(filp);
+
+ /* update kqfilter status, if any */
+ linux_dev_kqfilter_poll(filp,
+ LINUX_KQ_FLAG_HAS_READ | LINUX_KQ_FLAG_HAS_WRITE);
}
return (error);
}
Modified: projects/clang500-import/sys/conf/files.amd64
==============================================================================
--- projects/clang500-import/sys/conf/files.amd64 Sat Jun 3 18:20:23 2017 (r319548)
+++ projects/clang500-import/sys/conf/files.amd64 Sat Jun 3 18:21:50 2017 (r319549)
@@ -46,7 +46,7 @@ linux32_assym.h optional compat_linux32 \
#
linux32_locore.o optional compat_linux32 \
dependency "linux32_assym.h $S/amd64/linux32/linux32_locore.s" \
- compile-with "${CC} -x assembler-with-cpp -DLOCORE -m32 -shared -s -pipe -I. -I$S -Werror -Wall -fno-common -nostdinc -nostdlib -Wl,-T$S/amd64/linux32/linux32_vdso.lds.s -Wl,-soname=linux32_vdso.so,--eh-frame-hdr,-fPIC,-warn-common ${.IMPSRC} -o ${.TARGET}" \
+ compile-with "${CC} -x assembler-with-cpp -DLOCORE -m32 -shared -s -pipe -I. -I$S -Werror -Wall -fPIC -fno-common -nostdinc -nostdlib -Wl,-T$S/amd64/linux32/linux32_vdso.lds.s -Wl,-soname=linux32_vdso.so,--eh-frame-hdr,-warn-common ${.IMPSRC} -o ${.TARGET}" \
no-obj no-implicit-rule \
clean "linux32_locore.o"
#
Modified: projects/clang500-import/sys/conf/files.i386
==============================================================================
--- projects/clang500-import/sys/conf/files.i386 Sat Jun 3 18:20:23 2017 (r319548)
+++ projects/clang500-import/sys/conf/files.i386 Sat Jun 3 18:21:50 2017 (r319549)
@@ -33,7 +33,7 @@ linux_assym.h optional compat_linux \
#
linux_locore.o optional compat_linux \
dependency "linux_assym.h $S/i386/linux/linux_locore.s" \
- compile-with "${CC} -x assembler-with-cpp -DLOCORE -shared -s -pipe -I. -I$S -Werror -Wall -fno-common -nostdinc -nostdlib -Wl,-T$S/i386/linux/linux_vdso.lds.s -Wl,-soname=linux_vdso.so,--eh-frame-hdr,-fPIC,-warn-common ${.IMPSRC} -o ${.TARGET}" \
+ compile-with "${CC} -x assembler-with-cpp -DLOCORE -shared -s -pipe -I. -I$S -Werror -Wall -fPIC -fno-common -nostdinc -nostdlib -Wl,-T$S/i386/linux/linux_vdso.lds.s -Wl,-soname=linux_vdso.so,--eh-frame-hdr,-warn-common ${.IMPSRC} -o ${.TARGET}" \
no-obj no-implicit-rule \
clean "linux_locore.o"
#
Modified: projects/clang500-import/sys/dev/cxgbe/t4_sge.c
==============================================================================
--- projects/clang500-import/sys/dev/cxgbe/t4_sge.c Sat Jun 3 18:20:23 2017 (r319548)
+++ projects/clang500-import/sys/dev/cxgbe/t4_sge.c Sat Jun 3 18:21:50 2017 (r319549)
@@ -4581,12 +4581,8 @@ write_txpkts_wr(struct sge_txq *txq, struct fw_eth_tx_
if (checkwrap &&
(uintptr_t)cpl == (uintptr_t)&eq->desc[eq->sidx])
cpl = (void *)&eq->desc[0];
- txq->txpkts0_pkts += txp->npkt;
- txq->txpkts0_wrs++;
} else {
cpl = flitp;
- txq->txpkts1_pkts += txp->npkt;
- txq->txpkts1_wrs++;
}
/* Checksum offload */
@@ -4619,6 +4615,14 @@ write_txpkts_wr(struct sge_txq *txq, struct fw_eth_tx_
write_gl_to_txd(txq, m, (caddr_t *)(&flitp), checkwrap);
+ }
+
+ if (txp->wr_type == 0) {
+ txq->txpkts0_pkts += txp->npkt;
+ txq->txpkts0_wrs++;
+ } else {
+ txq->txpkts1_pkts += txp->npkt;
+ txq->txpkts1_wrs++;
}
txsd = &txq->sdesc[eq->pidx];
Modified: projects/clang500-import/sys/dev/etherswitch/e6000sw/e6000sw.c
==============================================================================
--- projects/clang500-import/sys/dev/etherswitch/e6000sw/e6000sw.c Sat Jun 3 18:20:23 2017 (r319548)
+++ projects/clang500-import/sys/dev/etherswitch/e6000sw/e6000sw.c Sat Jun 3 18:21:50 2017 (r319549)
@@ -28,40 +28,25 @@
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
-#include <sys/types.h>
#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/sockio.h>
+#include <sys/bus.h>
+#include <sys/errno.h>
#include <sys/kernel.h>
#include <sys/kthread.h>
-#include <sys/socket.h>
#include <sys/module.h>
-#include <sys/errno.h>
-#include <sys/bus.h>
-#include <sys/conf.h>
-#include <sys/uio.h>
-#include <sys/fcntl.h>
+#include <sys/socket.h>
+#include <sys/sockio.h>
#include <net/if.h>
#include <net/if_media.h>
#include <net/if_types.h>
-#include <machine/bus.h>
-#include <machine/resource.h>
-
-#include <arm/mv/mvwin.h>
-#include <arm/mv/mvreg.h>
-#include <arm/mv/mvvar.h>
-
#include <dev/etherswitch/etherswitch.h>
-#include <dev/mdio/mdio.h>
#include <dev/mii/mii.h>
#include <dev/mii/miivar.h>
-#include <dev/mge/if_mgevar.h>
#include <dev/fdt/fdt_common.h>
#include <dev/ofw/ofw_bus.h>
-#include <dev/ofw/ofw_bus_subr.h>
#include "e6000swreg.h"
#include "etherswitch_if.h"
@@ -71,14 +56,10 @@ __FBSDID("$FreeBSD$");
MALLOC_DECLARE(M_E6000SW);
MALLOC_DEFINE(M_E6000SW, "e6000sw", "e6000sw switch");
-#define E6000SW_LOCK(_sc) \
- sx_xlock(&(_sc)->sx)
-#define E6000SW_UNLOCK(_sc) \
- sx_unlock(&(_sc)->sx)
-#define E6000SW_LOCK_ASSERT(_sc, _what) \
- sx_assert(&(_sc)->sx, (_what))
-#define E6000SW_TRYLOCK(_sc) \
- sx_tryxlock(&(_sc)->sx)
+#define E6000SW_LOCK(_sc) sx_xlock(&(_sc)->sx)
+#define E6000SW_UNLOCK(_sc) sx_unlock(&(_sc)->sx)
+#define E6000SW_LOCK_ASSERT(_sc, _what) sx_assert(&(_sc)->sx, (_what))
+#define E6000SW_TRYLOCK(_sc) sx_tryxlock(&(_sc)->sx)
typedef struct e6000sw_softc {
device_t dev;
@@ -108,46 +89,43 @@ static etherswitch_info_t etherswitch_info = {
.es_name = "Marvell 6000 series switch"
};
-static void e6000sw_identify(driver_t *driver, device_t parent);
-static int e6000sw_probe(device_t dev);
-static int e6000sw_attach(device_t dev);
-static int e6000sw_detach(device_t dev);
-static int e6000sw_readphy(device_t dev, int phy, int reg);
-static int e6000sw_writephy(device_t dev, int phy, int reg, int data);
-static etherswitch_info_t* e6000sw_getinfo(device_t dev);
-static void e6000sw_lock(device_t dev);
-static void e6000sw_unlock(device_t dev);
-static int e6000sw_getport(device_t dev, etherswitch_port_t *p);
-static int e6000sw_setport(device_t dev, etherswitch_port_t *p);
-static int e6000sw_readreg_wrapper(device_t dev, int addr_reg);
-static int e6000sw_writereg_wrapper(device_t dev, int addr_reg, int val);
-static int e6000sw_readphy_wrapper(device_t dev, int phy, int reg);
-static int e6000sw_writephy_wrapper(device_t dev, int phy, int reg, int data);
-static int e6000sw_getvgroup_wrapper(device_t dev, etherswitch_vlangroup_t *vg);
-static int e6000sw_setvgroup_wrapper(device_t dev, etherswitch_vlangroup_t *vg);
-static int e6000sw_setvgroup(device_t dev, etherswitch_vlangroup_t *vg);
-static int e6000sw_getvgroup(device_t dev, etherswitch_vlangroup_t *vg);
-static void e6000sw_setup(device_t dev, e6000sw_softc_t *sc);
-static void e6000sw_port_vlan_conf(e6000sw_softc_t *sc);
-static void e6000sw_tick(void *arg);
-static void e6000sw_set_atustat(device_t dev, e6000sw_softc_t *sc, int bin,
*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***
More information about the svn-src-projects
mailing list