dragonfly.git
8 years agokernel: Silence two unused variables warnings without INET{,6}.
Sascha Wildner [Tue, 8 Dec 2015 17:52:59 +0000 (18:52 +0100)]
kernel: Silence two unused variables warnings without INET{,6}.

Unlikely that someone will compile a kernel without both INET and INET6
but it helps my testing of other, really optional, stuff.

8 years agosys/vfs/hammer: Move hammer_buf_xxx_io() to _KERNEL
Tomohiro Kusumi [Tue, 8 Dec 2015 06:51:50 +0000 (15:51 +0900)]
sys/vfs/hammer: Move hammer_buf_xxx_io() to _KERNEL

usr.bin/fstat/hammer.c
includes in-kernel structures and KKASSERT results in compile time error.

8 years agosys/vfs/hammer: Make bio ops static
Tomohiro Kusumi [Tue, 8 Dec 2015 06:26:47 +0000 (15:26 +0900)]
sys/vfs/hammer: Make bio ops static

Only functions that initialize bios need to see this.

8 years agosys/vfs/hammer: Add hammer_buf_peek_io()/hammer_buf_attach_io()
Tomohiro Kusumi [Mon, 7 Dec 2015 15:29:49 +0000 (00:29 +0900)]
sys/vfs/hammer: Add hammer_buf_peek_io()/hammer_buf_attach_io()

HAMMER doesn't really use bp->b_dep as a list, because it only
has one io entry linked to it (buf and io are 1:1).

Add hammer_buf_peek_io() and hammer_buf_attach_io() to hide the
implication of list (that isn't really a list). These functions
also hide bunch of void* casts between worklist and hammer_io.

8 years agosys/vfs/hammer: Add comments on struct worklist
Tomohiro Kusumi [Mon, 7 Dec 2015 14:55:25 +0000 (23:55 +0900)]
sys/vfs/hammer: Add comments on struct worklist

This worklist isn't very clean, but having a general structure
will require lots of changes in UFS.

8 years agosys/vfs/hammer: Remove union hammer_io_structure
Tomohiro Kusumi [Mon, 7 Dec 2015 12:19:52 +0000 (21:19 +0900)]
sys/vfs/hammer: Remove union hammer_io_structure

Remove union hammer_io_structure that was added in the early
stage of hammer development. This has been used in a certain
part of hammer_io.c, but the code is more clear without this.

Using the existing HAMMER_ITOB() as well as a newly added
HAMMER_ITOV() makes the code less complicated than using this
union.

8 years agokqueue: Make EVFILT_TIMER mpsafe, by modifying kq_ncallouts with atomics.
Imre Vadasz [Fri, 4 Dec 2015 15:45:21 +0000 (16:45 +0100)]
kqueue: Make EVFILT_TIMER mpsafe, by modifying kq_ncallouts with atomics.

8 years agoigb: Fix DMACR settings
Sepherosa Ziehau [Mon, 7 Dec 2015 09:44:28 +0000 (17:44 +0800)]
igb: Fix DMACR settings

Noticed-by: swildner@
8 years agoinpcb: Push porthash token down a bit and use atomic op to update lastport
Sepherosa Ziehau [Fri, 4 Dec 2015 08:47:12 +0000 (16:47 +0800)]
inpcb: Push porthash token down a bit and use atomic op to update lastport

This paves the way to use pooled token for porthash list head.

Even just with this commit, porthash token contention is reduced by 20K/s
on 12core/24threads system when running tools/kq_connect_client.

8 years agosys/vfs/hammer: Add lo_to_pfs()/pfs_to_lo() macros
Tomohiro Kusumi [Sun, 6 Dec 2015 10:36:05 +0000 (19:36 +0900)]
sys/vfs/hammer: Add lo_to_pfs()/pfs_to_lo() macros

These macros hide 16 bits shift and cast to int/uint32_t
that are necessary on localization to/from PFS id conversion.

Some code are better without details being hidden by macros,
but this seems to be more readable with x_to_y macros that
hide bunch of >>16, <<16, and casts.

(No diff in binary on x86_64/gcc5)

8 years agosys/vfs/hammer: Remove unused global variables and sysctls
Tomohiro Kusumi [Sat, 5 Dec 2015 15:34:45 +0000 (00:34 +0900)]
sys/vfs/hammer: Remove unused global variables and sysctls

Remove the following entries that aren't used for anything.
These are mostly from the early stage of hammer development
and no longer used.

  vfs.hammer.debug_recover_faults
  vfs.hammer.write_mode
  vfs.hammer.zone_limit

8 years agosbin/hammer: Change assertion on invalid cleanup path to printf
Tomohiro Kusumi [Sat, 5 Dec 2015 17:43:45 +0000 (02:43 +0900)]
sbin/hammer: Change assertion on invalid cleanup path to printf

This shouldn't be assertion.
Users could just type . for no reason and result in core dump.
It should end like other errors as shown below.

  # hammer cleanup . . . . .
  cleanup .                    - path must start with '/'
  cleanup .                    - PFS #0 already handled
  cleanup .                    - PFS #0 already handled
  cleanup .                    - PFS #0 already handled
  cleanup .                    - PFS #0 already handled

8 years agosys/vfs/hammer: Use hammer_vfs_root()
Tomohiro Kusumi [Sat, 5 Dec 2015 12:38:23 +0000 (21:38 +0900)]
sys/vfs/hammer: Use hammer_vfs_root()

8 years agosys/vfs/hammer: Define HAMMER_MAX_PFS in hammer_disk.h
Tomohiro Kusumi [Sat, 5 Dec 2015 11:04:08 +0000 (20:04 +0900)]
sys/vfs/hammer: Define HAMMER_MAX_PFS in hammer_disk.h

Maximum number of PFS (0 to 0xFFFF) is a part of ondisk definitions,
so move HAMMER_MAX_PFS to hammer_disk.h.

Also add HAMMER_MAX_PFSID which is (HAMMER_MAX_PFS - 1).

8 years agosys/vfs/hammer: Use bitwise OR to generate ondisk localization
Tomohiro Kusumi [Sat, 5 Dec 2015 07:32:38 +0000 (16:32 +0900)]
sys/vfs/hammer: Use bitwise OR to generate ondisk localization

Use |= to generate localization field for B-Tree elements and
cursor keys instead of +=, since lower 16 bits are bitfields
(or safer to treat INODE=0x1 and MISC=0x2 as bitfields).

The typical code to generate ondisk localization value is to
do either of the followings.

  ondisk_lo = local_variable          + {INODE or MISC};
  ondisk_lo = ip->obj_localization    + {INODE or MISC};
  ondisk_lo = HAMMER_XXX_LOCALIZATION + {INODE or MISC};
              ^^^^^^^^^^^^^^^^^^^^^^^   ^^^^^^^^^^^^^^^
              (A)32 bits localization   (B)lower 16 bits
                 with usually 0 for
                 lower 16 bits for type

Adding (A) and (B) to synthesize PFS id and localization type
could lead to a potential bug if (A) already has type bits set
to either INODE or MISC. For example if (A) had INODE for type
bits and the code is to += INODE for (B), then type bits turn
into MISC (1+1=2) which is not the intention of the code.

This could potentially occur with the first example of above
three where (A) is a local variable or a function argument.
It is not too obvious from the code whether that local variable
has 0 for the lower 16 bits (which basically should be).
If the code just always uses |= no such thing will happen.

8 years agogcc50: Very minor updates to three man pages
John Marino [Sun, 6 Dec 2015 10:55:27 +0000 (11:55 +0100)]
gcc50: Very minor updates to three man pages

Now that gcc 5.3 has been officially released, the new man pages are
available (they are not present in the repository).

8 years agobsd.lib.mk: No need to check DEBUG_FLAGS twice
Alexander Kuleshov [Sat, 5 Dec 2015 17:14:03 +0000 (23:14 +0600)]
bsd.lib.mk: No need to check DEBUG_FLAGS twice

We no need to check the DEBUG_FLAGS twice in the share/mk/bsd.lib.mk,
we can just add '.else' clause to the first check.

8 years agogcc50: Remove bits/mutex.h from the libstdcxx headers Makefile again.
Sascha Wildner [Sun, 6 Dec 2015 03:21:21 +0000 (04:21 +0100)]
gcc50: Remove bits/mutex.h from the libstdcxx headers Makefile again.

This header doesn't exist in bits/. The quoted_string.h addition
seems to have been correct though.

8 years agogcc50: add some missing files
Markus Pfeiffer [Sat, 5 Dec 2015 14:16:18 +0000 (14:16 +0000)]
gcc50: add some missing files

* mutex.h is an internal header omitted from a previous commit
* quoted_string.h and mutex.h were missing in Makefile.headers

This broke compilation of cmake-3.3.1 on my system.

8 years agoLocal adjustments for OpenSSL-1.0.1q.
Sascha Wildner [Fri, 4 Dec 2015 20:46:40 +0000 (21:46 +0100)]
Local adjustments for OpenSSL-1.0.1q.

8 years agoMerge branch 'vendor/OPENSSL'
Sascha Wildner [Fri, 4 Dec 2015 20:45:43 +0000 (21:45 +0100)]
Merge branch 'vendor/OPENSSL'

8 years agoImport OpenSSL 1.0.1q.
Sascha Wildner [Fri, 4 Dec 2015 20:45:11 +0000 (21:45 +0100)]
Import OpenSSL 1.0.1q.

* Certificate verify crash with missing PSS parameter (CVE-2015-3194)

* X509_ATTRIBUTE memory leak (CVE-2015-3195)

* Rewrite EVP_DecodeUpdate (base64 decoding) to fix several bugs

* In DSA_generate_parameters_ex, if the provided seed is too short,
  return an error

8 years agokqueue.2: Fix manpage.
Sascha Wildner [Fri, 4 Dec 2015 16:27:26 +0000 (17:27 +0100)]
kqueue.2: Fix manpage.

8 years agogcc50: Upgrade version 5.2.1 => 5.3.1
John Marino [Fri, 4 Dec 2015 14:20:16 +0000 (15:20 +0100)]
gcc50: Upgrade version 5.2.1 => 5.3.1

This came out today so there are no distfiles available yet.  That
means I can't update the manpages for cc.1, cpp.1, and gcov.1.  There
are no significant changes expected though.

8 years agoMerge branch 'vendor/GCC50'
John Marino [Fri, 4 Dec 2015 15:04:54 +0000 (16:04 +0100)]
Merge branch 'vendor/GCC50'

8 years agoUpdate gcc-50 to SVN version 231263 (gcc-5-branch)
John Marino [Fri, 4 Dec 2015 14:11:37 +0000 (15:11 +0100)]
Update gcc-50 to SVN version 231263 (gcc-5-branch)

This is equivalent to the gcc 5.3 release (version shows 5.3.1 though)

Last Changed Date: 2015-12-04 01:16:08 +0100 (Fri, 04 Dec 2015)

8 years agolibc: Define a new version, DF406.0, for the 4.5 branch
John Marino [Fri, 4 Dec 2015 13:34:18 +0000 (14:34 +0100)]
libc: Define a new version, DF406.0, for the 4.5 branch

8 years agokqueue: Bring in EV_RECEIPT and EV_DISPATCH from FreeBSD
Ben Woolley [Fri, 4 Dec 2015 07:58:21 +0000 (23:58 -0800)]
kqueue: Bring in EV_RECEIPT and EV_DISPATCH from FreeBSD

EV_RECEIPT:  FreeBSD SVN 197243
EV_DISPATCH: FreeBSD SVN 197242

Since EV_RECEIPT has been on FreeBSD since release 8.1 and on OSX
since Release 10.5, it's starting to show up in 3rd party software.
And authors assume if FreeBSD has it, all BSDs have.

suggested by:   Jan Beich
contributed by: Ben Woolley

8 years agoatomic: Fix atomic_cmpset_long prototype
Sepherosa Ziehau [Fri, 4 Dec 2015 07:26:48 +0000 (15:26 +0800)]
atomic: Fix atomic_cmpset_long prototype

Return value is actually a boolean, int should be enough.

8 years agoatomic: Add atomic_cmpset_short
Sepherosa Ziehau [Fri, 4 Dec 2015 07:04:28 +0000 (15:04 +0800)]
atomic: Add atomic_cmpset_short

8 years agosocket: so_ref 0->1 transition is valid for an aborted socket on so_comp
Sepherosa Ziehau [Fri, 4 Dec 2015 02:20:40 +0000 (10:20 +0800)]
socket: so_ref 0->1 transition is valid for an aborted socket on so_comp

Add comment about it.

Reported-by: marino@, dillon@
8 years agosys/vfs/hammer: Add hammer_is_zone2|direct_mapped_index()
Tomohiro Kusumi [Thu, 3 Dec 2015 12:43:15 +0000 (21:43 +0900)]
sys/vfs/hammer: Add hammer_is_zone2|direct_mapped_index()

No functional changes.

Just makes the code a bit more readable than having bunch of
assert(zone >= 8 && zone < 16)

8 years agosbin/hammer: Make blockmap print fill percentage on -v
Tomohiro Kusumi [Wed, 2 Dec 2015 18:55:00 +0000 (03:55 +0900)]
sbin/hammer: Make blockmap print fill percentage on -v

8 years agosbin/hammer: Use correct printf format for crc
Tomohiro Kusumi [Wed, 2 Dec 2015 18:47:42 +0000 (03:47 +0900)]
sbin/hammer: Use correct printf format for crc

8 years agosys/vfs/hammer: Add/fix comments on B-Tree node
Tomohiro Kusumi [Wed, 2 Dec 2015 14:20:45 +0000 (23:20 +0900)]
sys/vfs/hammer: Add/fix comments on B-Tree node

Add/fix missing/incomplete/obsolete comments.

Move struct hammer_node_ondisk to the right place which is
underneath the comment on ondisk node.

8 years agosys/vfs/hammer: Cleanup unnecessary cast
Tomohiro Kusumi [Wed, 2 Dec 2015 14:55:43 +0000 (23:55 +0900)]
sys/vfs/hammer: Cleanup unnecessary cast

DECODE macros do cast the result to int (actually was int32_t).

8 years agoix: Update to Intel ix-2.8.2
Sepherosa Ziehau [Tue, 1 Dec 2015 03:07:40 +0000 (11:07 +0800)]
ix: Update to Intel ix-2.8.2

This update adds more chips support.

Local changes:
Fix ifmedia support.  Now media change (force 10G-SR and 1G-SX) works
properly at least on my 82599 w/ DAC; though "autoselect" is still
the recommended mode.

8 years agoifmedia: Add two helper functions for ifmedia_add and ifmedia_set
Sepherosa Ziehau [Thu, 3 Dec 2015 02:48:03 +0000 (10:48 +0800)]
ifmedia: Add two helper functions for ifmedia_add and ifmedia_set

- ifmedia_add_nodup() will not add duplicated media into ifmedia
- ifmedia_tryset() will fail, if the target media does not exist

8 years agodrm: fb_get_options() can just use the unmodified connector-name.
Imre Vadasz [Wed, 2 Dec 2015 21:55:12 +0000 (22:55 +0100)]
drm: fb_get_options() can just use the unmodified connector-name.

There was apparently never an actual need for using a modified connector
name in the video mode tunable.
e.g. instead of drm.video.dvid1="1024x768" one can just use
drm.video.DVI-D-1="1024x768" which is more similar to the Linux
command line option.

8 years agodevfs(9): Rename DEVFS_DECLARE_CLONE_BITMAP to DEVFS_DEFINE_CLONE_BITMAP.
Sascha Wildner [Wed, 2 Dec 2015 20:14:10 +0000 (21:14 +0100)]
devfs(9): Rename DEVFS_DECLARE_CLONE_BITMAP to DEVFS_DEFINE_CLONE_BITMAP.

Also, add DEVFS_DECLARE_CLONE_BITMAP() for extern declarations, analogous
to MALLOC_DEFINE() and MALLOC_DECLARE().

In the sound code, replace some externs with DEVFS_DECLARE_CLONE_BITMAP()
and remove one unneeded extern.

8 years agobacktrace.3: Fix prototype of backtrace_symbols_fd_fmt().
Sascha Wildner [Wed, 2 Dec 2015 16:59:42 +0000 (17:59 +0100)]
backtrace.3: Fix prototype of backtrace_symbols_fd_fmt().

8 years agosys/vfs/hammer: Add/fix comments on volume header
Tomohiro Kusumi [Wed, 2 Dec 2015 09:42:02 +0000 (18:42 +0900)]
sys/vfs/hammer: Add/fix comments on volume header

8 years agosys/vfs/hammer: Cast HAMMER_BLOCKMAP_LAYER1|2_INDEX macros to int
Tomohiro Kusumi [Tue, 1 Dec 2015 17:06:32 +0000 (02:06 +0900)]
sys/vfs/hammer: Cast HAMMER_BLOCKMAP_LAYER1|2_INDEX macros to int

This commit does the same as 37fa1bc7 for INDEX macros.

RADIX macro is how many layer entries a big-block can hold,
INDEX macro is an index of layer entry for the given offset.
(i.e. Maximum INDEX equals (RADIX - 1))

8 years agosyscons: Fixup kms_draw() after change for xpad variable removal.
Imre Vadasz [Tue, 1 Dec 2015 22:47:02 +0000 (23:47 +0100)]
syscons: Fixup kms_draw() after change for xpad variable removal.

In kms_draw(), draw_pos should always point to the beginning of a
scanline now.

8 years agobmake - Disable use of PWD env
Matthew Dillon [Tue, 1 Dec 2015 19:00:11 +0000 (11:00 -0800)]
bmake - Disable use of PWD env

* bmake tries to use the logical directory path via the PWD environment
  variable, and its various exceptions for dealing with OBJDIR fall short.
  This creates mass confusion for buildworld if the source tree is built
  via a logical directory path which goes through a symlink.

* With this change, bmake now only uses the real directory path.

Taken-from: FreeBSD

8 years agosys/vfs/hammer: Cast HAMMER_BLOCKMAP_RADIX1|2 macros to int
Tomohiro Kusumi [Tue, 1 Dec 2015 13:25:07 +0000 (22:25 +0900)]
sys/vfs/hammer: Cast HAMMER_BLOCKMAP_RADIX1|2 macros to int

RADIX macros represent how many layer1/2 entries (32/16 bytes)
a 8MB big-block can hold, but these aren't zone-x offset.

These are typicaly used as an index of array where each entry
is a data structure that corresponds to layer1/2 entry,
therefore it makes sense to cast these macros to int.

8 years agosys/vfs/hammer: Remove HAMMER_BLOCKMAP_RADIX1|2_PERBUFFER macros
Tomohiro Kusumi [Tue, 1 Dec 2015 11:53:37 +0000 (20:53 +0900)]
sys/vfs/hammer: Remove HAMMER_BLOCKMAP_RADIX1|2_PERBUFFER macros

Things can be implemented without using these macros that
are a bit difficult to understand what they are.

newfs_hammer is the only program that currently uses them,
but it can be done in a more simple way.

8 years agosys/vfs/hammer: Add/fix comments on zones
Tomohiro Kusumi [Mon, 30 Nov 2015 15:15:47 +0000 (00:15 +0900)]
sys/vfs/hammer: Add/fix comments on zones

8 years agosys/vfs/hammer: Cleanup hammer_alloc_data()
Tomohiro Kusumi [Mon, 30 Nov 2015 14:22:24 +0000 (23:22 +0900)]
sys/vfs/hammer: Cleanup hammer_alloc_data()

8 years agodrm: Add BUILD_BUG_ON_MSG()
François Tigeot [Mon, 30 Nov 2015 19:23:59 +0000 (20:23 +0100)]
drm: Add BUILD_BUG_ON_MSG()

8 years agosys/vfs/hammer: Add/fix comments on ondisk formats
Tomohiro Kusumi [Sun, 29 Nov 2015 15:41:06 +0000 (00:41 +0900)]
sys/vfs/hammer: Add/fix comments on ondisk formats

8 years agosys/vfs/hammer: Use hammer_modify_buffer_noundo()
Tomohiro Kusumi [Sun, 29 Nov 2015 16:24:10 +0000 (01:24 +0900)]
sys/vfs/hammer: Use hammer_modify_buffer_noundo()

8 years agokevent: Reduce kqueue token contention
Sepherosa Ziehau [Mon, 30 Nov 2015 03:42:42 +0000 (11:42 +0800)]
kevent: Reduce kqueue token contention

By reducing kqueue token coverage on kern_event() path.

This halves the pool token contention for tool/kq_connect_client
(from 100Kcollisions/s to 50Kcollision/s, @315Kconns/s).  And
also reduces pool token contention for tool/kq_accept_server
noticeablely.

8 years agokevent: Fix comment and remove extra blank line
Sepherosa Ziehau [Mon, 30 Nov 2015 02:30:55 +0000 (10:30 +0800)]
kevent: Fix comment and remove extra blank line

8 years agohammer: Always set noatime for hammerfs
Sepherosa Ziehau [Mon, 30 Nov 2015 02:19:30 +0000 (10:19 +0800)]
hammer: Always set noatime for hammerfs

Set tunable vfs.hammer.noatime to 0 to disable this "auto" noatime.

Reviewed-by: dillon@
8 years agokernel: Better separate the "deprecated" spinlocks from DRM.
Sascha Wildner [Sun, 29 Nov 2015 16:26:09 +0000 (17:26 +0100)]
kernel: Better separate the "deprecated" spinlocks from DRM.

* Rename spin_lock_init() -> spin_init_deprecated(). Also remove
  the spinlock_t type for the deprecated ones.

* Move DRM to using struct spinlock * where it used spinlock_t
  before.

8 years agokernel: Clean up the "deprecated" spinlock stuff a bit.
Sascha Wildner [Sun, 29 Nov 2015 16:14:23 +0000 (17:14 +0100)]
kernel: Clean up the "deprecated" spinlock stuff a bit.

Remove intr_{lock,unlock,spinlock} and mpintr_{lock,unlock,spinlock}
because they are no longer used.

8 years agokernel/drm: Make i915 and radeon compilable into the kernel.
Sascha Wildner [Sun, 29 Nov 2015 15:59:52 +0000 (16:59 +0100)]
kernel/drm: Make i915 and radeon compilable into the kernel.

This is for debugging and testing purposes.

For example, it helps catching certain types of errors which are
not easily caught when building just the module, such as when a
prototype of a called function is present but its implementation
isn't.

8 years agokernel/drm: Move the CONFIG_* options to header files.
Sascha Wildner [Sun, 29 Nov 2015 15:57:03 +0000 (16:57 +0100)]
kernel/drm: Move the CONFIG_* options to header files.

i915_drv.h already had CONFIG_ACPI, so put the other options we
currently define for i915 here too.

radeon needs no additions since CONFIG_ACPI, the only option we
define for it, is already in radeon.h

Comparison of preprocessed files shows that this commit changes
nothing except a few line numbers in warning/error message
strings.

8 years agodrm: Stop ignoring the second argument of drm_free()
François Tigeot [Sun, 29 Nov 2015 16:19:21 +0000 (17:19 +0100)]
drm: Stop ignoring the second argument of drm_free()

DragonFly's native kfree() call takes a second argument in order to report
which usage correspond to which memory allocations.
Some memory areas in the drm subsystem must also be freed with the memory
type M_TEMP and not M_DRM.

Submitted-by: zrj
8 years agosys/vfs/hammer: Remove HAMMER_ITIMES_XXX macros
Tomohiro Kusumi [Sun, 29 Nov 2015 10:14:46 +0000 (19:14 +0900)]
sys/vfs/hammer: Remove HAMMER_ITIMES_XXX macros

hammer_update_itimes() is better without these macros.

The details of hammer_modify_buffer() arguments shouldn't be
hidden by these macros, because ondisk inode fields modified
in the next two lines are what hammer_modify_buffer() pushes
into undo fifo. This relation should be visible in the code.

Also remove a comment that refers to HAMMER_INODE_ITIMES.
This macro has already been removed.

8 years agosys/vfs/hammer: Remove integrity_crc field of ondisk inode
Tomohiro Kusumi [Sun, 29 Nov 2015 10:07:23 +0000 (19:07 +0900)]
sys/vfs/hammer: Remove integrity_crc field of ondisk inode

This integrity_crc field was added in 5a930e66,
but never used or explained what this was supposed to be.

Rename it to reserved.
Also rename reserved fields from 01.

8 years agosys/vfs/hammer: Remove time/freq fields of ondisk PFS
Tomohiro Kusumi [Sun, 29 Nov 2015 09:24:01 +0000 (18:24 +0900)]
sys/vfs/hammer: Remove time/freq fields of ondisk PFS

These ondisk fields were added in 4c038e17 when mirroring
code was committed (without detailed explanation), but the
idea of time/freq was never implemented.

Rename them to reserved.

8 years agoi386 removal, part 46/x: Remove sys/cpu/i386.
Sascha Wildner [Sun, 29 Nov 2015 13:42:18 +0000 (14:42 +0100)]
i386 removal, part 46/x: Remove sys/cpu/i386.

Move the four i386 headers which libstand previously took from this
directory to libstand's dir. This is just a precaution and actually
not necessary at all because our x86_64 headers have #ifdef __i386__
checks for everything which libstand needs (binary comparison with
a libstand that was compiled with only x86_64 headers confirms it).

Review of the .depend files in /usr/obj confirms that this headers
are now taken.

Also reduce some no longer needed compatibility setup in libstand's
Makefile.

8 years agosys/vfs/hammer: Remove #if0'd hammer_mirror_write()
Tomohiro Kusumi [Sun, 29 Nov 2015 07:52:46 +0000 (16:52 +0900)]
sys/vfs/hammer: Remove #if0'd hammer_mirror_write()

and its sub function hammer_mirror_localize_data().

These two functions are replaced by hammer_create_at_cursor()
and hammer_cursor_localize_data() which basically do the same
thing in 83f2a3aa, as the comment says.

Fix some comments that haven't been updated after replacing.

8 years agosys/vfs/hammer: Remove #if0'd obsolete symlink format
Tomohiro Kusumi [Sun, 29 Nov 2015 07:37:06 +0000 (16:37 +0900)]
sys/vfs/hammer: Remove #if0'd obsolete symlink format

Masters are to use "-1" after "@@", but not "0xFFFF....",
so this #if0'd code is obsolete.

8 years agosys/vfs/hammer: Remove #if0'd debug kprintfs
Tomohiro Kusumi [Sun, 29 Nov 2015 07:36:14 +0000 (16:36 +0900)]
sys/vfs/hammer: Remove #if0'd debug kprintfs

8 years agosys/vfs/hammer: Remove DEBUG_TRUNCATE flag
Tomohiro Kusumi [Sun, 29 Nov 2015 06:48:44 +0000 (15:48 +0900)]
sys/vfs/hammer: Remove DEBUG_TRUNCATE flag

This was only used in the early stage of hammer development
for debug kprintfs and no longer used or enabled.

8 years agokern: Support hh modifier in ksscanf (needed for drm/radeon).
Imre Vadasz [Sat, 28 Nov 2015 15:44:45 +0000 (16:44 +0100)]
kern: Support hh modifier in ksscanf (needed for drm/radeon).

This fixes VCE initialization in drm/radeon.
Taken from lib/libc/stdio/vfscanf.c

8 years agosys/vfs/hammer: Remove HAMMER_VOLF_VALID|OPEN macros
Tomohiro Kusumi [Sat, 28 Nov 2015 15:04:06 +0000 (00:04 +0900)]
sys/vfs/hammer: Remove HAMMER_VOLF_VALID|OPEN macros

These macros added by 8750964d in 2007 (the first hammer commit)
were never used.

8 years agosys/vfs/hammer: Remove HAMMER_HEAD_FLAG_FREE macro
Tomohiro Kusumi [Sat, 28 Nov 2015 14:51:48 +0000 (23:51 +0900)]
sys/vfs/hammer: Remove HAMMER_HEAD_FLAG_FREE macro

This macro is no longer used independently after bf686dbe,
but only used as a part of HAMMER_HEAD_TYPE_PAD.

(it can't be simply removed unless hammer version gets
++ or something, since TYPE_PAD is ondisk representation)

8 years agosys/vfs/hammer: Remove HAMMER_HEAD_TYPE_42|45 macros
Tomohiro Kusumi [Sat, 28 Nov 2015 14:47:37 +0000 (23:47 +0900)]
sys/vfs/hammer: Remove HAMMER_HEAD_TYPE_42|45 macros

These macros were never used.
See 02428fb6.

8 years agosys/vfs/hammer: #if0 HAMMER_BIGBLOCK_OVERFILL
Tomohiro Kusumi [Sat, 28 Nov 2015 14:37:23 +0000 (23:37 +0900)]
sys/vfs/hammer: #if0 HAMMER_BIGBLOCK_OVERFILL

The code using this macro has been #if0'd by b4f86ea3.
(The code isn't obsolete, so it should still be there)

8 years agokevent: Mark file_filtops and kqread_filtops MPSAFE
Sepherosa Ziehau [Sat, 28 Nov 2015 11:27:20 +0000 (19:27 +0800)]
kevent: Mark file_filtops and kqread_filtops MPSAFE

- kqread_filtops is MPSAFE.
- All fo_kqfilter are MPSAFE or take care of the MPSAFE of their
  sub-nodes.

8 years agokevent: Fix comment
Sepherosa Ziehau [Sat, 28 Nov 2015 10:01:49 +0000 (18:01 +0800)]
kevent: Fix comment

8 years agohammer: Change u_int{8,16,32,64}_t to uint{8,16,32,64}_t
Tomohiro Kusumi [Wed, 25 Nov 2015 13:46:57 +0000 (22:46 +0900)]
hammer: Change u_int{8,16,32,64}_t to uint{8,16,32,64}_t

in the following directories and/or files.

* sys/vfs/hammer
* sbin/hammer
* sbin/newfs_hammer
* sbin/mount_hammer
* usr.bin/fstat/hammer.c
* usr.bin/undo

8 years agomake(1): Create two more custom variables to speed up dports
John Marino [Sat, 28 Nov 2015 01:39:15 +0000 (02:39 +0100)]
make(1): Create two more custom variables to speed up dports

I've added two new static values to bmake:

.MAKE.DF.OSREL
This will currently return "4.5"

.MAKE.DF.VERSION
This will currently return "400500".  It matches what was in place on
/usr/src/sys/sys/param.h during the last buildworld.

Every dport runs piped shell commands to get these values. After iterating
through the entire ports tree several times, I noticed a large presence
of awk in process list.  After modifying bmake and then modifying dports
locally, the iteration runs 15% faster.  There are other optimizations
that can be done, but that's out of scope of this commit.

8 years agodrm/i915: Use fb->pitches[0] for stride. Remove duplicate kmalloc call.
Imre Vadász [Thu, 26 Nov 2015 22:00:52 +0000 (23:00 +0100)]
drm/i915: Use fb->pitches[0] for stride. Remove duplicate kmalloc call.

* We can directly use fb->pitches[0] for the stride in intel_fbdev.c.

* Remove duplicate kmalloc call for struct fb_info in intel_fbdev.c.

8 years agosyscons: Get rid of xpad variable by adjusting loop in sckmsrndr.c
Imre Vadász [Thu, 26 Nov 2015 21:56:38 +0000 (22:56 +0100)]
syscons: Get rid of xpad variable by adjusting loop in sckmsrndr.c

8 years agodrm.4: Fix two .Xr
Sascha Wildner [Fri, 27 Nov 2015 10:15:01 +0000 (11:15 +0100)]
drm.4: Fix two .Xr

8 years agosocket: Make sure that accept queues are empty before socket destruction
Sepherosa Ziehau [Fri, 27 Nov 2015 06:59:31 +0000 (14:59 +0800)]
socket: Make sure that accept queues are empty before socket destruction

8 years agosocket: Make sure so_refs will not go from 0 to 1
Sepherosa Ziehau [Fri, 27 Nov 2015 06:45:35 +0000 (14:45 +0800)]
socket: Make sure so_refs will not go from 0 to 1

8 years agosocket: Remove fo_ioctl(FIONBIO) for sockets.
Sepherosa Ziehau [Fri, 27 Nov 2015 03:31:45 +0000 (11:31 +0800)]
socket: Remove fo_ioctl(FIONBIO) for sockets.

This should not be called (soo_ioctl(FIONBIO) is actually a NOP),
since we records non-blocking in 'struct file'.

8 years agoem/emx/igb: Properly set status for manually configured media/mediaopt
Sepherosa Ziehau [Fri, 27 Nov 2015 03:00:41 +0000 (11:00 +0800)]
em/emx/igb: Properly set status for manually configured media/mediaopt

8 years agomxge: Always send the current media (optics) back to callers.
Sepherosa Ziehau [Fri, 27 Nov 2015 02:21:14 +0000 (10:21 +0800)]
mxge: Always send the current media (optics) back to callers.

8 years agodrm: Implement simple broken EDID override by loading firmware (v16)
zrj [Fri, 20 Nov 2015 11:59:41 +0000 (13:59 +0200)]
drm: Implement simple broken EDID override by loading firmware (v16)

Main differences between this variant and its gpl analogue:
  * permissive license;
  * no builtin generic EDID data blocks;

Generic EDID firmware can be used from new dports/sysutils/devedid-data port.
Still it is better to use monitor specific EDID block, either by modifying
generic variants or repairing dumped one or even better extracting from
working identical monitor if it is available (look for hex dump in Xorg.0.log).

Make sure that used fw.bin at least has correct resolutions and valid checksum.
This can be done with sysutils/edid-decode utility.

Tested with broken lcd panel returning corrupted EDID block on dvi port:
  * radeonkms R7 240, dvi and dvi2hdmi cable adapter
    echo 'drm.edid_firmware="DVI-D-1:edidfw_repaired"' >> /boot/loader.conf

  * i915 Haswell i7-4712MQ laptop, dvi2hdmi cable adapter
    echo 'drm.edid_firmware="HDMI-A-1:edidfw_1920x1080"' >> /boot/loader.conf
    echo 'drm.video.hdmia1="e"  # force enable on i915' >> /boot/loader.conf

While here, document tunables: drm.video.<connector> and new drm.edid_firmware.

8 years agolinux/ww_mutex.h: Remove a wrong assert
François Tigeot [Thu, 26 Nov 2015 07:28:54 +0000 (08:28 +0100)]
linux/ww_mutex.h: Remove a wrong assert

It constantly causes panics with newer drm code from Linux 4.0.

8 years agomxge: Integrate ifmedia flow control support.
Sepherosa Ziehau [Thu, 26 Nov 2015 06:31:04 +0000 (14:31 +0800)]
mxge: Integrate ifmedia flow control support.

And remove flow control sysctl node.  The following command should
be use to change flow control settings:
ifconfig mxgeX [mediaopt|-mediaopt] flowcontrol

Note, due to hardware limitation, rxpause and txpause could only be
all on or all off.

8 years agomxge: Fix ifmedia related bits
Sepherosa Ziehau [Thu, 26 Nov 2015 05:32:25 +0000 (13:32 +0800)]
mxge: Fix ifmedia related bits

8 years agoix: Integrate ifmedia flow control support.
Sepherosa Ziehau [Thu, 26 Nov 2015 01:31:03 +0000 (09:31 +0800)]
ix: Integrate ifmedia flow control support.

Other minor bits:
- Set media to IFM_NONE, if there is no link yet.
- Remove no longer used dev.ix.Y.flow_ctrl sysctl node.
  ifconfig ixY [mediaopt|-mediaopt] [rxpause|txpause|forcepause]
  should be used instead.

8 years agoem.4/igb.4: Set date properly
Sepherosa Ziehau [Thu, 26 Nov 2015 01:40:36 +0000 (09:40 +0800)]
em.4/igb.4: Set date properly

8 years agoix.4: ixX -> ixY and dev.ix.X -> dev.ix.Y
Sepherosa Ziehau [Thu, 26 Nov 2015 01:38:29 +0000 (09:38 +0800)]
ix.4: ixX -> ixY and dev.ix.X -> dev.ix.Y

8 years agoSync ACPICA with Intel's version 20151124.
Sascha Wildner [Wed, 25 Nov 2015 19:16:38 +0000 (20:16 +0100)]
Sync ACPICA with Intel's version 20151124.

* Silence warnings about non-existant _Sx methods because they are
  optional. In fact, we already had a fix for this from sephe
  (671882eba43).

* Fixed bugs in FADT handling and auto-serialization.

* Removed support for _SUB in AcpiGetObjectInfo because it caused
  errors due to not fully initialized operation regions.

* Fixed issues with terminate/quit/exit commands in the debugger.
  Also thread ID support was added to the debugger.

* Allow multiple definitions blocks in ASL/AML files for iasl,
  acpiexec and acpixtract.

* Enhanced type checking for Name() in iasl. Also indent fixes for
  -ic and -ia.

* Additional error message for attempting to open a Scope() on an
  object defined in an SSDT.

* Improved formatting.

For a more detailed list, please see sys/contrib/dev/acpica/changes.txt.

8 years agoiasl(8): Add some files as dependencies which are m4_include()'d only.
Sascha Wildner [Wed, 25 Nov 2015 18:42:36 +0000 (19:42 +0100)]
iasl(8): Add some files as dependencies which are m4_include()'d only.

This helps us across quickworld when just one of those files changes.

8 years agoix: Set up ifm_active properly when link is not up.
Sepherosa Ziehau [Wed, 25 Nov 2015 07:50:45 +0000 (15:50 +0800)]
ix: Set up ifm_active properly when link is not up.

8 years agoifmedia: Reset ifm_media and ifm_cur in ifmedia_removeall()
Sepherosa Ziehau [Wed, 25 Nov 2015 07:40:30 +0000 (15:40 +0800)]
ifmedia: Reset ifm_media and ifm_cur in ifmedia_removeall()

This function may be called by NIC drivers on non-detach path, so
we need to make sure everything of ifmedia are in sane state.

8 years agoix: Fix optics and ifmedia settings
Sepherosa Ziehau [Wed, 25 Nov 2015 07:30:43 +0000 (15:30 +0800)]
ix: Fix optics and ifmedia settings

8 years agoigb: Fix ifmedia leakage on detach path.
Sepherosa Ziehau [Wed, 25 Nov 2015 06:40:42 +0000 (14:40 +0800)]
igb: Fix ifmedia leakage on detach path.

While I'm here, remove outdated code.

8 years agoig: Factor out e1000_force_flowctrl
Sepherosa Ziehau [Wed, 25 Nov 2015 06:33:14 +0000 (14:33 +0800)]
ig: Factor out e1000_force_flowctrl

8 years agoem/emx: Integrate ifmedia flow control support.
Sepherosa Ziehau [Wed, 25 Nov 2015 03:30:35 +0000 (11:30 +0800)]
em/emx: Integrate ifmedia flow control support.

Other minor bits:
- Set media to IFM_NONE, if there is no link yet.
- Remove no longer used dev.em.Y.flow_ctrl sysctl node.
  ifconfig emY [mediaopt|-mediaopt] [rxpause|txpause|forcepause]
  should be used instead.