Commit Graph

84285 Commits

Author SHA1 Message Date
skrll c837287aab s/out/bad/ in cpu_dumpconf so this compiles. 2006-10-21 08:11:49 +00:00
mrg 065b4dbdca fix errors in the previous changes. 2006-10-21 08:09:58 +00:00
skrll 3d92eb6b84 De-__P() 2006-10-21 07:24:20 +00:00
skrll b560533af2 Pass the cookie (not the function address) to bus_space_alloc.
From OpenBSD.
2006-10-21 07:22:48 +00:00
kardel d094ff8f40 Avoid printf() the selected timecounter as it is called in the path of hardclock().
The information is available via sysctl anyway.
2006-10-21 07:16:54 +00:00
mrg 648bbec934 in cpu_dumpconf(), don't panic() if we can't bdevsw_lookup() the
dumpdev.  this occurs when we try to set the dumpdev to a device
with no driver loaded.  this fixes PR#34872.

in sys_swapctl, if bdevsw_lookup() fails, set dumpdev = NODEV
before calling cpu_dumpconf().  (this also fixes PR#34872.)

XXX: cpu_dumpconf() should probably be changed to take a dumpdev
XXX: and return an error in such cases, but that is a much more
XXX: intrusive change.

XXX2: this is only run-tested on sparc64 and compile tested on a
XXX2: couple of platforms.
2006-10-21 05:54:31 +00:00
tsutsui 5227317a1e Use CSR_WRITE_1() to write RTK_TXSTART register because it is localted
at an odd address (0xd9) and noted "8 bit" in rtl81x9reg.h.

XXX: FreeBSD and OpenBSD also use CSR_WRITE_1() to write RTK_GTXSTART
XXX: for 8169 even though there is a "16 bits" comment at GTXSTART macro.
XXX: Which is correct?
2006-10-21 03:44:47 +00:00
mrg 877957f469 add a "mach sir" command to call sir instruction ('software initiated
reset').  this is a much more drastic way to do "mach prom", but it
works when used from cpu>0, which "mach prom" currently does not.
2006-10-21 03:16:05 +00:00
elad 815337c3da Kill KAUTH_GENERIC_ISSUSER usage. 2006-10-21 00:13:57 +00:00
elad 305fe09181 Introduce a new action on the network scope, KAUTH_NETWORK_INTERFACE,
used to manage network interfaces.

Add four sub-actions to fulfill generic needs for now, until a more
carefully defined usage of the interface is documented: get, set,
getpriv, and setpriv.
2006-10-20 23:10:33 +00:00
elad a5d447aee5 Add an XXX to remind me why it's there when grepping. (securelevel ref) 2006-10-20 22:22:48 +00:00
mrg e54ce8ca38 avoid yet another GCC uninitialised warning at -O3. 2006-10-20 22:12:57 +00:00
elad 0c8de7ee9e Kill another KAUTH_GENERIC_ISSUSER. 2006-10-20 22:04:13 +00:00
elad fab05f403b Add a new ALTQ kauth(9) request, KAUTH_REQ_NETWORK_ALTQ_JOBS. 2006-10-20 22:02:54 +00:00
elad b8093b8985 Kill some KAUTH_GENERIC_ISSUSER. 2006-10-20 21:55:56 +00:00
mrg e76360da33 avoid yet another GCC uninitialised warning error that only comes
up with -O3.
2006-10-20 21:50:41 +00:00
reinoud 19cb20fb7b Back out TAILQ_FOREACH in the vflush() since vgone() and vclean() are
called, the TAILQ_NEXT() derefers 0xdeadbeef....

Implemented again using an explicit `for' loop that keep the next pointer
available.
2006-10-20 20:29:52 +00:00
liamjfoy cd64dacbef Remove some dead code - From OpenBSD Rev. 1.129 2006-10-20 19:13:02 +00:00
reinoud 0ce809091d Replace the LIST structure mp->mnt_vnodelist to a TAILQ structure since all
vnodes were synced and processed backwards. This meant that the last
accessed node was processed first and the earlierst last.

An extra benefit is the removal of the ugly hack from the Berkly days on
LFS.

In the proces, i've also replaced the various variations hand written loops
by the TAILQ_FOREACH() macro's.
2006-10-20 18:58:12 +00:00
martin d55cb18cdc A few -Wextra nits 2006-10-20 18:26:26 +00:00
reinoud f64c33e88b Define DPRINTF(x) as an empty block to prevent gcc from complaining about
empty statements. This is still an empty statement but it will be filtered
out still.
2006-10-20 18:14:59 +00:00
tsutsui f236f53515 In re_newbuf():
- adjust m_data and m_len directly rather than calling m_adj(9)
- more cosmetics
2006-10-20 17:11:36 +00:00
tsutsui 2cc86b486f KNF, remove register decls, TAB/space cosmetics etc. 2006-10-20 16:46:47 +00:00
tsutsui 572ce0789f u_intNN_t -> uintNN_t 2006-10-20 16:31:08 +00:00
tsutsui 7245fafc22 Add re at pci and rgephy at mii. 2006-10-20 15:48:37 +00:00
tsutsui d27d349474 Use BUS_DMA_COHERENT on mapping DMA memory for TX/RX descriptors.
I can't think of a good way to avoid race condition between writeback and
DMA write against descriptors if cachelinesize > sizeof(struct rtk_desc)...

Anyway, now re(4) is functional on O2 (and probably other mips ports).
2006-10-20 15:44:00 +00:00
tsutsui a7ca335bad Try to avoid race condition between cache writeback from CPU and DMA write
from re(4) chip as much as possible.
2006-10-20 15:19:01 +00:00
tsutsui 620e93c99c while (1) -> for (;;) 2006-10-20 14:51:06 +00:00
tsutsui d2c63dd7b9 - bcopy -> memcpy
- bcmp -> memcmp
2006-10-20 14:28:55 +00:00
tsutsui 55b9847900 There is no particular reason to use BUS_DMA_ALLOCNOW on bus_dmamap_create(9). 2006-10-20 14:00:49 +00:00
tsutsui 920add0c28 Tweak a for() loop a bit in re_rxeof(). 2006-10-20 13:44:31 +00:00
tsutsui 38e9d649da Sync RX mbufs before setting up RX DMA descriptor. 2006-10-20 13:39:47 +00:00
reinoud 78f5b5f9d5 Fix alignment problems causing regular panics in tpc_sack_option on
NetBSD/alpha and NetBSD/sparc. This fixes PR#34751.

The problem most likely started to show in gcc4 and is caused by the use of
a casting to an uint32_t pointer that is later copied from using memcpy.
Gcc detects the copying of 4 bytes from an uint32_t pointer and decides to
just replace it with an aligned copy causing the trap.

Fix provided by Izumi Tsutsui and ok'd by Martin.
2006-10-20 13:11:09 +00:00
tsutsui e9a7d245ed - call bus_dmamap_sync(9) against DMA descriptors more properly
- make DMA descripter members volatile
Now re(4) works on sgimips O2.

XXX: Still re(4) sometimes stalls on NFS load on sgimips,
XXX: but I'm not sure it's sgimips specific or not.
2006-10-20 11:30:54 +00:00
scw d269f28650 Force a reload of the EEPROM if the MAC address is all zeroes.
Fixes PR kern/34812.
2006-10-20 10:31:06 +00:00
scw 4526a898c6 Validate the sector size returned by READ CAPACITY. If it looks bogus
print a warning and fallback to a suitable default.

Fixes a problem on hp700 reported by skrll@
2006-10-20 07:11:50 +00:00
gdamore e8ac1cad77 This commit provides substantial fixes and functionality for SPI flash.
Specifically, the SPI flash now operates as a nearly fully functional block
device (other than lacking disklabel support).  It does some basic translation
stuff, so that if you attempt to write a block, the underlying flash sectors
(usually 64k in size) will be read, erased and rewritten.

To minize thrashing, the spiflash strategy routine attempts to gather writes
to the same sector together, so that in the typical case you will not have to
repeatedly erase/rewrite the sector.  It also attempts to check and verify
whether an erase cycle is truly needed.  There are still access patterns that
will cause multiple erases to occur, and so I heartily discourage the use
of these flash devices for storing anything other than small configuration
data, or write-once images.  If you want to do more than that, then someone
should try to write a real flash translation layer.

The drivers attempt to provide some level of asynchronous operation, so that
while you are erasing or writing to the flash, other things can reasonably
take place.

Note that spiflash does not do bad block remapping.  It also doesn't detect
when a device is in read-only mode, or if some sectors are read-only.  It
only supports uniform sectored NOR flash.  It lacks any code to deal with
disklabels, and does not offer any disk related ioctls.

These limitations aside, it would not be terribly hard, I think, to break
out the code I've done to create a generic "norflash" driver, backed by
a "common" spiflash module.  Then other flash drivers (e.g. athflash, etc.)
could benefit from the ability to use this as a block device.  I've tried
to architect it to support that, if someone else wants to do the work.
(Hi Jared!)

The primary reason that I've not added code to deal with disklabels is that
I had a difficult time figuring out which framework (disklabels or wedges)
to use, and which bits of code were necessary to implement.  In the case of
the flash devices I'm working with, a parser to deal with redboot FIS images
(partitions) would need to be added.  I was prepared to do this, but gave
up owing to the complete and total lack of any API or design documentation
pertaining to the requirements for disk drivers and disklabel management or
wedges.   I would strongly encourage someone who knows something about
wedges or disklabels to write a simple document (or even a dummy driver)
showing which interfaces should be provided in new mass storage drivers.

This work was funded by the Champaign-Urbana Community Wireless Network
Project.
2006-10-20 06:41:46 +00:00
martin 06f6d1ebf7 Sync (commented out) kgdb options with reality.
(Not that it works at all - the locore.s support is not done yet)
2006-10-19 22:01:18 +00:00
martin 6caa94ff4b kgdb support for sabtty 2006-10-19 21:52:12 +00:00
martin 860142f506 Remove unsued file 2006-10-19 21:44:51 +00:00
martin 8c154addc5 Remove obsolete (and partially accidently commited) kgdb parts 2006-10-19 21:09:46 +00:00
he e1fda29be8 Convert to using hexadecimal literals for the type limits.
Also, add a trailing 'U' to the unsigned limits.
2006-10-19 20:20:43 +00:00
drochner 06e33f371b remove relicts of COMPAT_AOUT, fixes compilation problems with old
kernel config files reported by Patrick Welche on current-users
2006-10-19 16:55:37 +00:00
reinoud 98d17cde9d Make it compile again; it had an empty if body due the the DPRINTF and gcc
complained about it.
2006-10-19 15:11:59 +00:00
tsutsui 881db3b0de Defer enabling hardware interrupts until all timecounter(9)s are initialized
in cpu_initclocks(9), and then remove "if (cold)" check in decr_intr().

Fixes long delay during config_process_deferred() for interrupt_config_queue,
OK'ed by macallan.
2006-10-19 14:25:29 +00:00
rpaulo 8106a506d3 Use a better way to create sysctl subtrees for ECN and Congctl.
Inspired on ABC subtree.
2006-10-19 14:14:34 +00:00
simonb e8ff7d18f3 Use "U" suffixes for largest unsigned type values.
Pointed out by Nick Hudson.
2006-10-19 12:05:26 +00:00
yamt c549acefec tcp_reno_newack: remove an __unused because it's now used. 2006-10-19 11:42:32 +00:00
yamt df8e5bddfa tcp_reno_newack: regardless of sysctl setting, use L=1*SMSS when
we are doing retransmission.
2006-10-19 11:42:02 +00:00
yamt 81463c93c7 implement RFC3465 appropriate byte counting.
from Kentaro A. Kurahone, with minor adjustments by me.
the ack prediction part of the original patch was omitted because
it's a separate change.  reviewed by Rui Paulo.
2006-10-19 11:40:51 +00:00