]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
5 years agoCXXSTD is the C++ analogue to CSTD.
ngie [Fri, 29 Mar 2019 18:13:44 +0000 (18:13 +0000)]
CXXSTD is the C++ analogue to CSTD.

CXXSTD defaults to `-std=c++11` with supporting compilers; `-std=gnu++98`,
otherwise for older versions of g++.

This change standardizes the CXXSTD variable, originally added to
googletest.test.inc.mk as part of r345203.

As part of this effort, convert all `CXXFLAGS+= -std=*` calls to use `CXXSTD`.

Notes:

This value is not sanity checked in bsd.sys.mk, however, given the two
most used C++ compilers on FreeBSD (clang++ and g++) support both modes, it is
likely to work with both toolchains. This method will be refined in the future
to support more variants of C++, as not all versions of clang++ and g++ (for
instance) support C++14, C++17, etc.

Any manual appending of `-std=*` to `CXXFLAGS` should be replaced with CXXSTD.
Example:

Before this commit:
```
CXXFLAGS+= -std=c++14
```

After this commit:
```
CXXSTD= c++14
```

Reviewed by: asomers
Approved by: emaste (mentor)
MFC after: 1 month
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D19732

5 years agoFix initial exec TLS mode for dynamically loaded shared objects.
kib [Fri, 29 Mar 2019 17:52:57 +0000 (17:52 +0000)]
Fix initial exec TLS mode for dynamically loaded shared objects.

If dso uses initial exec TLS mode, rtld tries to allocate TLS in
static space. If there is no space left, the dlopen(3) fails. If space
if allocated, initial content from PT_TLS segment is distributed to
all threads' pcbs, which was missed and caused un-initialized TLS
segment for such dso after dlopen(3).

The mode is auto-detected either due to the relocation used, or if the
DF_STATIC_TLS dynamic flag is set.  In the later case, the TLS segment
is tried to allocate earlier, which increases chance of the dlopen(3)
to succeed.  LLD was recently fixed to properly emit the flag, ld.bdf
did it always.

Initial test by: dumbbell
Tested by: emaste (amd64), ian (arm)
Tested by: Gerald Aryeetey <aryeeteygerald_rogers.com> (arm64)
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D19072

5 years agoEliminate adj_free field from vm_map_entry.
kib [Fri, 29 Mar 2019 16:53:46 +0000 (16:53 +0000)]
Eliminate adj_free field from vm_map_entry.

Drop the adj_free field from vm_map_entry_t. Refine the max_free field
so that p->max_free is the size of the largest gap with one endpoint
in the subtree rooted at p. Change vm_map_findspace so that, first,
the address-based splay is restricted to tree nodes with large-enough
max_free value, to avoid searching for the right starting point in a
subtree where all the gaps are too small. Second, when the address
search leads to a tree search for the first large-enough gap, that gap
is the subject of a splay-search that brings the gap to the top of the
tree, so that an immediate insertion will take constant time.

Break up the splay code into separate components, one for searching
and breaking up the tree and another for reassembling it. Use these
components, and not splay itself, for linking and unlinking. Drop the
after-where parameter to link, as it is computed as a side-effect of
the splay search.

Submitted by: Doug Moore <dougm@rice.edu>
Reviewed by: markj
Tested by: pho
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D17794

5 years agocxgbe/t4_tom: Catch up with r344433, which removed tcb_autorcvbuf_inc.
np [Fri, 29 Mar 2019 16:43:24 +0000 (16:43 +0000)]
cxgbe/t4_tom: Catch up with r344433, which removed tcb_autorcvbuf_inc.

The declaration in tcp_var.h is still around so t4_tom continued to
compile but wouldn't load.  A separate commit will fix tcp_var.h

Reported By: Dustin Marquess (dmarquess at gmail)

Sponsored by: Chelsio Communications

5 years agoFix restoring to graphics modes in VGLEnd().
bde [Fri, 29 Mar 2019 16:30:19 +0000 (16:30 +0000)]
Fix restoring to graphics modes in VGLEnd().

Correct restoring was only attempted for mode 258 (800x600x4 P).  (This
was the only useful graphics mode supported in the kernel until 10-15
years ago, and is still the only one explicitly documented in the man
page).  The comment says that it is the geometry (subscreen size) that
is restored, but it seems to only be necessary to restore the font
size, with the geometry only needed since it is set by the same ioctl.
The font size was not restored for this mode, but was forced to 16.

For other graphics modes, the font size was clobbered to 0.  This
confuses but doesn't crash the kernel (font size 0 gives null text).
This confuses and crashes vidcontrol.  The only way to recover was to
use vidcontrol to set the mode to any text mode on the way back to the
original graphics mode.

vidcontrol gets this wrong in the opposite way when backing out of
changes after an error.  It restores the font size correctly, but
forces the geometry to the full screen size.

5 years agoReduce the precision of "MB/s" by one, making room for displaying
trasz [Fri, 29 Mar 2019 16:05:30 +0000 (16:05 +0000)]
Reduce the precision of "MB/s" by one, making room for displaying
transfer rates larger 99MB/s.

MFC after: 2 weeks

5 years agoFix endless loops for handling SIGBUS and SIGSEGV.
bde [Fri, 29 Mar 2019 15:57:08 +0000 (15:57 +0000)]
Fix endless loops for handling SIGBUS and SIGSEGV.

r80270 has the usual wrong fix for unsafe signal handling -- just set
a flag and return to let an event loop check the flag and do safe
handling.  This never works for signals like SIGBUS and SIGSEGV that
repeat and works poorly for others unless the application has an event
loop designed to support this.

For these signals, clean up unsafely as before, except for arranging that
nested signals are fatal and forcing a nested signal if the cleanup doesn't
cause one.

5 years agoFix races in mouse signal handling almost properly using the INTOFF/INTON
bde [Fri, 29 Mar 2019 15:20:48 +0000 (15:20 +0000)]
Fix races in mouse signal handling almost properly using the INTOFF/INTON
method as in /bin/sh.

We still do technically undefined things in the signal handler, but it
is safe in practice to access state that is protected by INTOFF/INTON.

In a recent commit, I sprinkled VGLMouseFrozen++/-- operations in
places that need INTOFF/INTON.  This prevented clobbering of pixels
under the mouse, but left mouse signals deferred for too long.  It is
necessary to call the signal handler when the count goes to 0.  Old
versions did this in the unfreeze function, but didn't block actual
signals, so the signal handler raced itself.  The sprinkled operations
reduced the races, but when then worked to block a race they left
signals deferred for too long.

Use INTOFF/INTON to fix complete loss of mouse signals while reading
the mouse status.  Clobbering of the state was prevented by SIG_IGN'ing
mouse signals, but that has a high overhead and broke more than it
fixed by losing mouse signals completely.  sigprocmask() works to block
signals without losing them completely, but its overhead is also too
high.

libvgl's mouse signal handling is often worse than none.  Applications
can't block waiting for a mouse or keyboard or other event, but have
to busy-wait.  The SIG_IGN's lost about half of all mouse events while
busy-waiting for mouse events.

5 years agortld: attempt to fix reloc_non_plt TLS allocation on MIPS
emaste [Fri, 29 Mar 2019 15:07:00 +0000 (15:07 +0000)]
rtld: attempt to fix reloc_non_plt TLS allocation on MIPS

allocate_tls_offset returns true on success.  The same issue existed
on arm and was fixed in r345693.

PR: 236880
MFC after: 1 month
Sponsored by: The FreeBSD Foundation

5 years agortld: attempt to fix reloc_nonplt_object TLS allocation
emaste [Fri, 29 Mar 2019 14:35:23 +0000 (14:35 +0000)]
rtld: attempt to fix reloc_nonplt_object TLS allocation

allocate_tls_offset returns true on success.  This still needs more
testing and review, but this change is consistent with other archs.

PR: 236880
Reported by: Andrew Gierth <andrew@tao11.riddles.org.uk>
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

5 years agofix the GENERIC-NODEBUG build after r345675
asomers [Fri, 29 Mar 2019 14:07:30 +0000 (14:07 +0000)]
fix the GENERIC-NODEBUG build after r345675

Submitted by: cy
Reported by: cy, Michael Butler <imb@protected-networks.net>
MFC after: 2 weeks
X-MFC-With: 345675

5 years agoSkip test if feature security_capabilities is not available
olivier [Fri, 29 Mar 2019 08:43:21 +0000 (08:43 +0000)]
Skip test if feature security_capabilities is not available

PR: 236863
Approved by: asomers
MFC after: 1 month
Sponsored by: Netflix

5 years agoNOTES: Use non-default value for BOOT_TAG
kevans [Fri, 29 Mar 2019 04:00:46 +0000 (04:00 +0000)]
NOTES: Use non-default value for BOOT_TAG

Reported by: jhb
MFC after: 1 week (except non-empty value in stable/11)

5 years agopowerpc64: Fix kernel ldscript to only emit one PT_LOAD segment
jhibbits [Fri, 29 Mar 2019 03:01:21 +0000 (03:01 +0000)]
powerpc64: Fix kernel ldscript to only emit one PT_LOAD segment

Summary:
kexec-lite cannot currently handle multiple PT_LOAD segments.  In some
cases the compiler generates multiple PT_LOAD segments for an unknown
reason, causing boot to fail from kexec-lite.

Submitted by: Brandon Bergren (older version)
Differential Revision: https://reviews.freebsd.org/D19574

5 years agoAdd man page for VOP_FDATASYNC(9)
asomers [Fri, 29 Mar 2019 02:44:20 +0000 (02:44 +0000)]
Add man page for VOP_FDATASYNC(9)

Reviewed by:    kib
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D19678

5 years agopowerpc64: Use medium code model in asm files for TOC references
jhibbits [Fri, 29 Mar 2019 02:38:30 +0000 (02:38 +0000)]
powerpc64: Use medium code model in asm files for TOC references

Summary:
With a sufficiently large TOC, it's possible to index out of range, as
the immediate load instructions only permit 16-bit indices, allowing up
to 64kB range (signed) from the base pointer.  Allow +/- 2GB range, with
the medium code model TOC accesses in asm.

Patch originally by Brandon Bergren.  The issue appears to impact ELFv2
more than ELFv1.

Reviewed by: luporl
Differential Revision: https://reviews.freebsd.org/D19708

5 years agofusefs: convert debug printfs into dtrace probes
asomers [Fri, 29 Mar 2019 02:13:06 +0000 (02:13 +0000)]
fusefs: convert debug printfs into dtrace probes

fuse(4) was heavily instrumented with debug printf statements that could
only be enabled with compile-time flags. They fell into three basic groups:

1. Totally redundant with dtrace FBT probes. These I deleted.
2. Print textual information, usually error messages. These I converted to
   SDT probes of the form fuse:fuse:FILE:trace. They work just like the old
   printf statements except they can be enabled at runtime with dtrace. They
   can be filtered by FILE and/or by priority.
3. More complicated probes that print detailed information. These I
   converted into ad-hoc SDT probes.

Also, de-inline fuse_internal_cache_attrs.  It's big enough to be a regular
function, and this way it gets a dtrace FBT probe.

This commit is a merge of r345304, r344914, r344703, and r344664 from
projects/fuse2.

Reviewed by: cem
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D19667

5 years agopowerpc: Remove now-obsolete P9H MMU name
jhibbits [Fri, 29 Mar 2019 02:11:48 +0000 (02:11 +0000)]
powerpc: Remove now-obsolete P9H MMU name

5 years agoFactor out retrieving the interpreter path from the main ELF
trasz [Thu, 28 Mar 2019 21:43:01 +0000 (21:43 +0000)]
Factor out retrieving the interpreter path from the main ELF
loader routine.

Reviewed by: kib
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D19715

5 years agocxgbe(4): Count and clear interrupts generated at the software's request.
np [Thu, 28 Mar 2019 21:22:28 +0000 (21:22 +0000)]
cxgbe(4): Count and clear interrupts generated at the software's request.

An interrupt can be requested by setting the F_SWINT bit in PL_PF_CTL.

MFC after: 1 week
Sponsored by: Chelsio Communications

5 years agoUse a dedicated malloc type for lagg(4)'s structures.
jhb [Thu, 28 Mar 2019 21:00:54 +0000 (21:00 +0000)]
Use a dedicated malloc type for lagg(4)'s structures.

Reviewed by: gallatin
MFC after: 1 month
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D19719

5 years agoiflib: return ENETDOWN when the network device is down
erj [Thu, 28 Mar 2019 20:46:45 +0000 (20:46 +0000)]
iflib: return ENETDOWN when the network device is down

From Jake:
iflib_if_transmit returns ENOBUFS when the device is down, or when the
link isn't active.

This was changed in r308792 from return (0), so that the function
correctly reports an error that it was unable to transmit.

However, using ENOBUFS can cause some network applications to produce
the following or similar errors:

"ping: sendto: No buffer space available"

This is a bit confusing as the real cause of the issue is that the
network device is down.

Replace the ENOBUFS return with ENETDOWN to indicate more clearly that
the reason for the failure to send is due to the network device is
offline.

This will cause the error message to be reported as

"ping: sendto: Network is down"

Submitted by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed by: shurd@, sbruno@, bz@
MFC after: 1 week
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D19652

5 years agoiflib: hold the CTX lock in iflib_pseudo_register
erj [Thu, 28 Mar 2019 20:43:47 +0000 (20:43 +0000)]
iflib: hold the CTX lock in iflib_pseudo_register

From Jake:
The iflib_device_register function takes the CTX lock before calling
IFDI_ATTACH_PRE, and releases it upon finishing the registration.

Mirror this process in iflib_pseudo_register, so that we always hold the
CTX lock during the attach process when registering a pseudo interface
or a regular interface.

This was caught by code inspection while attempting to analyze where the
CTX lock was held.

Submitted by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed by: shurd@, erj@
MFC after: 1 week
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D19604

5 years agoDo not map small IOCTL buffers to KVA, but copy.
mav [Thu, 28 Mar 2019 20:41:02 +0000 (20:41 +0000)]
Do not map small IOCTL buffers to KVA, but copy.

CAM IOCTL interfaces traditionally mapped user-space data buffers to KVA.
It was nice originally, but now it takes too much to handle respective
TLB shootdowns, while small kernel memory allocations up to 64KB backed
by UMA and accompanied by copyin()/copyout() can be much cheaper.

For large buffers mapping still may have sense, and unmapped I/O would
be even better, but the last unfortunately is more tricky, since unmapped
I/O API is too specific to struct bio now.

MFC after: 2 weeks
Sponsored by: iXsystems, Inc.

5 years agoRemove nested epochs from lagg(4).
jhb [Thu, 28 Mar 2019 20:25:36 +0000 (20:25 +0000)]
Remove nested epochs from lagg(4).

lagg_bcast_start appeared to have a bug in that was using the last
lagg port structure after exiting the epoch that was keeping that
structure alive.  However, upon further inspection, the epoch was
already entered by the caller (lagg_transmit), so the epoch enter/exit
in lagg_bcast_start was actually unnecessary.

This commit generally removes uses of the net epoch via LAGG_RLOCK to
protect the list of ports when the list of ports was already protected
by an existing LAGG_RLOCK in a caller, or the LAGG_XLOCK.

It also adds a missing epoch enter/exit in lagg_snd_tag_alloc while
accessing the lagg port structures.  An ifp is still accessed via an
unsafe reference after the epoch is exited, but that is true in the
current code and will be fixed in a future change.

Reviewed by: gallatin
MFC after: 1 month
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D19718

5 years agoMake the "KB/s" field one character shorter (by reducing the precision)
trasz [Thu, 28 Mar 2019 20:16:19 +0000 (20:16 +0000)]
Make the "KB/s" field one character shorter (by reducing the precision)
and use the space to make the "tps" one character longer.

It makes the iostat(8) output a bit less messed up.

Reviewed by: allanjude
MFC after: 2 weeks
Sponsored by: Klara Inc.
Differential Revision: https://reviews.freebsd.org/D19710

5 years agoDistinguish between lseek errors and read errores.
delphij [Thu, 28 Mar 2019 18:20:47 +0000 (18:20 +0000)]
Distinguish between lseek errors and read errores.

MFC after: 2 weeks

5 years agoreadelf: add newline after dumping dynamic FLAGS / FLAGS_1
emaste [Thu, 28 Mar 2019 17:30:47 +0000 (17:30 +0000)]
readelf: add newline after dumping dynamic FLAGS / FLAGS_1

All three dump_flags() callers need a newline after printing the flags.

Sponsored by: The FreeBSD Foundation

5 years agoSpam CXXFLAGS with `-I${DESTDIR}/usr/include/private`, instead of GTEST_CXXFLAGS
ngie [Thu, 28 Mar 2019 17:22:31 +0000 (17:22 +0000)]
Spam CXXFLAGS with `-I${DESTDIR}/usr/include/private`, instead of GTEST_CXXFLAGS

This makes it easier for googletest users to leverage googletest, instead of
forcing them to plug GTEST_CXXFLAGS into CXXFLAGS manually (resulting in
unnecessary duplication).

I will be following this up with a more proper fix in src.libnames.mk, as
src.libnames.mk should be automatically adding this directory to
CFLAGS/CXXFLAGS when private libraries are referenced. Not doing so can result
in mismatches between base-provided private library's and ports-provided
library's headers.

While here, tweak the comment to clarify what the intent is behind spamming
CXXFLAGS.

MFC after: 5 weeks
MFC with: r345203
Reported by: asomers
Reviewed by: asomers
Approved by: emaste (mentor)
Differential Revision: https://reviews.freebsd.org/D19731

5 years agoSkip this test if if_tap module is not available
olivier [Thu, 28 Mar 2019 16:17:33 +0000 (16:17 +0000)]
Skip this test if if_tap module is not available

PR: 236842
Approved by: asomers
MFC after: 1 month
Sponsored by: Netflix

5 years agoFix VGLLine() in depths > 8.
bde [Thu, 28 Mar 2019 14:21:22 +0000 (14:21 +0000)]
Fix VGLLine() in depths > 8.

It started truncating its color arg to 8 bits using plot() in r229415.
The version in r229415 is also more than 3 times slower in segmented
modes, by doing more syscalls to move the window.

5 years agoRevert other accidentally committed part of r345625
emaste [Thu, 28 Mar 2019 13:27:34 +0000 (13:27 +0000)]
Revert other accidentally committed part of r345625

5 years agoFix VGLGetXY(), VGLSetXY() and VGLClear() for MEMBUFs in depths > 8.
bde [Thu, 28 Mar 2019 12:28:29 +0000 (12:28 +0000)]
Fix VGLGetXY(), VGLSetXY() and VGLClear() for MEMBUFs in depths > 8.

This depends on PixelBytes being properly initialized, which it is for
all bitmaps constructed by libvgl except mouse cursor bitmaps.

5 years agoRevert change accidentally committed along with r345625
emaste [Thu, 28 Mar 2019 10:56:27 +0000 (10:56 +0000)]
Revert change accidentally committed along with r345625

Reported by: Oliver Pinter <oliver.pinter@hardenedbsd.org>

5 years agoOops, r345496 got the pointer args backwards for bcopy() in VGLClear for
bde [Thu, 28 Mar 2019 09:51:37 +0000 (09:51 +0000)]
Oops, r345496 got the pointer args backwards for bcopy() in VGLClear for
segmented modes.

Also fix some style bugs in the 2 changed lines.  libvgl uses a very non-KNF
style with 2-column indentation with no tabs except for regressions.

5 years agoAdd new USB PCI ID.
hselasky [Thu, 28 Mar 2019 09:00:56 +0000 (09:00 +0000)]
Add new USB PCI ID.

Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoFix `make` in sys/modules
lwhsu [Thu, 28 Mar 2019 08:59:11 +0000 (08:59 +0000)]
Fix `make` in sys/modules

Sponsored by: The FreeBSD Foundation

5 years agoAdd dependent header files
lwhsu [Thu, 28 Mar 2019 08:30:45 +0000 (08:30 +0000)]
Add dependent header files

Reported by: https://ci.freebsd.org/job/FreeBSD-head-mips-build/6702/console

5 years agodtc(1): Update to 1a79f5f26631
kevans [Thu, 28 Mar 2019 03:48:51 +0000 (03:48 +0000)]
dtc(1): Update to 1a79f5f26631

Highlights:
- Bugfix for order in which /delete-node/ and /delete-property/ are
  processed [0]
- /omit-if-no-ref/ support has been added (used only by U-Boot at this
  point, in theory)
- GPL dtc compat version bumped to 1.4.7
- Various small fixes and compatibility improvements

Reported by: strejda [0]
MFC after: 1 week

5 years agoif_bridge(4): ensure all traffic passing over the bridge is accounted for
kevans [Thu, 28 Mar 2019 03:31:51 +0000 (03:31 +0000)]
if_bridge(4): ensure all traffic passing over the bridge is accounted for

Consider a bridge0 with em0 and em1 members. Traffic rx'd by em0 and
transmitted by bridge0 through em1 gets accounted for in IPACKETS/IBYTES
and bridge0 bpf -- assuming it's not unicast traffic destined for em1.
Unicast traffic destined for em1 traffic is not accounted for by any
mechanism, and isn't pushed through bridge0's bpf machinery as any other
packets that pass over the bridge do.

Fix this and simplify GRAB_OUR_PACKETS by bailing out early if it was rx'd
by the interface that it was addressed for. Everything else there is
relevant for any traffic that came in from one member that's being directed
at another member of the bridge.

Reviewed by: kp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D19614

5 years agorevert r341429 "disable BIND_NOW in libc, libthr, and rtld"
emaste [Thu, 28 Mar 2019 02:12:32 +0000 (02:12 +0000)]
revert r341429 "disable BIND_NOW in libc, libthr, and rtld"

r345620 by kib@ fixed the rtld issue that caused a crash at startup
during resolution of libc's ifuncs with BIND_NOW.

PR: 233333
Sponsored by: The FreeBSD Foundation

5 years agortld: disable relro enforcement for irelative relocation processing.
kib [Wed, 27 Mar 2019 22:35:28 +0000 (22:35 +0000)]
rtld: disable relro enforcement for irelative relocation processing.

This fixes yet another breakage for relro + bind now.

Reported by: emaste
Sponsored by: The FreeBSD Foundation
MFC after: 3 days

5 years agoTeach jedec_dimm(4) to be more forgiving of non-fatal errors.
rpokala [Wed, 27 Mar 2019 21:50:01 +0000 (21:50 +0000)]
Teach jedec_dimm(4) to be more forgiving of non-fatal errors.

It looks like some DIMMs claim to have a TSOD, but actually don't. Some
claim they weren't able to change the SPD page, but they did. Neither of
those should be fatal errors.

PR: 235944
Submitted by: Greg V <greg@unrelenting.technology>
Reported by: Greg V <greg@unrelenting.technology>
Reviewed by: cem
MFC after: 1 weeks
Sponsored by: Panasas
Differential Revision: https://reviews.freebsd.org/D19681

5 years agoUse the BUS_DMA_NOWRITE flag to expose and create the read-only VT-d
tychon [Wed, 27 Mar 2019 20:15:51 +0000 (20:15 +0000)]
Use the BUS_DMA_NOWRITE flag to expose and create the read-only VT-d
IOMMU mappings.

Reviewed by: kib
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D19729

5 years agoFix pidfile_open(3) to handle relative paths with multiple components.
markj [Wed, 27 Mar 2019 19:40:18 +0000 (19:40 +0000)]
Fix pidfile_open(3) to handle relative paths with multiple components.

r322369's use of basename(3) was incorrect and worked by accident so
long as the pidfile path was absolute or consisted of a single
component.  Fix the basename() usage and add a regression test.

Reported by: 0mp
Reviewed by: cem
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D19728

5 years agoStop using -fdebug-prefix-map to map the object directory.
markj [Wed, 27 Mar 2019 19:34:19 +0000 (19:34 +0000)]
Stop using -fdebug-prefix-map to map the object directory.

We were doing so as a workaround for the problem addressed by r345593, so
it's no longer necessary.

Reviewed by: jhb
Discussed with: emaste
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D19705

5 years agoPrepend DW_AT_comp_dir to relative line number directory table entries.
markj [Wed, 27 Mar 2019 19:32:21 +0000 (19:32 +0000)]
Prepend DW_AT_comp_dir to relative line number directory table entries.

Relative directories may appear in the line number program for a CPU if
files were included via a relative path, for instance with "-I.".
Previously, dwarf_srclines(3) and dwarf_srcfiles(3) would return the
relative path, so addr2line, for instance, would do the same.  However,
we can get an absolute path by prepending the compilation directory, so
change libdwarf to do that to improve compatibility with GNU binutils
and since it is more useful in general.

Reviewed by: jhb
Discussed with: emaste
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D19705

5 years agoFix accessing pixels under the mouse cursor:
bde [Wed, 27 Mar 2019 18:03:34 +0000 (18:03 +0000)]
Fix accessing pixels under the mouse cursor:

Reading of single pixels didn't look under the cursor.

Copying of 1x1 bitmaps didn't look under the cursor for either reading
or writing.

Copying of larger bitmaps looked under the cursor for at most the
destination.

Copying of larger bitmaps looked under a garbage cursor (for the Display
bitmap) when the destination is a MEMBUF.  The results are not used, so
this only wasted time and flickered the cursor.

Writing of single pixels looked under a garbage cursor for MEMBUF
destinations, as above except this clobbered the current cursor and
didn't update the MEMBUF.  Writing of single pixels is not implemented
yet in depths > 8.  Otherwise, writing of single pixels worked.  It was
the only working case for accessing pixels under the cursor.

Clearing of MEMBUFs wasted time freezing the cursor in the Display bitmap.

The fixes abuse the top bits in the color arg to the cursor freezing
function to control the function.  Also clear the top 8 bits so that
applications can't clobber the control bits or create 256 aliases for
every 24-bit pixel value in depth 32.

Races fixed:

Showing and hiding the cursor only tried to avoid races with the mouse
event signal handler for internal operations.  There are still many
shorter races from not using volatile or sig_atomic_t for the variable
to control this.  This variable also controls freezes, and has more
complicated states than before.

The internal operation of unfreezing the cursor opened a race window
by unsetting the signal/freeze variable before showing the cursor.

5 years agopkgbase: Use uname as ABI_FILE
manu [Wed, 27 Mar 2019 17:55:39 +0000 (17:55 +0000)]
pkgbase: Use uname as ABI_FILE

Add some more missed in r345159

MFC after: 1 week

5 years agorevert r302146: makeroot: zero out subsecond component of time= keywords
emaste [Wed, 27 Mar 2019 17:28:23 +0000 (17:28 +0000)]
revert r302146: makeroot: zero out subsecond component of time= keywords

After r345281 by mhorne subsecond components are supported.

PR: 194703
Sponsored by: The FreeBSD Foundation

5 years agoGrab timer frequency from FDT.
br [Wed, 27 Mar 2019 16:26:03 +0000 (16:26 +0000)]
Grab timer frequency from FDT.

RISC-V timer has no dedicated DTS node and we have to get timer
frequency from cpus node.

Tested on Government Furnished Equipment (GFE) cores synthesized
on Xilinx VCU118.

Reviewed by: markj
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D19727

5 years agoAdd workaround for a QoS-related bug in VMWare Workstation.
des [Wed, 27 Mar 2019 15:17:29 +0000 (15:17 +0000)]
Add workaround for a QoS-related bug in VMWare Workstation.

Submitted by: yuripv
Differential Revision: https://reviews.freebsd.org/D18636

5 years agoMerge r345574 from vendor-crypto:
emaste [Wed, 27 Mar 2019 14:35:38 +0000 (14:35 +0000)]
Merge r345574 from vendor-crypto:

upstream: when checking that filenames sent by the server side

match what the client requested, be prepared to handle shell-style brace
alternations, e.g. "{foo,bar}".

"looks good to me" millert@ + in snaps for the last week courtesy
deraadt@

OpenBSD-Commit-ID: 3b1ce7639b0b25b2248e3a30f561a548f6815f3e

Discussed with: des
Obtained from: OpenSSH-portable 3d896c157c722bc47adca51a58dca859225b5874

5 years agoAdd missing break statements. Coverity CID 1400446.
scottl [Wed, 27 Mar 2019 12:25:46 +0000 (12:25 +0000)]
Add missing break statements.  Coverity CID 1400446.

Reported by: mav

5 years agoFix copying of bitmaps in depths > 8. This fix is complete, except different
bde [Wed, 27 Mar 2019 08:02:55 +0000 (08:02 +0000)]
Fix copying of bitmaps in depths > 8.  This fix is complete, except different
depths for the source and target are not supported.  The bits for higher
numbered planes (mostly for red) were either not copied or were copied to
lower numbered planes for nearby pixels.

Quick fix for creation of mouse cursor bitmaps in all depths.   This fix is
only complete for the default lightwhite cursor with a black frame.

Even the lightwhite and black colors are hard to find.  The templates
use 0xff for lightwhite, but that means brightblue in the simplest mode
(Truecolor depth 24).  Other modes are even more complicated -- they are
singly or doubly indirect throught palette(s) and changing of the palettes
by applications is supported.

Details:

Replicate the template value for Truecolor modes to fill out the target
depth (and more for depths not a multiple of 8).  Do this for every
drawing of the cursor so that it sort of works for mouse cursor bitmaps
set by applications.

Use 0xf for lightwhite in most other modes.  Only do this for the
default cursor so that it doesn't affect mouse cursor bitmaps set by
applications.  0xf mostly works because it was originally for CGA
lightwhite and is emulated using 1 or 2 indirections on EGA and VGA.
0x3f (EGA white) and 0xff (VGA black) direct palette indexes mostly
don't work since backwards compatibility inhibits or prevents them
representing lightwhite.  But 0x3f (EGA white) must be used for mode
37 (VGA_MODEX) (320x240x8 V) since this mode is closer to EGA than VGA.

5 years agox86: Use XSAVEOPT for fpusave(), when available
cem [Tue, 26 Mar 2019 22:45:41 +0000 (22:45 +0000)]
x86: Use XSAVEOPT for fpusave(), when available

Remove redundant npxsave_core definition while here.

Suggested by: Anton Rang
Reviewed by: kib, Anton Rang <rang AT acm.org>
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D19665

5 years agoAdd CTLFLAG_VNET to the net.inet.icmp.tstamprepl definition.
markj [Tue, 26 Mar 2019 22:14:50 +0000 (22:14 +0000)]
Add CTLFLAG_VNET to the net.inet.icmp.tstamprepl definition.

Reported by: Hans Fiedler <hans@hfconsulting.com>
MFC after: 3 days

5 years agopf: use UID_ROOT and GID_WHEEL named constants in make_dev
emaste [Tue, 26 Mar 2019 21:20:42 +0000 (21:20 +0000)]
pf: use UID_ROOT and GID_WHEEL named constants in make_dev

No functional change but improves consistency and greppability of
make_dev calls.

Discussed with: kp

5 years agoAdd special psuedo-options for the base/{binutils,gcc} ports.
jhb [Tue, 26 Mar 2019 20:56:12 +0000 (20:56 +0000)]
Add special psuedo-options for the base/{binutils,gcc} ports.

The WITH_PORT_BASE_{BINUTILS,GCC} options are used to prevent 'make check-old'
and 'make delete-old' from deleting files installed by the base/binutils
and base/gcc packages as normally one disables the in-tree variants
(e.g. WITHOUT_BINUTILS) when using these packages.

Reviewed by: bapt (earlier version)
Differential Revision: https://reviews.freebsd.org/D19483

5 years agoRemove the TIMED src option from the list of options.
jhb [Tue, 26 Mar 2019 20:44:02 +0000 (20:44 +0000)]
Remove the TIMED src option from the list of options.

This was missed in r342139 when timed(8) was removed and fixes a
warning when running makeman to regenerate src.conf.5.

Differential Revision: https://reviews.freebsd.org/D19486

5 years agostand: remove CLANG_NO_IAS from zfsldr
emaste [Tue, 26 Mar 2019 20:32:05 +0000 (20:32 +0000)]
stand: remove CLANG_NO_IAS from zfsldr

Many components under stand/ had CLANG_NO_IAS added when Clang's
Integrated Assembler (IAS) did not handle .codeNN directives.  Clang
gained support quite some time ago, and we can now build stand/ with
IAS.

Note that in some cases there are small differences in the generated
output, so CLANG_NO_IAS should be removed only after testing (or after
finding no differences in the output).  For zfsldr I compared objdump
output between GNU as- and Clang IAS-built zfsldr and .text was
identical (changes were limited to the object's ELF headers and debug
info).

Sponsored by: The FreeBSD Foundation

5 years agoinit: pedantic correction to "can't exec" script warning
emaste [Tue, 26 Mar 2019 19:38:25 +0000 (19:38 +0000)]
init: pedantic correction to "can't exec" script warning

Direct /etc/rc exec was introduced in r337321, with a fallback to
passing it to sh if direct exec fails.  "Can't exec" is slightly
misleading in this case (the script is still executed, just not
directly).

5 years agoDTF_REWIND does nothing (since r247236) so retire its use
emaste [Tue, 26 Mar 2019 19:35:41 +0000 (19:35 +0000)]
DTF_REWIND does nothing (since r247236) so retire its use

Reviewed by: cem
Differential Revision: https://reviews.freebsd.org/D19663

5 years agoImprove error reporting when the swap pager runs out of memory.
trasz [Tue, 26 Mar 2019 19:11:15 +0000 (19:11 +0000)]
Improve error reporting when the swap pager runs out of memory.

Reviewed by: kib
MFC after: 2 weeks
Sponsored by: Klara Inc.
Differential Revision: https://reviews.freebsd.org/D19699

5 years agoChange default value of kern.bootfile to reflect reality
gonzo [Tue, 26 Mar 2019 18:03:18 +0000 (18:03 +0000)]
Change default value of kern.bootfile to reflect reality

In most cases kernel.bootfile is populated from the information
provided by loader(8). There are certain scenarios when loader
is not available, for instance when kernel is loaded by u-boot
or some other BootROM directly. In this case the default value
"/kernel" points to invalid location and breaks some functinality,
like using installkernel on self-hosted system or dtrace's CTF
lookup. This can be fixed by setting the value manually but the
default that reflects correct location is better than default that
points to invalid one.

Current default was set around FreeBSD 1, when "/kernel" was the
actual path. Transition to /boot/kernel/kernel happened circa FreeBSD 3.

PR: 221550
Reviewed by: ian, imp
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D18902

5 years agoMake smartpqi(4) behave better when running out of memory, by returning
trasz [Tue, 26 Mar 2019 15:47:13 +0000 (15:47 +0000)]
Make smartpqi(4) behave better when running out of memory, by returning
CAM_RESRC_UNAVAIL instead of CAM_REQUEUE_REQ.  This makes CAM delay a bit
before retrying, so that the retries actually get a chance to succeed.

Reviewed by: sbruno
MFC after: 2 weeks
Sponsored by: Klara Inc.
Differential Revision: https://reviews.freebsd.org/D19696

5 years ago.Xr trim(8) from dd(1).
trasz [Tue, 26 Mar 2019 15:44:06 +0000 (15:44 +0000)]
.Xr trim(8) from dd(1).

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

5 years agoFactor out resource limit enforcement code in the ELF loader.
trasz [Tue, 26 Mar 2019 15:35:49 +0000 (15:35 +0000)]
Factor out resource limit enforcement code in the ELF loader.
It makes the code slightly easier to follow, and might make
it easier to fix the resouce accounting to also account for
the interpreter.

The PROC_UNLOCK() is moved earlier - I don't see anything
it should protect; the lim_max() is a wrapper around lim_rlimit(),
and that, differently from lim_rlimit_proc(), doesn't require
the proc lock to be held.

Reviewed by: kib
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D19689

5 years agoFix a small bug in the tcp_log_id where the bucket
rrs [Tue, 26 Mar 2019 10:41:27 +0000 (10:41 +0000)]
Fix a small bug in the tcp_log_id where the bucket
was unlocked and yet the bucket-unlock flag was not
changed to false. This can cause a panic if INVARIANTS
is on and we go through the right path (though rare).

Reported by: syzbot+179a1ad49f3c4c215fa2@syzkaller.appspotmail.com
Reviewed by: tuexen@
MFC after: 1 week

5 years agoSZ has been known as Eswatini since April 2018 (formerly Swaziland).
philip [Tue, 26 Mar 2019 09:46:17 +0000 (09:46 +0000)]
SZ has been known as Eswatini since April 2018 (formerly Swaziland).

Sources:
https://www.iso.org/obp/ui/#iso:code:3166:SZ
http://www.un.org/en/member-states/index.html#gotoE
http://www.times.co.sz/news/118373-kingdom-of-eswatini-change-now-official.html

MFC after: 3 days

5 years agoFix a double free of an SCTP association in an error path.
tuexen [Tue, 26 Mar 2019 08:27:00 +0000 (08:27 +0000)]
Fix a double free of an SCTP association in an error path.
This is joint work with rrs@. The issue was found by running
syzkaller.

MFC after: 1 week

5 years agoImport tzdata 2019a
philip [Tue, 26 Mar 2019 08:10:51 +0000 (08:10 +0000)]
Import tzdata 2019a

Changes: https://github.com/eggert/tz/blob/2019a/NEWS

MFC after: 3 days

5 years agopowerpc64: Micro-optimize moea64 native pmap tlbie
jhibbits [Tue, 26 Mar 2019 02:53:35 +0000 (02:53 +0000)]
powerpc64: Micro-optimize moea64 native pmap tlbie

* Cache moea64_need_lock in a local variable; gcc generates slightly better
  code this way, it doesn't need to reload the value from memory each read.
* VPN cropping is only needed on PowerPC ISA 2.02 and older cores, a subset
  of those that need serialization, so move this under the need_lock check,
  so those that don't need the lock don't even need to check this.

5 years agoAllow kernel config to specify DTS/DTSO to build, and out-of-tree support
kevans [Tue, 26 Mar 2019 02:45:23 +0000 (02:45 +0000)]
Allow kernel config to specify DTS/DTSO to build, and out-of-tree support

This allows for directives such as

makeoptions DTS+=/out/of/tree/myboard.dts
# in tree! Same rules applied as if this were in a dtb/ module
makeoptions DTS+=otherboard.dts

to be specified in config(5) and have these built/installed alongside th
kernel. The assumption that overlays live in an overlays/ directory is only
made for in-tree DTSO, but we still make the assumption that out-of-tree
arm64 DTS will be in vendored directories (for now).

This lowers the cost to hacking on an overlay or dts by being able to
quickly throw it in a custom config, especially if it doesn't fit one of the
current dtb/modules quite appropriately or it's not intended for commit
there.

The build/install targets were split out of dtb.mk to centralize the build
logic and leave out the all/realinstall/CLEANFILES additions... it was
believed that we didn't want to pollute the kernel build with these.

The build rules were converted to suffix rules at the suggestion of Ian to
clean things up a little bit in a world where we can have mixed
in-tree/out-of-tree DTS/DTSO specified.

Reviewed by: ian
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D19351

5 years agolualoader: Fix up some luacheck concerns
kevans [Tue, 26 Mar 2019 02:35:58 +0000 (02:35 +0000)]
lualoader: Fix up some luacheck concerns

- Garbage collect an unused (removed because it was useless) constant
- Don't bother with vararg notation if args will not be used

MFC after: 1 week

5 years agolualoader: Clear the screen before prompting for password
kevans [Tue, 26 Mar 2019 02:33:27 +0000 (02:33 +0000)]
lualoader: Clear the screen before prompting for password

Assuming that the autoboot sequence was interrupted, we've done enough
cursor manipulation that the prompt for the password will be sufficiently
obscured a couple of lines up. Clear the screen and reset the cursor
position here, too.

MFC after: 1 week

5 years agoMFV r345515: netbsd-tests: import memory bump for libc/regex/t_exhaust
kevans [Tue, 26 Mar 2019 02:21:09 +0000 (02:21 +0000)]
MFV r345515: netbsd-tests: import memory bump for libc/regex/t_exhaust

MFC after: 3 days

5 years agoRefine r345425: get rid of superfluous helper macro that I have added.
sobomax [Tue, 26 Mar 2019 01:28:10 +0000 (01:28 +0000)]
Refine r345425: get rid of superfluous helper macro that I have added.

MFC after: 2 weeks

5 years agoReject F_SETLK_REMOTE commands when sysid == 0.
markj [Mon, 25 Mar 2019 21:38:58 +0000 (21:38 +0000)]
Reject F_SETLK_REMOTE commands when sysid == 0.

A sysid of 0 denotes the local system, and some handlers for remote
locking commands do not attempt to deal with local locks.  Note that
F_SETLK_REMOTE is only available to privileged users as it is intended
to be used as a testing interface.

Reviewed by: kib
Reported by: syzbot+9c457a6ae014a3281eb8@syzkaller.appspotmail.com
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D19702

5 years agoCorrect contradictory information on default syslog logging priority.
grembo [Mon, 25 Mar 2019 21:14:51 +0000 (21:14 +0000)]
Correct contradictory information on default syslog logging priority.

MFC after: 1 week

5 years agoSort printing of the ID registers on arm64 to be identical to the
andrew [Mon, 25 Mar 2019 18:02:04 +0000 (18:02 +0000)]
Sort printing of the ID registers on arm64 to be identical to the
documentation. This will simplify checking new fields when they are added.

MFC after: 2 weeks
Sponsored by: DARPA, AFRL

5 years agoInitialize scheduler specific data for the FCFS scheduler.
tuexen [Mon, 25 Mar 2019 16:40:54 +0000 (16:40 +0000)]
Initialize scheduler specific data for the FCFS scheduler.
This is joint work with rrs@. The issue was reported by using
syzkaller.

MFC after: 1 week

5 years agoImprove locking when tearing down an SCTP association.
tuexen [Mon, 25 Mar 2019 15:23:20 +0000 (15:23 +0000)]
Improve locking when tearing down an SCTP association.
This is joint work with rrs@ and the issue was found by
syzkaller.

MFC after: 1 week

5 years agoChange all kernel C-type macros into static inline functions.
hselasky [Mon, 25 Mar 2019 13:50:38 +0000 (13:50 +0000)]
Change all kernel C-type macros into static inline functions.

The current kernel C-type macros might obscurely hide the fact that
the input argument might be used multiple times.

This breaks code like:
isalpha(*ptr++)

Use static inline functions instead of macros to fix this.

Reviewed by: kib @
Differential Revision: https://reviews.freebsd.org/D19694
MFC after: 1 week
Sponsored by: Mellanox Technologies

5 years agoMFV r345495:
mm [Mon, 25 Mar 2019 11:49:57 +0000 (11:49 +0000)]
MFV r345495:
Sync libarchive with vendor.

Relevant vendor changes:
  PR #1153: fixed 2 bugs in ZIP reader [1]
  PR #1143: ensure archive_read_disk_entry_from_file() uses ARCHIVE_READ_DISK
  Changes to file flags code, support more file flags on FreeBSD:
    UF_OFFLINE, UF_READONLY, UF_SPARSE, UF_REPARSE, UF_SYSTEM
    UF_ARCHIVE is not supported by intention (yet)

PR: 236300
MFC after: 2 weeks

5 years agoFix another type of buffer overrun for segmented modes. The buffer index
bde [Mon, 25 Mar 2019 11:48:40 +0000 (11:48 +0000)]
Fix another type of buffer overrun for segmented modes.  The buffer index
was not taken modulo the window size in VGLClear().

Segmented modes also need a kernel fix to almost work.  The ioctl to set
the window origin is broken.

These bugs are rarely problems since non-VESA modes only need
segmentation to support multiple pages but libvgl doesn't support
multiple pages and treats these modes as non-segmented, and VESA modes
are usually mapped linearly except on old hardware so they really are
non-segmented.

5 years agoUpdate vendor/libarchive/dist to git 3c079320b23ddf5ef38c443569c25898ad79ddb9
mm [Mon, 25 Mar 2019 11:39:49 +0000 (11:39 +0000)]
Update vendor/libarchive/dist to git 3c079320b23ddf5ef38c443569c25898ad79ddb9

Relevant vendor changes:
  PR #1153: fixed 2 bugs in ZIP reader
  PR #1143: ensure archive_read_disk_entry_from_file() uses ARCHIVE_READ_DISK
  Changes to file flags code, support more file flags on FreeBSD:
    UF_OFFLINE, UF_READONLY, UF_SPARSE, UF_REPARSE, UF_SYSTEM
    UF_ARCHIVE is not supported by intention (yet)

5 years agoFix the handling of fragmented unordered messages when using DATA chunks
tuexen [Mon, 25 Mar 2019 09:47:22 +0000 (09:47 +0000)]
Fix the handling of fragmented unordered messages when using DATA chunks
and FORWARD-TSN.

This bug was reported in https://github.com/sctplab/usrsctp/issues/286
for the userland stack.

This is joint work with rrs@.

MFC after: 1 week

5 years agorun(4): merge some common TSF-related code into run_disable_tsf()
avos [Mon, 25 Mar 2019 09:10:07 +0000 (09:10 +0000)]
run(4): merge some common TSF-related code into run_disable_tsf()

No functional change intended.

MFC after: 5 days

5 years agoThe Atheros AR7241 has 20 GPIO pins
allanjude [Mon, 25 Mar 2019 07:48:52 +0000 (07:48 +0000)]
The Atheros AR7241 has 20 GPIO pins

AR724X_GPIO_PINS used for this family is defined as 18
The datasheet for the AR7241 describes 20 pins, allow all to be used.

Submitted by: Hiroki Mori <yamori813@yahoo.co.jp>
Reviewed by: mizhka
Differential Revision: https://reviews.freebsd.org/D17580

5 years agoMake TMPFS_PAGES_MINRESERVED a kernel option
allanjude [Mon, 25 Mar 2019 07:46:20 +0000 (07:46 +0000)]
Make TMPFS_PAGES_MINRESERVED a kernel option

TMPFS_PAGES_MINRESERVED controls how much memory is reserved for the system
and not used by tmpfs.

On very small memory systems, the default value may be too high and this
prevents these small memory systems from using reroot, which is required
for them to install firmware updates.

Submitted by: Hiroki Mori <yamori813@yahoo.co.jp>
Reviewed by: mizhka
Differential Revision: https://reviews.freebsd.org/D13583

5 years agoApply WITH_PIE changes to other binutils components
emaste [Mon, 25 Mar 2019 01:18:26 +0000 (01:18 +0000)]
Apply WITH_PIE changes to other binutils components

Followon to r345489, explicitly specified bare .a libraries need
${PIE_SUFFIX} (although these still built).

MFC with: r345489

5 years agoFix GNU objdump build under WITH_PIE
emaste [Mon, 25 Mar 2019 01:06:29 +0000 (01:06 +0000)]
Fix GNU objdump build under WITH_PIE

Explicitly specified bare .a libraries need ${PIE_SUFFIX}.

Reported by: David E. Cross, on twitter

5 years agoAdd description for WITHOUT_RETPOLINE
emaste [Sun, 24 Mar 2019 23:26:03 +0000 (23:26 +0000)]
Add description for WITHOUT_RETPOLINE

Not used by default at the moment, but added for the benefit of
downstream projects/branches with different options.

5 years agoOops, my previous commit to libvgl was missing the change of VGLSetBorder()
bde [Sun, 24 Mar 2019 20:43:21 +0000 (20:43 +0000)]
Oops, my previous commit to libvgl was missing the change of VGLSetBorder()
to match the change in its declaration.  Change the declaration back to
"byte color" since setting of the border color is not supported for more
than 256 colors.

5 years agoAdd event table decoding for SAS Broadcast Primitive events.
scottl [Sun, 24 Mar 2019 20:37:37 +0000 (20:37 +0000)]
Add event table decoding for SAS Broadcast Primitive events.

5 years agoFix the type of the color args for VGLMouseFreeze(), VGLBitmapPutChar(),
bde [Sun, 24 Mar 2019 20:36:35 +0000 (20:36 +0000)]
Fix the type of the color args for VGLMouseFreeze(), VGLBitmapPutChar(),
VGLBitmapString() and VGLSetBorder() so as to not truncate to 8 bits.

Complete the corresponding fix for VGLGetXY() and VGLPutXY() (parts
of the man page were out of date).

5 years agoAdd support for arbitrary font widths. Only multiples of 8 were supported.
bde [Sun, 24 Mar 2019 19:41:45 +0000 (19:41 +0000)]
Add support for arbitrary font widths.  Only multiples of 8 were supported.

Since the font format is undocumented, it is unclear how non-multiples
of 8 should be padded to bytes in the font file.  Use the same
representation as bdf text format (big- endian, with padding in the
lower bits).

5 years agoFix a transposition error from the previous commit
scottl [Sun, 24 Mar 2019 19:29:30 +0000 (19:29 +0000)]
Fix a transposition error from the previous commit

5 years agoFix reading of pixels in (4 and 8-plane) planar modes.
bde [Sun, 24 Mar 2019 19:27:03 +0000 (19:27 +0000)]
Fix reading of pixels in (4 and 8-plane) planar modes.

There seems to be no alternative to reading each plane independently using
3 slow i/o's per plane (this delivers 8 nearby pixels, but we don't buffer
the results so run 8 times slower than necessary.

All the code for this was there, but it was ifdefed out and replaced by
simpler code that cannot work in planar modes.  The ifdefed out code
was correct except it was missing a volatile declaration, so compilers
optimized the multiple dummy reads in it to a single read.