dragonfly.git
8 years agoMerge branch 'vendor/NCURSES'
John Marino [Fri, 11 Mar 2016 20:00:32 +0000 (21:00 +0100)]
Merge branch 'vendor/NCURSES'

8 years agoTemporarily revert contrib/ncurses local mods for upgrade
John Marino [Fri, 11 Mar 2016 18:58:00 +0000 (19:58 +0100)]
Temporarily revert contrib/ncurses local mods for upgrade

8 years agonrelease - Update to dhcp43-server
Matthew Dillon [Fri, 11 Mar 2016 18:46:00 +0000 (10:46 -0800)]
nrelease - Update to dhcp43-server

* dhcp42-server was removed from ports, use dhcp43-server now.

8 years agoUpdate ncurses from version 5.9 to 6.0 (5 MARCH 2016) gitea/vendor/NCURSES origin/vendor/NCURSES
John Marino [Fri, 11 Mar 2016 18:35:17 +0000 (19:35 +0100)]
Update ncurses from version 5.9 to 6.0 (5 MARCH 2016)

8 years agonrelease: Allow to build snapshots on tmpfs.
zrj [Thu, 10 Mar 2016 08:43:31 +0000 (10:43 +0200)]
nrelease: Allow to build snapshots on tmpfs.

/usr/libexec/locate.updatedb excludes files residing on tmpfs.
That causes an empty locate db failure just before the end of
customizeiso target and leaves a dangling ${ISOROOT}/dev mount.

By permitting updatedb to fail, the requirement for ISOROOT
to be on ufs/hammer fs is lifted.

8 years agobsd.cpu.gcc(47|50).mk: Return support for CPUTYPE i386
John Marino [Wed, 9 Mar 2016 15:22:50 +0000 (16:22 +0100)]
bsd.cpu.gcc(47|50).mk: Return support for CPUTYPE i386

The /boot loader and friends are still 32-bit.  While -m32 -march=native
should be okay in most cases, let's return limited support for
CPUTYPE=i386 which is explicitly specified in the world make files
through the use of FORCE_CPUTYPE.

Since this is only to support the bases /boot functionality, only the
generic i386 cpu is supported.  It's not intended for non-base use.

suggested by: zrj

8 years agodloader: Build i386 version for the bios bootloader as libdloader32.a.
Imre Vadász [Tue, 8 Mar 2016 23:08:56 +0000 (00:08 +0100)]
dloader: Build i386 version for the bios bootloader as libdloader32.a.

* sys/boot/pc32/loader and sys/boot/pc32/loader_tftp now link against
  libdloader32.a instead of libdloader.a.

* The libdloader.a from sys/boot/dloader is now built for x86_64.

8 years agolibstand: Build libstand for x86_64, and libstand32 for the bios loader.
Imre Vadász [Sun, 6 Mar 2016 21:39:48 +0000 (22:39 +0100)]
libstand: Build libstand for x86_64, and libstand32 for the bios loader.

* lib/libstand.a is now built for the native CPU architecture. The i386
  version is now built in sys/boot/libstand32 as an INTERNALLIB for usage
  in the BIOS bootloader.

* This makes the existing BIOS bootloader (from sys/boot/loader and
  sys/boot/loader_tftp) use the separately built libstand32.a instead of
  libstand.a.

* We now install an x86_64 version of libstand.a into world.

8 years agolibstand: Use new LIBSTAND_SRC and LIBSTAND_ARCH variables in makefiles.
Imre Vadász [Sun, 6 Mar 2016 21:21:27 +0000 (22:21 +0100)]
libstand: Use new LIBSTAND_SRC and LIBSTAND_ARCH variables in makefiles.

* Make it easier to include lib/libstand/Makefile for building different
  variants of libstand. Preparation for adding sys/boot/libstand32.

8 years agosys/boot: Push down Makeflags setting into dloader and pc32 subdirectories.
Imre Vadász [Tue, 8 Mar 2016 00:50:31 +0000 (01:50 +0100)]
sys/boot: Push down Makeflags setting into dloader and pc32 subdirectories.

* We need to build both i386 and x86_64 binaries in sys/boot for UEFI
  support. For this we need to move the .Makeflags usages one level deeper
  into sys/boot/dloader/Makefile and sys/boot/pc32/Makefile respectively.

8 years agoncurses solidation: Remove all references to libtermcap
John Marino [Wed, 9 Mar 2016 16:14:56 +0000 (17:14 +0100)]
ncurses solidation: Remove all references to libtermcap

The termlib, termcap, and tinfo libraries are all symlinked to ncurses
library.  There's no reason to have four aliases for the same library
when none of them are exposed outside base.

termlib and tinfo aren't referenced anywhere, but libtermcap is.
This commit changes all the references to libtermcap to libncurses,
and removes the private aliases of ncurses.

8 years agobnx: Don't use thread template
Sepherosa Ziehau [Wed, 9 Mar 2016 12:28:07 +0000 (20:28 +0800)]
bnx: Don't use thread template

Mainly to avoid lwkt_exit and bnx_softc free race.

8 years agodports(7): Document default WRKDIRPREFIX value
François Tigeot [Tue, 8 Mar 2016 21:32:08 +0000 (22:32 +0100)]
dports(7): Document default WRKDIRPREFIX value

Reported-by: lepot on irc
8 years agokernel/sysctl: Add SYSCTL_OUT_STR()
François Tigeot [Tue, 8 Mar 2016 20:00:13 +0000 (21:00 +0100)]
kernel/sysctl: Add SYSCTL_OUT_STR()

Obtained-from: FreeBSD

8 years ago<sys/select.h>: Provide timespec structure.
zrj [Mon, 7 Mar 2016 14:32:52 +0000 (16:32 +0200)]
<sys/select.h>: Provide timespec structure.

As per POSIX specs.

8 years agoRework the CPU Makefile for GCC 4.7, too.
Sascha Wildner [Mon, 7 Mar 2016 19:18:07 +0000 (20:18 +0100)]
Rework the CPU Makefile for GCC 4.7, too.

Due to the previous version's passing of unknown CPUTYPEs just
through to -march, a buildworld with for example CPUTYPE=haswell
(which is known by 5.3.0 but not by 4.7.4) would fail for files
that are compiled with gcc47 in the buildworld.

8 years agoAdd a manual page for exec_sys_{,un}register() system calls.
Sascha Wildner [Mon, 7 Mar 2016 19:17:34 +0000 (20:17 +0100)]
Add a manual page for exec_sys_{,un}register() system calls.

8 years agoAdjust markup of defined values to .Dv in various manual pages.
Sascha Wildner [Mon, 7 Mar 2016 19:16:33 +0000 (20:16 +0100)]
Adjust markup of defined values to .Dv in various manual pages.

8 years agoUn-__P() <opie.h>, which is a public header.
Sascha Wildner [Mon, 7 Mar 2016 19:16:31 +0000 (20:16 +0100)]
Un-__P() <opie.h>, which is a public header.

8 years agokqueue: Clear sleep counter before wakeup
Sepherosa Ziehau [Mon, 7 Mar 2016 12:43:17 +0000 (20:43 +0800)]
kqueue: Clear sleep counter before wakeup

8 years agokqueue: Make sure that kqueue sleep counter will not wrap around
Sepherosa Ziehau [Mon, 7 Mar 2016 12:26:11 +0000 (20:26 +0800)]
kqueue: Make sure that kqueue sleep counter will not wrap around

8 years agosys/kern: Change "bufcache" to "buffer cache" in warning message
Tomohiro Kusumi [Sat, 5 Mar 2016 10:57:34 +0000 (19:57 +0900)]
sys/kern: Change "bufcache" to "buffer cache" in warning message

It's better with "buffer cache".
This is the only "bufcache".

 # grep "bufcache" sys/ -rI
 sys/kern/vfs_bio.c:                         "during bufcache page allocation from %s\n",
 # grep "buffer cache" sys/ -rI | wc -l
      214

8 years agosbin/hammer: Cleanup beginning part of hammer show
Tomohiro Kusumi [Sat, 5 Mar 2016 08:50:44 +0000 (17:50 +0900)]
sbin/hammer: Cleanup beginning part of hammer show

to make the format a bit more understandable compared
to the original format, since search directives for
lo:obj_id:rt:key:tid have been available for a while.
It's confusing to print these directives along with other
arguments in a single line.

8 years agosbin/hammer: Cleanup long lines with >80 chars
Tomohiro Kusumi [Sat, 5 Mar 2016 08:27:05 +0000 (17:27 +0900)]
sbin/hammer: Cleanup long lines with >80 chars

8 years agosbin/hammer: Don't access beyond 16KB of HAMMER userspace buffer
Tomohiro Kusumi [Fri, 4 Mar 2016 16:08:46 +0000 (01:08 +0900)]
sbin/hammer: Don't access beyond 16KB of HAMMER userspace buffer

HAMMER userspace only supports upto 16KB buffer size while HAMMER
filesystem itself supports both 16KB and 64KB. This means even if
a leaf node elm says the record data is >16KB, HAMMER userspace can
only retrieve the first 16KB of the record data. Anything beyond
16KB is not supported (not malloc'd in userspace).

print_record() in hammer show is passing a pointer to maximum 16KB
buffer to hexdump(3), but is also passing data_len which is taken
from elm->leaf.data_len. This becomes an issue when the file size
is >1MB where HAMMER starts to use 64KB buffer for data beyond 1MB.
elm->leaf.data_len will typically say the length is 64KB, but
the maximum HAMMER userspace can handle is still 16KB regardless
of what the leaf node elm says. hammer show needs to omit anything
beyond 16KB (for now).

 # hammer -vvvv -f /dev/da1:/dev/da2:/dev/da3 show > /dev/null
 zsh: segmentation fault (core dumped)  hammer -vvvv -f /dev/da1:/dev/da2:/dev/da3 show > /dev/null

8 years agosbin/hammer: Minor fix for hammer(8) manpage
Tomohiro Kusumi [Fri, 4 Mar 2016 13:58:30 +0000 (22:58 +0900)]
sbin/hammer: Minor fix for hammer(8) manpage

8 years agosbin/hammer: Add num_bad_rec counter to hammer show
Tomohiro Kusumi [Thu, 3 Mar 2016 17:49:50 +0000 (02:49 +0900)]
sbin/hammer: Add num_bad_rec counter to hammer show

Add a counter for CRC error and blockmap offset error for records
in addition to counters for nodes and elms. Bad records has been
checked by hammer show, but the result wasn't printed like other two.

8 years agosbin/hammer: Cleanup error string formats for records' crc error
Tomohiro Kusumi [Thu, 3 Mar 2016 16:51:03 +0000 (01:51 +0900)]
sbin/hammer: Cleanup error string formats for records' crc error

Also make it grep friendly with "error=%s" format.

8 years agosbin/hammer: Fix indentation of config data output
Tomohiro Kusumi [Thu, 3 Mar 2016 20:21:51 +0000 (05:21 +0900)]
sbin/hammer: Fix indentation of config data output

Align config data with " before and after the data.
Otherwise hammer show generates output that looks as if
each line of config data starts with two spaces "  ".

8 years agosbin/hammer: Fix trailing blank line in config data output
Tomohiro Kusumi [Thu, 3 Mar 2016 20:11:11 +0000 (05:11 +0900)]
sbin/hammer: Fix trailing blank line in config data output

hammer show needs to ignore the last string "" after strsep(3)
replaces \n at the end of config data with \0, in order not to
print an extra blank line that shouldn't be printed.

(This also ignores the real blank line, but there are usually
no blank lines in config data)

8 years agosbin/hammer: Fix wrong config data field name
Tomohiro Kusumi [Thu, 3 Mar 2016 18:19:07 +0000 (03:19 +0900)]
sbin/hammer: Fix wrong config data field name

bc5af92e changed the name of char[] field from "text" to "stext",
which was wrong. Change it back to "text".

8 years agosbin/hammer: Don't modify buffer_info for config data for no reason
Tomohiro Kusumi [Wed, 2 Mar 2016 16:32:15 +0000 (01:32 +0900)]
sbin/hammer: Don't modify buffer_info for config data for no reason

print_config() introduced by bc5af92e modifies the data part
of buffer_info via strsep(3). No other part of hammer show
modifies data read from block devices obviously because the
command is supposed to be a read-only command.

Although it's still safe to modify the data part as long as
modified flag isn't set to 1, it's just safer to strdup(3)
the data part before calling print_config(). If someone ever
sets modified flag for some reason, calling print_config()
will break the filesystem.

8 years agosbin/hammer: Cleanup and squash inode record format of hammer show
Tomohiro Kusumi [Wed, 2 Mar 2016 17:40:01 +0000 (02:40 +0900)]
sbin/hammer: Cleanup and squash inode record format of hammer show

Inode information was taking too many lines for no reason.
Squash three lines into two and also add atime= in addition to
mtime= and ctime=.

8 years agosbin/hammer: Make hammer show print record type in text
Tomohiro Kusumi [Wed, 2 Mar 2016 15:53:12 +0000 (00:53 +0900)]
sbin/hammer: Make hammer show print record type in text

hammer show prints "dir-entry" for each directory entry record.
Do the same for the rest of record types, e.g. "inode".

Add indentation for lines that show record information.

Makes the result a bit more readable for anyone who doesn't
know or memorize what rt=%02x type means.

8 years agosbin/hammer: Cleanup and squash elm format of hammer show
Tomohiro Kusumi [Tue, 1 Mar 2016 16:38:21 +0000 (01:38 +0900)]
sbin/hammer: Cleanup and squash elm format of hammer show

Fix possible trailing whitespace after object type field.

Record information was taking too many lines for no reason.
Squash three lines (ot=, dataoff=, fill=) into one.
Record type dependent part is printed from the next line.

8 years agosbin/hammer: Add obfuscate option to hammer show
Tomohiro Kusumi [Sat, 5 Mar 2016 05:44:21 +0000 (14:44 +0900)]
sbin/hammer: Add obfuscate option to hammer show

Add an option not to print directory entry name so that users
can send hammer show output to someone else if necessary
without making public their name. Most users never use hammer
show, but some users do and see errors in it.

By default hammer show printfs directory entry name like
 dir-entry ino=00000001007a933b lo=00000000 name="hammer.c"
but by using this option it would be like
 dir-entry ino=00000001007a933b lo=00000000

Note that hammer show command is a subcommand of /sbin/hammer,
so this option is not a part of getopt(3) options. It needs
to be used as follows if one does not need to filter btree.
 # hammer -f /dev/da1:/dev/da2:/dev/da3 show none none obfuscate

Also note that this option is not written in hammer(8) manpage
just like filter/nofilter option is not written.

8 years agosbin/hammer: Use sizeof(*elm)
Tomohiro Kusumi [Wed, 2 Mar 2016 13:56:28 +0000 (22:56 +0900)]
sbin/hammer: Use sizeof(*elm)

8 years agosbin/hammer: Use HAMMER_OFF_BAD
Tomohiro Kusumi [Tue, 1 Mar 2016 13:28:45 +0000 (22:28 +0900)]
sbin/hammer: Use HAMMER_OFF_BAD

8 years agosys/vfs/hammer: Add missing hammer_crc_set_btree()
Tomohiro Kusumi [Wed, 2 Mar 2016 15:08:25 +0000 (00:08 +0900)]
sys/vfs/hammer: Add missing hammer_crc_set_btree()

set_btree is the only one missing in pairs of set/test crc functions,
though other set functions are not inlined.

8 years agosys/vfs/hammer: Don't use HAMMER_CURSOR_GET_LEAF
Tomohiro Kusumi [Tue, 1 Mar 2016 17:29:09 +0000 (02:29 +0900)]
sys/vfs/hammer: Don't use HAMMER_CURSOR_GET_LEAF

HAMMER_CURSOR_GET_LEAF is not used by the current implementation
of hammer_btree_extract(), since this function will cause
cursor->leaf to point to the node element in question regardless
of the flag value. Then just don't use this flag when calling
hammer_btree_extract() when we know loading node element (leaf)
is the default behavior.

The cursor flag is already complicated enough, so simplifying
btree extract callers by either passing 0 or DATA but not LEAF
makes things a bit more clear.

8 years agosys/vfs/hammer: Add hammer_btree_extract_data() [2/2]
Tomohiro Kusumi [Sun, 28 Feb 2016 15:29:59 +0000 (00:29 +0900)]
sys/vfs/hammer: Add hammer_btree_extract_data() [2/2]

This commit replaces
hammer_btree_extract(cursor, HAMMER_CURSOR_GET_DATA)
with
hammer_btree_extract_data(&cursor)
which are the remaining ones from the previous commit.

From the way hammer_btree_extract_data() is implemented,
hammer_btree_extract(cursor, HAMMER_CURSOR_GET_DATA)
is the same as
hammer_btree_extract(cursor, HAMMER_CURSOR_GET_LEAF | HAMMER_CURSOR_GET_DATA)
and it probably should have been (LEAF | DATA) instead of just DATA,
according to the way hammer_get_inode(), hammer_update_inode() and
hammer_update_itimes() set cursor flag. It's either LEAF or
(LEAF | DATA), but not just DATA that makes sense on calling
hammer_btree_extract().

8 years agosys/vfs/hammer: Add hammer_btree_extract_data() [1/2]
Tomohiro Kusumi [Sun, 28 Feb 2016 15:25:03 +0000 (00:25 +0900)]
sys/vfs/hammer: Add hammer_btree_extract_data() [1/2]

hammer_btree_extract() reads data from block devices if flag
has HAMMER_CURSOR_GET_DATA. It doesn't really matter if the flag
is HAMMER_CURSOR_GET_DATA or (LEAF | DATA) as long as the flag
has HAMMER_CURSOR_GET_DATA. Calling this function will cause
cursor->leaf to point to the node element in question regardless
of the flag value.

This commit adds hammer_btree_extract_data() which is just a
wrapper over hammer_btree_extract(cursor, LEAF | DATA).
This commit replaces those with (LEAF | DATA).

8 years agosys/vfs/hammer: Add hammer_btree_extract_leaf()
Tomohiro Kusumi [Sun, 28 Feb 2016 15:05:10 +0000 (00:05 +0900)]
sys/vfs/hammer: Add hammer_btree_extract_leaf()

hammer_btree_extract() doesn't read data from block devices
unless flag has HAMMER_CURSOR_GET_DATA. It doesn't really matter
if the flag is HAMMER_CURSOR_GET_LEAF or not in order to just
extract the node element (without reading data) as long as the
flag doesn't have HAMMER_CURSOR_GET_DATA. Calling this function
will cause cursor->leaf to point to the node element in question
regardless of the flag value.

This commit adds hammer_btree_extract_leaf() which is just a
wrapper over hammer_btree_extract(cursor, HAMMER_CURSOR_GET_LEAF).
This hides complexity of using HAMMER_CURSOR_GET_LEAF or 0 or
anything other than HAMMER_CURSOR_GET_DATA which are all the same.

8 years agohammer - Fix coredump bug which can stall processes
Matthew Dillon [Sat, 5 Mar 2016 03:17:28 +0000 (19:17 -0800)]
hammer - Fix coredump bug which can stall processes

* Fix a coredump bug which can stall the process.  If a process > 100MB is
  in the process of being coredumped, a signal will cause the hammer_write()
  path to hit tstop() due to the core-dump being in progress.  Unfortunately
  the write might be happening from the kernel core generator itself which
  will stall the process forever with a number of locks held.

  hammer only checks for signals on very large (> 100MB) read() and write()
  calls so the issue does not effect coredumps of smaller processes.

* Use CURSIG_NOBLOCK() instead of CURSIG().

8 years agoClean up some manual pages (mainly .Dv related).
Sascha Wildner [Fri, 4 Mar 2016 18:27:44 +0000 (19:27 +0100)]
Clean up some manual pages (mainly .Dv related).

8 years agokqueue: Add simple per-cpu cache for the knote
Sepherosa Ziehau [Fri, 4 Mar 2016 16:06:43 +0000 (00:06 +0800)]
kqueue: Add simple per-cpu cache for the knote

This moves the malloc(M_WAITOK) out of the kqueue token for most of
the time.  This significantly reduces the kqueue token contention when
TCP connect rate is @395Kconns/s on connect side: contention rate
dropped from ~150K/s to ~50K/s.

8 years agokqueue: Only allow one thread to register event to a kqueue
Sepherosa Ziehau [Fri, 4 Mar 2016 14:15:54 +0000 (22:15 +0800)]
kqueue: Only allow one thread to register event to a kqueue

This prevents various races on the registration path, if it
ever blocks (kq token will be released):
- Kqueue hash table creation; the malloc(M_WAIT) could block.
- Install a new event.  Holding the token protect the klist could block.

Since kqueue _should_ rarely be shared between threads, allowing one
thread to do the event registration to a kqueue can work well enough.

8 years agoRewrite bsd.cpu.gcc50.mk (new cpus types; i386 removed)
John Marino [Fri, 4 Mar 2016 09:35:13 +0000 (10:35 +0100)]
Rewrite bsd.cpu.gcc50.mk (new cpus types; i386 removed)

The bsd.cpu.gcc50.mk should have been reworked when gcc50 came into
base.  The gcc47 version was such an unmaintainable mess (despite putting
a lot of time into it) that the gcc50 version was just copied from it as
a "good enough" solution that required work later.  It's time to pay the
piper.  I've almost rewritten it from scratch with a goal of comprehension
and maintainability.

- All 32-bit architectures were removed
- CPU types are formally defined per architecture.  If somebody tries to
  define CPUTYPE to an unrecognized value, the native march flag will be
  set with generic features for that architecture.  It will not propagate
  values that gcc50 doesn't understand (as it did previously)
- Support for several new cpus have been added.
- For x86_64 (the only arch currently supported on DF), the recognized
  CPUTYPE values are:
    * athlon64       (aka k8, opteron, athlon-fx)
    * athlon64-sse3  (aka k8-sse3, opteron-sse3)
    * barcelona      (aka amdfam10)
    * bdver(1|2|3|4)
    * bonnell
    * broadwell
    * btver(1|2)
    * core2
    * haswell
    * ivybridge
    * knl
    * nocona
    * nehalem
    * sandybridge
    * silvermont
    * skylake
    * skylake-avx512
    * westmere
    * znver1
- The method for defining CPU features was reworked.  The new method
  removes a ton of repetition by allowing CPU features to be build on
  other CPUs.  It's more readable and easy to add new ones.  The trade-off
  is that when CPUTYPE is defined to a legal value, the mk file will
  define features for all CPUs internal (OTOH, condition chain is gone).
- CPU feature has been made fully complete based on GCC 5.3 documention
- Adding new architectures will be easy using x86_64 as a template
- General makefile improvements were made

When CPUTYPE is not defined (which is the default), this version of the
makefile is functionally identical to the previous versions.  Most of the
improvements are only executed when CPUTYPE type is defined in arguments
or /etc/make.conf

8 years agolibstand: Fix qdivrem.c on x86_64. Don't assume sizeof(int) == sizeof(long).
Imre Vadasz [Wed, 2 Mar 2016 21:24:21 +0000 (22:24 +0100)]
libstand: Fix qdivrem.c on x86_64. Don't assume sizeof(int) == sizeof(long).

* Adds two _Static_asserts() to check if the assumptions of this code
  actually hold.

Taken-From: FreeBSD

8 years agokqueue: Use wakeup_one based on # of threads sleep on kqueue
Sepherosa Ziehau [Wed, 2 Mar 2016 14:39:29 +0000 (22:39 +0800)]
kqueue: Use wakeup_one based on # of threads sleep on kqueue

Get rid of the sysctl to set wakeup_one optimization.  This also
unbreaks the case when wakeup_one optimization is enabled, and
multiple threads share and sleep on one kqueue.

8 years agoLocal adjustments for OpenSSL 1.0.1s.
Sascha Wildner [Wed, 2 Mar 2016 09:33:30 +0000 (10:33 +0100)]
Local adjustments for OpenSSL 1.0.1s.

8 years agoMerge branch 'vendor/OPENSSL'
Sascha Wildner [Wed, 2 Mar 2016 09:32:33 +0000 (10:32 +0100)]
Merge branch 'vendor/OPENSSL'

8 years agoImport OpenSSL 1.0.1s.
Sascha Wildner [Wed, 2 Mar 2016 09:31:53 +0000 (10:31 +0100)]
Import OpenSSL 1.0.1s.

* Fix CVE-2016-0800, CVE-2016-0705, CVE-2016-0798, CVE-2016-0797,
  CVE-2016-0799, CVE-2016-0702

* Disable weak ciphers in SSLv3 and up in default builds of OpenSSL.

For a more detailed list of changes, see crypto/openssl/CHANGES.

8 years agolib/libstand: Remove special lib/libstand/machine headers.
Imre Vadasz [Mon, 29 Feb 2016 20:14:44 +0000 (21:14 +0100)]
lib/libstand: Remove special lib/libstand/machine headers.

* stdarg.h was identical

* stdint.h stuff was already included in sys/cpu/x86_64/include/stdint.h.

* endian.h is obsoleted by the sys/cpu/x86_64/include/endian.h.

* Added #ifdef-s to sys/cpu/x86_64/include/asm.h to handle the __i386__
  case.

* No need for CFLAGS+= -I${.CURDIR} in lib/libstand/Makefile anymore.

8 years agouname(1): The maximum length for a varsym value is MAXVARSYM_DATA.
Sascha Wildner [Tue, 1 Mar 2016 20:59:10 +0000 (21:59 +0100)]
uname(1): The maximum length for a varsym value is MAXVARSYM_DATA.

8 years agouname(3): Make uname() honor varsym variables too.
Sascha Wildner [Tue, 1 Mar 2016 20:58:34 +0000 (21:58 +0100)]
uname(3): Make uname() honor varsym variables too.

Just like uname(1) does.

8 years agortadv{d,ctl}(8): Resolve some __FreeBSD__/__FreeBSD_version checks.
Sascha Wildner [Tue, 1 Mar 2016 20:28:08 +0000 (21:28 +0100)]
rtadv{d,ctl}(8): Resolve some __FreeBSD__/__FreeBSD_version checks.

Discussed-with: sephe
Tested-by: profmakx
8 years agovi(1): Raise WARNS to 1.
Sascha Wildner [Sun, 28 Feb 2016 22:40:19 +0000 (23:40 +0100)]
vi(1): Raise WARNS to 1.

Anything should survive 1.

8 years agomake(1): Raise WARNS to 6.
Sascha Wildner [Sun, 28 Feb 2016 22:39:39 +0000 (23:39 +0100)]
make(1): Raise WARNS to 6.

8 years agosvc(8): Clean up the Makefile a bit.
Sascha Wildner [Sun, 28 Feb 2016 22:39:34 +0000 (23:39 +0100)]
svc(8): Clean up the Makefile a bit.

* Remove redundant LDADD, we already add -pthread. Add DPADD instead for
  properly dependencies.

* Remove commented out WARNS=2. It is 6 without specifying anything.

8 years agoping6(8): Fix a -Wcast-qual warning with a cast and raise WARNS to 6.
Sascha Wildner [Sun, 28 Feb 2016 22:36:44 +0000 (23:36 +0100)]
ping6(8): Fix a -Wcast-qual warning with a cast and raise WARNS to 6.

8 years agoldd(1): Fix some warnings, raise WARNS to 6, further cleanup.
Sascha Wildner [Sun, 28 Feb 2016 20:50:56 +0000 (21:50 +0100)]
ldd(1): Fix some warnings, raise WARNS to 6, further cleanup.

* Remove remaining a.out support.

* Nuke some orphaned externs.

* Remove (void) casts.

* Use ssize_t for read(2)'s return value.

8 years agostat(1): Sync with FreeBSD, bump WARNS to 6.
Sascha Wildner [Sun, 28 Feb 2016 20:16:57 +0000 (21:16 +0100)]
stat(1): Sync with FreeBSD, bump WARNS to 6.

* Add -H to stat.

* Add -f to readlink.

* Various improvements and bug fixes.

Taken-from: FreeBSD

8 years agosys/vfs/hammer: Rename hammer_directory_namekey() to hammer_direntry_namekey()
Tomohiro Kusumi [Sun, 28 Feb 2016 10:32:58 +0000 (19:32 +0900)]
sys/vfs/hammer: Rename hammer_directory_namekey() to hammer_direntry_namekey()

The name of this function should be hammer_direntry_namekey()
since it's only used with directory entry rectype, but not
directories as an object type.
(Note that rectype for directory entry is HAMMER_RECTYPE_DIRENTRY)

8 years agosys/vfs/hammer: Rename hammer_ip_del_directory() to hammer_ip_del_direntry()
Tomohiro Kusumi [Sun, 28 Feb 2016 10:30:55 +0000 (19:30 +0900)]
sys/vfs/hammer: Rename hammer_ip_del_directory() to hammer_ip_del_direntry()

The name "hammer_ip_del_directory" is confusing in the sense that
it sounds like the function deletes a directory as an object type.
What this function actually does is delete a directory entry which
is different from a directory as an object type.
(Note that rectype for directory entry is HAMMER_RECTYPE_DIRENTRY)

8 years agosys/vfs/hammer: Rename hammer_ip_add_directory() to hammer_ip_add_direntry()
Tomohiro Kusumi [Sun, 28 Feb 2016 10:28:46 +0000 (19:28 +0900)]
sys/vfs/hammer: Rename hammer_ip_add_directory() to hammer_ip_add_direntry()

The name "hammer_ip_add_directory" is confusing in the sense that
it sounds like the function adds a directory as an object type.
What this function actually does is add a directory entry which
is different from a directory as an object type.
(Note that rectype for directory entry is HAMMER_RECTYPE_DIRENTRY)

8 years agosys/vfs/hammer: Rename struct hammer_entry_data to hammer_direntry_data
Tomohiro Kusumi [Sun, 28 Feb 2016 10:04:34 +0000 (19:04 +0900)]
sys/vfs/hammer: Rename struct hammer_entry_data to hammer_direntry_data

hammer_entry_data is a structure for dirctory entry, so it's
simply more understandable if the name was hammer_direntry_data.
(Note that rectype for directory entry is HAMMER_RECTYPE_DIRENTRY)

This change does not affect userspace since userspace applications
never use (and should never use) this structure, except for some
sbin/hammer commands. sbin/hammer/cmd_recover.c is the only file
that refers to the name of this structure.

8 years agosys/vfs/hammer: Fix comment
Tomohiro Kusumi [Sat, 27 Feb 2016 19:11:19 +0000 (04:11 +0900)]
sys/vfs/hammer: Fix comment

This comment made by 66325755 in 2007 seems to be wrong today.
There is no code that indicates parent inode# == 0 means it's
deleted, or treats it as deleted.

8 years agovkernel.7: Improve formatting (also of usage(), while here).
Sascha Wildner [Sun, 28 Feb 2016 09:41:38 +0000 (10:41 +0100)]
vkernel.7: Improve formatting (also of usage(), while here).

8 years agosbin/hammer: Reword "llid" to "pfs_id"
Tomohiro Kusumi [Sat, 27 Feb 2016 16:07:28 +0000 (01:07 +0900)]
sbin/hammer: Reword "llid" to "pfs_id"

This file is the only one using "llid" instead of "pfs_id".
Not sure what llid stands for, but this is apparently PFS id,
so rename it to more common and obvious pfs_id.

8 years agosbin/hammer: Use HAMMER_OBJID_ROOT for root inode
Tomohiro Kusumi [Sat, 27 Feb 2016 03:29:28 +0000 (12:29 +0900)]
sbin/hammer: Use HAMMER_OBJID_ROOT for root inode

8 years agosys/vfs/hammer: Add hammer_is_pfs_{master|slave|deleted}()
Tomohiro Kusumi [Thu, 25 Feb 2016 19:09:23 +0000 (04:09 +0900)]
sys/vfs/hammer: Add hammer_is_pfs_{master|slave|deleted}()

Makes code more readable, but introducing these macros could
make |= and &=~ unclear by hiding &.
There are a few |= and &=~ but not many.

8 years agolib/libhammer: Add CFLAGS+= -I${.CURDIR}/../../sys
Tomohiro Kusumi [Sat, 27 Feb 2016 02:13:36 +0000 (11:13 +0900)]
lib/libhammer: Add CFLAGS+= -I${.CURDIR}/../../sys

so libhammer includes headers under the working tree instead of
/usr/include/...

8 years agosbin/hammer: Printf "PFS" instead of "pfs"
Tomohiro Kusumi [Sat, 27 Feb 2016 01:43:14 +0000 (10:43 +0900)]
sbin/hammer: Printf "PFS" instead of "pfs"

The existing printfs as well as hammer(5) use "PFS" unless
it's a part of command name like "pfs-master".

8 years agosys/boot/pc32: Update smbios code a bit, needed for the UEFI bootloader.
Imre Vadász [Sat, 27 Feb 2016 12:54:04 +0000 (13:54 +0100)]
sys/boot/pc32: Update smbios code a bit, needed for the UEFI bootloader.

* The void smbios_detect(const caddr_t addr) declaration is moved to a
  separate smbios.h header.

* Since smbios_match() isn't needed yet, this change omits importing that
  code from FreeBSD for now.

Taken-From: FreeBSD

8 years agosys/boot/common: Fix a pointer type mismatch when building for x86_64.
Imre Vadasz [Sat, 27 Feb 2016 10:18:51 +0000 (11:18 +0100)]
sys/boot/common: Fix a pointer type mismatch when building for x86_64.

8 years agosys/boot/common: Add some casts to fix warnings when building for x86_64.
Imre Vadasz [Fri, 26 Feb 2016 21:19:23 +0000 (22:19 +0100)]
sys/boot/common: Add some casts to fix warnings when building for x86_64.

Inspired-By: FreeBSD
8 years agoipfw3: update rule in func skipto
Bill Yuan [Fri, 26 Feb 2016 23:17:28 +0000 (23:17 +0000)]
ipfw3: update rule in func skipto

8 years agoipfw3: new feature 'ipfwsync'
Bill Yuan [Fri, 26 Feb 2016 22:48:37 +0000 (22:48 +0000)]
ipfw3: new feature 'ipfwsync'

ipfwsync is a new feature to synchronize firewall states between machines
which is running ipfw3 firewall for high availability. ipfw3 can be configured
in centre or edge mode. the centre will automatically sync the states from
centre to the edge.

e.g.
ipfw3 sync edge 5000
ipfw3 sync start edge

ipfw3 sync centre 192.168.1.1:5000,192.168.1.2:5000
ipfw3 sync start centre

ipfw3 sync show config
ipfw3 sync show status
ipfw3 sync test centre 123

8 years agolibstand: Fix some build warnings/errors when trying to build for 64bit.
Imre Vadasz [Thu, 25 Feb 2016 20:16:14 +0000 (21:16 +0100)]
libstand: Fix some build warnings/errors when trying to build for 64bit.

* Just casts uintptr_t values to uintmax_t, since libstand doesn't have
  <inttypes.h> and hence no PRIuPTR for formatting those.

* Use %zd and %zu for ssize_t and size_t values, instead of %d formats.

Partly Submitted-by: zrj (casting uintptr_t to uintmax_t as easiest fix).

8 years agosys/vfs/hammer: Redo commit 283f6970
Tomohiro Kusumi [Wed, 24 Feb 2016 17:26:10 +0000 (02:26 +0900)]
sys/vfs/hammer: Redo commit 283f6970

283f6970 was reverted by 8a94c3eb.
This commit redo the same sanity check in the right place.

Mirror write code that isn't trying to create a PFS still
calls hammer_mkroot_pseudofs() (which is kind of confusing),
so this sanity check must be done only after hammer_get_inode()
failed to find the existing inode by returning NULL.

8 years agoipfw3: fix func lookup_host
Bill Yuan [Fri, 26 Feb 2016 00:26:11 +0000 (00:26 +0000)]
ipfw3: fix func lookup_host

8 years agolibstand: Use the +Q register constraint in the __byte_swap16_var() macro.
Imre Vadasz [Thu, 25 Feb 2016 15:49:39 +0000 (16:49 +0100)]
libstand: Use the +Q register constraint in the __byte_swap16_var() macro.

* Using +Q makes sure that the register also has a 'high' 8-bit
  sub-register. On amd64, the +q constraint would also contain the
  SIL and DIL registers, which don't have a 'high' 8-bit sub-register.

8 years agokqueue: Avoid code duplication for knote searching in kqueue_register
Sepherosa Ziehau [Thu, 25 Feb 2016 14:15:08 +0000 (22:15 +0800)]
kqueue: Avoid code duplication for knote searching in kqueue_register

8 years agokernel/syscons: Add EFI Framebuffer support.
Imre Vadász [Thu, 11 Feb 2016 22:36:49 +0000 (23:36 +0100)]
kernel/syscons: Add EFI Framebuffer support.

* Uses the SC_DFLT_FONT kernel configuration option by default, which is
  required for a usable EFI framebuffer console (otherwise no font would
  be available there, resulting in invisible text).

8 years agokqueue: Use lwkt_{get,rel}pooltoken in kqueue_register
Sepherosa Ziehau [Thu, 25 Feb 2016 13:43:43 +0000 (21:43 +0800)]
kqueue: Use lwkt_{get,rel}pooltoken in kqueue_register

8 years agokqueue: Move fp holding out of kqueue token
Sepherosa Ziehau [Thu, 25 Feb 2016 12:41:43 +0000 (20:41 +0800)]
kqueue: Move fp holding out of kqueue token

8 years agokernel/pc64: Make have_efi_framebuffer static in pc64/x86_64/machdep.c.
Imre Vadász [Mon, 22 Feb 2016 21:29:03 +0000 (22:29 +0100)]
kernel/pc64: Make have_efi_framebuffer static in pc64/x86_64/machdep.c.

probe_efi_fb() should be enough for everyone else.

8 years agodrm/i915: Update to Linux 4.2
François Tigeot [Tue, 23 Feb 2016 20:21:06 +0000 (21:21 +0100)]
drm/i915: Update to Linux 4.2

* Work in progress atomic modesetting support

* Broadwell support improvements

* Skylake support improvements, including runtime power management.
  Starting from Linux 4.2, a separate firmware blob is required to save
  and restore the state of display engines in some low-power modes. These
  low-power modes have been forcibly disabled in the DragonFly version of
  this driver in order to keep it blob-free.

* Basic Broxton (BXT) support

* Various Displayport improvements including optimized link training,
  increased robustness, and automated support for compliance testing

* Execlist overhead reduced

* Frequency boost tuning

* Plenty of bugfixes all around

8 years agokqueue: Nuke unused code
Sepherosa Ziehau [Tue, 23 Feb 2016 13:58:44 +0000 (21:58 +0800)]
kqueue: Nuke unused code

8 years agokqueue: Return value of knote_release is no longer useful.
Sepherosa Ziehau [Tue, 23 Feb 2016 13:44:23 +0000 (21:44 +0800)]
kqueue: Return value of knote_release is no longer useful.

8 years agoRevert 283f6970e848724e9bd2c20d5311e412dea5e67c
Tomohiro Kusumi [Tue, 23 Feb 2016 13:36:26 +0000 (22:36 +0900)]
Revert 283f6970e848724e9bd2c20d5311e412dea5e67c

There seems to be an issue when hammer_ioc_set_pseudofs() is
called by mirror code (that doesn't attemp to create a PFS).

8 years agokqueue: Avoid reprocessing processed knotes in KNOTE.
Sepherosa Ziehau [Mon, 22 Feb 2016 14:08:36 +0000 (22:08 +0800)]
kqueue: Avoid reprocessing processed knotes in KNOTE.

Put a marker before the currently processing knote, so that even if
we have to reprocess this knote for non-zero hint, we don't have to
reprocess already-processed knotes, i.e. knotes before the marker.

Reviewed-by: dillon@
8 years agotest commit
Bill Yuan [Tue, 23 Feb 2016 15:30:54 +0000 (15:30 +0000)]
test commit

8 years agosys/boot/common: Simpler fix for "ls -l", which also works on cd9660 fs.
Imre Vadász [Mon, 22 Feb 2016 21:03:15 +0000 (22:03 +0100)]
sys/boot/common: Simpler fix for "ls -l", which also works on cd9660 fs.

* Blindly using "." as path instead of "" when no explicit path is given
  for ls, doesn't work on the cd9660 filesystem at the moment.

* Just omitting the "/" at the beginning of the buffer, when building the
  path for calling rel_stat() seems better.

8 years agopc64: Introduce machine/framebuffer.h header. Probe EFI fb.
Imre Vadász [Sun, 21 Feb 2016 15:28:39 +0000 (16:28 +0100)]
pc64: Introduce machine/framebuffer.h header. Probe EFI fb.

* Move struct fb_info definition from dev/drm/include/linux/fb.h to
  platform/pc64/include/framebuffer.h.

* Implement EFI framebuffer probing in platform/pc64/x86_64/machdep.c.

8 years agokernel/syscons: Add NULL checks for struct fb_info's restore callback.
Imre Vadász [Sun, 21 Feb 2016 16:40:48 +0000 (17:40 +0100)]
kernel/syscons: Add NULL checks for struct fb_info's restore callback.

8 years agodrm: Use drm_legacy_xxx functions
François Tigeot [Sun, 21 Feb 2016 07:58:43 +0000 (08:58 +0100)]
drm: Use drm_legacy_xxx functions

Reducing differences with Linux

8 years agosyscons: Check if vaddr == 0 in sckmsrndr.c. Improve IOCTLs with KMS.
Imre Vadász [Sat, 20 Feb 2016 14:38:04 +0000 (15:38 +0100)]
syscons: Check if vaddr == 0 in sckmsrndr.c. Improve IOCTLs with KMS.

* Just disable syscons drawing when the vaddr in struct fb_info is 0.
  This allows e.g. to initialize syscons with a framebuffer console,
  before the framebuffer has been mapped into virtual memory.

* Some more IOCTLs should check if the KMS framebuffer is active and
  avoid VGA accesses in that case.

8 years agokernel/syscons: Make the sc_update_render() function a bit more readable.
Imre Vadász [Fri, 19 Feb 2016 19:37:41 +0000 (20:37 +0100)]
kernel/syscons: Make the sc_update_render() function a bit more readable.

Just get rid of an unnecessary indentation level.