Commit Graph

99504 Commits

Author SHA1 Message Date
Jean-Sébastien Pédron
1f9c1db5f5 vt(4): Remove "FIXME" about multiple locking of vt_buf in vt_flush()
After some testing, it appears that acquiring the lock once and keeping
it longer is slower than taking it multiple times.

While here, fix a typo in another comment.

MFC after:	1 week
2014-08-22 17:49:24 +00:00
Jean-Sébastien Pédron
82276bbb00 vt(4): Use the actual size of the mouse when marking its position as dirty
This fixes a bug where part of the cursor was not erased.

MFC after:	1 week
2014-08-22 17:09:31 +00:00
Jean-Sébastien Pédron
523473b8f7 vt_vga: Remove a "FIXME" comment; the issue was solved in r270338
MFC after:	1 week
2014-08-22 17:05:41 +00:00
Jean-Sébastien Pédron
15c6d8f590 vt(4): Don't run vt_set_border() and vt_flush() concurrently
In the case of vt_vga, the two concurrent calls were writing to the same
VGA registers, causing incorrect refresh of the screen.

MFC after:	1 week
2014-08-22 16:30:26 +00:00
Roger Pau Monné
1e218ce964 xen: fix incorrectly accounted free
Fix some frees incorrectly assigned to M_XENBUS when the memory is
allocated with M_XENSTORE.

Sponsored by: Citrix Systems R&D
MFC after:	1 week

dev/xen/blkback/blkback.c:
 - Fix incorrect frees.
2014-08-22 15:38:21 +00:00
Jean-Sébastien Pédron
ccd5615a33 vt(4): The offset to center the text area is per-window now
The previous global offset, based on the last loaded font, had no
meaning for other windows. This caused a shifted text area, often partly
out-of-screen.

MFC after:	1 week
2014-08-22 15:36:57 +00:00
Roger Pau Monné
b740f63f23 netback: remove dead code
Remove the xen_net_read_mac function since it's not used anymore.

Sponsored by: Citrix Systems R&D
2014-08-22 15:34:56 +00:00
Jean-Sébastien Pédron
ab06c77688 vt(4): Give the window to vd_bitblt_text_t callback
... instead of both the buffer and the font. Again, this simplifies the
API.

MFC after:	1 week
2014-08-22 15:16:41 +00:00
Roger Pau Monné
1b386f626f netback: fixes for netback
This patch contains the following fixes for netback:
 - Only unbind the evtchn if it has been bound.
 - Set xnb->bridge to NULL after free to prevent double-freeing it.
 - Set the MAC address for the host-facing interface to a dummy value.

Sponsored by: Citrix Systems R&D

dev/xen/netback/netback.c:
 - Prevent trying to unbind if the evtchn has not been bounded.
 - Prevent double-freeing xnb->bridge.
 - Set the MAC address of the host-facing interface to a dummy value,
   so it can work when the interface is added to a bridge.
2014-08-22 15:10:26 +00:00
Roger Pau Monné
cd407ca216 pci: add a new pci_child_added newbus method.
This is needed so when running under Xen the calls to pci_child_added
can be intercepted and a custom Xen method can be used to register
those devices with Xen. This should not include any functional
change, since the Xen implementation will be added in a following
patch and the native implementation is a noop.

Sponsored by: Citrix Systems R&D
Reviewed by: jhb

dev/pci/pci.c:
dev/pci/pci_if.m:
dev/pci/pci_private.h:
dev/pci/pcivar.h:
 - Add the pci_child_added newbus method.
2014-08-22 15:05:51 +00:00
Jean-Sébastien Pédron
3235c9eb55 vt(4): Store cursor bitmap & colors in struct vt_device
This removes the need to specify them to each call to vd_bitblt_text_t
and, therefore, simplifies the API.

MFC after:	1 week
2014-08-22 14:31:53 +00:00
Jean-Sébastien Pédron
e2eb041785 vt(4): Mark new mouse position as dirty only when it's actually displayed
MFC after:	1 week
2014-08-22 13:48:33 +00:00
Warner Losh
e4bed0b403 We should never enter the PROBE_SETAN phase if we're not ATAPI, since
that's ATAPI specific. Instead, skip to PROBE_SET_MULTI instead for
non ATAPI protocols. The prior code incorrectly terminated the probe
with a break, rather than arranging for probedone to get called. This
caused panics or worse on some systems.
2014-08-22 13:15:59 +00:00
Jean-Sébastien Pédron
37fcd2911e vt_vga: Clip the draw area to never draw offscreen
This fixes a bug when two windows use different fonts, but a longer-term
solution is required. The dirty area should be stored as pixels, not
character cells, because such coordinates don't have the same meaning in
all windows, when using different fonts.

MFC after:	1 week
2014-08-22 10:49:51 +00:00
Jean-Sébastien Pédron
bdcaf97c3e vt(4): Add new vd_bitblt_text_t callback, and implement it for vt_vga
Compared to the deprecated vd_bitbltchr_t callback, vd_bitblt_text_t
receives:
    o  the whole text buffer
    o  the dirty area
    o  the mouse cursor (map, position, colors)

This allows the backend to perform optimization on how to draw things.
The goal is to remove vd_bitbltchr_t and vd_putchar_t, once all driver
are converted (only vt_vga is included in this commit).

In vt_vga, this allows to draw the text and the cursor in one pass,
without ever reading from video memory (because it has all the context).
The main benefit is the speed improvement: no more slideshow during
boot!

Other bugs fixed in vt_vga are:
    o  left-most characters are drawn properly (the left-most pixels were
       missing with bold characters and some wide letters such as 'm')
    o  no more black square around the cursor
    o  no cursor flickering when the text is scrolling

There are still many problems to fix: the known issues are marked with
"FIXME" inside the code.

MFC after:	1 week
2014-08-22 08:22:40 +00:00
Konstantin Belousov
350ae56373 Ensure that sigaction flags for signal, which disposition is reset to
ignored or default, are not leaking.  Apparently, there exists code
which relies on SA_SIGINFO not reported for SIG_DFL or SIG_IGN.

In kern_sigaction, ignore flags when resetting.  Encapsulate the flag
and disposition testing into helper sigact_flag_test().

On exec, and when delivering signal with SA_RESETHAND flag set,
signals are reset automatically.  Use new helper sigdflt(), which
removes duplicated code and corrects all flag bits for the signal.

For proc0, set sigintr bit for all ignored signals.  Ignored signals
are consumed in tdsendsignal() and not delivered to the victim thread
at all.

Reported and tested by:	royger
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2014-08-22 08:19:08 +00:00
Konstantin Belousov
2d86417410 Check the validity of struct sigaction sa_flags value, reject unknown
flags.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2014-08-22 07:52:47 +00:00
Hiroki Sato
ed063112f4 Fix a panic which occurs in a VIMAGE-enabled kernel after r270158, and
separate socket_hhook_register() part and put it into VNET_SYS{,UN}INIT()
handler.

Discussed with:	marcel
2014-08-22 05:03:30 +00:00
Ian Lepore
1fd407a76c This module requires pci_if.h, add it to the SRCS list.
We haven't noticed that it was missing because eisa has been disabled for
a while in -current, but it became apparent when some parallel-build stuff
was MFC'd to 10-stable and this module failed to build there.
2014-08-21 22:42:02 +00:00
Sean Bruno
5f91863a54 Add the Samsung 843T as a 4k enabled drive
Submitted by:	Jason Wolfe <jason@llnw.com>
MFC after:	2 weeks
Sponsored by:	Limelight Networks
2014-08-21 21:05:58 +00:00
Ed Maste
4d52a0fd97 Rename DT_FEATURE_1 to DT_FEATURE
This provides a minor cleanup in elfdump; there are otherwise no
consumers in the tree.  Old SUN documentation can be found for either
variant, but GNU binutils switched to DT_FEATURE around 2000.

Sponsored by:	The FreeBSD Foundation
2014-08-21 20:55:10 +00:00
Jean-Sébastien Pédron
0c1c6af438 vt_vga: When clearing video memory, don't read from it
The goal is to clear the video memory, in case an application drew to
it. So the content shouldn't be loaded in the latches, it can't be
trusted anyway.

This improves a bit the window switch speed.

MFC after:	1 week
2014-08-21 20:10:05 +00:00
Jean-Sébastien Pédron
02ebdd502d vt(4): Rename the "mouse_cursor" structure to "vt_mouse_cursor"
At the same time, "w" and "h" members are now called "width" and
"height". The goal is to have a more "public" structure, because it will
soon be passed as argument to a new callback, replacing vd_bitbltchr_t.

MFC after:	1 week
2014-08-21 19:42:24 +00:00
Jean-Sébastien Pédron
943c702a1b vt(4): Test if the cursor is shown only once
Later, we just see if the "struct mouse_cursor" pointer is set. This
avoids the need to mess with all the conditions several times; this has
been error prone.

While here, rename the variable "m" to a more meaningful "cursor", like
it's done elsewhere in the code.

MFC after:	1 week
2014-08-21 19:15:22 +00:00
Jean-Sébastien Pédron
c6e1a98786 vt(4): Constify vt_buf argument of vtbuf_iscursor()
MFC after:	1 week
2014-08-21 18:26:32 +00:00
Alexander V. Chernikov
c59adfc6a5 * Add new net/sff8436.h containing constants used to access
QSFP+ data via i2c inteface. These constants has been taken
  from SFF-8436 "QSFP+ 10 Gbs 4X PLUGGABLE TRANSCEIVER" standard
  rev 4.8.
* Add support for printing QSFP+ information from 40G NICs
  such as Chelsio T5.

This commit does not contain ioctl changes necessary for this
functionality work, there will be another commit soon.

Example:
cxl1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=ec07bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,.....>
        ether 00:07:43:28:ad:08
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
        media: Ethernet 40Gbase-LR4 <full-duplex>
        status: active
        plugged: QSFP+ 40GBASE-LR4 (MPO Parallel Optic)
        vendor: OEM PN: OP-QSFP-40G-LR4 SN: 20140318001 DATE: 2014-03-18
        module temperature: 64.06 C voltage: 3.26 Volts
        lane 1: RX: 0.47 mW (-3.21 dBm) TX: 2.78 mW (4.46 dBm)
        lane 2: RX: 0.20 mW (-6.94 dBm) TX: 2.80 mW (4.47 dBm)
        lane 3: RX: 0.18 mW (-7.38 dBm) TX: 2.79 mW (4.47 dBm)
        lane 4: RX: 0.90 mW (-0.45 dBm) TX: 2.80 mW (4.48 dBm)

Tested on:	Chelsio T5
Tested on:	Mellanox/Huawei passive/active cables/transceivers.
MFC after:	2 weeks
Sponsored by:	Yandex LLC
2014-08-21 17:54:42 +00:00
Edward Tomasz Napierala
ddc5fd903d Use proper include paths in kernel iSCSI code.
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2014-08-21 16:08:17 +00:00
Edward Tomasz Napierala
f5440d1a9d Fix includes.
Suggested by:	pluknet@
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2014-08-21 15:59:25 +00:00
Jean-Sébastien Pédron
52ff33d967 vt(4): Pause the flush timer while swithing window
This fixes bad looking refresh when switching window: squares instead
of text, flashing screen, and so on. In the worst case, vt_flush() came
at a very inappropriate timing and the screen was not refreshed at all
(leaving squares all over the place).

This doesn't fix the flickering of the screen with vt_vga, because the
sync signal is temporarily stopped and the video memory is cleared.

MFC after:	1 week
2014-08-21 15:55:18 +00:00
Edward Tomasz Napierala
b7a65e3936 Make the iSCSI stack use __FBSDID() properly.
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2014-08-21 15:32:38 +00:00
Jean-Sébastien Pédron
353ad09fad vt(4): Mark cursor position as dirty when we enable/disable it
MFC after:	1 week
2014-08-21 15:14:54 +00:00
Edward Tomasz Napierala
925fd94584 Use __FBSDID() properly.
Suggested by:	pluknet@
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
2014-08-21 15:07:25 +00:00
Jean-Sébastien Pédron
7e6dfdd6e5 vt(4): Mark the current cursor position as dirty
Like r270273, this has no effect for now, because the cursor is always
drawn. This is in preparation of future changes to vd_bitbltchr_t API.

MFC after:	1 week
2014-08-21 15:00:21 +00:00
Jean-Sébastien Pédron
608b7ceace vt(4): If the cursor didn't move, don't mark its position as dirty
Currently, this has no effect, because the cursor is always redrawn
anyway. But this will be useful after improvements to the vd_bitbltchr_t
callback API.

The vt_device structure members used to store the position of the cursor
as of the last redraw are renamed from vd_mdirty{x,y} to vd_mold{x,y}.
The associated comment is fixed too. Also, their value is now expressed
in pixels, not in character columns/row.

MFC after:	1 week
2014-08-21 14:54:37 +00:00
Jean-Sébastien Pédron
e861fb376a vt(4): If the cursor is globally disabled, don't mark its position as dirty
This avoids unnecessary redraw. In particular, during boot, where the
cursor is disabled and its fake position is [0;0], this triggered a
refresh of the whole screen each time vt_flush() is called.

MFC after:	1 week
2014-08-21 14:12:11 +00:00
Jean-Sébastien Pédron
c5dabe0780 vt(4): Mark cursor old position as dirty before reading the dirty area
Otherwise, the redraw is done during the next vt_flush run.

MFC after:	1 week
2014-08-21 13:28:48 +00:00
Jean-Sébastien Pédron
c4ad232a03 vt(4): Handle global and per-window mouse cursor toggle in one place
Before the global flag was set/unset using the CONS_MOUSECTL ioctl, and
the per-window flag through the MOUSE_SETLEVEL or MOUSE_SETMODE ioctls.

Also, if the cursor is already enabled/disabled, return immediatly. This
avoids to reset the cursor's position to the center of the screen.

This matches syscons' behavior.

While here, remove a trailing space and a redundant variable
declaration.
2014-08-21 13:04:34 +00:00
Jean-Sébastien Pédron
a5d099afa9 vt(4): Fix an inconsistency between the mouse cursor bitmap and its mask
MFC after:	1 week
2014-08-21 10:54:39 +00:00
Davide Italiano
e957745707 Revert r270227. GCC doesn't like the lack of LL suffix,
so this makes powerpc build failing.
2014-08-21 09:01:42 +00:00
Xin LI
d291a3bd9c Provide compatibility shim for atomic_dec_64_nv.
X-MFC-with:	r270247
MFC after:	13 days
2014-08-21 08:25:46 +00:00
Gavin Atkinson
f8569ca154 Add a missing brace to callout_init_rm() to fix syntax.
MFC after:	1 week
2014-08-21 07:52:51 +00:00
Adrian Chadd
f8cdacdd18 Add missing locking.
Whilst here, assert that the lock is held when calling epstop().

Tested:

ep0: <3com Megahertz 574B>
2014-08-21 00:57:32 +00:00
Navdeep Parhar
9721a22d4a Change netmap's global lock to sx instead of a mutex.
Reviewed by:	luigi@
MFC after:	1 day
2014-08-20 23:37:44 +00:00
Warner Losh
15f48aaad6 Turns out that IDENTIFY DEVICE and IDENTIFY PACKET DEVICE return data
that's only mostly similar. Specifically word 78 bits are defined for
IDENTIFY DEVICE as
	5 Supports Hardware Feature Control
while a IDENTIFY PACKET DEVICE defines them as
	5 Asynchronous notification supported
Therefore, only pay attention to bit 5 when we're talking to ATAPI
devices (we don't use the hardware feature control at this time).
Ignore it for ATA devices. Remove kludge that papered over this issue
for Samsung SATA SSDs, since Micron drives also have the bit set and
the error was caused by this bad interpretation of the spec (which is
quite easy to do, since bits aren't normally overlapping like this).
2014-08-20 22:58:12 +00:00
Xin LI
7c1db36b28 MFV r270196:
Illumos issue:
    5047 don't use atomic_*_nv if you discard the return value

MFC after:	2 weeks
2014-08-20 22:39:26 +00:00
Xin LI
249ddb42f6 MFC r270195:
Illumos issue:
    5045 use atomic_{inc,dec}_* instead of atomic_add_*

MFC after:	2 weeks
2014-08-20 21:44:48 +00:00
Xin LI
2bcc37f99c MFV r270193:
Illumos issues:
    5042 stop using deprecated atomic functions

MFC after:	2 weeks
2014-08-20 18:29:18 +00:00
Luiz Otavio O Souza
801abb3eba Rewrite of ti_i2c based on gonzo's patch, fix the following bugs/problems:
. interrupt storm detected on "intr70:"; throttling interrupt source;

  . Added access serialization on iicbus_transfer(), previously there was
    no such protection and a new transfer could easily confuse the
    controller;

  . Add error checkings (i.e. stop the transfer when a error is detected
    and do _not_ overwrite the previous error);

  . On command done interrupt do not assume that the transfer was finished
    sucessfully as we will receive the command done interrupt even after
    errors;

  . Simplify the FIFO handling;

  . Reset the FIFO between the transfers as the FIFO may contain data from
    the last (failed) transfer;

  . Fix the iicbus speed for AM335x, which in turn will make better use of
    the I2C noise filter (set to one internal clock cycle);

  . Move the read and write handler to ithread instead of notifying the
    requesting thread with wakeup(9);

  . Fix the comments based on OMAP4 TRM.

The above changes allows me to read the EDID from my HDMI monitor on BBB
with gonzo's patches to support TDA19988 (which does 128 bytes reads) and
repeatedly scan the iicbus (with a modified i2c(8)) without lock up the bus.

Phabric:	D465
2014-08-20 17:02:37 +00:00
Davide Italiano
d0091d6625 Make Bruce happy removing the "LL abomination" from time.h
It's not necessary in all the three instances because
they already have the correct type on all the supported
arches.

Requested by:	bde
2014-08-20 16:32:02 +00:00
John Baldwin
e6e574516a Add kernel modules for si(4), wds(4), and wl(4). 2014-08-20 16:09:05 +00:00