Commit Graph

156682 Commits

Author SHA1 Message Date
Jaakko Heinonen
f4e7c5a894 Convert md(4) to use alloc_unr(9) and alloc_unr_specific(9) for unit
number allocation. The old approach had some problems such as it allowed
an overflow to occur in the unit number calculation.

PR:		kern/122288
2010-07-22 10:24:28 +00:00
Konstantin Belousov
e2b801ddd9 Verify return value of the sigset manipulation functions
to catch invalid signal numbers [1]. Use consistent style of
not assigning the return value to a local variable.

Reported by:	Garrett Cooper <yanegomi gmail com> [1]
MFC after:	1 week
2010-07-22 09:14:18 +00:00
Konstantin Belousov
87d45a0392 When compat32 binary asks for the value of hw.machine_arch, report the
name of 32bit sibling architecture instead of the host one. Do the
same for hw.machine on amd64.

Add a safety belt debug.adaptive_machine_arch sysctl, to turn the
substitution off.

Reviewed by:	jhb, nwhitehorn
MFC after:	2 weeks
2010-07-22 09:13:49 +00:00
Pawel Jakub Dawidek
1a517c3ec5 Actually, only the fullsync mode is implemented, not memsync mode.
Correct manual page.

MFC after:	3 days
2010-07-22 08:30:14 +00:00
Edward Tomasz Napierala
175389cff2 Remove spurious '/*-' marks and fix some other style problems.
Submitted by:	bde@
2010-07-22 05:42:29 +00:00
Andrew Turner
05ef546154 - Add myself to committers-src.dot
Approved by:	imp (mentor)
2010-07-21 21:23:23 +00:00
Xin LI
d74001ad8d Apply vendor version 1.20.00.17.
This version adds support for ARC1880; additionally this version fixed
an issue where all devices on a SAS port gets offlined when any device
failed on the port [1].

Many thanks to Areca for continuing to support FreeBSD.

PR:		kern/148502 [1]
Submitted by:	Ching-Lung Huang <ching2048 areca com tw>
Obtained from:	Areca
Tested by:	Rich Ercolani <rercola acm jhu edu> [1]
MFC after:	2 weeks
2010-07-21 18:50:24 +00:00
Rui Paulo
2b95672852 MFamd64:
Add USD_GETBASE(), USD_SETBASE(), USD_GETLIMIT() and USD_SETLIMIT().
2010-07-21 18:47:52 +00:00
Kai Wang
85de6c411e * Remove a superfluous error description.
* Document an additional error that may be returned: `ELF_E_ARCHIVE`.

Obtained from:	elftoolchain
MFC after:		1 month
2010-07-21 13:29:00 +00:00
Kai Wang
0806107365 Add a cross-reference to elf_rawfile(3).
Obtained from:	elftoolchain
MFC after:		1 month
2010-07-21 13:23:07 +00:00
Kai Wang
52d63629e6 * Note that ar(1) archives may also be opened using elf_memory(3).
* Ignore the passed in value of the `fd` argument for ar(1) archives
  opened with elf_memory(3).

Obtained from:	elftoolchain
MFC after:		1 month
2010-07-21 13:18:57 +00:00
Bjoern A. Zeeb
101235dcb3 Since r186119 IP6 input counters for octets and packets were not
working anymore.  In addition more checks and operations were missing.

In case lla_lookup results in a match, get the ifaddr to update the
statistics counters, and check that the address is neither tentative,
duplicate or otherwise invalid before accepting the packet.  If ok,
record the address information in the mbuf.  [ as is done in case
lla_lookup does not return a result and we go through the FIB ].

Reported by:	remko
Tested by:	remko
MFC after:	2 weeks
2010-07-21 13:01:21 +00:00
Kai Wang
d284162491 Remove a redundant word.
Obtained from:	elftoolchain
MFC after:		1 month
2010-07-21 13:00:01 +00:00
Kai Wang
d961c5b461 Move helper functions _libelf_ar_get_{name,number,string}() and
`_libelf_ar_open()` to a new compilation unit "libelf_ar_util.c"
to break the circular dependency between "elf_memory.o" and
"libelf_ar.o".

Obtained from:	elftoolchain
MFC after:		1 month
2010-07-21 12:54:34 +00:00
Kai Wang
e2efa43644 Fix a memory leak.
Obtained from:	elftoolchain
MFC after:		1 month
2010-07-21 12:30:58 +00:00
Alexander Motin
e88f9fb47f Use proper sysctl type (quad) for et_frequency. It fixes output on sparc64. 2010-07-21 12:23:49 +00:00
Kai Wang
86f5401b91 * Deprecate elf_getshnum(), elf_getphnum() and elf_getshstrndx() in
favour of `elf_getshdrnum()`, `elf_getphdrnum()` and `elf_getshdrstrndx()`
  respectively.
* Add new manual pages for `elf_getshdrstrndx()`, `elf_getphdrnum()` and
  `elf_getshdrnum()`.
* Add a deprecation warning for `elf_getshstrndx()`, `elf_getphnum()` and
  `elf_getshnum()`.

Obtained from:	elftoolchain
MFC after:		1 month
2010-07-21 12:14:50 +00:00
Kai Wang
9eab8b61d9 Avoid switching between "unsigned char" and "char" in the C code
generated from "libelf_convert.m4".

Obtained from:	elftoolchain
MFC after:		1 month
2010-07-21 11:26:18 +00:00
Kai Wang
1d69e83ddd Add support for translating sections of type ELF_T_GNUHASH.
Obtained from:	elftoolchain
MFC after:		1 month
2010-07-21 10:57:22 +00:00
Kai Wang
fff07a4233 - Document that the *fsize() functions return a size of 1 for Elf
types that don't have a fixed size.
- The *fsize() functions should return a size of 1, for variable length
  types.
- Redefine symbol ELF_T_LAST to match the current end of the list.

Obtained from:	elftoolchain
MFC after:		1 month
2010-07-21 10:39:29 +00:00
Kai Wang
f0f10541db Perform additional checks when translating between file and memory
representations of ELF types.

The ELF(3) API allows applications to request a conversion that is
`in-place', i.e., with source and destinations data buffers being
the same.  However, the file and memory sizes of ELF sections that
have additional internal structure, such as those of type `Elf_Note',
or `Elf_GNU_Hash_Header', can be determined only known after the
type-specific headers that comprise the first few words in these
sections are read and translated.

Pass in the size of destination buffer to type translation routines
in "libelf_convert.m4" and have these routines return an error code
if the translated data would not fit inside the destination buffer.

Obtained from:	elftoolchain
MFC after:		1 month
2010-07-21 10:25:02 +00:00
Attilio Rao
4e55157fa4 Probabilly defaulting to KTR_GEN is not the right decision when KTR_MASK
is not defined at all because KTR_GEN is still a valid class and some
traces may fit in. Default to 0, instead, and block any tracing.

As long as this is a POLA violation (some thirdy-part code, even if
that may be a questionable choice, could be rely on that feature) a
MFC possibility might be carefully evaluated.

Sponsored by:	Sandvine Incorporated
2010-07-21 10:14:04 +00:00
Kai Wang
5d261af96d Reduce verbosity.
Obtained from:	elftoolchain
MFC after:		1 month
2010-07-21 10:11:46 +00:00
Kai Wang
a2cf6dae18 - Return zero for file sizes of ELF types that have a variable size.
- Neaten a few comments.

Obtained from:	elftoolchain
MFC after:		1 month
2010-07-21 10:08:25 +00:00
Attilio Rao
651aa2d896 KTR_CTx are long time aliased by existing classes so they can't serve
their purpose anymore. Axe them out.

Sponsored by:	Sandvine Incorporated
Discussed with:	jhb, emaste
Possible MFC:	TBD
2010-07-21 10:05:07 +00:00
Kai Wang
135fdd3027 Note that the *_fsize() functions are only defined for ELF types that
have a fixed size.

Obtained from:	elftoolchain
MFC after:		1 month
2010-07-21 10:02:59 +00:00
Kai Wang
0e3c61d436 Changes for supporting GNU Hash sections.
Obtained from:	elftoolchain
MFC after:		1 month
2010-07-21 09:56:42 +00:00
Kai Wang
894afa87d6 Add a new ELF type denoting GNU style hash tables.
Obtained from:	elftoolchain
MFC after:		1 month
2010-07-21 09:51:24 +00:00
Kai Wang
7384c87800 Allow an application that updates only the ELF Ehdr to work.
Obtained from:	elftoolchain
MFC after:		1 month
2010-07-21 09:47:14 +00:00
Kai Wang
f44d4dafb4 Use <unistd.h> to declare the prototype for ftruncate().
Obtained from:	elftoolchain
MFC after:		1 month
2010-07-21 09:33:45 +00:00
Kai Wang
c0308c2c84 Bug fix: permit the creation of zero-sized sections.
Obtained from:	elftoolchain
MFC after:		1 month
2010-07-21 09:27:16 +00:00
Jayachandran C.
49ca10d40c Redo the page table page allocation on MIPS, as suggested by
alc@.

The UMA zone based allocation is replaced by a scheme that creates
a new free page list for the KSEG0 region, and a new function
in sys/vm that allocates pages from a specific free page list.

This also fixes a race condition introduced by the UMA based page table
page allocation code. Dropping the page queue and pmap locks before
the call to uma_zfree, and re-acquiring them afterwards  will introduce
a race condtion(noted by alc@).

The changes are :
- Revert the earlier changes in MIPS pmap.c that added UMA zone for
page table pages.
- Add a new freelist VM_FREELIST_HIGHMEM to MIPS vmparam.h for memory that
is not directly mapped (in 32bit kernel). Normal page allocations will first
try the HIGHMEM freelist and then the default(direct mapped) freelist.
- Add a new function 'vm_page_t vm_page_alloc_freelist(int flind, int
order, int req)' to vm/vm_page.c to allocate a page from a specified
freelist. The MIPS page table pages will be allocated using this function
from the freelist containing direct mapped pages.
- Move the page initialization code from vm_phys_alloc_contig() to a
new function vm_page_alloc_init(), and use this function to initialize
pages in vm_page_alloc_freelist() too.
- Split the  function vm_phys_alloc_pages(int pool, int order) to create
vm_phys_alloc_freelist_pages(int flind, int pool, int order), and use
this function from both vm_page_alloc_freelist() and vm_phys_alloc_pages().

Reviewed by:	alc
2010-07-21 09:27:00 +00:00
Kai Wang
3fd7b10a01 Improve compatibility with other implementations of the ELF(3) API:
when an output file has no program headers, set the 'e_phentsize'
field of the ELF executable header to zero.

Obtained from:	elftoolchain
MFC after:		1 month
2010-07-21 09:20:40 +00:00
Kai Wang
e8968eb491 Bug fix: when updating headers using the gelf_update_*() functions,
the appropriate `dirty' bit needs to be set for both the Elf32 and
Elf64 case.

Obtained from:	elftoolchain
MFC after:		1 month
2010-07-21 08:58:52 +00:00
Kai Wang
7ee5b008fb - Correctly handle sections of type SHT_NOBITS. For these sections:
- elf_getdata() and elf_rawdata() should return an "Elf_Data" structure
    that has its "d_buf" member set to NULL and "d_size" member set to
    the nominal 'size' of the section.  [1]
  - Update the manual page for these functions.
- Fix a memory leak in an error handling path inside elf_getdata().
- Use _libelf_allocate_data() in elf_newdata() for consistency.

Obtained from:	elftoolchain
MFC after:		1 month
2010-07-21 08:54:46 +00:00
Ed Schouten
8b18f12fc6 Also link getutxent.3 to utmpx.3.
If you run `man utmpx', you expect to get some info on it.
2010-07-21 08:51:38 +00:00
Kai Wang
c0aaca95a7 Remove a superfluous comment.
Obtained from:	     elftoolchain
MFC after:	     1 month
2010-07-21 08:43:48 +00:00
Ed Schouten
781ad8efe1 Chase LLVM version bump to 2.8. 2010-07-21 08:27:56 +00:00
Juli Mallett
32272e3b0a Remove unused file. Replaced by tlb.c. 2010-07-20 21:17:33 +00:00
Juli Mallett
bfa39fa09f o) Add the "octusb" controller which supports the first port of the Octeon
on-board USB controller.  It is not currently enabled because there are
   known problems with device communication and until those are fixed I am not
   certain that it won't destabilize the system. [1]
o) Add the "cryptocteon" opencrypto device based on the OCF device written by
   David McCullough.  It is not currently enabled because until support for
   saving/restoring coprocessor 2 state on context switch is available, it runs
   with interrupts disabled, which tends to pessimize performance over using a
   software crypto facility.  Tests using this driver which are not negatively
   affected by it running with interrupts disabled show it to be substantially
   faster than software for large blocks.

Submitted by:	hps [1]
2010-07-20 19:32:25 +00:00
Juli Mallett
cea2b8b915 Update the port of FreeBSD to Cavium Octeon to use the Cavium Simple Executive
library:
o) Increase inline unit / large function growth limits for MIPS to accommodate
   the needs of the Simple Executive, which uses a shocking amount of inlining.
o) Remove TARGET_OCTEON and use CPU_CNMIPS to do things required by cnMIPS and
   the Octeon SoC.
o) Add OCTEON_VENDOR_LANNER to use Lanner's allocation of vendor-specific
   board numbers, specifically to support the MR320.
o) Add OCTEON_BOARD_CAPK_0100ND to hard-wire configuration for the CAPK-0100nd,
   which improperly uses an evaluation board's board number and breaks board
   detection at runtime.  This board is sold by Portwell as the CAM-0100.
o) Add support for the RTC available on some Octeon boards.
o) Add support for the Octeon PCI bus.  Note that rman_[sg]et_virtual for IO
   ports can not work unless building for n64.
o) Clean up the CompactFlash driver to use Simple Executive macros and
   structures where possible (it would be advisable to use the Simple Executive
   API to set the PIO mode, too, but that is not done presently.)  Also use
   structures from FreeBSD's ATA layer rather than structures copied from
   Linux.
o) Print available Octeon SoC features on boot.
o) Add support for the Octeon timecounter.
o) Use the Simple Executive's routines rather than local copies for doing reads
   and writes to 64-bit addresses and use its macros for various device
   addresses rather than using local copies.
o) Rename octeon_board_real to octeon_is_simulation to reduce differences with
   Cavium-provided code originally written for Linux.  Also make it use the
   same simplified test that the Simple Executive and Linux both use rather
   than our complex one.
o) Add support for the Octeon CIU, which is the main interrupt unit, as a bus
   to use normal interrupt allocation and setup routines.
o) Use the Simple Executive's bootmem facility to allocate physical memory for
   the kernel, rather than assuming we know which addresses we can steal.
   NB: This may reduce the amount of RAM the kernel reports you as having if
       you are leaving large temporary allocations made by U-Boot allocated
       when starting FreeBSD.
o) Add a port of the Cavium-provided Ethernet driver for Linux.  This changes
   Ethernet interface naming from rgmxN to octeN.  The new driver has vast
   improvements over the old one, both in performance and functionality, but
   does still have some features which have not been ported entirely and there
   may be unimplemented code that can be hit in everyday use.  I will make
   every effort to correct those as they are reported.
o) Support loading the kernel on non-contiguous cores.
o) Add very conservative support for harvesting randomness from the Octeon
   random number device.
o) Turn SMP on by default.
o) Clean up the style of the Octeon kernel configurations a little and make
   them compile with -march=octeon.
o) Add support for the Lanner MR320 and the CAPK-0100nd to the Simple
   Executive.
o) Modify the Simple Executive to build on FreeBSD and to build without
   executive-config.h or cvmx-config.h.  In the future we may want to
   revert part of these changes and supply executive-config.h and
   cvmx-config.h and access to the options contained in those files via
   kernel configuration files.
o) Modify the Simple Executive USB routines to support getting and setting
   of the USB PID.
2010-07-20 19:25:11 +00:00
Xin LI
d10d35b369 Staticify local variables.
While I'm there also add a 'static' keyword for a function to make it
consistent with prototype.

Reviewed by:	phk
MFC after:	3 months
2010-07-20 17:42:13 +00:00
Ed Schouten
ffd1746d03 Upgrade our Clang in base to r108428.
This commit merges the latest LLVM sources from the vendor space. It
also updates the build glue to match the new sources. Clang's version
number is changed to match LLVM's, which means /usr/include/clang/2.0
has been renamed to /usr/include/clang/2.8.

Obtained from:	projects/clangbsd
2010-07-20 17:16:57 +00:00
Alexander Motin
599cf0f197 Fix several un-/signedness bugs of r210290 and r210293. Add one more check. 2010-07-20 15:48:29 +00:00
Ollivier Robert
77a0c59b8f Week days are all lowercase in French.
cf. http://www.academie-francaise.fr/langue/questions.html#jourdelasemaine (FR)

PR:		misc/148792
Submitted by:	Mathieu <freebsd@breatheless.net>
MFC after:	1 weeks
2010-07-20 14:27:09 +00:00
Ivan Voras
b089a17737 Fix expression style.
Prodded by: jhb
2010-07-20 13:59:51 +00:00
Tijl Coosemans
3245ecbe92 Store fsbase and gsbase in the right fields of the mcontext. They were
switched.

PR:		i386/148344
Approved by:	kib (mentor)
MFC after:	1 week
2010-07-20 12:36:36 +00:00
Alexander Motin
e9f0d5658c Refactor Marvell ARM SoC timer driver to the new timer infrastructure. 2010-07-20 11:46:45 +00:00
Rui Paulo
4e3eab5258 Fix typo in comment. 2010-07-20 11:20:45 +00:00
Alexander Motin
51636352b6 Extend timer driver API to report also minimal and maximal supported period
lengths. Make MI wrapper code to validate periods in request. Make kernel
clock management code to honor these hardware limitations while choosing hz,
stathz and profhz values.
2010-07-20 10:58:56 +00:00