dragonfly.git
8 years agocldr2def: Update to generate colldef replacement directory
John Marino [Tue, 28 Jul 2015 15:55:34 +0000 (17:55 +0200)]
cldr2def: Update to generate colldef replacement directory

The new localedef tool needs extracts for CLDR POSIX localization
definition files, and it needs the UTF-8 character map along with
the width definitions (mainly for Asian monitor support).

Since the LC_COLLATE handling is fundamentally different from the
first four groups, new sections to the cldr2def tool had to be
written, thus requiring me to brush up on my perl skills.

The finalize script (which I had previously written) was modified
to copy the widths and charmap files over to the regenerated
colldef directory (a drop-in replacement for share/colldef).

8 years agoAdd localedef(1), a locale definition generator tool
John Marino [Tue, 28 Jul 2015 16:31:53 +0000 (18:31 +0200)]
Add localedef(1), a locale definition generator tool

The localedef tool can read entire (and unmodified) CLDR posix definition
files, and generate all 6 LC categories: LC_COLLATE, LC_CTYPE, LC_TIME,
LC_NUMERIC, LC_MONETARY and LC_MESSAGES.

The last 4 of those aren't needed.  We already have a tool that generates
msgdef, timedef, moneydef and numericdef.  In the immediate future,
localedef will only be used generate LC_COLLATE files in a new format.
This will render colldef files unreadable, thus colldef will be removed
when this happens.

In the future, localedef will be tasked to generate LC_CTYPE files as
well.  When that happens, the mklocale tool will be retired.

While localedef *can* read pristine POSIX files (which causes 6 files
to be generated), it will given files with only the LC_COLLATE part,
which will also have all the white space removed as well.  Remove just
the spaces can save megabytes.

This tool has a long history with Solaris [1].  The Nexenta developers
modified it to read CLDR files and created the much richer collation
formats.  The libc collation functions have to be modified to read the
new format (called "DragonFly-4.4") and to handle the new data structures.

The result will be that locale-sensitive tools and functions will now
properly sort multibyte and unicode strings.  Our "BSD" sort is not locale
sensitive, so it will probably have to be replaced with GNU sort in order
to leverage our new collation capabilities.

This can't be hooked into the build yet.  It needs the new header for
collate.c to define the data structures.  Until that happens, this is
actually unbuildable.

[1] Linux also has a tool called localdef, but I do know know if it shares
    a common history or if it uses CLDR POSIX files.  It seems to have the
    same purpose though.

8 years agoinet6: No need to explicitly avoid calling ioctl(SIOCSADDR)
Sepherosa Ziehau [Mon, 27 Jul 2015 14:47:58 +0000 (22:47 +0800)]
inet6: No need to explicitly avoid calling ioctl(SIOCSADDR)

Rearrange the code a little bit.

8 years agoinet6: Use M_WAITOK on SIOCAIFADDR_IN6 path.
Sepherosa Ziehau [Mon, 27 Jul 2015 14:27:03 +0000 (22:27 +0800)]
inet6: Use M_WAITOK on SIOCAIFADDR_IN6 path.

Addition:
- Use M_ZERO, instead of calling bzero().
- Avoid M_ZERO, if the allocated memory is to be completely over-
  written.
- Remove unapplied comment.

8 years agoroute: Enhance panic message
Sepherosa Ziehau [Mon, 27 Jul 2015 14:03:30 +0000 (22:03 +0800)]
route: Enhance panic message

8 years agosys/vfs/hammer: Add HAMMER_BTREE_TYPE_NONE
Tomohiro Kusumi [Mon, 27 Jul 2015 16:17:31 +0000 (01:17 +0900)]
sys/vfs/hammer: Add HAMMER_BTREE_TYPE_NONE

- No functional changes, but just makes things clearer.

- root_btree_{beg|end} has 0 (not used) for btype.
  Defining a macro for it makes code clearer than
  implicitly taking care of btype by 0 or non-0.

8 years agosys/vfs/hammer: Keep root node signature on root split
Tomohiro Kusumi [Sun, 26 Jul 2015 18:43:10 +0000 (03:43 +0900)]
sys/vfs/hammer: Keep root node signature on root split

- newfs_hammer sets a signature value for the root btree node
  so keep that signature on root node split along with other
  fields being copied to the new root node. This doesn't affect
  the existing fs as it's used for nothing.

- (The former root node signature is not cleared on root split,
  so every node that has once been the root has the signature.
  The one at the lowest zone offset is the original one unless
  moved by reblock)

8 years agosbin/hammer: Fix hammer show output format
Tomohiro Kusumi [Sun, 26 Jul 2015 16:19:45 +0000 (01:19 +0900)]
sbin/hammer: Fix hammer show output format

- Sync with other formats.

8 years agosbin/hammer: Cleanup headers
Tomohiro Kusumi [Sun, 26 Jul 2015 08:16:05 +0000 (17:16 +0900)]
sbin/hammer: Cleanup headers

- Define struct softprune in hammer_util.h just like other
  hammer userspace structures are defined here.

8 years agosbin/hammer: Cleanup zone statistics
Tomohiro Kusumi [Sun, 26 Jul 2015 05:59:55 +0000 (14:59 +0900)]
sbin/hammer: Cleanup zone statistics

- No functional changes, things should have been named this way.

8 years agodirfs - Do not acquire dirfs' mount token
Antonio Huete Jimenez [Mon, 27 Jul 2015 16:46:44 +0000 (09:46 -0700)]
dirfs - Do not acquire dirfs' mount token

- dirfs is still marked as non mp-safe so the VN ops are protected
  by VFS_MPLOCK()

8 years agodirfs - Remove no longer needed comment
Antonio Huete Jimenez [Sun, 26 Jul 2015 22:57:33 +0000 (15:57 -0700)]
dirfs - Remove no longer needed comment

8 years agotestcases - Remove posixipc test
Antonio Huete Jimenez [Sun, 26 Jul 2015 16:44:18 +0000 (09:44 -0700)]
testcases - Remove posixipc test

- POSIX IPC tests are already migrated individually to dfregress(8)

8 years agotop.1 - Fix manpage
Antonio Huete Jimenez [Sun, 26 Jul 2015 16:03:46 +0000 (09:03 -0700)]
top.1 - Fix manpage

- This commit follows up 30277d08ae where top(1) went back to
  use RES again after PRES was removed.

8 years agodirfs - Change debug levels
Antonio Huete Jimenez [Sun, 26 Jul 2015 14:49:35 +0000 (07:49 -0700)]
dirfs - Change debug levels

- Specific debug levels are specified for easier debugging:

    1       Calls to VFS operations (mount, umount, ...)
    3       Calls to VN operations (open, close, read, ...)
    5       Calls to subroutines
    9       Everything

- Once dirfs is stabilised, debugging facilities will go and
  only KTR will remain.

8 years agoboot - Fix minor memory leak, statistics
Matthew Dillon [Mon, 27 Jul 2015 04:45:51 +0000 (21:45 -0700)]
boot - Fix minor memory leak, statistics

* open() calls devopen() which installs a generic malloc'd device
  wrapper in f->f_devdata.  However, some devices will replace this
  with their own descriptor.

  Add F_DEVDESC to indicate when f->f_devdata contains this generic
  object, free and clear the generic object when replacing f_devdata
  in particular devices.

  This fixes a minor memory leak of 192 bytes on open()s made by the boot
  code when booting from e.g. PXE.

* Fix incorrect MallocCount statistics.  calloc() and realloc() were
  improperly incrementing the global, even though the malloc() call they
  both make also increments it.

* Remove the unused F_NODEV flag.  This flag is never set, collapse the
  related code.

8 years agotcpdrop: Drop a specific tcp connection or all tcp connections
Sepherosa Ziehau [Sun, 26 Jul 2015 09:20:18 +0000 (17:20 +0800)]
tcpdrop: Drop a specific tcp connection or all tcp connections

Obtained-from: OpenBSD via FreeBSD

8 years agowcscoll.3: Fix copy/paste error (due to wcsxfrm)
John Marino [Sun, 26 Jul 2015 12:38:30 +0000 (14:38 +0200)]
wcscoll.3: Fix copy/paste error (due to wcsxfrm)

8 years agoboot - Put loader heap in high memory
Matthew Dillon [Sun, 26 Jul 2015 08:03:46 +0000 (01:03 -0700)]
boot - Put loader heap in high memory

* We ran out of low BIOS memory.  The initrd.img.gz unpacking requires a
  bit more than ~32KB of temporary space and it ran the loader out of
  low-BIOS heap memory.

  This can cause the loader to fail to load the image and prevent proper
  crypto or single-user bootstrapping.

* Steal the heap from high-memory, just ender the kernel+modules load area
  limit.  For now, steal 1MB, which gives the loader plenty of space again.
  The kernel will lose 1MB of physical memory, boo-hoo.

* The loader must remove the heap from the SMAP passed to the kernel.

* Move any objects requiring VTOPSEG/VTOPOFF out of malloc and into a
  static or stack declaration.

Reported-by: cgag, multiple
8 years agosbin/hammer: Fix memory allocation for zone statistics
Tomohiro Kusumi [Sat, 25 Jul 2015 16:01:33 +0000 (01:01 +0900)]
sbin/hammer: Fix memory allocation for zone statistics

- 2550036 allocates unnecessary amount of memory when the
  filesystem consists of >1 volumes and accounting actually
  reaches to the second volume. This commit fixes it by
  splitting bitmap into bitmaps[2^8] where 2^8 is the maximum
  number of volumes. Other than that it's basically the same.

  layer1/layer2 direct map:
      <------> Max 2^8 volumes
  zzzzvvvvvvvvoooo oooooooooooooooo oooooooooooooooo oooooooooooooooo
  ----111111111111 1111112222222222 222222222ooooooo oooooooooooooooo
              <----...
              Most environment doesn't use address space this
              far as the storage usually isn't as huge as 2^52,
              so hammer_extend_layer2_bits() allocating bitmaps
              for this region mostly ends up waste of memory.
              Having an array bitmaps[2^8] prevents this as the
              volume-bits-masked-laye1-index doesn't jump up by
              2^10 when v part gets ++.

8 years agonetif: Configure mbuf clusters/jclusters limits
Sepherosa Ziehau [Sat, 25 Jul 2015 12:58:08 +0000 (20:58 +0800)]
netif: Configure mbuf clusters/jclusters limits

Default mbuf clusters limit work for most of the network device
drivers.  The drivers modified by this commit:
- Use mbuf jclusters.
- Size of the reception queues could be configured.
- Support multiple reception queues.

et(4) and mxge(4) are special; they use non-cluster mbuf for small
packets reception, so we adjust non-cluster mbuf limit manually in
these two drivers.

8 years agoifnet: Allow drivers to adjust mbuf cluster/jcluster limits
Sepherosa Ziehau [Sat, 25 Jul 2015 08:02:59 +0000 (16:02 +0800)]
ifnet: Allow drivers to adjust mbuf cluster/jcluster limits

This is mainly for raising mbuf clusters/jclusters limits to a high
enough value for device reception queues, e.g. modern network devices
w/ multiple reception queues and each reception queue could consume
>=512 mbuf clusters.

8 years agopatch - Remove RCS and SCCS auto-checkout support
Matthew Dillon [Sat, 25 Jul 2015 02:40:41 +0000 (19:40 -0700)]
patch - Remove RCS and SCCS auto-checkout support

* Remove stale RCS and SCCS support which involves the patch(1) program
  constructing a system() command using filename data supplied from the
  file.  DragonFly deems this to be too dangerous, quoted or not.

Security: CVE-2015-1416
Reported-by: Xin Li, Martin Natano
8 years agokernel/route: Use the netisr threads to initialize the route tables.
Nuno Antunes [Tue, 21 Jul 2015 07:34:24 +0000 (15:34 +0800)]
kernel/route: Use the netisr threads to initialize the route tables.

Reviewed-by: sephe

8 years agosbin/hammer: Enable AssertOnFailure on -d for hammer show/checkmap
Tomohiro Kusumi [Fri, 24 Jul 2015 19:37:04 +0000 (04:37 +0900)]
sbin/hammer: Enable AssertOnFailure on -d for hammer show/checkmap

8 years agosbin/hammer: Cleanup hammer checkmap
Tomohiro Kusumi [Fri, 24 Jul 2015 19:32:00 +0000 (04:32 +0900)]
sbin/hammer: Cleanup hammer checkmap

8 years agosbin/hammer: Make hammer checkmap support zone4
Tomohiro Kusumi [Fri, 24 Jul 2015 17:23:30 +0000 (02:23 +0900)]
sbin/hammer: Make hammer checkmap support zone4

- It's kind of obvious that zone4 never fails on checkmap tests,
  but it was a missing zone as it already supports btree and undos.

- Note that this commit changes condition of error=-5 case in
  blockmap_lookup() by adding "HAMMER_ZONE_FREEMAP_INDEX != zone &&".
  This is necessary as zone4 is really just zone2 and all the
  blockmap offsets have 0x02 in the upper 4 bits which means
  blockmap lookup for zone4 offset always hits this assertion.
  Normal filesystem operations (including other hammer commands
  and newfs_hammer) never need this condition change as they never
  lookup zone4 offset, and in fact blockmap lookup in kernel space
  doesn't have this, however this commit needs it. This should make
  sense though as zone4 really is an exceptional case where all
  data is just a bunch of metadata that is made to effectively
  map storage chunks to zone2.

- Update hammer(8). Now it supports all possible zones but
  it only mentions btree elements.

8 years agosbin/hammer: Use bitmaps for zone statistics
Tomohiro Kusumi [Thu, 23 Jul 2015 20:41:51 +0000 (05:41 +0900)]
sbin/hammer: Use bitmaps for zone statistics

- Didn't squash this with the previous commit in order to be able
  to go back to the previous one (rbtree version) for some reason.

8 years agosbin/hammer: Make hammer show support zone statistics
Tomohiro Kusumi [Thu, 23 Jul 2015 20:35:50 +0000 (05:35 +0900)]
sbin/hammer: Make hammer show support zone statistics

- Update zone statistics while iterating btree and
  print them after btree-walk is done.

- The zone statistics is enabled when -v is specified just
  like hammer checkmap.

- hammer show's statistics use elm->leaf.data_len for used
  bytes, so it could have different number from blockmap/
  checkmap statistics (blockmap/checkmap statistics will
  have the same or higher used bytes as well as percentage).

- Newly added item count is always 0 on blockmap/checkmap
  statistics while it has >0 for zone 8,9,10,11 for show.
  Both hammer blockmap/checkmap are not aware of items in
  each big-block so they can't count items. The idea of
  item is countable only when iterating btree.

8 years agosbin/hammer: Make hammer blockmap support zone statistics
Tomohiro Kusumi [Wed, 22 Jul 2015 19:14:52 +0000 (04:14 +0900)]
sbin/hammer: Make hammer blockmap support zone statistics

- Update zone statistics while iterating layer1/layer2 and
  print them after layer-walk is done.

- The zone statistics is enabled when -v is specified just
  like hammer checkmap.

8 years agosbin/hammer: Add functions for zone statistics
Tomohiro Kusumi [Tue, 21 Jul 2015 19:15:06 +0000 (04:15 +0900)]
sbin/hammer: Add functions for zone statistics

- Add functions to init/cleanup/add/print zone statistics and
  make hammer checkmap's existing zone statistics use these.

- hammer_print_zone_stat() shows something like this. Zones with
  0 blocks doesn't necessary mean it has 0 block in that zone.
  For example checkmap doesn't support zone4 (at this point) so
  the block count is 0, but each volume obviously does have at
  least 1 big-block that belongs to zone4.

  ==========
  HAMMER zone statistics
zone #  blocks       used[B]             used[%]
zone 0  0            0                   0
zone 1  0            0                   0
zone 2  0            0                   0
zone 3  63           528482304           100
zone 4  0            0                   0
zone 5  0            0                   0
zone 6  0            0                   0
zone 7  0            0                   0
zone 8  5            38313984            91.3477
zone 9  2            15776736            94.0367
zone 10 326          2731311104          99.8766
zone 11 23           166333072           86.2106
zone 12 0            0                   0
zone 13 0            0                   0
zone 14 0            0                   0
zone 15 0            0                   0
--------------------------------------------------
total   419          3480217200          99.0153
  ==========

8 years agosbin/hammer: Add struct zone_stat for generic zone statistics
Tomohiro Kusumi [Tue, 21 Jul 2015 17:57:05 +0000 (02:57 +0900)]
sbin/hammer: Add struct zone_stat for generic zone statistics

- Nothing changes, but just replaces the existing hammer checkmap's
  zone statistics with zone_stat[].

- This is for the next few commits that make hammer show/blockmap
  /checkmap provide zone statistics to clarify storage consumption
  by each zone. It's better to have a common data structure to
  retrieve statistics of the same format from different view.

8 years agolm(4): Remove unneeded kernel configuration entries
Imre Vadasz [Fri, 24 Jul 2015 19:22:33 +0000 (21:22 +0200)]
lm(4): Remove unneeded kernel configuration entries

8 years agoLC_TIME locales: Regenerate to fix 23 locales' alt-months
John Marino [Fri, 24 Jul 2015 15:50:19 +0000 (17:50 +0200)]
LC_TIME locales: Regenerate to fix 23 locales' alt-months

The commit diff revealed a regression in the timedef on some locales.
All of these locales have alternative months defined in a separate
xml file used by the cdlr2def tool.  The bug in the tool has been fixed,
and the locale definitions have been regenerated.

8 years agocldr2def tool: Fix alternative month generation
John Marino [Fri, 24 Jul 2015 15:46:02 +0000 (17:46 +0200)]
cldr2def tool: Fix alternative month generation

For some locales defined in tools/tools/locale/etc/charmaps.xml,
there are alternative month names defined in CDATA.  When they are
not present, the POSIX months are just repeated, otherwise this CDATA
set is returned.

The problem is that the spaces and approximately half of the double
quotes were retained as part of the names.  This modification will
strip off the white space and quotes to fix alternative month
definitions.

8 years agombuf: Add helper functions to inc/dec mbuf limits
Sepherosa Ziehau [Fri, 24 Jul 2015 14:51:10 +0000 (22:51 +0800)]
mbuf: Add helper functions to inc/dec mbuf limits

While I'm here, refactor code a little bit.

8 years agombuf: Staticize mbupdatelimits
Sepherosa Ziehau [Fri, 24 Jul 2015 14:40:15 +0000 (22:40 +0800)]
mbuf: Staticize mbupdatelimits

8 years agombuf: Don't allow mbuf thresholds be configured too low.
Sepherosa Ziehau [Fri, 24 Jul 2015 13:00:09 +0000 (21:00 +0800)]
mbuf: Don't allow mbuf thresholds be configured too low.

They still could be configured to a low value through tunables though.

8 years agombuf: Hold mbuf update lock, only if the thresholds are to be changed.
Sepherosa Ziehau [Fri, 24 Jul 2015 12:59:25 +0000 (20:59 +0800)]
mbuf: Hold mbuf update lock, only if the thresholds are to be changed.

While I'm here, assert mbuf update lock in mbupdatelimits()

8 years agosystat(1): Remove an unused extern.
Sascha Wildner [Fri, 24 Jul 2015 10:48:12 +0000 (12:48 +0200)]
systat(1): Remove an unused extern.

8 years agokernel/usb4bsd: Remove bogus header file.
Sascha Wildner [Fri, 24 Jul 2015 10:42:34 +0000 (12:42 +0200)]
kernel/usb4bsd: Remove bogus header file.

8 years agoi386 removal, part 23/x: Remove i386 specific DEBUG_INTERRUPTS and remains.
Sascha Wildner [Fri, 24 Jul 2015 10:42:08 +0000 (12:42 +0200)]
i386 removal, part 23/x: Remove i386 specific DEBUG_INTERRUPTS and remains.

8 years agoi386 removal, part 22/x: Remove some i386 specific assembly language files.
Sascha Wildner [Fri, 24 Jul 2015 09:06:37 +0000 (11:06 +0200)]
i386 removal, part 22/x: Remove some i386 specific assembly language files.

8 years agoImport generated locales (time, money, msg, numeric)
John Marino [Thu, 23 Jul 2015 21:46:56 +0000 (23:46 +0200)]
Import generated locales (time, money, msg, numeric)

All the definitions were generated by the "new" tool located at
src/tools/tools/locale.  It uses CLDR version 2.0.1 and Unicode
release 8.0.0.

The tool is smart enough to eliminate duplicates -- every one of
these real files is unique.  The makefiles are also generated and
are much simpler.

8 years agocldr2def tool: Implement c_format generation
John Marino [Fri, 24 Jul 2015 08:30:19 +0000 (10:30 +0200)]
cldr2def tool: Implement c_format generation

The time definitions were missing c_fmt.  The patch I applied to make
the tool run caused it (it was always a bug, but I didn't fix it
correctly).  The c_formats are not defined, so I'm taking the full
date-time format and stripping any %z or %Z timezone symbols that are
contained within.  It's not perfect, but not too bad either considering.

8 years agokernel - Allow nmbufs, nmbclusters, and nmbjclusters to be adjusted live
Matthew Dillon [Fri, 24 Jul 2015 04:23:46 +0000 (21:23 -0700)]
kernel - Allow nmbufs, nmbclusters, and nmbjclusters to be adjusted live

* Refactor the sysctls for kern.ipc.nmbufs, kern.ipc.nmbclusters,
  and kern.ipc.nmbjclusters, changing from read-only to read-write.
  Use SYSCTL_PROC to automatically apply changes to the object caches.

* Add a function, mbupdatelimits(), which recalculates the objcache
  limits based on nmbufs, nmbclusters, and nmbjclusters.

8 years agokernel - Add objcache_set_cluster_limit()
Matthew Dillon [Fri, 24 Jul 2015 04:22:20 +0000 (21:22 -0700)]
kernel - Add objcache_set_cluster_limit()

* Add objcache_set_cluster_limit() which allows the objcache cluster limit
  for a particular objcache to be adjusted dynamically.

8 years agokernel - wbsio: support NCT6776F (0xc3); supported by lm(4) as W83627DHG (0xc1)
Matthew Dillon [Thu, 23 Jul 2015 21:53:49 +0000 (14:53 -0700)]
kernel - wbsio: support NCT6776F (0xc3); supported by lm(4) as W83627DHG (0xc1)

The sc_devid value of struct wbsio_softc is used to pass the device id
of the SUPERIO chipset to lm, so it can decide whether it's actually an
NCT6776F or the W83627DHG.

Taken-From: OpenBSD
Author: Imre Vadasz <imre@vdsz.com>
Submitted-by: vadaszi bug #2833
8 years agonmalloc - Improve incremental reallocs()
Matthew Dillon [Thu, 23 Jul 2015 21:22:32 +0000 (14:22 -0700)]
nmalloc - Improve incremental reallocs()

* Fix realloc() issue that caused unnecessary unmap/remap operations
  due to the page coloring optimization.

* In addition, scale large reallocations by allowing more wiggle room
  as the allocation becomes larger so overhead isn't quite as geometrically
  bad for programs which do incremental realloc()s to huge sizes.

Initial-patch-by: vadaszi Bug #2832
8 years agolocales/nls: Rename last three zh_han* files
John Marino [Thu, 23 Jul 2015 21:43:24 +0000 (23:43 +0200)]
locales/nls: Rename last three zh_han* files

I missed these on prior commit and it broke world.

8 years agoi386 removal, part 21/x: Remove obsolete i386 specific USERCONFIG bits.
Sascha Wildner [Thu, 23 Jul 2015 20:39:06 +0000 (22:39 +0200)]
i386 removal, part 21/x: Remove obsolete i386 specific USERCONFIG bits.

Even though some of this code was copied over to x86_64, this platform
never had the kernel support.

8 years agolocales: Rename zh_han* to zh_Han* (capitalize)
John Marino [Thu, 23 Jul 2015 21:17:21 +0000 (23:17 +0200)]
locales: Rename zh_han* to zh_Han* (capitalize)

8 years agolocales: Import unused FreeBSD tool to generate locales
John Marino [Thu, 23 Jul 2015 20:31:13 +0000 (22:31 +0200)]
locales: Import unused FreeBSD tool to generate locales

Five years ago, Edwin Groothuis put in a *LOT* of work to create a perl-
based tool that would use the latest Unicode release from The Unicode
Consortium <http://unicode.org> and the latest Unicode CLDR release from
the same organization, and generate all the locale defintions for numeric,
monetary, time, and messages, including generating a readable Makefile.

The tool has the ability to define the conversions from Unicode to lower
resolution formats.  While there were some minor bugs in it, the tool now
works, but for reasons unknown to me right now, it was never imported into
FreeBSD, nor used to improve their localization 5 years ago.

I've generated the new locale definitions which will go in soon.  Note
that the Unicode Consortium no longer provides the "posix" definitions
the tool reads, so these definitions are 3 years old.  Supposedly they
provide tools to generate the POSIX definitions, but I haven't found them
yet.  Once I do, I'll regenerate the locales with the latest CLDR.

Refer: https://wiki.freebsd.org/LocaleNewApproach

8 years agoMove some locales before upcoming overhauls
John Marino [Thu, 23 Jul 2015 17:40:19 +0000 (19:40 +0200)]
Move some locales before upcoming overhauls

Several locales are obsolete and have misleading names.  This moves
many of them at once.  An entry to the UPDATING files notifies what
the new locale options are for users of affected locales.

This is necessary because the upcoming locale updates are going to be
generated and we can avoid carrying ancient aliases over.  Also note
that Serbia's change may not be complete until the entire locales are
updated.

8 years agoi386 removal, part 20/x: Rename boot_pc32.8 -> boot_pc64.8
Sascha Wildner [Thu, 23 Jul 2015 17:05:39 +0000 (19:05 +0200)]
i386 removal, part 20/x: Rename boot_pc32.8 -> boot_pc64.8

8 years agoi386 removal, part 19/x: Remove bogus message in acpi's APM compat code.
Sascha Wildner [Thu, 23 Jul 2015 16:15:49 +0000 (18:15 +0200)]
i386 removal, part 19/x: Remove bogus message in acpi's APM compat code.

8 years agokernel/kbdmux: Fix a panic upon 'shutdown -h now'.
Sascha Wildner [Thu, 23 Jul 2015 17:35:58 +0000 (19:35 +0200)]
kernel/kbdmux: Fix a panic upon 'shutdown -h now'.

Follow-up to fc9700a1359c0dd3fa2c207933975ed59237ba2b.

Why it was ocurring just recently is not 100% clear. According to Matt
it might be a timing issue.

Reported-by: ChibaPet, charlie5
8 years agoRemove no_NO (only use nb_NO and nn_NO)
John Marino [Wed, 22 Jul 2015 21:14:50 +0000 (23:14 +0200)]
Remove no_NO (only use nb_NO and nn_NO)

There are only two variations of Norwegian: Bokmål or nynorsk, both of
which are equally official.  These are established by law and governmental
policy:  Bokmål (literally "book language") and Nynorsk (literally "new
Norwegian").  The Norwegian Language Council recommends the terms
"Newegian Bokmål" and "Norwegian Nynorsk" in English.

The no_NO variant is a holdover from when nb_NO and nn_NO were created.
In glibc, the old no_NO was kept as an alias to nb_NO.  This option is
considered confusing and probably should have been removed years ago.

8 years agolocales LC_NUMERIC: Overhaul completely wrong definitions
John Marino [Wed, 22 Jul 2015 17:08:43 +0000 (19:08 +0200)]
locales LC_NUMERIC: Overhaul completely wrong definitions

I have no idea how the UTF-8 definitions were created.  They appear
to be grouped by (allegedly) similar countries with the same
definitions as other codesets.  The assumption is wrong.  I went through
every POSIX (UTF-8) definition on http://unicode.org and redefined all
UTF-8 locales. Besides being correct, there are 2 additional benefits:
1) The makefile is loads simpler, at least for UTF-8 part
2) This fixes a lot of locale failures on gcc testsuite

8 years agolocales: Add 66 "@euro" symlinks, and UTF8 alias
John Marino [Wed, 22 Jul 2015 13:39:12 +0000 (15:39 +0200)]
locales: Add 66 "@euro" symlinks, and UTF8 alias

While not documented, it appears that modifiers work.  The only widely
used modifier is "@euro" which is an alias for ISO 8859-15 coded which
contains the Euro currently along with 7 other new symbols as compared
to ISO 8859-1.  For all 33 localization sets that use la_LN.ISO8859-15
for LC_CTYPE, I'm creating an @euro and .ISO-8859-15@euro symlink to
them.  These are still found on Linux and the .ISO-8859* extension is
the chosen linux format (this is unfortanately not standardized thus
BSD and Linux differ).  Thus any use of @euro will probably also refer
to the Linux format and that's why I chose it.

For the same reason, .UTF8 versions (Linux) are being symlinked to
DragonFly's .UTF-8 versions.  Symlinks are cheap.

8 years agomake upgrade: Remove 122 dangling locale symlinks
John Marino [Wed, 22 Jul 2015 11:59:56 +0000 (13:59 +0200)]
make upgrade: Remove 122 dangling locale symlinks

The symlinks mechanism that created these extra symlinks has been fixed,
so now let's clean up the mess.

8 years agobsd.links.mk: Support symlinks to directories
John Marino [Wed, 22 Jul 2015 11:54:22 +0000 (13:54 +0200)]
bsd.links.mk: Support symlinks to directories

Recently locales support utilized symlinks to directories.  On the
second installworld, the links were followed and installed there,
creating dangling links.  The commit forces symlinks to directories to
be removed before recreating them (as is done for files).  The effect
on file symlinks is unchanged.

8 years agokernel/acpi_toshiba: Use NULL for pointers.
Sascha Wildner [Tue, 21 Jul 2015 17:25:16 +0000 (19:25 +0200)]
kernel/acpi_toshiba: Use NULL for pointers.

8 years agosys/vfs/hammer: Fix comments
Tomohiro Kusumi [Tue, 21 Jul 2015 10:34:28 +0000 (19:34 +0900)]
sys/vfs/hammer: Fix comments

- Fix comments left unchanged in 1afb73cf. It seems the same comments
  are still effective with rbtree.

8 years agosys/vfs/hammer: Remove unused typedef
Tomohiro Kusumi [Tue, 21 Jul 2015 10:34:00 +0000 (19:34 +0900)]
sys/vfs/hammer: Remove unused typedef

- hammer_seq_t was only used in the early days of hammer.

8 years agosbin/hammer: Fix hammer checkmap big-block offset
Tomohiro Kusumi [Mon, 20 Jul 2015 18:45:36 +0000 (03:45 +0900)]
sbin/hammer: Fix hammer checkmap big-block offset

- hammer checkmap wasn't showing the offset of big-block for each
  layer2 within a layer1 correctly.

- (The checkmap for supported zones works the same, and there was
  nothing nothing wrong with that, but offsets in output were not
  correct)

8 years agosbin/hammer: Make hammer blockmap print all blockmap offsets
Tomohiro Kusumi [Sun, 19 Jul 2015 20:30:07 +0000 (05:30 +0900)]
sbin/hammer: Make hammer blockmap print all blockmap offsets

- Add phys_offset and first_offset, where phys_offset points to
  zone2 address of the layer1 big-block.

8 years agosbin/hammer: Make hammer_parsedevs() initialize NumVolumes
Tomohiro Kusumi [Sun, 19 Jul 2015 15:33:36 +0000 (00:33 +0900)]
sbin/hammer: Make hammer_parsedevs() initialize NumVolumes

- hammer_parsedevs() should initialize NumVolumes as well as
  initializing volumes. This is as simple as incrementing the
  counter each time setup_volume() is called.

- newfs_hammer can tell and initialize NumVolumes from argc,
  however low-level hammer commands that use hammer_parsedevs()
  can't do this because a blkdevs arg contains volumes joined
  by ':'. These commands need a way to initialize NumVolumes.

8 years agosbin/hammer: Cleanup AssertOnFailure assertions on blockmap lookup
Tomohiro Kusumi [Sun, 19 Jul 2015 10:40:16 +0000 (19:40 +0900)]
sbin/hammer: Cleanup AssertOnFailure assertions on blockmap lookup

- Since now that blockmap_lookup() has an unique 'error' value
  for each error, the function can assert-0 at the end of the
  function with the 'error' value when AssertOnFailure is set.

- This makes code clearer as the function doesn't have to have
  two types of error check (assert-cond or goto-done-if-not-cond)
  for 9 different error cases.

8 years agosbin/hammer: Fix fill info of hammer show
Tomohiro Kusumi [Sat, 18 Jul 2015 21:44:02 +0000 (06:44 +0900)]
sbin/hammer: Fix fill info of hammer show

- Printing big-block index within lower 60 bits (layer1/2 combined)
  is not that useful. It should print an index within each layer.

- It dissects zoneX (where X is either of 8,9,10,11) offset into
  layer1 index, layer2 index, big-block offset and prints those.

8 years agosbin/hammer: Minor cleanups
Tomohiro Kusumi [Sat, 18 Jul 2015 20:12:54 +0000 (05:12 +0900)]
sbin/hammer: Minor cleanups

- Some minor cleanups.

8 years agokernel/syscons: Enable kern.kms_console by default (if *kms.ko are loaded).
Sascha Wildner [Tue, 21 Jul 2015 07:03:43 +0000 (09:03 +0200)]
kernel/syscons: Enable kern.kms_console by default (if *kms.ko are loaded).

8 years agokernel - Hack pcm audio for firefox issue
Matthew Dillon [Tue, 21 Jul 2015 04:01:52 +0000 (21:01 -0700)]
kernel - Hack pcm audio for firefox issue

* Observed that the firefox thread handling sound output winds up being
  in a cpu-bound loop calling poll() on two descriptors, one being the
  /dev/dsp descriptor.  With some debugging, determined that this call
  occurs with the sound buffer ~slightly less than half full.

  The sound is generated via the dports/audio/alsa-plugins (oss) library,
  but the poll() appears to come from the snd_pcm_ioplug subsystem.  It
  appears that this subsystem has a bug in it when pacing sound output,
  it still polls and live-loops on the sound output descriptor even when
  it has no new data to send to the decriptor.

* There could be something else going on here with assumptions made by
  linux sound client code vs our implementation, but I don't know what
  they might be.

* This is probably not the correct fix, but we hack in a change to not
  generate POLLWR events until the sound buffer is at least half empty.
  This matches up with observed behavior from the above subsystem and
  prevents the cpu loop.

  It should be harmless to other code using kqueue/select/poll.

  Appears to fix firefox's live looping in poll() during sound and
  video (w/sound) playback.

8 years agokernel - Fix pmap_change_attr() use cases.
Matthew Dillon [Mon, 20 Jul 2015 18:27:49 +0000 (11:27 -0700)]
kernel - Fix pmap_change_attr() use cases.

* In DragonFly this function takes a page count, not a byte count.
  some calls were made with a byte count, others with a page count.

  Note that in FreeBSD this function takes a byte count, but after
  reviewing the use cases I decided to normalize it all to a page count.

* Fixes reported DRM issues.  Might also fix test branch ehci/ethernet
  panics due to memory corruption when DRM is loaded.

8 years agokernel - Fix general MSI/interrupt issue with HDAA
Matthew Dillon [Mon, 20 Jul 2015 18:21:47 +0000 (11:21 -0700)]
kernel - Fix general MSI/interrupt issue with HDAA

* Testing on J1900, MSI didn't work and the normal interrupt mode
  was stuck on, resulting in an interrupt storm.

* Problem was tracked down to a missing initialization of the WAKEEN
  (wake enable) bits.  Intel errata documentation clarifies that these bits
  might not be cleared by a chip reset (since the idea is to support a
  wake event).

  On the J1900 some of these bits were found to be set, which caused
  STATESTS to force an interrupt event and prevent additional
  MSI events.

* Clearing the WAKEEN bits fixes the interrupt storm and MSI appears to
  work again.  STATESTS is only used to detect CODECs and there's no reason
  to try to clear it (which would mess up driver reloads).

* Remove the QUIRK added in the previous commit.

* Reverse the resource hint test, run it after loading the quirk table
  so it can override the quirk table.

8 years agousb4bsd/pci: Correct typo in bootverbose message
Markus Pfeiffer [Mon, 20 Jul 2015 13:37:30 +0000 (14:37 +0100)]
usb4bsd/pci: Correct typo in bootverbose message

8 years agokernel - Quick Baytrail to disable MSI
Matthew Dillon [Mon, 20 Jul 2015 06:41:42 +0000 (23:41 -0700)]
kernel - Quick Baytrail to disable MSI

* Intel hdac on valleyview (Baytrail id?) interrupt does not work with MSI,
  quirk it off.  This is a medium-end Atom cpu.

* Tested on Intel(R) Celeron(R) CPU  J1900 @ 1.99GHz system.

8 years agodrm - Add valleyview support
Matthew Dillon [Mon, 20 Jul 2015 06:00:24 +0000 (23:00 -0700)]
drm - Add valleyview support

* Fix infininte loop during PCI iteration.  The previous code was not
  actually iterating, so any loop would wind up being infinite.  Valleyview
  triggers this issue.

* Fix improper register offset in intel_gpio_setup() (note, linux master
  also made this fix in April).

* Allow hw.drm.debug to be modified with a sysctl.

8 years agokernel - Add valleyview PCI ids and support to agp.
Matthew Dillon [Mon, 20 Jul 2015 05:55:58 +0000 (22:55 -0700)]
kernel - Add valleyview PCI ids and support to agp.

* Add valleyview PCI ids and support.

* Fix a number of cases where gpu PCI space registers were being accessed
  via the bridge.  Parts of the GPU PCI space was replicated on the bridge
  in the past, but not necessarily in the future and not in valleyview.

8 years agokernel - Add PCI functionality
Matthew Dillon [Mon, 20 Jul 2015 05:52:09 +0000 (22:52 -0700)]
kernel - Add PCI functionality

* Add pci_iterate_class() for the drm code.

8 years agopowerd: Add options to limit CPU power domains' frequency
Sepherosa Ziehau [Fri, 17 Jul 2015 14:50:06 +0000 (22:50 +0800)]
powerd: Add options to limit CPU power domains' frequency

8 years agokernel/acpi: Prefer _BIX to _BIF for battery info if it is present.
Sascha Wildner [Sun, 19 Jul 2015 18:36:00 +0000 (20:36 +0200)]
kernel/acpi: Prefer _BIX to _BIF for battery info if it is present.

As it is stated in the ACPI specification 6.0:
"The _BIF object is deprecated in lieu of _BIX in ACPI 4.0."

The seven additional fields of the package which _BIX returns
are skipped for now.

8 years agoStop removing /usr/include/machine/ieee.h via 'make upgrade' again.
Sascha Wildner [Sun, 19 Jul 2015 18:03:33 +0000 (20:03 +0200)]
Stop removing /usr/include/machine/ieee.h via 'make upgrade' again.

It is now installed again.

8 years agokernel/usb4bsd: Fix buildkernel.
Sascha Wildner [Sun, 19 Jul 2015 17:30:25 +0000 (19:30 +0200)]
kernel/usb4bsd: Fix buildkernel.

8 years agoddb: Add a command to call the ACPICA debugger if ACPI_DEBUG is specified.
Sascha Wildner [Sun, 19 Jul 2015 11:46:05 +0000 (13:46 +0200)]
ddb: Add a command to call the ACPICA debugger if ACPI_DEBUG is specified.

Code stolen from AcpiDbUserCommands() but it won't AcpiTerminate() upon
"Exit" or "Quit" commands so that we may 'continue' from ddb.

8 years agokernel/kprintf: Implement the space flag, as in '% 7ld'.
Sascha Wildner [Sat, 2 May 2015 09:31:15 +0000 (11:31 +0200)]
kernel/kprintf: Implement the space flag, as in '% 7ld'.

The ACPICA debugger needs it for the 'Info Misc' command.

8 years agokernel/usb4bsd: Add device enumeration and port power disabling support.
Sascha Wildner [Sun, 19 Jul 2015 10:34:45 +0000 (12:34 +0200)]
kernel/usb4bsd: Add device enumeration and port power disabling support.

Adds some sysctls/tunables, none of which are set by default.

8 years agogcc50: Change c++ locale handling
John Marino [Sat, 18 Jul 2015 22:22:03 +0000 (00:22 +0200)]
gcc50: Change c++ locale handling

The biggest change is removing the modification of the specified locale.
Before locales without extensions were appended with ".UTF-8" and
modifiers (e.g. @euro) were silently stripped off.

The latter is probably a bad idea, and even if we want to continue doing
this (modifiers are not supported), it should be done at the library
level, not at c++ on gcc level.  The no-extension problem has been solved
today by creating symlinks at /usr/share/locale.

The logic of the "gnu" support was mimicked by using newlocale, duplocale,
and freelocale.  The generic version uses setlocale only.  This patch will
be pushed upstream most likely.

8 years agosbin/hammer: Make hammer blockmap show verbose info on -v
Tomohiro Kusumi [Sat, 18 Jul 2015 15:41:22 +0000 (00:41 +0900)]
sbin/hammer: Make hammer blockmap show verbose info on -v

- Shows volume# and layer1/layer2 index or offset when -v(v) is used.

8 years agosys/vfs/hammer: Add HAMMER_BLOCKMAP_LAYER[12]_INDEX()
Tomohiro Kusumi [Sat, 18 Jul 2015 15:38:43 +0000 (00:38 +0900)]
sys/vfs/hammer: Add HAMMER_BLOCKMAP_LAYER[12]_INDEX()

- This commit adds HAMMER_BLOCKMAP_LAYER[12]_INDEX() which is
  /=sizeof(layer[12]) version of HAMMER_BLOCKMAP_LAYER[12]_OFFSET().

- This is useful as it sometimes (the next commit, debugging, etc)
  wants to retrieve an index of layer1/2 instead of an offset.

8 years agosbin/hammer: Align zone# in hammer blockmap output
Tomohiro Kusumi [Sat, 18 Jul 2015 09:49:34 +0000 (18:49 +0900)]
sbin/hammer: Align zone# in hammer blockmap output

- Use printf("%-2d") for zone.

8 years agosbin/newfs_hammer: Minor fixes
Tomohiro Kusumi [Sat, 18 Jul 2015 07:32:04 +0000 (16:32 +0900)]
sbin/newfs_hammer: Minor fixes

- It's better to call rel_volume() for the root volume here
  without waiting for potential non-root ones to do it as
  they all modifies the root volume.

- Also add assertions to ensure a caller calls this function
  for the root volume first, and then non-root volumes.
  (non-root volumes do += to these volume statistics)

8 years agosbin/hammer: Remove modified1 flag
Tomohiro Kusumi [Sat, 18 Jul 2015 06:57:31 +0000 (15:57 +0900)]
sbin/hammer: Remove modified1 flag

- modified1 isn't necessary and also the code is clearer without
  this flag.

- Once layer1 big-block is initialized, the only thing allocator
  has to do to layer1 is ++ or -- layer1->blocks_free and update
  crc. So it's better to just update crc whenever layer1->blocks_free
  got ++ or --.

8 years agodefault/compilers.conf: Fix include path
John Marino [Sat, 18 Jul 2015 17:27:33 +0000 (19:27 +0200)]
default/compilers.conf: Fix include path

Reported by: zrj

8 years agoOpenLIBM: Undefine two C99 macros
John Marino [Sat, 18 Jul 2015 15:04:01 +0000 (17:04 +0200)]
OpenLIBM: Undefine two C99 macros

Martynas@openbsd believes that only fast FMA for float is implemented,
and that the double and long double versions are not "fast".  This also
matches what FreeBSD has so I'm reverting these new definitions on his
recommendation.

8 years agoCreate short name locales
John Marino [Sat, 18 Jul 2015 09:13:51 +0000 (11:13 +0200)]
Create short name locales

In other (non-BSD?) platforms, it's possible to use a locale such as
"en_GB".  Up until now, this did not work on DragonFly.  It required
a codeset as well, so if "en_GB.UTF-8" wasn't specified, setlocale
would fail.

Every locale except two has a version that uses the UTF-8 codeset,
so a symlink was created to these to create these territory locales.
The other two are
  hi_IN => hi_IN.ISCII-DEV
  la_LN => la_LN.ISO8859-1

This should improve cross-platform compatibility, and it will lead
to a change in gcc50 libstdc++ locale handling.

While here, set the "share" directory to build in parallel rather
than serially.

8 years agoGCC50: Upgrade base compiler to GCC release 5.2
John Marino [Sat, 18 Jul 2015 07:27:06 +0000 (09:27 +0200)]
GCC50: Upgrade base compiler to GCC release 5.2

8 years agoMerge branch 'vendor/GCC50'
John Marino [Sat, 18 Jul 2015 07:51:54 +0000 (09:51 +0200)]
Merge branch 'vendor/GCC50'

8 years agoUpdate gcc-50 to SVN version 225979 (gcc-5-branch)
John Marino [Sat, 18 Jul 2015 01:50:11 +0000 (03:50 +0200)]
Update gcc-50 to SVN version 225979 (gcc-5-branch)

This is equivalent to gcc 5.2 release plus a few additional commits
that came through when the gcc-5 branch reopened.

Last Changed Date: 2015-07-18 02:16:08 +0200 (Sat, 18 Jul 2015)

8 years agodevfs: Use lwkt_domsg() instead of lwkt_sendmsg() + lwkt_waitport().
Nuno Antunes [Sat, 4 Aug 2012 08:03:23 +0000 (09:03 +0100)]
devfs: Use lwkt_domsg() instead of lwkt_sendmsg() + lwkt_waitport().

* lwkt_domsg() already implements the concept of synchronous message
  execution, use it instead.

* The caller of devfs_msg_send_sync() has allocated the message and
  keeps a reference to it, so we don't need to return the reference
  back.  Return the message error instead.