]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
12 years agoFix a typo: use lower case in "A Shorthand".
pluknet [Tue, 6 Mar 2012 09:57:50 +0000 (09:57 +0000)]
Fix a typo: use lower case in "A Shorthand".

Noted by: maxim

12 years agoKill EoL whitespaces.
pluknet [Tue, 6 Mar 2012 09:40:34 +0000 (09:40 +0000)]
Kill EoL whitespaces.

12 years agoCosmetic nit:
pluknet [Tue, 6 Mar 2012 09:34:30 +0000 (09:34 +0000)]
Cosmetic nit:
- rename isspace1() macro to the more appropriate rtld_isspace().

Discussed with: kib

12 years agoThe missing part of r232588 that documents ifaddr_byindex() itself.
pluknet [Tue, 6 Mar 2012 09:04:53 +0000 (09:04 +0000)]
The missing part of r232588 that documents ifaddr_byindex() itself.

MFC after: 1 week

12 years ago- ifnet_addrs has gone and replaced by ifaddr_byindex(), as per r83130
pluknet [Tue, 6 Mar 2012 08:59:42 +0000 (08:59 +0000)]
- ifnet_addrs has gone and replaced by ifaddr_byindex(), as per r83130
- access to the AF_LINK address through if_addrhead is deprecated (r128315)

MFC after: 1 week

12 years agoGarbage collect some unused symbols.
jmallett [Tue, 6 Mar 2012 08:40:21 +0000 (08:40 +0000)]
Garbage collect some unused symbols.

12 years agoMake the native sigreturn just wrap set_mcontext, much as freebsd32_sigreturn
jmallett [Tue, 6 Mar 2012 08:10:48 +0000 (08:10 +0000)]
Make the native sigreturn just wrap set_mcontext, much as freebsd32_sigreturn
does.

12 years agoStore TLS base in the sigframe just as is done in freebsd32_sendsig. Because
jmallett [Tue, 6 Mar 2012 08:02:10 +0000 (08:02 +0000)]
Store TLS base in the sigframe just as is done in freebsd32_sendsig.  Because
the native sigreturn doesn't use set_mcontext like the COMPAT_FREEBSD32 version
does, this wouldn't actually result in overwriting the TLS base.  Probably it
makes sense to restructure the native sigreturn to use set_mcontext for
consistency, and to allow sigreturn to change the TLS base.

12 years agoFix two and a half oversights in COMPAT_FREEBSD32 related to contexts and
jmallett [Tue, 6 Mar 2012 07:50:45 +0000 (07:50 +0000)]
Fix two and a half oversights in COMPAT_FREEBSD32 related to contexts and
TLS:
o) The mc_tls field used to store the TLS base when doing context gets and
   restores was left a pointer and not converted to a 32-bit integer.  This
   had the bug of not correctly capturing the TLS value desired by the user,
   and the extra nastiness of making the structure the wrong size.
o) The mc_tls field was not being saved by sendsig.  As a result, the TLS base
   would always be set to NULL when restoring from a signal handler.

Thanks to gonzo for helping track down a bunch of other TLS bugs that came out
of tracking these down.

12 years agoWhen emulating rdhwr for TLS, use the 32-bit offset under COMPAT_FREEBSD32.
jmallett [Tue, 6 Mar 2012 07:47:28 +0000 (07:47 +0000)]
When emulating rdhwr for TLS, use the 32-bit offset under COMPAT_FREEBSD32.

12 years ago- Switch ARM and MIPS to TLS Variant I
gonzo [Tue, 6 Mar 2012 03:42:54 +0000 (03:42 +0000)]
- Switch ARM and MIPS to TLS Variant I
- Fix TLS allocation  for Variant I: both rtld and libc allocators
    assume that tls_static_space includes space for TLS structure.
    So increment calculated static size by the size of it.

12 years agoImplement _set_tp
gonzo [Tue, 6 Mar 2012 03:30:09 +0000 (03:30 +0000)]
Implement _set_tp

12 years ago- Remove NOSHARED parts since it seems to be no-op
gonzo [Tue, 6 Mar 2012 03:29:46 +0000 (03:29 +0000)]
- Remove NOSHARED parts since it seems to be no-op
- Call _init_tls for statically linked binaries

12 years ago- Switch to saving non-offseted pointer to TLS block in order too keep things simple
gonzo [Tue, 6 Mar 2012 03:27:58 +0000 (03:27 +0000)]
- Switch to saving non-offseted pointer to TLS block in order too keep things simple

12 years ago- Switch to saving non-offseted pointer to TLS block in order too keep things simple
gonzo [Tue, 6 Mar 2012 03:27:08 +0000 (03:27 +0000)]
- Switch to saving non-offseted pointer to TLS block in order too keep things simple

12 years agoPrepare for large TLS redo. Save pointer to the beginning of TLS area,
gonzo [Tue, 6 Mar 2012 03:25:50 +0000 (03:25 +0000)]
Prepare for large TLS redo. Save pointer to the beginning of TLS area,
    and offset it only if requested by RDHWR handler. Otherwise things
    get overly complicated - we need to track whether address passsed in
    request for setting td_md.md_tls is already offseted or not.

12 years agoIn the trap messages that aid the primitive debugging environment of MIPS,
jmallett [Tue, 6 Mar 2012 02:23:15 +0000 (02:23 +0000)]
In the trap messages that aid the primitive debugging environment of MIPS,
include the tid as well, so it's easier to tell which thread of a process
with multiple is responsible for a crash.

12 years agoLink EV_SET(3) to kqueue(2).
pjd [Mon, 5 Mar 2012 20:59:34 +0000 (20:59 +0000)]
Link EV_SET(3) to kqueue(2).

MFC after: 3 days

12 years agoThe libmap.conf initialization is performed before TLS is functional.
kib [Mon, 5 Mar 2012 20:43:06 +0000 (20:43 +0000)]
The libmap.conf initialization is performed before TLS is functional.
Since after r232498 the ctype macros require working access to
thread-local variables, rtld crashes when libmap.conf is present.

Use hand-made isspace1() macro which is enough to detect spaces in
libmap.conf.

Reported by: alc, lme, many on current@
Tested by: lme
Reviewed by: dim, kan
MFC after: 1 week

12 years agoActually bump date, sigh.
pluknet [Mon, 5 Mar 2012 20:04:28 +0000 (20:04 +0000)]
Actually bump date, sigh.

12 years agoFix boot2 to handle boot config files that only contain a custom path to
jhb [Mon, 5 Mar 2012 19:53:17 +0000 (19:53 +0000)]
Fix boot2 to handle boot config files that only contain a custom path to
a loader or kernel.  Specifically, kname cannot be pointed at cmd[] since
it's value is change to be an empty string after the initial call to
parse, and cmd[]'s value can be changed (thus losing a prior setting for
kname) due to user input at the boot prompt.  While here, ensure that that
initial boot config file text is nul-terminated, that ops is initialized
to zero, and that kname is always initialized to a valid string.

Tested by: Domagoj Smolcic  rank1seeker of gmail
MFC after: 1 week

12 years agoFix three instances of a missing word.
jhb [Mon, 5 Mar 2012 19:38:59 +0000 (19:38 +0000)]
Fix three instances of a missing word.

Submitted by: bjk

12 years agoFix few style nits.
jkim [Mon, 5 Mar 2012 18:47:42 +0000 (18:47 +0000)]
Fix few style nits.

12 years agoFix typo. Bump .Dd for the previous change.
pluknet [Mon, 5 Mar 2012 17:38:44 +0000 (17:38 +0000)]
Fix typo. Bump .Dd for the previous change.

12 years agoMake growfs(8) mostly style compliant. No functional changes,
trasz [Mon, 5 Mar 2012 16:37:51 +0000 (16:37 +0000)]
Make growfs(8) mostly style compliant.  No functional changes,
verified with MD5.

12 years agoPrint out process name and thread id in the debugging message.
ivoras [Mon, 5 Mar 2012 14:19:43 +0000 (14:19 +0000)]
Print out process name and thread id in the debugging message.
This is useful because the message can end up in system logs in
non-debugging operation.

Reviewed by: attilio (earlier version)

12 years agoApply inlined vn_vget_ino() algorithm for ".." lookup in pseudofs.
kib [Mon, 5 Mar 2012 11:38:02 +0000 (11:38 +0000)]
Apply inlined vn_vget_ino() algorithm for ".." lookup in pseudofs.

Reported and tested by: pho
MFC after: 2 weeks

12 years agoAdd DWC OTG module to ARM builds.
hselasky [Mon, 5 Mar 2012 06:46:35 +0000 (06:46 +0000)]
Add DWC OTG module to ARM builds.

MFC after: 1 week

12 years agoFix for DWC OTG interrupt register programming.
hselasky [Mon, 5 Mar 2012 06:41:44 +0000 (06:41 +0000)]
Fix for DWC OTG interrupt register programming.
Fix a compiler warning.
Add missing header file.

MFC after: 1 week

12 years agoFix ng_ipfw(4) cookie number in example.
glebius [Mon, 5 Mar 2012 06:12:15 +0000 (06:12 +0000)]
Fix ng_ipfw(4) cookie number in example.

Pointed out by: "Jacco van Buuren" <jaccovanbuuren gmail.com>

12 years agoMake the chroot shell more functional by providing devfs.
nwhitehorn [Mon, 5 Mar 2012 02:40:18 +0000 (02:40 +0000)]
Make the chroot shell more functional by providing devfs.

Reported by: Robert Simmons
MFC after: 4 days

12 years agoOops - used the wrong field.
adrian [Mon, 5 Mar 2012 02:36:15 +0000 (02:36 +0000)]
Oops - used the wrong field.

Noticed by: nwhitehorn

12 years agoAdd the thread id to the net80211 alq records.
adrian [Sun, 4 Mar 2012 23:13:52 +0000 (23:13 +0000)]
Add the thread id to the net80211 alq records.

This will (hopefully) aid in debugging concurrency related issues.

12 years agoFix style(9) issues.
adrian [Sun, 4 Mar 2012 23:04:16 +0000 (23:04 +0000)]
Fix style(9) issues.

12 years agoFix a thinko in r232322, where gcc (and its tools) are not built during
dim [Sun, 4 Mar 2012 21:36:18 +0000 (21:36 +0000)]
Fix a thinko in r232322, where gcc (and its tools) are not built during
the cross-tools stage, if CC=clang and WITH_CLANG_IS_CC is not set.

This causes no 'cc' to be installed in the temporary cross-tools tree,
making lint fall over later in the build, because it ignores ${CC} and
attempts to run 'cc' anyway.

To fix this, only skip building gcc during cross-tools, if WITHOUT_GCC
is set, or if WITH_CLANG_IS_CC is set.

Pointy hat to: dim
MFC after: 2 weeks

12 years agoExclude USB drivers (except umass and ukbd) from main kernel image on i386
rmh [Sun, 4 Mar 2012 21:31:13 +0000 (21:31 +0000)]
Exclude USB drivers (except umass and ukbd) from main kernel image on i386
and amd64.

Reviewed by: hselasky, arch, usb
Approved by: kib (mentor)

12 years agoCopy amd64 ptrace.h to x86 and merge with i386 ptrace.h. Replace
tijl [Sun, 4 Mar 2012 20:24:28 +0000 (20:24 +0000)]
Copy amd64 ptrace.h to x86 and merge with i386 ptrace.h. Replace
amd64/i386/pc98 ptrace.h with stubs.

For amd64 PT_GETXSTATE and PT_SETXSTATE have been redefined to match the
i386 values. The old values are still supported but should no longer be
used.

Reviewed by: kib

12 years agoDo not use INT64_C and UINT64_C to define 64 bit integer limits. They
tijl [Sun, 4 Mar 2012 20:02:20 +0000 (20:02 +0000)]
Do not use INT64_C and UINT64_C to define 64 bit integer limits.  They
aren't defined for C++ code unless __STDC_CONSTANT_MACROS is defined.

Reported by: jhb

12 years agoRespect phy-handle property in Ethernet nodes of the device tree.
raj [Sun, 4 Mar 2012 19:22:52 +0000 (19:22 +0000)]
Respect phy-handle property in Ethernet nodes of the device tree.

This lets specify whereabouts of the parent PHY for a given MAC node
(and get rid of ugly kludges in mge(4) and tsec(4)).

Obtained from: Semihalf
MFC after: 1 week

12 years agoChange SYSINIT priorities so that ip_mroute_modevent() is executed
zec [Sun, 4 Mar 2012 18:59:38 +0000 (18:59 +0000)]
Change SYSINIT priorities so that ip_mroute_modevent() is executed
before vnet_mroute_init(), since vnet_mroute_init() depends on mfchashsize
tunable to be set, and that is done in in ip_mroute_modevent().
Apparently I broke that ordering with r208744 almost 2 years ago...

PR: kern/162201
Submitted by: Stevan Markovic (mcafee.com)
MFC after: 3 days

12 years agoDocument pci_find_extcap() and pci_find_htcap().
jhb [Sun, 4 Mar 2012 18:55:33 +0000 (18:55 +0000)]
Document pci_find_extcap() and pci_find_htcap().

12 years agoRather than printing the output from route add for all FIBs just print them
bz [Sun, 4 Mar 2012 18:53:35 +0000 (18:53 +0000)]
Rather than printing the output from route add for all FIBs just print them
for the default FIB followed by a statement with a list of FIB numbers for
all the other FIBs we install the routes for.

Request by: kib (to make it less noisy)
Tested by: kib
MFC after: 3 days

12 years agoIn nd6_options() ignore the RFC 6106 options completely rather than printing
bz [Sun, 4 Mar 2012 18:51:45 +0000 (18:51 +0000)]
In nd6_options() ignore the RFC 6106 options completely rather than printing
them if nd6_debug is enabled as unknown.  Leave a comment about the RFC4191
option as I am undecided so far.

Discussed with: hrs
MFC after: 3 days

12 years agoCorrect typo in the RFC number for the constants based on IANA assignments
bz [Sun, 4 Mar 2012 18:47:20 +0000 (18:47 +0000)]
Correct typo in the RFC number for the constants based on IANA assignments
for IPv6 Neighbor Discovery Option types for "IPv6 Router Advertisement
Options for DNS Configuration".  It is RFC 6106.

MFC after: 3 days

12 years agoRemove unused #defines. All this is now retrieved from the device tree.
raj [Sun, 4 Mar 2012 18:13:45 +0000 (18:13 +0000)]
Remove unused #defines. All this is now retrieved from the device tree.

MFC after: 1 week

12 years agoPermit the use of raidz3 in pc-sysinstall
eadler [Sun, 4 Mar 2012 17:33:22 +0000 (17:33 +0000)]
Permit the use of raidz3 in pc-sysinstall

PR: conf/164709
Submitted by: Garrett Cooper <yanegomi@gmail.com>
Reviewed by: brd, brooks
Approved by: cperciva
MFC after: 3 days

12 years agoFix race condition in KfRaiseIrql().
brucec [Sun, 4 Mar 2012 17:08:43 +0000 (17:08 +0000)]
Fix race condition in KfRaiseIrql().

After getting the current irql, if the kthread gets preempted and
subsequently runs on a different CPU, the saved irql could be wrong.

Also, correct the panic string.

PR: kern/165630
Submitted by: Vladislav Movchan <vladislav.movchan at gmail.com>

12 years agoBump date as modified the man page
eadler [Sun, 4 Mar 2012 16:59:45 +0000 (16:59 +0000)]
Bump date as modified the man page

Submitted by: gjb

12 years agoExplicitly list dependency
eadler [Sun, 4 Mar 2012 16:46:27 +0000 (16:46 +0000)]
Explicitly list dependency

PR: misc/160463
Submitted by: Garrett Cooper <yanegomi@gmail.com>
Helped by: kan
Approved by: cperciva
MFC after: 3 days

12 years agoRemove outdated comment of seven years
eadler [Sun, 4 Mar 2012 16:44:04 +0000 (16:44 +0000)]
Remove outdated comment of seven years

PR: docs/116116
Approved by: cperciva
MFC after: 1 week

12 years agoRemove reference to gcc's non-standard -fwritable-strings, which
eadler [Sun, 4 Mar 2012 16:41:07 +0000 (16:41 +0000)]
Remove reference to gcc's non-standard -fwritable-strings, which
doesn't exist in recent releases (and is bad advice anyway)

PR: docs/163119
Submitted by: Yuri Pankov <yuri.pankov@gmail.com>
Approved by: cperciva
MFC after: 1 week

12 years agoPOSIX mandates that swab do nothing when len < 0
eadler [Sun, 4 Mar 2012 16:39:08 +0000 (16:39 +0000)]
POSIX mandates that swab do nothing when len < 0

PR: kern/140690
Submitted by: Jeremy Huddleston <jeremyhu@apple.com>
Approved by: cperciva
MFC after: 2 weeks

12 years agoFix a variety of grammar issues and style nits.
eadler [Sun, 4 Mar 2012 16:37:44 +0000 (16:37 +0000)]
Fix a variety of grammar issues and style nits.

PR: docs/165668
Submitted by: Robert Simmons <rsimmons0@gmail.com>
Reviewed by: kaduk@mit.edu
Approved by: cperciva
MFC after: 1 week

12 years agoehci tunables are only available when kernel is compiled with USB_DEBUG
eadler [Sun, 4 Mar 2012 16:26:49 +0000 (16:26 +0000)]
ehci tunables are only available when kernel is compiled with USB_DEBUG

PR: docs/163646
Reported by: Momchil Ivanov <momchil@xaxo.eu>
Submitted by: Benjamin Kaduk <kaduk@mit.edu>
Approved by: cperciva
MFC after: 1 week

12 years agoReapply 227753 (xlocale cleanup), plus some fixes so that it passes build
theraven [Sun, 4 Mar 2012 15:31:13 +0000 (15:31 +0000)]
Reapply 227753 (xlocale cleanup), plus some fixes so that it passes build
universe with gcc.

Approved by: dim (mentor)

12 years agoAdd __aeabi_read_tp to the symbol list.
cognet [Sun, 4 Mar 2012 15:25:11 +0000 (15:25 +0000)]
Add  __aeabi_read_tp to the symbol list.

12 years agoPR: docs/158813
eadler [Sun, 4 Mar 2012 15:22:03 +0000 (15:22 +0000)]
PR: docs/158813
Submitted by: Ben Kaduk <kaduk@mit.edu>
Approved by: bcr
MFC after: 1 week

12 years agopipe_read(): change the type of size to int, and remove signed clamp.
kib [Sun, 4 Mar 2012 15:09:01 +0000 (15:09 +0000)]
pipe_read(): change the type of size to int, and remove signed clamp.
pipe_write(): change the type of desiredsize back to int, its value fits.

Requested by: bde
MFC after:    3 weeks

12 years agoInstead of incomplete handling of read(2)/write(2) return values that
kib [Sun, 4 Mar 2012 14:55:37 +0000 (14:55 +0000)]
Instead of incomplete handling of read(2)/write(2) return values that
does not fit into registers, declare that we do not support this case
using CTASSERT(), and remove endianess-unsafe code to split return value
into td_retval.

While there, change the style of the sysctl debug.iosize_max_clamp
definition.

Requested by: bde
MFC after: 3 weeks

12 years agoRemove unneeded cast to u_int. The values as small enough to fit into
kib [Sun, 4 Mar 2012 14:51:42 +0000 (14:51 +0000)]
Remove unneeded cast to u_int. The values as small enough to fit into
int, beside the use of MIN macro which performs type promotions.

Submitted by: bde
MFC after: 3 weeks

12 years agoCopy amd64 trap.h to x86 and replace amd64/i386/pc98 trap.h with stubs.
tijl [Sun, 4 Mar 2012 14:12:57 +0000 (14:12 +0000)]
Copy amd64 trap.h to x86 and replace amd64/i386/pc98 trap.h with stubs.

12 years agoCopy amd64 float.h to x86 and merge with i386 float.h. Replace
tijl [Sun, 4 Mar 2012 14:00:32 +0000 (14:00 +0000)]
Copy amd64 float.h to x86 and merge with i386 float.h. Replace
amd64/i386/pc98 float.h with stubs.

12 years agoRestore proper dot symbol creation for assembly files in the kernel build case.
andreast [Sun, 4 Mar 2012 11:55:28 +0000 (11:55 +0000)]
Restore proper dot symbol creation for assembly files in the kernel build case.
Without this patch we were not able to see the assembly function.
Only the function descriptor was visible.

- Distinguish between user-land and kernel when creating the ENTRY() point of
  assembly source.
- Make the ENTRY() macro more readable, replace the .align directive with the
  gas platform independant .p2align directive.
- Create an END()macro for later use to provide traceback tables on powerpc64.

12 years agoProperly restore curvnet context when returning early from
zec [Sun, 4 Mar 2012 11:11:03 +0000 (11:11 +0000)]
Properly restore curvnet context when returning early from
ether_input_internal().

This change only affects options VIMAGE kernel builds.

PR: kern/165643
Submitted by: Vijay Singh
MFC after: 3 days

12 years agoRemove unnecessary casts
kevlo [Sun, 4 Mar 2012 09:48:58 +0000 (09:48 +0000)]
Remove unnecessary casts

12 years agoFix build w/o 'options IEEE80211_SUPPORT_MESH'.
glebius [Sun, 4 Mar 2012 09:45:43 +0000 (09:45 +0000)]
Fix build w/o 'options IEEE80211_SUPPORT_MESH'.

12 years agoClean up style(9) nits
kevlo [Sun, 4 Mar 2012 09:38:20 +0000 (09:38 +0000)]
Clean up style(9) nits

12 years agoAdd support for PWM controlled fans. I found these fans on my PowerMac9,1.
andreast [Sun, 4 Mar 2012 08:43:33 +0000 (08:43 +0000)]
Add support for PWM controlled fans. I found these fans on my PowerMac9,1.
These fans are not located under the same node as the the RPM controlled ones,
So I had to adapt the current source to parse and fill the properties correctly.
To control the fans we can set the PWM ratio via sysctl between 20 and 100%.

Tested by: nwhitehorn
MFC after: 3 weeks

12 years ago* Introduce new flag for QoS control field;
adrian [Sun, 4 Mar 2012 05:52:26 +0000 (05:52 +0000)]
* Introduce new flag for QoS control field;
* Change in mesh_input to validate that QoS is set and Mesh Control field
  is present, also both bytes of the QoS are read;
* Moved defragmentation in mesh_input before we try to forward packet as
  inferred from amendment spec, because Mesh Control field only present in first
  fragment;
* Changed in ieee80211_encap to set QoS subtype and Mesh Control field present,
  only first fragment have Mesh Control field present bit equal to 1;

Submitted by: monthadar@gmail.com

12 years ago* Added IEEE80211_ACTION_CAT_MESH in ieee80211.h as specified amendment spec;
adrian [Sun, 4 Mar 2012 05:49:39 +0000 (05:49 +0000)]
* Added IEEE80211_ACTION_CAT_MESH in ieee80211.h as specified amendment spec;
* Moved old categories as specified by D4.0 to be action fields of MESH category
  as specified in amendment spec;
* Modified functions to use MESH category and its action fields:
  + ieee80211_send_action_register
  + ieee80211_send_action
  + ieee80211_recv_action_register
  +ieee80211_recv_action;
* Modified ieee80211_hwmp_init and hwmp_send_action so they uses correct
  action fields as specified in amendment spec;
* Modified ieee80211_parse_action so that it verifies MESH frames.
* Change Mesh Link Metric to use one information element as amendment spec.
  Draft 4.0 defined two different information elements for request and response.

Submitted by: monthadar@gmail.com

12 years agoFix tls base computation with COMPAT_FREEBSD32 on n64 kernels. The previous
jmallett [Sun, 4 Mar 2012 05:19:55 +0000 (05:19 +0000)]
Fix tls base computation with COMPAT_FREEBSD32 on n64 kernels.  The previous
version was missing an else and would always use the n64 TP_OFFSET.  Eliminate
some duplication of logic here.

It may be worth getting rid of some of the ifdefs and introducing gratuitous
SV_ILP32 runtime checks on n64 kernels without COMPAT_FREEBSD32 and on o32
kernels, similarly to how PowerPC works.

12 years agoIn r232322, I forgot one case where a check for MK_CLANG_IS_CC was
dim [Sun, 4 Mar 2012 00:42:18 +0000 (00:42 +0000)]
In r232322, I forgot one case where a check for MK_CLANG_IS_CC was
needed, in sys/conf/kern.pre.mk.  Add it now.

MFC after: 2 weeks

12 years agoRevert r232473. I have been convinced by Doug Barton and Bjoern Zeeb
dim [Sat, 3 Mar 2012 23:49:53 +0000 (23:49 +0000)]
Revert r232473.  I have been convinced by Doug Barton and Bjoern Zeeb
that it is better to error out when people attempt to build using the
wrong bsd.*.mk files, than to silently ignore the problem.

This means, that after this commit, if you want to build kernel modules
by hand (or via a port) from a head source tree, you *must* make sure
the files in /usr/share/mk are in sync with that tree.  If that isn't
possible, for example when you are running on an older FreeBSD branch,
you can:

- Run "make buildenv" from your head source tree, to have the correct
  environment setup.  (It's advisable to have run "make buildworld", or
  at a minimum "make toolchain" first.)
- Alternatively, set MAKESYSPATH to the share/mk directory under your
  head source tree.  If your build tools are too old, other problems may
  still occur.
- Alternatively, use "make -m" and specify the share/mk directory under
  your head source tree.  Again, build tools that are too old may still
  result in trouble.

MFC after: 2 weeks

12 years agoOn MIPS, _ALIGN always aligns to 8 bytes, even for 32-bit binaries. This might
jmallett [Sat, 3 Mar 2012 21:39:12 +0000 (21:39 +0000)]
On MIPS, _ALIGN always aligns to 8 bytes, even for 32-bit binaries.  This might
not be ideal, but is the ABI we've shipped so far.  Fix macros which reflect
the results of _ALIGN on 32-bit MIPS to use the right alignment.

This fixes sendmsg under COMPAT_FREEBSD32 on n64 MIPS kernels.

12 years agoAfter r232322, it turned out many people (and some ports) are building
dim [Sat, 3 Mar 2012 18:58:15 +0000 (18:58 +0000)]
After r232322, it turned out many people (and some ports) are building
kernel modules using their old installed /usr/share/mk/bsd.*.mk files,
instead of the updated ones in their source tree.  This leads to errors
like:

  "sys/conf/kmod.mk", line 111: Malformed conditional (${MK_CLANG_IS_CC} == "no" && ${CC:T:Mclang} != "clang")

Obviously, these errors will go away after a "make installworld", or
alternatively, by using "make buildenv" before attempting to manually
build modules.

However, since it is apparently an expected use case to build using old
.mk files, change the way we test for clang, so it also works when the
MK_CLANG_IS_CC macro doesn't exist.

Note the conditional expressions are becoming rather unreadable now, but
I will attempt to fix that on a followup commit.

MFC after: 2 weeks

12 years agoExpand the set of APIs available for locating PCI capabilities:
jhb [Sat, 3 Mar 2012 18:08:57 +0000 (18:08 +0000)]
Expand the set of APIs available for locating PCI capabilities:
- pci_find_extcap() is repurposed to be used for fetching PCI-express
  extended capabilities (PCIZ_* constants in <dev/pci/pcireg.h>).
- pci_find_htcap() can be used to locate a specific HyperTransport
  capability (PCIM_HTCAP_* constants in <dev/pci/pcireg.h>).
- Cache the starting location of the PCI-express capability for PCI-express
  devices in PCI device ivars.

12 years agoDocument the [n]eei and [n]bacc options
eadler [Sat, 3 Mar 2012 18:07:53 +0000 (18:07 +0000)]
Document the [n]eei and [n]bacc options

PR: docs/165009
Submitted by: Jeremy Huddleston <jeremyhu@apple.com>
Approved by: bcr
MFC after: 1 week

12 years agoUse pci_find_cap() instead of pci_find_extcap() to locate PCI
jhb [Sat, 3 Mar 2012 18:03:50 +0000 (18:03 +0000)]
Use pci_find_cap() instead of pci_find_extcap() to locate PCI
find capabilities as the latter API is deprecated for this purpose.

MFC after: 2 weeks

12 years agoBump date to today (since I modified it)
eadler [Sat, 3 Mar 2012 17:52:19 +0000 (17:52 +0000)]
Bump date to today (since I modified it)

PR: bin/165321
Approved by: gjb
MFC after: 3 days

12 years agoThe name caching changes of r230394 exposed an intermittent bug
rmacklem [Sat, 3 Mar 2012 16:13:20 +0000 (16:13 +0000)]
The name caching changes of r230394 exposed an intermittent bug
in the new NFS server for NFSv4, where it would report ENOENT
when the file actually existed on the server. This turned out
to be caused by not initializing ni_topdir before calling lookup()
and there was a rare case where the value on the stack location
assigned to ni_topdir happened to be a pointer to a ".." entry,
such that "dp == ndp->ni_topdir" succeeded in lookup().
This patch initializes ni_topdir to fix the problem.

MFC after: 5 days

12 years agoDirect users to swapinfo and pstat from df
eadler [Sat, 3 Mar 2012 15:38:01 +0000 (15:38 +0000)]
Direct users to swapinfo and pstat from df

PR: bin/165321
Submitted by: jhs
Approved by: bcr
MFC after: 3 days

12 years agoUpdate the pci_get_vpd_readonly() wrapper to use 'vptr' instead of
jhb [Sat, 3 Mar 2012 14:25:36 +0000 (14:25 +0000)]
Update the pci_get_vpd_readonly() wrapper to use 'vptr' instead of
'identptr' for its last parameter to match the default implementation
as well as the method definition in pci_if.m.

12 years agoFix a typo.
jhb [Sat, 3 Mar 2012 14:24:39 +0000 (14:24 +0000)]
Fix a typo.

12 years agoExpand and reorganize the pci(9) manpage a bit:
jhb [Sat, 3 Mar 2012 14:23:54 +0000 (14:23 +0000)]
Expand and reorganize the pci(9) manpage a bit:
- Document the following routines: pci_alloc_msi(), pci_alloc_msix(),
  pci_find_cap(), pci_get_max_read_req(), pci_get_vpd_ident(),
  pci_get_vpd_readonly(), pci_msi_count(), pci_msix_count(),
  pci_pending_msix(), pci_release_msi(),  pci_remap_msix(), and
  pci_set_max_read_req().
- Group the functions into five sub-sections: raw configuration access,
  locating devices, device information, device configuration, and
  message signaled interrupts.
- Discourage use of pci_disable_io() and pci_enable_io() in device drivers.
  The PCI bus driver handles this automatically as resources are activated.

MFC after: 2 weeks

12 years agoMake kern.proc.umask sysctl readonly.
trociny [Sat, 3 Mar 2012 11:53:35 +0000 (11:53 +0000)]
Make kern.proc.umask sysctl readonly.

Requested by: src
MFC after: 1 week

12 years agoFix bug of r232207, when cpu_search() could prefer CPU group with best
mav [Sat, 3 Mar 2012 11:50:48 +0000 (11:50 +0000)]
Fix bug of r232207, when cpu_search() could prefer CPU group with best
load, but with no CPU matching given limitations. It caused kernel panics
in some cases when thread was bound to specific CPUs with cpuset(1).

12 years agoUnbreak n64 build without COMPAT_FREEBSD32 by fixing mismatched preprocessor
jmallett [Sat, 3 Mar 2012 10:22:49 +0000 (10:22 +0000)]
Unbreak n64 build without COMPAT_FREEBSD32 by fixing mismatched preprocessor
conditionals.

12 years agoUse snprintf(3) constantly when generating CAM error messages.
jh [Sat, 3 Mar 2012 09:19:20 +0000 (09:19 +0000)]
Use snprintf(3) constantly when generating CAM error messages.

PR: bin/57088
Submitted by: Rui Lopes, arundel
MFC after: 2 weeks

12 years agoo) Add COMPAT_FREEBSD32 support for MIPS kernels using the n64 ABI with userlands
jmallett [Sat, 3 Mar 2012 08:19:18 +0000 (08:19 +0000)]
o) Add COMPAT_FREEBSD32 support for MIPS kernels using the n64 ABI with userlands
   using the o32 ABI.  This mostly follows nwhitehorn's lead in implementing
   COMPAT_FREEBSD32 on powerpc64.
o) Add a new type to the freebsd32 compat layer, time32_t, which is time_t in the
   32-bit ABI being used.  Since the MIPS port is relatively-new, even the 32-bit
   ABIs use a 64-bit time_t.
o) Because time{spec,val}32 has the same size and layout as time{spec,val} on MIPS
   with 32-bit compatibility, then, disable some code which assumes otherwise
   wrongly when built for MIPS.  A more general macro to check in this case would
   seem like a good idea eventually.  If someone adds support for using n32
   userland with n64 kernels on MIPS, then they will have to add a variety of
   flags related to each piece of the ABI that can vary.  That's probably the
   right time to generalize further.
o) Add MIPS to the list of architectures which use PAD64_REQUIRED in the
   freebsd32 compat code.  Probably this should be generalized at some point.

Reviewed by: gonzo

12 years agoMake sure that the USB system suspend event is executed synchronously
hselasky [Sat, 3 Mar 2012 08:11:04 +0000 (08:11 +0000)]
Make sure that the USB system suspend event is executed synchronously
and not asynchronously. This fixes problems related to USB system
suspend and resume.  It is assumed that we are always allowed to sleep
from the device_suspend() method.

MFC after: 1 week
Submitted by: jkim

12 years agoAdd entry for packages-8.3-release directory.
kensmith [Sat, 3 Mar 2012 05:04:47 +0000 (05:04 +0000)]
Add entry for packages-8.3-release directory.

12 years agoPost r230394, the Lookup RPC counts for both NFS clients increased
rmacklem [Sat, 3 Mar 2012 01:06:54 +0000 (01:06 +0000)]
Post r230394, the Lookup RPC counts for both NFS clients increased
significantly. Upon investigation this was caused by name cache
misses for lookups of "..". For name cache entries for non-".."
directories, the cache entry serves double duty. It maps both the
named directory plus ".." for the parent of the directory. As such,
two ctime values (one for each of the directory and its parent) need
to be saved in the name cache entry.
This patch adds an entry for ctime of the parent directory to the
name cache. It also adds an additional uma zone for large entries
with this time value, in order to minimize memory wastage.
As well, it fixes a couple of cases where the mtime of the parent
directory was being saved instead of ctime for positive name cache
entries. With this patch, Lookup RPC counts return to values similar
to pre-r230394 kernels.

Reported by: bde
Discussed with: kib
Reviewed by: jhb
MFC after: 2 weeks

12 years agoAdd VESA option to GENERIC for amd64 and i386.
jkim [Sat, 3 Mar 2012 00:11:46 +0000 (00:11 +0000)]
Add VESA option to GENERIC for amd64 and i386.

MFC after: 1 month

12 years agoFix a problem that was causing the mpt(4) driver to attach to MegaRAID
ken [Fri, 2 Mar 2012 22:00:40 +0000 (22:00 +0000)]
Fix a problem that was causing the mpt(4) driver to attach to MegaRAID
cards that should be handled by the mfi(4) driver.

The root of the problem is that the mpt(4) driver was masking off the
bottom bit of the PCI device ID when deciding which cards to attach to.

It appears that a number of the mpt(4) Fibre Channel cards had a LAN
variant whose PCI device ID was just one bit off from the FC card's device
ID.  The FC cards were even and the LAN cards were odd.

The problem was that this pattern wasn't carried over on the SAS and
parallel SCSI mpt(4) cards.  Luckily the SAS and parallel SCSI PCI device
IDs were either even numbers, or they would get masked to a supported
adjacent PCI device ID, and everything worked well.

Now LSI is using some of the odd-numbered PCI device IDs between the 3Gb
SAS device IDs for their new MegaRAID cards.  This is causing the mpt(4)
driver to attach to the RAID cards instead of the mfi(4) driver.

The solution is to stop masking off the bottom bit of the device ID, and
explicitly list the PCI device IDs of all supported cards.

This change should be a no-op for mpt(4) hardware.  The only intended
functional change is that for the 929X, the is_fc variable gets set.  It
wasn't being set previously, but needs to be because the 929X is a Fibre
Channel card.

Reported by: Kashyap Desai <Kashyap.Desai@lsi.com>
MFC After: 3 days

12 years agoWhen creating a handle for a subregion, be sure to actually math out the new
jmallett [Fri, 2 Mar 2012 21:46:31 +0000 (21:46 +0000)]
When creating a handle for a subregion, be sure to actually math out the new
handle address, where we're using handles as raw addresses.

This fixes devices with subregions on Octeon PCI specifically, and likely also on
MIPS more generally, where there isn't another bus_space in use that was doing the
math already.

12 years agoIf an Atheros device is attached to an Octeon, it's going to be by PCI.
jmallett [Fri, 2 Mar 2012 21:44:39 +0000 (21:44 +0000)]
If an Atheros device is attached to an Octeon, it's going to be by PCI.

12 years ago- Add a bus_dma tag to each PCI bus that is a child of a Host-PCI bridge.
jhb [Fri, 2 Mar 2012 20:38:04 +0000 (20:38 +0000)]
- Add a bus_dma tag to each PCI bus that is a child of a Host-PCI bridge.
  The tag enforces a single restriction that all DMA transactions must not
  cross a 4GB boundary.  Note that while this restriction technically only
  applies to PCI-express, this change applies it to all PCI devices as it
  is simpler to implement that way and errs on the side of caution.
- Add a softc structure for PCI bus devices to hold the bus_dma tag and
  a new pci_attach_common() routine that performs actions common to the
  attach phase of all PCI bus drivers.  Right now this only consists of
  a bootverbose printf and the allocate of a bus_dma tag if necessary.
- Adjust all PCI bus drivers to allocate a PCI bus softc and to call
  pci_attach_common() from their attach routines.

MFC after: 2 weeks

12 years agoUnbreak SMP on stock Octeon systems -- copy the core_mask from bootinfo into
jmallett [Fri, 2 Mar 2012 20:34:15 +0000 (20:34 +0000)]
Unbreak SMP on stock Octeon systems -- copy the core_mask from bootinfo into
sysinfo.  This should have been done as part of replacing bootinfo with sysinfo.

12 years agoSimilar to the fixes in 226967 and 226987, purge any name cache entries
jhb [Fri, 2 Mar 2012 18:55:19 +0000 (18:55 +0000)]
Similar to the fixes in 226967 and 226987, purge any name cache entries
associated with the previous vnode (if any) associated with the target of
a rename().  Otherwise, a lookup of the target pathname concurrent with a
rename() could re-add a name cache entry after the namei(RENAME) lookup
in kern_renameat() had purged the target pathname.

MFC after: 2 weeks

12 years agoFix typo.
andreast [Fri, 2 Mar 2012 18:18:14 +0000 (18:18 +0000)]
Fix typo.