]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
11 years agoMerge from vmcontention
attilio [Thu, 7 Feb 2013 10:24:04 +0000 (10:24 +0000)]
Merge from vmcontention

11 years agoReformat comments to follow original version and re-add correct
attilio [Wed, 6 Feb 2013 23:48:04 +0000 (23:48 +0000)]
Reformat comments to follow original version and re-add correct
locking flags.

11 years agoMerge from vmcontention
attilio [Wed, 6 Feb 2013 23:42:04 +0000 (23:42 +0000)]
Merge from vmcontention

11 years agoDo not assume the lock to be held so that this can be used also in
attilio [Wed, 6 Feb 2013 19:03:48 +0000 (19:03 +0000)]
Do not assume the lock to be held so that this can be used also in
safe cases as a short-cut.

11 years agoTweak comment to remove splay tree references.
attilio [Wed, 6 Feb 2013 19:02:46 +0000 (19:02 +0000)]
Tweak comment to remove splay tree references.

11 years agoMake vm_object_cache_is_empty() inline.
attilio [Wed, 6 Feb 2013 18:59:34 +0000 (18:59 +0000)]
Make vm_object_cache_is_empty() inline.

11 years agoCleanup vm_radix KPI:
attilio [Wed, 6 Feb 2013 18:37:46 +0000 (18:37 +0000)]
Cleanup vm_radix KPI:
- Avoid the return value for vm_radix_insert()
- Name the functions argument per-style(9)
- Avoid to get and return opaque objects but use vm_page_t as vm_radix is
  thought to not really be general code but to cater specifically page
  cache and resident cache.

11 years agoFixup r246423 by adding vm_radix.h includes where it is not present
attilio [Wed, 6 Feb 2013 18:33:32 +0000 (18:33 +0000)]
Fixup r246423 by adding vm_radix.h includes where it is not present
currently.

11 years agoAvoid a namespace pollution in vm_object.h by defining separately the
attilio [Wed, 6 Feb 2013 18:04:28 +0000 (18:04 +0000)]
Avoid a namespace pollution in vm_object.h by defining separately the
structure for vm_radix implementation.

11 years agoEnrich comments on newly added assertions.
attilio [Wed, 6 Feb 2013 17:47:24 +0000 (17:47 +0000)]
Enrich comments on newly added assertions.

11 years ago- Move the vm_object_cache_is_empty() prototype to be sorted
attilio [Wed, 6 Feb 2013 17:27:41 +0000 (17:27 +0000)]
- Move the vm_object_cache_is_empty() prototype to be sorted
  alphabetically.
- Change the return type to be boolean_t in order to match what
  vm_page_is_cached() does.

11 years agoFix mismerge.
attilio [Wed, 6 Feb 2013 17:22:16 +0000 (17:22 +0000)]
Fix mismerge.

11 years agoReduce diffs against HEAD.
attilio [Wed, 6 Feb 2013 17:17:11 +0000 (17:17 +0000)]
Reduce diffs against HEAD.

11 years agoRevert previously added locking to tmpfs_mapped{read, write}.
attilio [Wed, 6 Feb 2013 15:06:26 +0000 (15:06 +0000)]
Revert previously added locking to tmpfs_mapped{read, write}.
This part needs to be overhauled anyway and this will be done in a
separate branch.
Just cope with changes to let the radix trie compile.

11 years agoNow that vm_page_cache_free() and vm_page_cache_transfer() are
attilio [Wed, 6 Feb 2013 14:50:34 +0000 (14:50 +0000)]
Now that vm_page_cache_free() and vm_page_cache_transfer() are
reimplemented as ranged operations, sync vm_page_is_cached() semantic
with HEAD.

11 years agoReduce diffs against HEAD:
attilio [Wed, 6 Feb 2013 14:29:05 +0000 (14:29 +0000)]
Reduce diffs against HEAD:
Reimplement vm_page_cache_free() as a range operation.

11 years agoMerge from vmcontention
attilio [Wed, 6 Feb 2013 11:59:32 +0000 (11:59 +0000)]
Merge from vmcontention

11 years agoMFC
attilio [Wed, 6 Feb 2013 11:49:43 +0000 (11:49 +0000)]
MFC

11 years agoMake sure that all mouse buttons are released when clients
hselasky [Wed, 6 Feb 2013 11:16:18 +0000 (11:16 +0000)]
Make sure that all mouse buttons are released when clients
using /dev/consolectl close. This fixes a problem where if
a USB mouse is detached while a button is pressed, that
button is never released.

MFC after: 1 week

11 years agoFixes to QUEUE_MACRO_DEBUG support:
glebius [Wed, 6 Feb 2013 07:27:25 +0000 (07:27 +0000)]
Fixes to QUEUE_MACRO_DEBUG support:
 - Add const quilifiers to fields that store value of __FILE__.
 - Use long type for fields that store value of __LINE__.
 - Sort and style(9) debugging fields.
 - Add initializer for debugging fields into TAILQ_INITIALIZER macro.

PR: 175759
Submitted by: Andrey Simonenko <simon comsys.ntu-kpi.kiev.ua>
Reviewed by: bde

11 years agoBusy-wait when cold.
np [Wed, 6 Feb 2013 06:44:42 +0000 (06:44 +0000)]
Busy-wait when cold.

Reported by: gnn, jhb
MFC after: 3 days

11 years agoCompute the number of initial kernel page table pages (NKPT) dynamically.
neel [Wed, 6 Feb 2013 04:53:00 +0000 (04:53 +0000)]
Compute the number of initial kernel page table pages (NKPT) dynamically.

This eliminates the need to recompile the kernel when the default value
of NKPT is not big enough - for e.g. when loading large kernel modules
or memory disk images from the loader.

If NKPT is defined in the kernel configuration file then it overrides the
dynamic calculation.

Reviewed by: alc, kib

11 years agoUse and set gpio pin to high to power up usb.
ganbold [Wed, 6 Feb 2013 01:03:13 +0000 (01:03 +0000)]
Use and set gpio pin to high to power up usb.

Approved by: gonzo@

11 years agoAdd the __aeabi_mem* functions to compiler-rt as clang uses them.
andrew [Wed, 6 Feb 2013 00:01:28 +0000 (00:01 +0000)]
Add the __aeabi_mem* functions to compiler-rt as clang uses them.

11 years agosh: Do not test for digit_contig in mksyntax.
jilles [Tue, 5 Feb 2013 22:54:09 +0000 (22:54 +0000)]
sh: Do not test for digit_contig in mksyntax.

ISO/IEC 9899:1999 (E) 5.2.1p3 guarantees that the values of the characters
0123456789 are contiguous.

The generated syntax.c and syntax.h remain the same.

Submitted by: Christoph Mallon

11 years agoRemove reference to the rlist code from comments, and fix a typo visible
pluknet [Tue, 5 Feb 2013 20:08:33 +0000 (20:08 +0000)]
Remove reference to the rlist code from comments, and fix a typo visible
in the resulted change.

Reviewed by: kib
MFC after: 1 week

11 years ago* Add the integer div & mod functions and ARM EABI support functions to
andrew [Tue, 5 Feb 2013 20:03:58 +0000 (20:03 +0000)]
* Add the integer div & mod functions and ARM EABI support functions to
  libstand.
* Stop linking the ARM U-Boot loader against libgcc now libstand has the
  required symbols.

11 years agoInstall <dev/agp/agpreg.h> and <dev/pci/pcireg.h> as userland headers
jhb [Tue, 5 Feb 2013 18:55:09 +0000 (18:55 +0000)]
Install <dev/agp/agpreg.h> and <dev/pci/pcireg.h> as userland headers
in /usr/include.

MFC after: 2 weeks

11 years agoAdd defines to more easily allow a single threaded version of the FreeBSD
hselasky [Tue, 5 Feb 2013 14:44:25 +0000 (14:44 +0000)]
Add defines to more easily allow a single threaded version of the FreeBSD
USB stack. This is useful for non-kernel purposes, like the loader.

11 years agoRemove political propaganda
des [Tue, 5 Feb 2013 14:39:37 +0000 (14:39 +0000)]
Remove political propaganda

11 years agoBump .Dd for the change in r246121.
zeising [Tue, 5 Feb 2013 14:29:37 +0000 (14:29 +0000)]
Bump .Dd for the change in r246121.

Approved by: joel (mentor)

11 years agoFix some nits.
hselasky [Tue, 5 Feb 2013 13:30:07 +0000 (13:30 +0000)]
Fix some nits.

11 years agoFix depend target.
hselasky [Tue, 5 Feb 2013 12:37:50 +0000 (12:37 +0000)]
Fix depend target.

11 years agoLoad the pfsync module if necessary.
des [Tue, 5 Feb 2013 12:18:39 +0000 (12:18 +0000)]
Load the pfsync module if necessary.

Reviewed by: glebius@
MFC after: 1 week

11 years agoBuild clang for little-endian arm by default. Due to size issues when built
andrew [Tue, 5 Feb 2013 05:16:02 +0000 (05:16 +0000)]
Build clang for little-endian arm by default. Due to size issues when built
with gcc disable CLANG_FULL for now.

11 years agoRemove two dead assignments and
ganbold [Tue, 5 Feb 2013 04:13:34 +0000 (04:13 +0000)]
Remove two dead assignments and
make use of sc more explicit and clear

Submitted by: Christoph Mallon
Approved by: gonzo@

11 years agoext2fs: move assignment where it is not dead.
pfg [Tue, 5 Feb 2013 03:26:34 +0000 (03:26 +0000)]
ext2fs: move assignment where it is not dead.

Submitted by: Christoph Mallon
MFC after: 2 weeks

11 years agoext2fs: Remove unused em_e2fsb definition..
pfg [Tue, 5 Feb 2013 03:23:56 +0000 (03:23 +0000)]
ext2fs: Remove unused em_e2fsb definition..

Submitted by: Christoph Mallon
MFC after: 2 weeks

11 years agoext2fs: Remove useless rootino local variable.
pfg [Tue, 5 Feb 2013 03:17:41 +0000 (03:17 +0000)]
ext2fs: Remove useless rootino local variable.

Submitted by: Christoph Mallon
MFC after: 2 weeks

11 years agoext2fs: Correct off-by-one errors in FFTODT() and DDTOFT().
pfg [Tue, 5 Feb 2013 03:13:05 +0000 (03:13 +0000)]
ext2fs: Correct off-by-one errors in FFTODT() and DDTOFT().

Submitted by: Christoph Mallon
MFC after: 2 weeks

11 years agoext2fs: Use nitems().
pfg [Tue, 5 Feb 2013 03:08:56 +0000 (03:08 +0000)]
ext2fs: Use nitems().

Submitted by: Christoph Mallon
MFC after: 2 weeks

11 years agoext2fs: Use EXT2_LINK_MAX instead of LINK_MAX
pfg [Tue, 5 Feb 2013 03:01:04 +0000 (03:01 +0000)]
ext2fs: Use EXT2_LINK_MAX instead of LINK_MAX

Submitted by: Christoph Mallon
MFC after: 2 weeks

11 years agocrunchgen: Permit use of alternative linkers.
pfg [Tue, 5 Feb 2013 02:57:59 +0000 (02:57 +0000)]
crunchgen: Permit use of alternative linkers.

Submitted by: Pete Chou
MFC after: 1 week

11 years agoAdd gpio driver and update dts and kernel config accordingly.
ganbold [Tue, 5 Feb 2013 02:25:13 +0000 (02:25 +0000)]
Add gpio driver and update dts and kernel config accordingly.

Approved by: gonzo@

11 years agoRework jumbo frame handling. QAC confirmed that the controller
yongari [Tue, 5 Feb 2013 00:37:45 +0000 (00:37 +0000)]
Rework jumbo frame handling.  QAC confirmed that the controller
requires 8 bytes alignment on RX buffer.  Given that non-jumbo
frame works on any alignments I guess this DMA limitation for RX
buffer could be jumbo frame specific one.  Also I'm not sure
whether this DMA limitation is related with 64bit DMA.  Previously
age(4) disabled 64bit DMA addressing due to silent data corruption.
So we may need more testing on re-enabling 64bit DMA in future.

While I'm here, change mbuf chaining algorithm to use fixed sized
buffer and force software checksum if controller reports length
error. According to QAC, RFD is not updated at all for jumbo frame
so it works just like alc(4) controllers.  This change also added
alignment fixup for strict alignment architectures.  Because I'm
not aware of any non-x86 machines that use age(4) controllers it's
just for completeness at this moment.

Wit this change, jumbo frame should work with age(4).

Tested by: Christian Gusenbauer < c47g <> gmx dot at >
MFC after: 1 week

11 years agoFix compilation.
attilio [Tue, 5 Feb 2013 00:33:32 +0000 (00:33 +0000)]
Fix compilation.

11 years agoRestrengten vn_has_cached_data() by also checking the resident pages
attilio [Tue, 5 Feb 2013 00:20:00 +0000 (00:20 +0000)]
Restrengten vn_has_cached_data() by also checking the resident pages
count, just like HEAD does.

11 years agoReduce diffs against HEAD:
attilio [Tue, 5 Feb 2013 00:09:33 +0000 (00:09 +0000)]
Reduce diffs against HEAD:
- Reimplement vm_page_cache_transfer() properly
- Remove vm_page_cache_rename() as a subsequent change

11 years agoMerge from vmcontention
attilio [Mon, 4 Feb 2013 22:15:36 +0000 (22:15 +0000)]
Merge from vmcontention

11 years agoMFC
attilio [Mon, 4 Feb 2013 22:10:01 +0000 (22:10 +0000)]
MFC

11 years agoReduce differences with HEAD.
attilio [Mon, 4 Feb 2013 22:05:22 +0000 (22:05 +0000)]
Reduce differences with HEAD.

11 years agoktr: prevent possible footshooting with KTR_ENTRIES and KTR_BOOT_ENTRIES
avg [Mon, 4 Feb 2013 21:58:57 +0000 (21:58 +0000)]
ktr: prevent possible footshooting with KTR_ENTRIES and KTR_BOOT_ENTRIES

Suggested by: adrian
MFC after: 14 days
X-MFC with: r246282

11 years agoktr: copy content from the early static buffer if KTR_ENTRIES !=
avg [Mon, 4 Feb 2013 21:50:55 +0000 (21:50 +0000)]
ktr: copy content from the early static buffer if KTR_ENTRIES !=
KTR_BOOT_ENTRIES

Reported by: glebius, jhb
Pointyhat to: avg
MFC after: 14 days
X-MFC with: r246282

11 years agoUse stripesize as smallest block size if it's available.
delphij [Mon, 4 Feb 2013 19:17:15 +0000 (19:17 +0000)]
Use stripesize as smallest block size if it's available.

MFC after: 2 weeks

11 years agoSort by MK_* knob like the comment says
des [Mon, 4 Feb 2013 19:05:53 +0000 (19:05 +0000)]
Sort by MK_* knob like the comment says

MFC after: 1 week

11 years agoMissed adding Makefile.config and unit-tests/Makefile should
sjg [Mon, 4 Feb 2013 17:41:17 +0000 (17:41 +0000)]
Missed adding Makefile.config and unit-tests/Makefile should
allow FreeBSD make to do 'obj'.

Approved by: marcel (mentor)

11 years agong_ether_ifnet_arrival_event: check interface type before using IFP2NG
avg [Mon, 4 Feb 2013 17:29:13 +0000 (17:29 +0000)]
ng_ether_ifnet_arrival_event: check interface type before using IFP2NG

The check is copied from vnet_ng_ether_init.
Not sure if it covers all the types that we want to support with
ng_ether.

Reported by: markj
Discussed with: zec
MFC after: 10 days
X-MFC with: r246245

11 years agoMerge from vmcontention
attilio [Mon, 4 Feb 2013 15:44:42 +0000 (15:44 +0000)]
Merge from vmcontention

11 years agoCast *tabchar, a wchar_t, to a wint_t as it is the type the %lc printf
andrew [Mon, 4 Feb 2013 10:05:55 +0000 (10:05 +0000)]
Cast *tabchar, a wchar_t, to a wint_t as it is the type the %lc printf
format string expects. This is only an issue on ARM EABI where wint_t is
different to wchar_t.

11 years agoUse the STACKALIGN macro to alight the stack rather than with a magic mask.
andrew [Mon, 4 Feb 2013 09:48:50 +0000 (09:48 +0000)]
Use the STACKALIGN macro to alight the stack rather than with a magic mask.

Submitted by: Christoph Mallon <christoph.mallon gmx.de>

11 years agoAdd #undef TARGET_DEFAULT back as it shouldn't have been removed in r245539
andrew [Mon, 4 Feb 2013 09:42:12 +0000 (09:42 +0000)]
Add #undef TARGET_DEFAULT back as it shouldn't have been removed in r245539

11 years agoTry to improve r242655 take III: move these SYSCTLs describing the kernel
marius [Mon, 4 Feb 2013 09:35:48 +0000 (09:35 +0000)]
Try to improve r242655 take III: move these SYSCTLs describing the kernel
map, which is defined and initialized in vm/vm_kern.c, to the latter.

Submitted by: alc

11 years agoFix xdev by using the install shell script as it knows about the -l
andrew [Mon, 4 Feb 2013 09:34:25 +0000 (09:34 +0000)]
Fix xdev by using the install shell script as it knows about the -l
argument thile the local version install may not.

11 years agoAllow the unwind functions int libgcc_s to interact correctly with libthr.
andrew [Mon, 4 Feb 2013 09:28:36 +0000 (09:28 +0000)]
Allow the unwind functions int libgcc_s to interact correctly with libthr.

_Unwind_ForcedUnwind in libgcc_s takes as one of it's parameters a stop
function to tell it when to stop unwinding. One of the stop function's
parameters is a _Unwind_Exception_Class. On most architectures this is an
int64_t, however on ARM EABI the gcc developers have made this a char array
with 8 items. While both of these take the same space they are passed into
the stop function differently, an int64_t is passed in in registers r2 and
r3, while the char[8] is passed in as a pointer to the first item in
register r2.

Because libthr expects the value to be an int64_t we would get incorrect
results when it passes a function that take an int64_t but libgcc passes in
a pointer to a char array including crashing.

The fix is to update libgcc_s to make it pass an int64_t to the stop
function and to libstdc++ as it expects _Unwind_Exception_Class to be an
array.

11 years agoDetect address wrapup without defining the right boundary.
attilio [Mon, 4 Feb 2013 08:53:51 +0000 (08:53 +0000)]
Detect address wrapup without defining the right boundary.

11 years agoExtend GDB to check the value in the .note.tag section along with the
andrew [Mon, 4 Feb 2013 06:59:33 +0000 (06:59 +0000)]
Extend GDB to check the value in the .note.tag section along with the
.note.ABI-tag section.

This helps on ARM EABI where the OS/ABI field is zero. It would be better
to use the NOTES program header however this would require a more invasive
change.

11 years agoFurther improve r242655 and supply VM_{MIN,MAX}_KERNEL_ADDRESS as constant
marius [Sun, 3 Feb 2013 21:43:55 +0000 (21:43 +0000)]
Further improve r242655 and supply VM_{MIN,MAX}_KERNEL_ADDRESS as constant
values to SYSCTL_ULONG(9) where possible.

Submitted by: bde

11 years ago- Make pci_ns8250_ids[] const.
marius [Sun, 3 Feb 2013 21:30:29 +0000 (21:30 +0000)]
- Make pci_ns8250_ids[] const.
- Use DEVMETHOD_END.
- Use NULL instead of 0 for pointers.

MFC after: 1 week

11 years agoUFS: Remove dead assignment.
pfg [Sun, 3 Feb 2013 21:30:02 +0000 (21:30 +0000)]
UFS: Remove dead assignment.

Submitted by: Christoph Mallon
MFC after: 3 days

11 years agocrunchide(1): Put e_shnum into a local variable.
pfg [Sun, 3 Feb 2013 21:16:33 +0000 (21:16 +0000)]
crunchide(1): Put e_shnum into a local variable.

This simplifies the code a bit.

Submitted by: Cristoph Mallon
MFC after: 2 weeks

11 years agoAdd several missing symbols to libcxxrt's symbol version map, and remove
dim [Sun, 3 Feb 2013 20:40:41 +0000 (20:40 +0000)]
Add several missing symbols to libcxxrt's symbol version map, and remove
a few duplicates.  This should fix building world with -stdlib=libc++
after r246028.

Submitted by: Yamaya Takashi <yamayan@kbh.biglobe.ne.jp>
MFC after: 1 week
X-MFC-With: r246028

11 years agocrunchide(1): support non-custom elf object layout
pfg [Sun, 3 Feb 2013 20:35:37 +0000 (20:35 +0000)]
crunchide(1): support non-custom elf object layout

The crunchide utility presumes the last 3 chunks of an ELF object
layout are section headers, symbol table, and then string table.
However, this is  not specified in the ELF standards, and linkers
may generate different layouts when doing partial linking (-r).

This change is required to build FreeBSD with mclinker or the
gold linker.

PR: bin/174011
Submitted by: Pete Chou
Reviewed by: Cristoph Mallon
MFC after: 2 weeks

11 years agoMFC
attilio [Sun, 3 Feb 2013 20:13:33 +0000 (20:13 +0000)]
MFC

11 years agozfs: fix, improve and re-organize page_lookup and page_unlock
avg [Sun, 3 Feb 2013 18:42:20 +0000 (18:42 +0000)]
zfs: fix, improve and re-organize page_lookup and page_unlock

Now they are split into two pairs: page_hold/page_unhold for mappedread
and page_busy/page_unbusy for update_pages.

For mappedread we simply hold a page that is to be used as a source if it
is resident and valid (and not busy).  This is sufficient since we are
only doing page -> user buffer copying.  There is no page <-> backing
storage I/O involved.

update_pages is now better split to properly handle the putpages case
(page -> arc) and the regular write case (arc -> page).

For the latter we use complete protocol of marking an object with
paging-in-progress and marking a page with io_start (busy count).
Also, in this case we remove the write bit from all page mappings and
clear dirty bits of the pages, the former is needed to ensure that the
latter does the right thing.
Additionally we update a page if it is cached instead of just freeing it
as was done before.  This needs to be verified.

A minor detail: ZFS-backed pages should always be either fully valid
or fully invalid.  Assert this and use simpler API that does not deal
with sub-page blocks.

Reviewed by: kib
MFC after: 26 days

11 years agoFor UFS2 i_blocks is unsigned. The current "sanity" check that it
mckusick [Sun, 3 Feb 2013 17:16:32 +0000 (17:16 +0000)]
For UFS2 i_blocks is unsigned. The current "sanity" check that it
has gone below zero after the blocks in its inode are freed is a
no-op which the compiler fails to warn about because of the use of
the DIP macro. Change the sanity check to compare the number of
blocks being freed against the value i_blocks. If the number of
blocks being freed exceeds i_blocks, just set i_blocks to zero.

Reported by: Pedro Giffuni (pfg@)
MFC after:   2 weeks

11 years agosh: Expand here documents in the current process.
jilles [Sun, 3 Feb 2013 15:54:57 +0000 (15:54 +0000)]
sh: Expand here documents in the current process.

Expand here documents at the same point other redirections are expanded but
use a non-fork subshell environment (like simple command substitutions) for
compatibility. Substitition errors result in an empty here document like
before.

As a result, a fork is avoided for short (<4K) expanded here documents.

Unexpanded here documents (with quoted end marker after <<) are not affected
by this change. They already only forked when >4K.

Side effects:
* Order of expansion is slightly different.
* Slow expansions are not executed in parallel with the redirected command.
* A non-fork subshell environment is subtly different from a forked process.

11 years ago- Add CHECKSUM.* support in Makefile[1].
hrs [Sun, 3 Feb 2013 10:26:24 +0000 (10:26 +0000)]
- Add CHECKSUM.* support in Makefile[1].
- Use ln -fs to create a symlink.
- Remove pkgadd for docports.
- Use WITHOUT_JADETEX=yes instead of WITH_JADETEX=no.
- Add {WORLD,KERNEL}_FLAGS to [BTWK]MAKE.
- Use makefs(8) and gpart(8) for sparc64 ISO image[2].
- Add publisher option to makefs(8)[2].

Based on work by: gjb[1]
Discussed with: marius, nwhitehorn[2]

11 years agoallow for large KTR_ENTRIES values by allocating ktr_buf using malloc(9)
avg [Sun, 3 Feb 2013 09:57:39 +0000 (09:57 +0000)]
allow for large KTR_ENTRIES values by allocating ktr_buf using malloc(9)

Only during very early boot, before malloc(9) is functional (SI_SUB_KMEM),
the static ktr_buf_init is used.  Size of the static buffer is determined
by a new kernel option KTR_BOOT_ENTRIES.  Its default value is 1024.

This commit builds on top of r243046.

Reviewed by: alc
MFC after: 17 days

11 years agocrunch: Sync some NetBSD changes
pfg [Sun, 3 Feb 2013 01:54:25 +0000 (01:54 +0000)]
crunch: Sync some NetBSD changes

Fix a couple of free's in previous commit.

Obtained from: NetBSD
MFC after: 1 week

11 years agoAnother overhaul of the CPSW driver for BeagleBone
kientzle [Sun, 3 Feb 2013 01:08:01 +0000 (01:08 +0000)]
Another overhaul of the CPSW driver for BeagleBone

Major changes:
  * Finally tracked down the flow control setting that
    seems to have been causing TX stalls and watchdog timeouts
  * RX and TX paths now share a lot more code
  * TX interrupt is no longer used; we instead GC finished
    tx queue entries at the bottom of the start routine.
  * TX start now queues fragmented packets directly; it only
    invokes defrag() for occasional very fragmented packets.
  * "sysctl dev.cpsw" dumps controller statistics and queue counts
  * Host Error Interrupt will give extensive debugging information
    if the controller chokes on the queued data.

11 years agoFix the PowerPC DTrace copy functions. The kernel doesn't hold the same view to
jhibbits [Sun, 3 Feb 2013 00:19:34 +0000 (00:19 +0000)]
Fix the PowerPC DTrace copy functions.  The kernel doesn't hold the same view to
the user map, so use the md copy in/out functions provided by the kernel.

MFC with: r242723

11 years agoRegenerate src.conf(5).
dim [Sat, 2 Feb 2013 22:52:24 +0000 (22:52 +0000)]
Regenerate src.conf(5).

11 years agoAdd missing src.conf(5) fragments for WITHOUT_LIBCPLUSPLUS and WITH_GPL_DTC.
dim [Sat, 2 Feb 2013 22:42:46 +0000 (22:42 +0000)]
Add missing src.conf(5) fragments for WITHOUT_LIBCPLUSPLUS and WITH_GPL_DTC.

11 years agocrunch: Sync some NetBSD changes
pfg [Sat, 2 Feb 2013 22:39:21 +0000 (22:39 +0000)]
crunch: Sync some NetBSD changes

Revert a comment that was not supposed to go away.

Obtained from: NetBSD

11 years agoRegenerate src.conf(5).
dim [Sat, 2 Feb 2013 22:36:02 +0000 (22:36 +0000)]
Regenerate src.conf(5).

11 years agoPull in r170135 from upstream clang trunk:
dim [Sat, 2 Feb 2013 22:28:29 +0000 (22:28 +0000)]
Pull in r170135 from upstream clang trunk:

  Dont use/link ARCMT, StaticAnalyzer and Rewriter to clang when the user
  specifies not to. Dont build ASTMatchers with Rewriter disabled and
  StaticAnalyzer when it's disabled.

  Without all those three, the clang binary shrinks (x86_64) from ~36MB
  to ~32MB (unstripped).

To disable these clang components, and get a smaller clang binary built
and installed, set WITHOUT_CLANG_FULL in src.conf(5).  During the
initial stages of buildworld, those extra components are already
disabled automatically, to save some build time.

MFC after: 1 week

11 years agoext2fs: general cleanup.
pfg [Sat, 2 Feb 2013 22:23:45 +0000 (22:23 +0000)]
ext2fs: general cleanup.

- Remove unused extern declarations in fs.h
- Correct comments in ext2_dir.h
- Several panic() messages showed wrong function names.
- Remove commented out stray line in ext2_alloc.c.
- Remove the unused macro EXT2_BLOCK_SIZE_BITS() and the then
  write-only member e2fs_blocksize_bits from struct m_ext2fs.
- Remove the unused macro EXT2_FIRST_INO() and the then write-only
  member e2fs_first_inode from struct m_ext2fs.
- Remove EXT2_DESC_PER_BLOCK() and the member e2fs_descpb from
  struct m_ext2fs.
- Remove the unused members e2fs_bmask, e2fs_dbpg and
  e2fs_mount_opt from struct m_ext2fs
- Correct harmless off-by-one error for fspath in ext2_vfsops.c.
- Remove the unused and broken macros EXT2_ADDR_PER_BLOCK_BITS()
  and EXT2_DESC_PER_BLOCK_BITS().
- Remove the !_KERNEL versions of the EXT2_* macros.

Submitted by: Christoph Mallon
MFC after: 2 weeks

11 years agoImprove r238673 to additionally allow for odd-aligned buffers as
marius [Sat, 2 Feb 2013 21:57:06 +0000 (21:57 +0000)]
Improve r238673 to additionally allow for odd-aligned buffers as
passed in by smartd of smartmontools.
While at it, hint the compiler that 32-bit PIO is the most likely
case (idea from Linux) and use bus_{read,write}_stream_2(9) instead
of bus_{read,write}_multi_stream_2(9) for single count reads/writes.

MFC after: 1 week

11 years agocrunch: Sync some NetBSD changes.
pfg [Sat, 2 Feb 2013 21:51:14 +0000 (21:51 +0000)]
crunch: Sync some NetBSD changes.

crunchide:
Apr 11, 2009: fix some -Wsign-compare issues.
Sep 20, 1999: Free the right thing.

crunchgen:
Apr 14, 2009: Fix some WARNS=4 issues (-Wshadow -Wcast-qual)
Oct 30, 2004: Add (unsigned char) cast to ctype functions
Feb 5, 2001: fix nested extern.

examples:
Aug 30, 2007: NetBSD 36867 - trsp references are deprecated

Obtained from: NetBSD
MFC after: 1 week

11 years agoUse the default policy table of RFC 6724.
ume [Sat, 2 Feb 2013 18:08:09 +0000 (18:08 +0000)]
Use the default policy table of RFC 6724.

MFC after: 1 weeks

11 years agofix some fat-fingering in r246246
avg [Sat, 2 Feb 2013 14:19:50 +0000 (14:19 +0000)]
fix some fat-fingering in r246246

Submitted by: mjg
Pointyhat to: avg
MFC after: 5 days
X-MFC with: r246246

11 years agorevert accidentally committed unneeded changes from r246250
avg [Sat, 2 Feb 2013 12:52:43 +0000 (12:52 +0000)]
revert accidentally committed unneeded changes from r246250

MFC after: 7 days
X-MFC with: r246250

11 years agoacpi: clear power button status bit after waking up...
avg [Sat, 2 Feb 2013 12:44:19 +0000 (12:44 +0000)]
acpi: clear power button status bit after waking up...

so that it is not confused for a new power off request.

Learned from: Linux and ACPI specification
Tested by: gjb
MFC after: 12 days

11 years agoacpi: after wakeup from a state > S1 re-enable SCI_EN with a direct write
avg [Sat, 2 Feb 2013 12:42:07 +0000 (12:42 +0000)]
acpi: after wakeup from a state > S1 re-enable SCI_EN with a direct write

This hack is picked up from Linux, which claims that it follows
Windows behavior.

PR: amd64/174409
Tested by: Sergey V. Dyatko <sergey.dyatko@gmail.com>,
KAHO Toshikazu <kaho@elam.kais.kyoto-u.ac.jp>,
Slawa Olhovchenkov <slw@zxy.spb.ru>
MFC after: 13 days

11 years agocpususpend_handler: mark AP as resumed only after fully setting up lapic
avg [Sat, 2 Feb 2013 12:04:32 +0000 (12:04 +0000)]
cpususpend_handler: mark AP as resumed only after fully setting up lapic

Reviewed by: jhb
Tested by: Sergey V. Dyatko <sergey.dyatko@gmail.com>,
KAHO Toshikazu <kaho@elam.kais.kyoto-u.ac.jp>
MFC after: 12 days

11 years agox86 suspend/resume: suspend pics and pseudo-pics in reverse order
avg [Sat, 2 Feb 2013 12:02:42 +0000 (12:02 +0000)]
x86 suspend/resume: suspend pics and pseudo-pics in reverse order

- change 'pics' from STAILQ to TAILQ
- ensure that Local APIC is always first in 'pics'

Reviewed by: jhb
Tested by: Sergey V. Dyatko <sergey.dyatko@gmail.com>,
KAHO Toshikazu <kaho@elam.kais.kyoto-u.ac.jp>
MFC after: 12 days

11 years agoprint compiler version in the kernel banner
avg [Sat, 2 Feb 2013 11:58:35 +0000 (11:58 +0000)]
print compiler version in the kernel banner

And provide kernel compiler version as a sysctl as well.
This is useful while we have gcc and clang cohabitation.
This could be even more useful when we have support
for external toolchains.

In cooperation with: mjg
MFC after: 13 days

11 years agong_ether: track interface renaming
avg [Sat, 2 Feb 2013 11:54:00 +0000 (11:54 +0000)]
ng_ether: track interface renaming

Also sanitize interface names that can potentially contain characters
that are prohibited in netgraph names.

PR: kern/154850 (sanitizing of names)
Discussed with: eri, melifaro
Submitted by: Nikolay Denev <ndenev@gmail.com> (sanitizing code)
Reviewed by: eri, glebius
MFC after: 17 days

11 years agosolaris compat: remove KM_ZERO
avg [Sat, 2 Feb 2013 11:41:05 +0000 (11:41 +0000)]
solaris compat: remove KM_ZERO

- there is no such flag in Solaris and derivatives
- the flag was added in an unrelated change
- the flag is not used

The proper way to allocate zeroed out memory is to use kmem_zalloc.

MFC after: 3 days

11 years agouart: add resume method and enable it for attachments on the most common
avg [Sat, 2 Feb 2013 11:38:26 +0000 (11:38 +0000)]
uart: add resume method and enable it for attachments on the most common
x86 buses

Otherwise the uart hardware could be in such a state after the resume
where IER is cleared and thus no interrupts are generated.

This behavior is observed and tested with QEMU, so I am comitting this
change to help with my debugging.
There has been no feedback from users of serial ports on real hardware.

MFC after: 20 days