Commit Graph

189890 Commits

Author SHA1 Message Date
Ian Lepore
b07d0cbce3 Add cpu_l2cache_drain_writebuf(), use it to implement generic_bs_barrier().
On modern ARM SoCs the L2 cache controller sits between the CPU and the
AXI bus, and most on-chip memory-mapped devices are on the AXI bus.  We
map the device registers using the 'Device' memory attribute, which means
the memory is not cached, but writes to it are buffered.  Ensuring that a
write has made it all the way to a device may require that the L2
controller take some action.

There is currently only one implementation of the new function, for the
PL310 cache controller.  It invokes a function that the controller
manual calls "cache sync" but it actually has nothing to do with cache at
all, it triggers a drain of all pending store buffer writes and it blocks
until they complete.

The sheeva and xscale L2 controllers (which predate the concept of Device
memory) don't seem to have a corresponding function.  It appears that the
standard armv5 drain_writebuf function includes draining all the way
through the L2 controller.
2014-05-11 04:24:57 +00:00
Peter Grehan
ffd328487a Enable SMP for Exynos-based platforms (i.e. Chromebook)
Reviewed by:	br
2014-05-11 04:18:51 +00:00
Nathan Whitehorn
010afa35ca Use vt(4) by default on 32-bit PowerPC now that it is fully functional and
fast. 64-bit PowerPC will follow along once the PS3 framebuffer driver is
adapted.
2014-05-11 02:18:17 +00:00
Nathan Whitehorn
0ee4b22d75 Port over mmap routine from syscons. This lets X11 work on PowerPC with vt.
The last obstacle to switching PowerPC entirely to vt is that the Playstation 3
framebuffer driver needs to be ported over. This only applies for powerpc64,
however.
2014-05-11 02:16:08 +00:00
Eitan Adler
2f4de29783 mesg: remove advertising clause
The University of California board of trustees has given permission to remove
the advertising clause of all software attributed to it.
2014-05-11 02:04:40 +00:00
Eitan Adler
b245fc98c8 look(1): add compability with other implementations.
On other implementations 'look -a' uses an alternate dictionary.  Since we don't
have one, just ignore it.
2014-05-11 02:00:48 +00:00
Nathan Whitehorn
015ac42e4b Make ofwfb not be painfully slow. This reduces the time for a verbose boot
on my G4 iBook by more than half. Still 10% slower than syscons, but that's
much better than a factor of 2.

The slowness had to do with pathological write performance on 8-bit
framebuffers, which are almost universally used on Open Firmware systems.
Writing 1 byte at a time, potentially nonconsecutively, resulted in many
extra PCI write cycles. This patch, in the common case where it's writing
one or several characters in an 8x8 font, gangs the writes together into
a set of 32-bit writes. This is a port of r143830 to vt(4).

The EFI framebuffer is also extremely slow, probably for the same reason,
and the same patch will likely help there.
2014-05-11 01:58:56 +00:00
Eitan Adler
8be8ad916f libedit: add H_SAVE_FP which saves history to a file pointer.
H_SAVE_FP is similar to H_SAVE but operates on a FILE* instead of a filename.
This is useful when operating in capability mode.

Reviewed by:	christos@NetBSD.org, pfg
2014-05-11 01:44:11 +00:00
Nathan Whitehorn
bdf49e3953 Make ofwfb actually work again. Apparently the API it was written against
still exists but is now silently ignored by the VT core. At least xboxfb
needs similar changes.
2014-05-11 01:19:55 +00:00
Ian Lepore
6af0d51bce Make the hardware memory and instruction barrier functions work on armv4
and armv5 as well.
2014-05-11 00:43:06 +00:00
Pedro F. Giffuni
76f66be6bf prinf: replace use of alloca with variable length array.
Use of alloca(3) is discouraged in FreeBSD. Using a VLA
is simple and should be more portable.

Requested by:	jilles
2014-05-10 22:27:01 +00:00
Andrew Turner
b36b897e51 Rename platform_gpio_init to be SoC specific 2014-05-10 21:30:19 +00:00
Warner Losh
cb8b0584f4 Really, I don't want to install src.opts.mk at all. 2014-05-10 21:27:47 +00:00
Andrew Turner
87ef4d1f85 Rename platform_gpio_init to be platform specific, and make it static as
it's only used from this file.
2014-05-10 20:31:05 +00:00
Andrew Turner
3664cbc0f0 Rename platform_gpio_init to be SoC specific, and make it static as it's
only called from this file.
2014-05-10 20:26:49 +00:00
Ian Lepore
b8821f8415 When mapping device memory, use PTE_DEVICE rather than PTE_NOCACHE.
On armv4 these are defined as synonyms right now, but it's a bit ambiguous
what NOCACHE means (is buffering/write-combining also enabled or not?); this
is a first step towards replacing PTE_NOCACHE with a less ambiguous name.
2014-05-10 20:03:03 +00:00
Alan Cox
d9a9209abe About 9% of the pmap_protect() calls being performed by vm_map_copy_entry()
are unnecessary.  Eliminate the unnecessary calls.

Reviewed by:	kib
MFC after:	1 week
Sponsored by:	EMC / Isilon Storage Division
2014-05-10 19:47:00 +00:00
Jilles Tjoelker
c8fb3e69d0 sh: In getopts, unset OPTARG where POSIX says we should. 2014-05-10 19:18:49 +00:00
Konstantin Belousov
ca5e4fe970 Invalidate the cache for the named posix semaphore when opened and
actual file storing the semaphore object is different from the file
created on the first open.  Store the file st_dev and st_ino members
of the struct stat in the semaphore structure on open, and compare
them with the attributes of the opened file to detect unlink and
re-creation.

This fixes an issue of sem_unlink(3) failing to flush the named entry
in the semaphore list for the current or remote process, making
sem_unlink(3) not correctly operating if the unlinked semaphore is
still opened.

Reported by:	Joris Giovannangeli <joris@giovannangeli.fr>
PR:	standards/189353
Reviewed by:	jilles (previous version)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2014-05-10 19:08:07 +00:00
Jilles Tjoelker
8207fd5f81 sh: Add new tests to the Makefile. 2014-05-10 19:06:36 +00:00
Konstantin Belousov
9b6224b70f Style.
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2014-05-10 18:59:09 +00:00
Jilles Tjoelker
6e76445cf7 sh: Don't discard getopts state on unknown option or missing argument.
When getopts finds an invalid option or a missing option-argument, it should
not reset its state and should set OPTIND as normal. This is an old ash bug
that was fixed long ago in dash. Our behaviour now matches most other
shells.
2014-05-10 17:42:21 +00:00
Konstantin Belousov
0973283d6e For the upgrade case in vm_fault_copy_entry(), when the entry does not
need COW and is writeable (i.e. becoming writeable due to the
mprotect(2) operation), do not create a new backing object for the
entry.  The caller of the function is vm_map_protect(), the call is
made to ensure that wired entry has all pages resident and wired in
the top level object and to enable the write.  We might need to copy
read-only page from some backing objects into the top object or remap
the page with the write allowed.

This fixes the issue with mishandling of the swap accounting when
read-only wired mapping is upgraded to write-enabled after fork.  The
previous code path did not accounted the new object, but it creation
is redundand anyway and the change provides an optimization for the
non-common situation.

Reported by:	markj
Suggested and reviewed by:	alc (previous version)
Tested by:	pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2014-05-10 17:03:33 +00:00
Eitan Adler
b17de684ba arcconfig: add one
Add a .arcconfig to allow arc to work in its usual way.
2014-05-10 16:59:15 +00:00
Warner Losh
724afafa72 bitrotted compat cruft removal:
o KMODDEPS warning is 15 years stale. Remove it.
o MK_CTF will always be defined now, so no need to test to see if it
  is defined.
o no need to define MK_FORMAT_EXTENTIONS if undefined anymore.
2014-05-10 16:39:15 +00:00
Warner Losh
e8bad5dc64 grep -L returns non-zero status if none of the files had the pattern
in them. This is often the case, so just ignore the return
code. Actual errors that are found will also be detected downstream in
the rare cases where the return code is 2 instead of 1.
2014-05-10 16:39:08 +00:00
Warner Losh
b8fffe166d Sprinkle a few more .WAITs into the mix after csu, libc, msun and the
early built libraries. This should be sufficient for most cases and
has eliminated the issues I've seen with high -j builds. Races likely
still remain, but this knocks the problem down a notch.
2014-05-10 16:39:00 +00:00
Warner Losh
7ecf742eeb Move DOCCOMPRESS to MK variable. 2014-05-10 16:38:54 +00:00
Warner Losh
93654dca21 We haven't done anything with _UPGRADING in ~forever (was present, but
not needed, in FreeBSD 6.x, and has been absent in newer versions).
This was needed to upgrade from 3.x -> 4.x, once upon a time.
2014-05-10 16:38:45 +00:00
Warner Losh
c115b8184e Remove last two NO_MAN= in the tree. In both of these cases, MAN= is
what is needed.
2014-05-10 16:38:37 +00:00
Warner Losh
be4646cf7f Remove some useless, commented out code. Remove name space polution in
the POSIX case by moving more things under !Posix part of an if.
2014-05-10 16:38:32 +00:00
Warner Losh
dfd11a4413 g/c unmaintained, uninstalled bsd.pkg.mk. It tied into the ports
system, as it existed 9 years ago, and has been obsolete for a long
time.
2014-05-10 16:38:27 +00:00
Warner Losh
58c2dbbc30 Remove the compatibility hack for FreeBSD 7 systems for
MACHINE_CPUARCH. Fewer places to have to hack each time a new one is
added.
2014-05-10 16:38:18 +00:00
Warner Losh
22ba0b2f67 Simplify clang ifdefs in the kernel a bit. Introduce
CFLAGS.${COMPILER_TYPE} to mirror userland. Be explicit about which
compiler needs something (not clang isn't necessarily gcc in the
future).
2014-05-10 16:38:09 +00:00
Warner Losh
7273339dc4 Eliminate EARLY_BUILD flag. It is redundant and means MK_CLANG_FULL=no
and MK_LLDB=no, so set those explicitly (now that we can do
that). Simplify tests for these variables as well, since we know they
will always be defined regardless of the phase of the build.
2014-05-10 16:38:03 +00:00
Warner Losh
ab72ce6b1b Migrate NO_WARN to MK_WARN. Support legacy NO_WARN usage. Remove a
check for EARLY_BUILD because it isn't necessary (MK_WARN=no will
always be defined for that).
2014-05-10 16:37:53 +00:00
Warner Losh
999298523e Support, to the extent we generate proper command lines, compiling
with clang 3.3. Useful for test building -current on a -stable system
in individual directories. Potentially useful if we ever want to
support, say, gcc 4.8 or 4.9's new warnings when building with an
external toolchain (but such support not yet committed). Document
the bsd.compiler.mk interface.
2014-05-10 16:37:44 +00:00
Warner Losh
f510ecf0ee Optionally allow building the historical FreeBSD make program and
install it as fmake. This defaults to no. This should be viewed as the
first step towards evental migration of this historic code to ports
and removal from the tree.
2014-05-10 16:37:39 +00:00
Warner Losh
4d9b013a63 Remove a few more vestiges of allowing WITHOUT_BMAKE to imply you want
to buid with fmake.
2014-05-10 16:37:33 +00:00
Warner Losh
21f76c672f Document WITHOUT_SYSCALL_COMPAT and WITHOUT_GNU_GREP_COMPAT. 2014-05-10 16:37:28 +00:00
Konstantin Belousov
44bbc3b77d When printing the map with the ddb 'show procvm' command, do not dump
page queues for the backing objects.  The queues are huge and clutter
the display, when mostly the map entries and its backing storage is
interesting.

The page queues can be seen with ddb 'show object' command.

Reviewed by:	alc
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2014-05-10 16:36:13 +00:00
Konstantin Belousov
3d95614f9d Print the entry address in addition to the object. The variable is
typically optimized out and debuggers cannot find its value.

Sponsored by:	    The FreeBSD Foundation
MFC after:	1 week
2014-05-10 16:30:48 +00:00
Nathan Whitehorn
4f412b06fd Simplify code slightly. Passing an array by &array[0] does work, but is
silly.
2014-05-10 15:38:26 +00:00
Kevin Lo
3e90173173 Fix -width argument to Bl -tag. 2014-05-10 15:34:32 +00:00
Alexander Motin
7585c68486 Comment out some pointless device open/close around reading device IDs.
FreeBSD ZFS port unlike OpenSolaris does not use device IDs, and does not
implement respective devid_*() fuctions.  It is pointless to open devices
just to close them back immediately.

MFC after:	2 weeks
Sponsored by:	iXsystems, Inc.
2014-05-10 15:21:37 +00:00
Michael Tuexen
6ed8e454a1 UDP-Lite uses SOCK_DGRAM, not SOCK_STREAM. 2014-05-10 13:18:20 +00:00
Luiz Otavio O Souza
ee454ea929 Do not configure all pins as outputs as this can lead to short circuits when
the GPIO pin is connected to a push button (or other devices).

Instead keep the boot loader settings.

Calling ar71xx_gpio_pin_configure() with DEFAULT_CAPS was probably a
mistake and was causing all the pins to be set as outputs.
2014-05-10 13:16:04 +00:00
Warren Block
3bff5e84a7 Fix document title.
Submitted by:	pluknet
2014-05-10 13:10:42 +00:00
Luiz Otavio O Souza
9cce5d9339 Remove an old mistake of mine. This has sneak in the code i sent to gonzo
at that time, but AFAIK it is only used on routerboards.

Enabling GPIO_FUNC_SPI_CS[1|2]_EN will claim the use of gpio pins 0 and 1
respectivelly for use as SPI CS pins.

When really needed, this can still be enabled on kernel hints using the
function_set and function_clear knobs.
2014-05-10 12:58:18 +00:00
Luiz Otavio O Souza
dd75f2c5eb Add the lm75 i2c digital temperature sensor driver.
This driver supports the low and high precision models (9 and 11 bits) and
it will auto-detect the both variants.

The driver expose the temperature registers (actual temperature, shutdown
and hysteresys temperature) and also the configuration register.

It was tested on FDT systems: RPi, BBB and on non-FDT systems: AR71xx, with
both, hardware i2c controllers (when available) and gpioiic(4).

This provides a simple and cheap way for verifying the i2c bus on embedded
systems.
2014-05-10 12:19:02 +00:00