2 years agonetif/re: Sync with Realtek's re-1.95. re195_1
Sepherosa Ziehau [Sat, 16 Feb 2019 11:42:32 +0000 (19:42 +0800)]
netif/re: Sync with Realtek's re-1.95.

Mainly fix some register settings.

2 years agosys/vfs/autofs: Drop <sys/bus.h>
Tomohiro Kusumi [Sat, 16 Feb 2019 09:27:25 +0000 (01:27 -0800)]
sys/vfs/autofs: Drop <sys/bus.h>

Looks like this is no longer needed just to compile.

2 years agoMove some accidentally separated text back to the correct spot.
Justin C. Sherrill [Sat, 16 Feb 2019 02:57:58 +0000 (21:57 -0500)]
Move some accidentally separated text back to the correct spot.

2 years agodd(1): Sync with FreeBSD
Aaron LI [Thu, 14 Feb 2019 16:12:06 +0000 (00:12 +0800)]
dd(1): Sync with FreeBSD

Some highlights:
* Add the "fillchar" operand.
* Add the "speed" operand to limit the speed.
* Support to specify the output data parity in the "conv" operand.
* Add tests, which can be run with "make test".

I adjusted the device names in the examples of the man page.  Some minor
tweaks (e.g., styles, function prototypes, comments) were also applied.

2 years agodd(1): Implement GNU's extension of "status" operand
Aaron LI [Thu, 14 Feb 2019 12:34:21 +0000 (20:34 +0800)]
dd(1): Implement GNU's extension of "status" operand

* status=none: do not print status information
* status=noxfer: do not print transfer  statistics

  This feature is useful because the statistics information can
  sometimes be annoying, and redirecting stderr to /dev/null would also
  lost error messages.

  Obtained from FreeBSD (revision 264059)

* status=progress: report the current status on a single line every

  Obtained from FreeBSD (revisions 337505,337865,338646)

2 years agodd(1): Rework the time interval calculation
Aaron LI [Thu, 14 Feb 2019 13:38:21 +0000 (21:38 +0800)]
dd(1): Rework the time interval calculation

dd(1) uses gettimeofday(2) to compute the throughput statistics.
However, gettimeofday returns the system clock, which may jump forward
or back, especially if NTP is in use.  If the time jumps backwards, then
dd will see negative elapsed time, round it up to 1usec, and print an
absurdly fast transfer rate.

The solution is to use clock_gettime(2) with CLOCK_MONOTONIC as the
clock_id.  That clock advances steadily, regardless of changes to the
system clock.

Don't sacrifice precision by converting the output of clock_gettime() to
a double and then comparing the results.  Instead, subtract the values
of the two clock_gettime() calls, then convert to double.

Obtained-from: FreeBSD (revisions 265472,265698)

2 years agodd(1): Make signal handler async safe
Aaron LI [Thu, 14 Feb 2019 13:06:26 +0000 (21:06 +0800)]
dd(1): Make signal handler async safe

Obtained-from: FreeBSD (revision 250469)

2 years agosys/sys/mutex2: Fix mutex(9) man page
Tomohiro Kusumi [Fri, 15 Feb 2019 00:27:25 +0000 (16:27 -0800)]
sys/sys/mutex2: Fix mutex(9) man page

"mtxex" does no exist after cabfc9f6989fa1e4dbccc61162309bd2ec6891c9.

2 years agortld-elf - Allow dynamic (late) relocations to relro section (2)
Matthew Dillon [Tue, 12 Feb 2019 20:28:11 +0000 (12:28 -0800)]
rtld-elf - Allow dynamic (late) relocations to relro section (2)

* Add missing header file adjustment

2 years agoipfw3: allow the ipfw_insn with only the basic action
Bill Yuan [Tue, 12 Feb 2019 14:17:11 +0000 (14:17 +0000)]
ipfw3: allow the ipfw_insn with only the basic action

2 years agortld-elf - Allow dynamic (late) relocations to relro section
Matthew Dillon [Mon, 11 Feb 2019 21:47:22 +0000 (13:47 -0800)]
rtld-elf - Allow dynamic (late) relocations to relro section

* Normally the relro section is mprotect()ed to read-only after normal
  load relocations.

* It appears that some programs can issue dynamic relocations at
  run-time to such sections.

* If the relro mprotect has been done on an object, temporarily mprotect
  the object back to RW to execute the relocation, then mprotect it back
  to RO.

Reported-by: marino
2 years agobsd-family-tree: Sync with FreeBSD (add macOS 10.14).
Sascha Wildner [Mon, 11 Feb 2019 16:31:55 +0000 (17:31 +0100)]
bsd-family-tree: Sync with FreeBSD (add macOS 10.14).

2 years agomakefs(8): DragonFly porting.
Sascha Wildner [Sun, 10 Feb 2019 09:01:52 +0000 (10:01 +0100)]
makefs(8): DragonFly porting.

Some notes:

* UFS2 support has been disabled for now. It would require more UFS2
  related pieces in our UFS kernel headers. I might look at enabling
  this in the future.

* Our CGSIZE() macro causes issues when used in makefs(8), which is
  why I'm using FreeBSD's currently.

* makefs(8) uses a local daddr_t type which is 64 bits wide, since
  ours is 32 bits.

* I added cg_blks() and cg_blktot() calls in a few places because
  our fsck(8) checks them in pass 5. I'm not sure if the associated
  fields are actually needed anymore.

2 years agoBring in most of makefs(8) from FreeBSD unchanged.
Sascha Wildner [Sun, 10 Feb 2019 08:11:11 +0000 (09:11 +0100)]
Bring in most of makefs(8) from FreeBSD unchanged.

To create filesystem images without kernel involvement. We can use it
to create our initrd without needing vn(4).

Originally from NetBSD.

2 years agoFix pkg "-f" flag in the "make upgrade" message
Aaron LI [Mon, 4 Feb 2019 05:33:39 +0000 (13:33 +0800)]
Fix pkg "-f" flag in the "make upgrade" message

2 years agorc.d/sysctl: Only set a sysctl when give a new value
Aaron LI [Mon, 4 Feb 2019 05:22:02 +0000 (13:22 +0800)]
rc.d/sysctl: Only set a sysctl when give a new value

For a sysctl, compare the given value with its current value, and only
update the value if the new value is different.  This suppresses
unhelpful messages on the console.

Reported-by: sephe
2 years agokernel - Fix panic in mlock() and munlock()
Matthew Dillon [Sat, 2 Feb 2019 22:29:40 +0000 (14:29 -0800)]
kernel - Fix panic in mlock() and munlock()

* Fix a degenerate case when mlock() or munlock() is called
  with a size of 0.  Silently allow the case and return success

* Fixes vm_map panic.

2 years agogcore(1): Some cleanup.
Sascha Wildner [Sat, 2 Feb 2019 18:07:58 +0000 (19:07 +0100)]
gcore(1): Some cleanup.

* Update usage(). While here, remove void casts.

* Sentences in manual pages should start on a new line.

* Flags without arguments should be specified first in the SYNOPSIS
  grouped together.

* Bump manual page date.

2 years agogcore - Fix /proc map reading, add verbose option, add limit option
Matthew Dillon [Sat, 2 Feb 2019 17:57:54 +0000 (09:57 -0800)]
gcore - Fix /proc map reading, add verbose option, add limit option

* Our /proc/*/map code allows incremental reads so the old
  code that detects an insufficient buffer size no longer works.
  Fix the code so processes with long maps are properly processed.

* Add -v to verbosely print the segments being dumped.

* Add -l <limit>{,k,m,g,t} to ignore segments larger than the
  specified limitm.

2 years agosys/vfs/autofs: Drop unused autofs_mount/autofs_softc fields
Tomohiro Kusumi [Sat, 2 Feb 2019 16:57:25 +0000 (08:57 -0800)]
sys/vfs/autofs: Drop unused autofs_mount/autofs_softc fields

Drop unused ones which originate from FreeBSD.

2 years agogcore - Handle segments > 2GB
Matthew Dillon [Sat, 2 Feb 2019 08:15:16 +0000 (00:15 -0800)]
gcore - Handle segments > 2GB

* Fix an improper 'int' plus a little cleanup.  This allows gcore to
  operate on processes which map segments greater than 2GB.

2 years agosys/vfs/autofs: Whitespace cleanups
Tomohiro Kusumi [Thu, 31 Jan 2019 17:45:43 +0000 (09:45 -0800)]
sys/vfs/autofs: Whitespace cleanups

Use space rather than tab (originates from FreeBSD).

2 years agokernel - Sync usb3.0 pci ids w/FreeBSD
Matthew Dillon [Thu, 31 Jan 2019 19:35:40 +0000 (11:35 -0800)]
kernel - Sync usb3.0 pci ids w/FreeBSD

* Add missing PCI ids for Sunrise Point, Lewisburg, Union Point,
  and Cavium ThunderX.

Reported-by: dualcyclo
2 years agosys/vfs/autofs: Rename autofs_readdir_one() -> autofs_write_dirent()
Tomohiro Kusumi [Wed, 30 Jan 2019 23:05:14 +0000 (15:05 -0800)]
sys/vfs/autofs: Rename autofs_readdir_one() -> autofs_write_dirent()

2 years agosys/vfs/autofs: Don't calculate dirent reclen twice
Tomohiro Kusumi [Wed, 30 Jan 2019 22:50:41 +0000 (14:50 -0800)]
sys/vfs/autofs: Don't calculate dirent reclen twice

when autofs_readdir() may call autofs_dirent_reclen() after
returned from autofs_readdir_one().

2 years agoatomic: Alway use inline functions.
Sepherosa Ziehau [Sun, 27 Jan 2019 14:06:08 +0000 (22:06 +0800)]
atomic: Alway use inline functions.

Originally only builtin functions use the inline version of the
atomic ops, while modules only use real function call, which is
designed for binary compatibility.  However, this kind of
compatibility is not necessary for DragonFly.

2 years agodrm/linux: Add EXPORT_SYMBOL_GPL()
François Tigeot [Sun, 27 Jan 2019 10:15:31 +0000 (11:15 +0100)]
drm/linux: Add EXPORT_SYMBOL_GPL()

2 years agodrm/linux: Add preempt.h
François Tigeot [Sat, 26 Jan 2019 09:04:34 +0000 (10:04 +0100)]
drm/linux: Add preempt.h

2 years agopcm.4: Use .Dx
Sascha Wildner [Sat, 26 Jan 2019 08:51:08 +0000 (09:51 +0100)]
pcm.4: Use .Dx

2 years agoefirt.9: Comment out a non-existant function.
Sascha Wildner [Mon, 21 Jan 2019 10:50:09 +0000 (11:50 +0100)]
efirt.9: Comment out a non-existant function.

2 years agodrm: Fix excessive wired memory usage
François Tigeot [Sun, 20 Jan 2019 20:11:44 +0000 (21:11 +0100)]
drm: Fix excessive wired memory usage

* This is a partial revert of 7ca4ece0a85bea451332580015344d3f12333419:
  "drm: Rename struct drm_gem_object.vm_obj to filp".

* That commit caused wired memory usage to become excessive over time.

2 years agodrm/gem: de-inline the ref/unref functions
François Tigeot [Sat, 19 Jan 2019 19:11:34 +0000 (20:11 +0100)]
drm/gem: de-inline the ref/unref functions

Reducing differences with Linux 4.7.10

2 years agodrm/linux/workqueue: the internal function is named func
François Tigeot [Wed, 16 Jan 2019 19:43:47 +0000 (20:43 +0100)]
drm/linux/workqueue: the internal function is named func

Some driver code expects to be able to access it.

2 years agofgetln.3: Recommend to use the safer POSIX getline()
Aaron LI [Wed, 16 Jan 2019 09:00:47 +0000 (17:00 +0800)]
fgetln.3: Recommend to use the safer POSIX getline()

Obtained-from: OpenBSD

2 years agofgetln.3: Add the CAVEATS section with an example
Aaron LI [Wed, 16 Jan 2019 08:57:05 +0000 (16:57 +0800)]
fgetln.3: Add the CAVEATS section with an example

Add the CAVEATS section to warn about the behavior of fgetln().  An
example is included to demonstrate how to properly use it.

Obtained-from: NetBSD, with the ferror() check from OpenBSD

2 years agogetline.3: Note to distinguish between error and EoF
Aaron LI [Wed, 16 Jan 2019 08:51:41 +0000 (16:51 +0800)]
getline.3: Note to distinguish between error and EoF

Note that the getline() and getdelim() functions do not distinguish
between end-of-file and error, so the callers must use feof() or
ferror() to determine which occurred.

Update the example to check the error.

Obtained-from: OpenBSD

2 years agotmpfs - Fix periodic syncer cpu-bound stalls w/tmpfs on big-mem boxes
Matthew Dillon [Tue, 15 Jan 2019 22:17:26 +0000 (14:17 -0800)]
tmpfs - Fix periodic syncer cpu-bound stalls w/tmpfs on big-mem boxes

* A bug in tmpfs leaves dirty tmpfs vnodes (which is basically all
  of them) on the syncer list, causing the syncer to scan the entire
  list every few seconds.  When a large number of vnodes are involved,
  this can lead to noticable cpu-bound stalls on the cpu the syncer is
  running on.

* Generally speaking this should significantly improve applications
  which use tmpfs a lot, such as synth runs, but was probably not noticed
  on machines with less than 32GB of ram due to the lower kern.maxvnodes

* Solved by unconditionally removing the vnode from the syncer list
  in tmpfs_fsync(), but otherwise leaving the vnode marked VISDIRTY and
  usually also VOBJDIRTY.  Tmpfs's reclaim code properly handles the
  disconnect regardless of the syncer state of the vnode.

  Removing the vnode ensures that only one syncer pass is performed on
  it, instead of repeated passes every few seconds.

2 years agoUpdate the pciconf(8) database.
Sascha Wildner [Tue, 15 Jan 2019 06:37:48 +0000 (07:37 +0100)]
Update the pciconf(8) database.

January 9, 2019 snapshot from https://pci-ids.ucw.cz

2 years agokernel: Remove puffs(4), putter(9) and associated libs and utilities.
Sascha Wildner [Tue, 15 Jan 2019 03:44:42 +0000 (04:44 +0100)]
kernel: Remove puffs(4), putter(9) and associated libs and utilities.

All of these were originally pushed and hooked into the build in non-
working condition so that they would not go stale break building. The
hope was that someone would pick up the work and fix the remaining
issues, which never materialized.

This has led to more harm than good, with people occasionally assuming
that this code is functional. Also, the existence of /usr/include/fuse.h
might lead configure checks into believing that we have a working

2 years agokernel: Hide the sysctl.debug sysctl in the SYSCTL_DEBUG kernel option.
Sascha Wildner [Mon, 14 Jan 2019 17:59:58 +0000 (18:59 +0100)]
kernel: Hide the sysctl.debug sysctl in the SYSCTL_DEBUG kernel option.

The output is quite excessive and was previously too easily triggered,
like with "sysctl name=value" (instead of just "name=value") in

Taken-from: FreeBSD

2 years agolibcrypto: Switch over to libc's reallocarray().
Sascha Wildner [Sun, 13 Jan 2019 14:54:35 +0000 (15:54 +0100)]
libcrypto: Switch over to libc's reallocarray().

2 years agosbin/hammer2: Silence -Wformat-truncation= warning on Linux (gcc 7.3)
Tomohiro Kusumi [Sun, 13 Jan 2019 22:40:19 +0000 (14:40 -0800)]
sbin/hammer2: Silence -Wformat-truncation= warning on Linux (gcc 7.3)

filename[HAMMER2_INODE_MAXNAME] may not be sufficient if
snprintf source pfs.name string is large enough. To silence
the warning, filename[] needs another 16 bytes.

This doesn't make difference on runtime, because bytes beyond
sizeof(pfs.name) won't be used even if strlen(pfs.name) is
large enough that filename[] contents exceeds sizeof(pfs.name).

(i.e. end result of pfs.name may be incomplete with or without
this commit)

cmd_snapshot.c: In function 'cmd_pfs_snapshot':
cmd_snapshot.c:84:9: warning: '%04d' directive output may be truncated writing between 4 and 11 bytes into a region of size between 0 and 255 [-Wformat-truncation=]
cmd_snapshot.c:83:3: note: 'snprintf' output between 17 and 324 bytes into a destination of size 256
   snprintf(filename, sizeof(filename),
     tp->tm_year + 1900,
     tp->tm_mon + 1,

2 years agolibc: Adjust Versions.def properly.
Sascha Wildner [Sun, 13 Jan 2019 03:34:23 +0000 (04:34 +0100)]
libc: Adjust Versions.def properly.

2 years agoi386 removal, part 70/x: Remove some i386 specific bits in the kernel.
Sascha Wildner [Sun, 13 Jan 2019 00:07:03 +0000 (01:07 +0100)]
i386 removal, part 70/x: Remove some i386 specific bits in the kernel.

2 years agoi386 removal, part 69/x: Clean up sys/dev/netif.
Sascha Wildner [Thu, 3 Jan 2019 22:25:39 +0000 (23:25 +0100)]
i386 removal, part 69/x: Clean up sys/dev/netif.

According to comments from sephe.

2 years agoMake libssh and mandoc use reallocarray() from libc.
Sascha Wildner [Sat, 12 Jan 2019 22:39:00 +0000 (23:39 +0100)]
Make libssh and mandoc use reallocarray() from libc.

2 years agolibc: Add reallocarray() from OpenBSD.
Sascha Wildner [Sat, 12 Jan 2019 22:37:36 +0000 (23:37 +0100)]
libc: Add reallocarray() from OpenBSD.

It is useful for dhcpcd, mandoc and libssh. Also some dports might pick
it up. A few other dports have workarounds which, once reallocarray() is
in release too, can be removed.

Taken-from:     OpenBSD (manual page from FreeBSD)
Pointed-out-by: aly
2 years agodrm/linux: Add struct device_driver
François Tigeot [Sat, 12 Jan 2019 12:05:56 +0000 (13:05 +0100)]
drm/linux: Add struct device_driver

2 years agorc.subr: Fix breakage in the rcrun(8) scripts.
Sascha Wildner [Thu, 10 Jan 2019 18:55:49 +0000 (19:55 +0100)]
rc.subr: Fix breakage in the rcrun(8) scripts.

0e7badd402459228d38ddfb0e06224b5a3d9fdf8 added an early exit to
rc.subr to avoid sourcing it again. However, some DragonFly bits
in rc.conf are specific to the rc.d script that rc.subr is sourced
from, specifically the contents of the $provide_list variable. The
result was that the varsym variables that rcstart(8) et al. use to
track dependency states were not get set.

Put the setup of $provide_list before the early exit.

2 years agoAdd work-around for bug #3167
Michael Neumann [Wed, 9 Jan 2019 20:41:47 +0000 (21:41 +0100)]
Add work-around for bug #3167

"UEFI boot hangs right after initializing UEFI framebuffer."
It actually boots but the system console is not shown.

I had this issue on a TUXEDO InfinityBook Pro 14v4.
This commits allows me to boot by setting loader tunable

This commit is not intended to be there forever.
It's there for people who experience the same issue and want
a quick and easy way to test if this fixes their booting issue.

Discussed-with: dillon

2 years agoSync ACPICA with Intel's version 20190108.
Sascha Wildner [Wed, 9 Jan 2019 09:18:50 +0000 (10:18 +0100)]
Sync ACPICA with Intel's version 20190108.

* New acpiexec(8) option -va to dump memory leak information.

* iasl(8)'s TPM2 table template adjusted for revision 4 of the table.

* Bumped copyrights.

2 years agoMakefile_upgrade.inc: Add a missing file i forgot in 5a31d992307898
Sascha Wildner [Tue, 8 Jan 2019 20:53:38 +0000 (21:53 +0100)]
Makefile_upgrade.inc: Add a missing file i forgot in 5a31d992307898

2 years agoopenssl(1): Remove a no longer existing .PATH from the Makefile.
Sascha Wildner [Tue, 8 Jan 2019 20:21:07 +0000 (21:21 +0100)]
openssl(1): Remove a no longer existing .PATH from the Makefile.

2 years agokernel/Makefiles: Remove two empty lines I added by mistake.
Sascha Wildner [Mon, 7 Jan 2019 21:01:23 +0000 (22:01 +0100)]
kernel/Makefiles: Remove two empty lines I added by mistake.

2 years agodrm/i915/gem: Really implement i915_gem_object_invalidate()
François Tigeot [Mon, 7 Jan 2019 20:14:50 +0000 (21:14 +0100)]
drm/i915/gem: Really implement i915_gem_object_invalidate()

2 years agodrm/linux: Add invalidate_mapping_pages()
François Tigeot [Mon, 7 Jan 2019 19:44:57 +0000 (20:44 +0100)]
drm/linux: Add invalidate_mapping_pages()

Inspired-by: FreeBSD
2 years agodrm/i915: Sync i915_drv.c a bit with Linux
François Tigeot [Mon, 7 Jan 2019 18:03:05 +0000 (19:03 +0100)]
drm/i915: Sync i915_drv.c a bit with Linux

2 years agokernel: Change CFLAGS -> KCFLAGS also in commented out Makefile lines.
Sascha Wildner [Mon, 7 Jan 2019 10:33:12 +0000 (11:33 +0100)]
kernel: Change CFLAGS -> KCFLAGS also in commented out Makefile lines.

2 years agoipfw3: insert the new rule in the beginning
Your Name [Mon, 7 Jan 2019 08:03:12 +0000 (08:03 +0000)]
ipfw3: insert the new rule in the beginning

"ipfw3 add" is still the same, while the "ipfw3 insert" is the new method
which will insert the new rule in the beginning of the rule list.

2 years agoRemove some dead code.
Sascha Wildner [Sun, 6 Jan 2019 18:16:25 +0000 (19:16 +0100)]
Remove some dead code.

2 years agodrm: Add drm_prime.c
François Tigeot [Sat, 5 Jan 2019 22:28:31 +0000 (23:28 +0100)]
drm: Add drm_prime.c

Increase dma-buf subsystem coverage.

2 years agodrm/i915: Enable the I915_GEM_USERPTR ioctl
François Tigeot [Sat, 5 Jan 2019 21:22:08 +0000 (22:22 +0100)]
drm/i915: Enable the I915_GEM_USERPTR ioctl

Start building some of the associated code

2 years agodrm: Partially sync drm_mm.c with Linux 4.7.10
François Tigeot [Sat, 5 Jan 2019 20:56:07 +0000 (21:56 +0100)]
drm: Partially sync drm_mm.c with Linux 4.7.10

2 years agokernel: Remove two no longer used sysinit ids.
Sascha Wildner [Sat, 5 Jan 2019 20:43:50 +0000 (21:43 +0100)]
kernel: Remove two no longer used sysinit ids.

* SI_BOOT2_BIOS was used for longrun and other i386 specific stuff only.
  The last usage was removed in c292f53669b4862993224dcf5c489355215be50d.

* SI_SUB_CLIST was removed in the recent tty clist refactoring commit,
  see 4725869b060b0e647b6c64480a0ce50f64ff23bb.

2 years agokernel: Remove unused *.h files from SRCS in kernel module Makefiles. (2)
Sascha Wildner [Sat, 5 Jan 2019 18:58:04 +0000 (19:58 +0100)]
kernel: Remove unused *.h files from SRCS in kernel module Makefiles. (2)

Forgot two Makefiles.

2 years agokernel: Remove kernel profiling bits.
Sascha Wildner [Sat, 5 Jan 2019 17:58:10 +0000 (18:58 +0100)]
kernel: Remove kernel profiling bits.

It was broken on i386, is even more broken on x86_64 and isn't
worth fixing.

Discussed-with: dillon

2 years agoClean up the USB driver directories, remove unbuilt source.
Sascha Wildner [Sat, 5 Jan 2019 13:25:45 +0000 (14:25 +0100)]
Clean up the USB driver directories, remove unbuilt source.

Remove old source that has not (yet) been ported. If any of these
drivers would get ported in the future, it would be from current
FreeBSD source anyway. Keeping the old source around just confuses
when grepping in /usr/src.

2 years agolib/libc: Remove a file that is not used in libc.
Sascha Wildner [Sat, 5 Jan 2019 13:19:33 +0000 (14:19 +0100)]
lib/libc: Remove a file that is not used in libc.

2 years agokernel: Remove unused *.h files from SRCS in kernel module Makefiles.
Sascha Wildner [Fri, 4 Jan 2019 20:38:57 +0000 (21:38 +0100)]
kernel: Remove unused *.h files from SRCS in kernel module Makefiles.

They were found by checking the preprocessed code of the files
in SRCS to see if the header was included at some point.

After removal, the preprocessed source of a build with the old
Makefiles was compared against one with the changes (for various
kernel configurations and when building just from /usr/src) to
verify that the commit leads to no functional change.

2 years agodrm/i915: Add i915_gem_dmabuf.c
François Tigeot [Thu, 3 Jan 2019 20:50:43 +0000 (21:50 +0100)]
drm/i915: Add i915_gem_dmabuf.c

This just means we now build more dma-buf code, not that the
end result is usable.

2 years agodrm: Rename struct drm_gem_object.vm_obj to filp
François Tigeot [Thu, 3 Jan 2019 20:08:24 +0000 (21:08 +0100)]
drm: Rename struct drm_gem_object.vm_obj to filp

Synchronize a bunch of related code with Linux

2 years agodrm/linux: Add linux/mmu_context.h
François Tigeot [Wed, 2 Jan 2019 22:23:36 +0000 (23:23 +0100)]
drm/linux: Add linux/mmu_context.h

2 years agoHAPPY NEW YEAR!
Sascha Wildner [Mon, 31 Dec 2018 23:15:51 +0000 (00:15 +0100)]

2 years agoSync zoneinfo database with tzdata2018i from ftp://ftp.iana.org/tz/releases
Sascha Wildner [Mon, 31 Dec 2018 19:24:33 +0000 (20:24 +0100)]
Sync zoneinfo database with tzdata2018i from ftp://ftp.iana.org/tz/releases

* Qyzylorda, Kazakhstan moved from +06 to +05 on 2018-12-21.

* New zone Asia/Qostanay because Qostanay, Kazakhstan didn't move.

* Metlakatla, Alaska observes PST this winter only.

* Guess Morocco will continue to adjust clocks around Ramadan.

* Add predictions for Iran from 2038 through 2090.

* São Tomé and Príncipe switches from +01 to +00 on 2019-01-01.

For a detailed list of changes, see share/zoneinfo/NEWS.

2 years agomkinitrd.sh: Fix comment typo.
Sascha Wildner [Mon, 31 Dec 2018 12:00:43 +0000 (13:00 +0100)]
mkinitrd.sh: Fix comment typo.

2 years agovkernel - Remove unneeded -T flag, that was added in 7b21e5e4a2ba4592a.
Imre Vadász [Fri, 28 Dec 2018 14:50:31 +0000 (15:50 +0100)]
vkernel - Remove unneeded -T flag, that was added in 7b21e5e4a2ba4592a.

* Instead the -e hw.tsc_cputimer_enable=0 flag can be used, to set the
  tunable that disables use of the TSC cputimer.

Pointed-out-by: swildner
2 years agokernel: Remove more duplicate includes.
Sascha Wildner [Fri, 28 Dec 2018 13:34:12 +0000 (14:34 +0100)]
kernel: Remove more duplicate includes.

2 years agokernel/ic: Remove an unneeded #ifdef _KERNEL and two duplicate includes.
Sascha Wildner [Fri, 28 Dec 2018 13:27:57 +0000 (14:27 +0100)]
kernel/ic: Remove an unneeded #ifdef _KERNEL and two duplicate includes.

2 years agoOops, fix lagg's type in LINT64.
Sascha Wildner [Fri, 28 Dec 2018 12:50:47 +0000 (13:50 +0100)]
Oops, fix lagg's type in LINT64.

2 years agoAdd lagg(4) to LINT64.
Sascha Wildner [Fri, 28 Dec 2018 12:47:24 +0000 (13:47 +0100)]
Add lagg(4) to LINT64.

While here, adjust LINT64's ident and fix lagg's type in VKERNEL64.

2 years agovkernel - Delete unused/ancient timer/rtc function declarations in clock.h.
Imre Vadász [Fri, 28 Dec 2018 10:50:57 +0000 (11:50 +0100)]
vkernel - Delete unused/ancient timer/rtc function declarations in clock.h.

* Also get rid of tsc_is_broken flag, that is completely unused.

2 years agobsd-family-tree: Sync with FreeBSD.
Sascha Wildner [Fri, 28 Dec 2018 10:32:37 +0000 (11:32 +0100)]
bsd-family-tree: Sync with FreeBSD.

2 years agokernel/acpi: Bring in FreeBSD's r341632.
Sascha Wildner [Thu, 27 Dec 2018 23:23:14 +0000 (00:23 +0100)]
kernel/acpi: Bring in FreeBSD's r341632.

On specific machines (a Lenovo Ideapad 100-15IBD in this case) would fail
detecting the battery properly after 7bcb6caf98d72e1e5fd653428e604ea1.

See https://lists.freebsd.org/pipermail/svn-src-all/2018-December/173505.html
for further info.

Reported-by: mazocomp on #dragonflybsd.
Taken-from: FreeBSD

2 years agonet - Simplify net/altq TSC timer code, get rid of its TSC calibration code.
Imre Vadász [Thu, 27 Dec 2018 21:41:25 +0000 (22:41 +0100)]
net - Simplify net/altq TSC timer code, get rid of its TSC calibration code.

* There is no use for the custom TSC calibration code in the ALTQ code.
  If our bootup TSC calibration would ever fail, we have bigger problems
  than being a little bit slower in the ALTQ code.

2 years agobufcache.9: Fix bread() prototype.
Sascha Wildner [Thu, 27 Dec 2018 13:05:08 +0000 (14:05 +0100)]
bufcache.9: Fix bread() prototype.

2 years agovkernel.7: Fix a typo and bump date
Aaron LI [Thu, 27 Dec 2018 11:26:36 +0000 (19:26 +0800)]
vkernel.7: Fix a typo and bump date

2 years agokernel - Factor out TSC cputimer into common x86_64 code, use for vkernel.
Imre Vadász [Tue, 25 Dec 2018 15:02:38 +0000 (16:02 +0100)]
kernel - Factor out TSC cputimer into common x86_64 code, use for vkernel.

* This adds a command line flag -T to the vkernel, to force disable use of
  the TSC cputimer.

* By default the TSC will be used as a cputimer for the vkernel when the
  TSC is invariant and mpsync according to the hw.tsc_invariant and
  hw.tsc_mpsync sysctl values of the host.

2 years agokernel - Throw a global lock around udev dictionary ops
Matthew Dillon [Thu, 27 Dec 2018 03:33:23 +0000 (19:33 -0800)]
kernel - Throw a global lock around udev dictionary ops

* Throw a global lockmgr lock around accesses and adjustments to

* Refactor functions that used to access dev->si_dict directly by
  adding two helper functions, udev_get_dict() and udev_put_dict().

* Should fix occassional vn-related panics.

2 years agoiwm - Fix possible null pointer indirection
Matthew Dillon [Wed, 26 Dec 2018 06:17:25 +0000 (22:17 -0800)]
iwm - Fix possible null pointer indirection

* Fix possible null pointer indirection.  No known cases for dfly but
  I would speculate possibly something in the error path could
  trigger a NULL field there.

* Provisional change, may be adjusted in the future.  But harmless.

Taken-from: haiku
Requested-by: waddlespl
2 years agoefirt.9: Yet another prototype fix.
Sascha Wildner [Tue, 25 Dec 2018 10:05:18 +0000 (11:05 +0100)]
efirt.9: Yet another prototype fix.

2 years agoiconvlist.3: Fix prototype in SYNOPSIS.
Sascha Wildner [Sun, 23 Dec 2018 21:37:03 +0000 (22:37 +0100)]
iconvlist.3: Fix prototype in SYNOPSIS.

2 years agobus_space.9: Fix some protoypes in SYNOPSIS.
Sascha Wildner [Sun, 23 Dec 2018 21:25:59 +0000 (22:25 +0100)]
bus_space.9: Fix some protoypes in SYNOPSIS.

2 years agokernel: Add descriptions to the p1003_1b sysctls.
Sascha Wildner [Sun, 23 Dec 2018 20:39:46 +0000 (21:39 +0100)]
kernel: Add descriptions to the p1003_1b sysctls.

While here, clean up a bit.

2 years agokernel: Populate the p1003_1b sysctl tree a bit more.
Sascha Wildner [Sun, 23 Dec 2018 20:36:57 +0000 (21:36 +0100)]
kernel: Populate the p1003_1b sysctl tree a bit more.

2 years agosem_init.3: Mark up SEM_VALUE_MAX.
Sascha Wildner [Sun, 23 Dec 2018 20:09:35 +0000 (21:09 +0100)]
sem_init.3: Mark up SEM_VALUE_MAX.

2 years ago<utmpx.h>: Change struct utmpx's ut_type from uint16_t to short, per POSIX.
Sascha Wildner [Sun, 23 Dec 2018 08:13:58 +0000 (09:13 +0100)]
<utmpx.h>: Change struct utmpx's ut_type from uint16_t to short, per POSIX.

See https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/utmpx.h.html

Our valid ut_types are 0-8 currently, so there should not be any issues.

Also fix a no longer necessary cast in utmp_update.

2 years agokernel/mrsas: Fix a double assignment.
Sascha Wildner [Sun, 23 Dec 2018 06:35:02 +0000 (07:35 +0100)]
kernel/mrsas: Fix a double assignment.

This code is in an ioctl path that is not used in DragonFly.

Taken-from: FreeBSD

2 years agortadvctl(8): Add __printflike and fix warnings.
Sascha Wildner [Fri, 21 Dec 2018 20:21:29 +0000 (21:21 +0100)]
rtadvctl(8): Add __printflike and fix warnings.

2 years agolibc/sysvipc: Fix some style issues (no functional change).
Sascha Wildner [Fri, 21 Dec 2018 14:18:00 +0000 (15:18 +0100)]
libc/sysvipc: Fix some style issues (no functional change).

2 years agolibc/sysvipc: Mark two functions as printf-like and fix resulting errors.
Sascha Wildner [Fri, 21 Dec 2018 14:14:14 +0000 (15:14 +0100)]
libc/sysvipc: Mark two functions as printf-like and fix resulting errors.