Commit Graph

150004 Commits

Author SHA1 Message Date
Xin LI
57f20544f5 Fix LINT build. 2009-09-25 02:19:57 +00:00
David Xu
daf3ced72b don't report error if key was deleted.
PR:	threads/135462
2009-09-25 00:15:30 +00:00
David Xu
b101b127f3 In function do_rw_wrlock, when a writer got an error and before returning,
check if there are readers blocked by us via URWLOCK_WRITE_WAITERS flag,
and resume the readers. The error must be EAGAIN, otherwise there must
have memory problem, and nobody can rescue the buggy application.

The revision 197445 might be reverted.
2009-09-25 00:03:13 +00:00
Jung-uk Kim
5ec510d8f4 Dump real mode registers under bootverbose to help debugging BIOS emulator. 2009-09-24 22:42:35 +00:00
Ed Schouten
64d0447d4e Add __unused.
It turns out my previous commit does survive a buildkernel, but not
compilation of the individual test tools that use WARNS=6.
2009-09-24 20:34:44 +00:00
Ed Schouten
fbcd1b6eac Make SCS work in 8-bit mode.
This means we can finally do things like VT100 box drawing when using
Syscons (8-bit characters). As far as I know, the only remaining issue
is the absense of proper escape sequences for special keyboard
characters (cursor, F1 to F12, etc) and xterm emulation should be ready
for general use.

Enabling xterm would have the following advantages:

- Easier possible migration to Unicode. cons25 termcap entries are very
  8-bit centric. They use things like CP437 characters for box drawing,
  etc.

- Better support for SSH'ing to other operating systems/devices. Most
  switches use VT100-style admin interfaces.

- Reduced bandwidth, because applications can now use things like
  scrolling regions.

- You can finally use applications like dtach(1) on both the console and
  inside an xterm.
2009-09-24 20:33:14 +00:00
Jung-uk Kim
55990ad0c3 Initialize registers to zero before calling the interrupt handlers inside
emulator as we did in r197424 for vesa.

Submitted by:	paradox (ddkprog yahoo com)
2009-09-24 20:23:24 +00:00
Jung-uk Kim
4d849a58c4 Some broken VESA BIOSes, e.g., IBM T23, return wrong value from
vesa_bios_get_line_length() in graphics mode.  Always calculate the value
from known video info instead.

Submitted by:	paradox (ddkprog yahoo com)
2009-09-24 20:10:00 +00:00
Jung-uk Kim
ed89577f29 r197444 unnecessarily changed positions of these files. Re-sort. 2009-09-24 19:42:56 +00:00
Jung-uk Kim
a867274808 - Use FreeBSD function naming convention.
- Change x86biosCall() to more appropriate x86bios_intr().[1]

Discussed with:	delphij, paradox (ddkprog yahoo com)
Submitted by:	paradox (ddkprog yahoo com)[1]
2009-09-24 19:24:42 +00:00
Pyun YongHyeon
42bd415090 Align Tx/Rx descriptors on 32 bytes boundary instead of PAGE_SIZE.
Also align setup descriptor on 32 bytes boundary. Tx buffer have no
alignment limitation so create dmamap without alignment
restriction[1]. Rx buffer still seems to require 4 bytes alignment
limitation but we can simply use MCLBYTES for size to map the
buffer instead of TULIP_DATA_PER_DESC as the buffer is allocated
with m_getcl(9).
de(4) supports up to TULIP_MAX_TXSEG segments for Tx buffers,
increase maximum dma segment size to TULIP_MAX_TXSEG * MCLBYTES.
While I'm here remove TULIP_DATA_PER_DESC as it is not used anymore.

This should fix de(4) breakage introduced after r176206.

Submitted by:	jhb [1]
Reported by:	WATANABE Kazuhiro < CQG00620 <> nifty dot ne dot jp >
Tested by:	WATANABE Kazuhiro < CQG00620 <> nifty dot ne dot jp >,
		Takahashi Yoshihiro < nyan <> jp dot freebsd dot org >
2009-09-24 17:53:00 +00:00
Pyun YongHyeon
f0ca781120 Destroy dmamap in dma cleanup. 2009-09-24 17:11:41 +00:00
Pyun YongHyeon
d0cf2f2116 Consistently use bus_addr_t. 2009-09-24 17:07:04 +00:00
Alexander Motin
6090db7d38 Do not call BUS_DRIVER_ADDED() for detached buses (attach failed) on
driver load. This fixes crash on atapicam module load on systems,
where some ata channels (usually ata1) was probed, but failed to attach.

Reviewed by:	jhb, imp
Tested by:	many
2009-09-24 17:03:32 +00:00
Pyun YongHyeon
839dd22afd Use __NO_STRICT_ALIGNMENT to determine whether de(4) have to apply
alignment fixup code for received frames on strict alignment
architectures.
2009-09-24 16:57:35 +00:00
John Baldwin
08bfbfaa08 Remove unnecessary locking from attach(). This fixes a LOR between the
acpi_ibm lock and the sysctl lock.

MFC after:	3 days
2009-09-24 16:51:56 +00:00
Pawel Jakub Dawidek
ad8294cf98 Before calling vflush(FORCECLOSE) mark file system as unmounted so the
following vnops will fail. This is very important, because without this change
vnode could be reclaimed at any point, even if we increased usecount. The only
way to ensure that vnode won't be reclaimed was to lock it, which would be very
hard to do in ZFS without changing a lot of code. With this change simply
increasing usecount is enough to be sure vnode won't be reclaimed from under
us. To be precise it can still be reclaimed but we won't be able to see it,
because every try to enter ZFS through VFS will result in EIO.

The only function that cannot return EIO, because it is needed for vflush() is
zfs_root(). Introduce ZFS_ENTER_NOERROR() macro that only locks
z_teardown_lock and never returns EIO.

MFC after:	3 days
2009-09-24 15:56:26 +00:00
Pawel Jakub Dawidek
ab9bbf4a2b Close race in zfs_zget(). We have to increase usecount first and then
check for VI_DOOMED flag. Before this change vnode could be reclaimed
between checking for the flag and increasing usecount.

MFC after:	3 days
2009-09-24 15:49:15 +00:00
Ed Maste
43721b6e84 Add a backtrace to the "fpudna in kernel mode!" case, to help track down
where this comes from.

Reviewed by:	bde
2009-09-24 14:26:42 +00:00
Rui Paulo
249e7759ac Update the includes to two more levels of subdirs.
MFC after:	1 week
2009-09-24 11:11:00 +00:00
Andriy Gapon
1e908511f8 number of cleanups in i386 and amd64 pci md code
o introduce PCIE_REGMAX and use it instead of ad-hoc constant
o where 'reg' parameter/variable is not already unsigned, cast it to
  unsigned before comparison with maximum value to cut off negative
  values
o use PCI_SLOTMAX in several places where 31 or 32 were explicitly used
o drop redundant check of 'bytes' in i386 pciereg_cfgread() - valid
  values are already checked in the subsequent switch

Reviewed by:	jhb
MFC after:	1 week
2009-09-24 07:11:23 +00:00
Marcel Moolenaar
87f4470620 Don't create more partitions than can fit in the table by checking
that the index is within bounds.
2009-09-24 06:00:49 +00:00
Attilio Rao
b13c5f2883 rwlock implemented from libthr need to fall through the 'hard path' and
query umtx also if the shared waiters bit is set on a shared lock.
The writer starvation avoidance technique, infact, can lead to shared
waiters on a shared lock which can bring to a missed wakeup and thus
to a deadlock if the right bit is not checked (a notable case is the
writers counterpart to be handled through expired timeouts).

Fix that by checking for the shared waiters bit also when unlocking the
shared locks.

That bug was causing a reported MySQL deadlock.
Many thanks go to Nick Esborn and his employer DesertNet which provided
time and machines to identify and fix this issue.

PR:		thread/135673
Reported by:	Nick Esborn <nick at desert dot net>
Tested by:	Nick Esborn <nick at desert dot net>
Reviewed by:	jeff
2009-09-23 21:38:57 +00:00
Jung-uk Kim
19de5df5e5 Move sys/dev/x86bios to sys/compat/x86bios.
It may not be optimal but it is clearly better than the old place.

OK'ed by:	delphij, paradox (ddkprog yahoo com)
2009-09-23 20:49:14 +00:00
Jung-uk Kim
9747418cc4 - Use spin lock instead of default mutex for safety. INT/IRET instructions
save/clear/restore flags but emulated flags have no effect on the host.
I believe BIOS writers never meant to run their code in emulated
environment with interrupt enabled. :-)
- Use memcpy(3) instead of copying individual members.  I believe struct
x86regs was intentionally copied from the first half of struct x86emu_regs
for this very purpose.
- Fix some style nits and consistencies.

Reviewed by:	delphij, paradox (ddkprog yahoo com)
2009-09-23 20:13:36 +00:00
Rui Paulo
0be3021195 Replace 'can not' with 'cannot' so that we use 'cannot' everywhere. 2009-09-23 17:48:16 +00:00
John Baldwin
d95e7f5a7a Extract the code to find and map the MADT ACPI table during early kernel
startup and genericize it so it can be reused to map other tables as well:
- Add a routine to walk a list of ACPI subtables such as those used in the
  APIC and SRAT tables in the MI acpi(4) driver.
- Move the routines for mapping and unmapping an ACPI table as well as
  mapping the RSDT or XSDT and searching for a table with a given signature
  out into acpica_machdep.c for both amd64 and i386.
2009-09-23 15:42:35 +00:00
John Baldwin
36a888a17f Uninline an instance of STAILQ_FOREACH_SAFE(). 2009-09-23 15:39:54 +00:00
Ed Maste
7149ebf446 Use %zu for size_t, not %zd.
Submitted by:	ru
MFC after:	1 week
2009-09-23 15:32:59 +00:00
Edward Tomasz Napierala
c39f46352f Add cross-filesystem regression tests for ACLs. 2009-09-23 15:12:20 +00:00
Edward Tomasz Napierala
c40502ccd0 In VOP_SETACL(9) and VOP_GETACL(9), specifying wrong ACL type should result
in EINVAL, not EOPNOTSUPP.
2009-09-23 15:09:34 +00:00
Edward Tomasz Napierala
95e7b798b9 Add ACL fuzzer. It's not used by the regression tests right now,
but I'd prefert to have it here, so it won't get lost.
2009-09-23 15:06:51 +00:00
Max Laier
23250941e8 Improve on r197334:
Find the most recently merged svn revision, too. If we get a svn revision
that matches HEAD use rXXX=GIT otherwise use rXXX+GIT.

Submitted by:	avg
MFC after:	3 days
X-MFC:		not stable/8 before 8.0
2009-09-23 14:48:13 +00:00
John Baldwin
0cab1e9602 - Remove a bogus test: setsockopt() doesn't return a length, getsockopt()
does.
- Use %z to printf a size_t to fix compile on 64-bit platforms.
2009-09-23 14:23:09 +00:00
Stanislav Sedov
50989f36fc - Bump __FreeBSD_version to reflect the point when EVFILT_USER kevent filter
has been implemented.
2009-09-23 12:33:32 +00:00
Konstantin Belousov
edf7321479 Document osrel node for procfs.
Approved by:	des (procfs maintainer)
MFC after:	3 weeks
2009-09-23 12:10:13 +00:00
Konstantin Belousov
17dfbc1c43 Add per-process osrel node to the procfs, to allow read and set p_osrel
value for the process.

Approved by:	des (procfs maintainer)
MFC after:	3 weeks
2009-09-23 12:08:08 +00:00
Pawel Jakub Dawidek
eb03c3cdfb Restore BSD behaviour - when creating new directory entry use parent directory
gid to set group ownership and not process gid.

This was overlooked during v6 -> v13 switch.

PR:		kern/139076
Reported by:	Sean Winn <sean@gothic.net.au>
MFC after:	3 days
2009-09-23 09:18:16 +00:00
Mike Silbersack
aae0914135 In netstat -x, do not try to print out tcp timer status for udp sockets. 2009-09-23 05:32:33 +00:00
Xin LI
f27b147e40 Initialize registers to zero before calling the interrupt handlers inside
emulator.  This fixes VESA related freeze observed on some systems.

Submitted by:	paradox <ddkprog yahoo com>
2009-09-23 02:45:02 +00:00
Alexander Motin
01a967e266 MFp4:
If on sense request device returns no sence, give up and return,
or we may loop forever.
2009-09-22 22:23:52 +00:00
Alexander Motin
3ba45aaa60 Lock bus scan. 2009-09-22 22:20:43 +00:00
Alexander Motin
a3f00c8abf MFp4:
Reduce code duplication.
2009-09-22 22:17:14 +00:00
Xin LI
bacfa53de3 Temporarily disable typematic retrieving code until we get a real fix,
which currently causes hangs in some configurations.

Reported by:	joel
Submitted by:	swell.k at gmail.com
2009-09-22 20:12:10 +00:00
John Baldwin
fd0a5b2f1e The elements in the component arrays may be direct Package objects rather
than references to objects.  In that case, simply use the Package directly.

I think a recent change to ACPI-CA is causing the interpreter to
automatically expand these references.

Reported by:	Olivier Smedts  olivier gid0 org
MFC after:	3 days
2009-09-22 18:34:23 +00:00
Rui Paulo
350036a06d Note the D3.03 mesh changes.
MFC after:	1 week
2009-09-22 18:19:18 +00:00
Rui Paulo
c77735e28f Update 802.11s mesh support to draft 3.03. This includes a revised frame
format for peering and changes to the PERR frames.
Note that this is incompatible with the previous code.

Reviewed by:	sam
MFC after:	1 week
2009-09-22 18:18:14 +00:00
Rui Paulo
f0fda3a508 Reserve events for XScale.
Reviewed by:	jkoshy, gnn
MFC after:	1 week
2009-09-22 17:45:28 +00:00
Xin LI
3f6f37f067 Removed unused empty directory.
Submitted by:	b. f. <bf1783 googlemail com>
2009-09-22 16:59:15 +00:00
John Baldwin
07ee969179 - Split the logic to parse an SMAP entry out into a separate function on
amd64 similar to i386.  This fixes a bug on amd64 where overlapping
  entries would not cause the SMAP parsing to stop.
- Change the SMAP parsing code to do a sorted insertion into physmap[]
  instead of an append to support systems with out-of-order SMAP entries.

PR:		amd64/138220
Reported by:	James R. Van Artsdalen  james of jrv org
MFC after:	3 days
2009-09-22 16:51:00 +00:00