Commit Graph

56903 Commits

Author SHA1 Message Date
thorpej 11bb3d047b Avoid NULL pointer dereference. kern/17438, xs@kittenz.org. 2002-07-02 16:22:28 +00:00
thorpej f055878614 Fix using poll(2) on systrace descriptors. 2002-07-02 16:16:33 +00:00
matt af8dc59949 Add AltiVec routines for save_vec/enable_vec/init_vec. 2002-07-02 15:22:47 +00:00
itojun 5092dd2653 wsdisplay needs wsevent.c. PR 17456 2002-07-02 12:59:39 +00:00
thorpej 7ff40c446d Fix multicast filter programming. 2002-07-01 22:42:47 +00:00
itojun fb05cd3dd3 new copyright boilerplate from CMU. from openbsd 2002-07-01 22:09:31 +00:00
itojun 390ee363bd check AF_INET6 socketes when IPv4 "too big" messages arrive.
PR 17448
2002-07-01 20:51:25 +00:00
matt 708f4c7b9b Add VRSAVE. 2002-07-01 20:11:05 +00:00
bjh21 3763adaefd Avoid leaving junk in the top half of R0 on return.
This fixes port-arm/17440.
2002-07-01 19:07:18 +00:00
drochner 3680345a91 simplify console initialization a bit, avoid wasting
memory in attach(), and add some commemts
2002-07-01 16:56:09 +00:00
christos 61a86a83fe add a couple more dependencies so that we can build a kernel without
make depend.
2002-07-01 16:37:08 +00:00
ragge 779789e94f Protect biodone() with spl7(). Found by art@openbsd, but fixed in the
wrong way.
2002-07-01 16:20:35 +00:00
thorpej f3ae1a786e In ex_shutdown(), call ex_enable() to make sure the interface is
powered up and the PCI configuration registers restored.  If we
don't do this, the firmware on some machines gets REALLY confused.
2002-07-01 16:16:37 +00:00
thorpej 2555837833 Also save/restore the PCI_INTERRUPT_REG. 2002-07-01 16:15:35 +00:00
fredette cfd4248d21 Made the signal trampoline PLABEL-aware.
Added a missing comma to the pmap_redzone() call.
2002-07-01 16:10:02 +00:00
christos dad84218d6 Fix iplog problem on sparc64 [from Tomi Nylund]
1. size_t is 64 bits, so use a u_32_t for iplused
	2. microtime() and friends expect a struct timeval,
	   passing the first of two unsigned longs will not cut it.
2002-07-01 13:55:35 +00:00
christos 2a01227008 Add example use of WSDISPLAY_CHARFUNCS, from Julio Merino 2002-07-01 13:19:05 +00:00
christos 63a19c881d more cleanups from Julio Merino. 2002-07-01 13:17:48 +00:00
thorpej 0ba2c1b425 When delivering a signal, arrange for the signal handler to be invoked
directly, using the trampoline only for the return path.
2002-07-01 03:10:01 +00:00
thorpej 47506c123a Add kttcp device. 2002-06-30 23:30:07 +00:00
thorpej 10c252ba47 Changes to allow the IPv4 and IPv6 layers to align headers themseves,
as necessary:
* Implement a new mbuf utility routine, m_copyup(), is is like
  m_pullup(), except that it always prepends and copies, rather
  than only doing so if the desired length is larger than m->m_len.
  m_copyup() also allows an offset into the destination mbuf, which
  allows space for packet headers, in the forwarding case.
* Add *_HDR_ALIGNED_P() macros for IP, IPv6, ICMP, and IGMP.  These
  macros expand to 1 if __NO_STRICT_ALIGNMENT is defined, so that
  architectures which do not have strict alignment constraints don't
  pay for the test or visit the new align-if-needed path.
* Use the new macros to check if a header needs to be aligned, or to
  assert that it already is, as appropriate.

Note: This code is still somewhat experimental.  However, the new
code path won't be visited if individual device drivers continue
to guarantee that packets are delivered to layer 3 already properly
aligned (which are rules that are already in use).
2002-06-30 22:40:32 +00:00
thorpej 8eb0145183 Add a table of known-64-bit DP83820-based cards. Use this table
to enable 64-bit data transfers on 64-bit cards when plugged into
a 64-bit slot.  Right know the Asante GigaNIX is listed in that
table.

Sigh, there is an EEPROM bit that can be used to detect 64-bit vs
32-bit cards.  Unfortunately, at least 2 vendors of 32-bit cards
fail to clear the "DATA64_EN" bit in the EEPROM, which causes the
card to lose badly, because it still manages to detect that it's
plugged into a 64-bit PCI slot.  Yay, stupid hardware vendors.
2002-06-30 20:36:06 +00:00
thorpej 145fa4de8a Load configuration data from the EEPROM on the DP83820 differently: rather
than grovel the EEPROM directly, initiate an "EEPROM load" in the PCI
test register, and fetch the values from the CFG register.
2002-06-30 20:04:43 +00:00
thorpej b77065a9a2 Update the TODO list: We have some Tx interrupt mitigation now, so
we need to do Rx interrupt mitigation next.
2002-06-30 19:13:46 +00:00
thorpej c9983ba67f Be more aggressive in giving descriptors to the chip in the transmit
path: Instead of waiting for the if_snd queue to be drained before
giving ownership of the frist descriptor to the chip, do it after
sync'ing all the descriptors for a single packet.
2002-06-30 19:11:40 +00:00
thorpej 6caa2f6db1 Implement a sliding interrupt delay window for Tx interrupts. 2002-06-30 18:52:21 +00:00
thorpej 0f2cbd0361 * Give symbolic names to the CFG bits in the EEPROM.
* Get CFG_M64ADDR, CFG_T64ADDR, and CFG_DATA64_EN from the EEPROM.
  Note, we still disable CFG_M64ADDR and CFG_T64ADDR later (XXX need
  PCI bus capability flags for these).
* Print a message if we're in a 64-bit slot and 64-bit data is
  disabled in the EEPROM.  Make sure CFG_DATA64_EN is disabled if
  we're not in a 64-bit slot.
2002-06-30 18:04:12 +00:00
bjh21 c1ba727b47 Version times() so that programs compiled before the recent change to make
sysconf(_SC_CLK_TCK) return hz will work.

In detail:
__times13() returns values scaled by hz.
times() returns values scaled by 100.
<sys/times.h> renames times() to __times13().

_SC_CLK_TCK has changed from 3 to 39.
sysconf(3) returns 100.
sysconf(39) returns hz.
CLK_TCK is defined as sysconf(39).
2002-06-30 09:45:39 +00:00
scottr 9765c0afdf Before reading the (new) Apple Partition Map laid out by sysinst, be sure
to clear the disk label. From Bob Nestor; part 2 of 2 of a fix for
PR 15528.
2002-06-29 19:44:52 +00:00
matt 76c24da31d Add kttcp device. 2002-06-29 19:04:45 +00:00
chs cfefc92864 rearrange a few lines to appease an assertion. 2002-06-29 18:27:30 +00:00
itojun 3973cdf049 typo in name 2002-06-29 12:33:33 +00:00
rafal 4a563f551c Allow this work work without a DRQ for PCNet parts mapped into ISA space
but which are connected to a local bus and do their own bus-mastering.
This has to be turned on via `flags 1' on the nele? device specification.
Gets one of my boxes working again with -current again.
2002-06-29 05:30:44 +00:00
rafal fc0c4eac18 Pass bus_space_map() an address then a size, rather than size twice, so this
has a hope of working.
2002-06-29 05:20:15 +00:00
yamt 58077442ae split logging code in order to reduce maximum stack usage. 2002-06-29 04:13:21 +00:00
eeh c05c5884e6 Turn on parity checking for the PCI bus. 2002-06-29 02:35:22 +00:00
thorpej 7f2925365c Add the kttcp device. 2002-06-28 23:29:26 +00:00
thorpej 473e69750b This is the "kttcp" network throughput testing pseudo-device. From
the block comment at the top of the file:

      This module provides kernel support for testing network
      throughput from the perspective of the kernel.  It is
      similar in spirit to the classic ttcp network benchmark
      program, the main difference being that with kttcp, the
      kernel is the source and sink of the data.

      Testing like this is useful for a few reasons:

      1. This allows us to know what kind of performance we can
         expect from network applications that run in the kernel
         space, such as the NFS server or the NFS client.  These
         applications don't have to move the data to/from userspace,
         and so benchmark programs which run in userspace don't
         give us an accurate model.

      2. Since data received is just thrown away, the receiver
         is very fast.  This can provide better exercise for the
         sender at the other end.

      3. Since the NetBSD kernel currently uses a run-to-completion
         scheduling model, kttcp provides a benchmark model where
         preemption of the benchmark program is not an issue.

There is a companion "kttcp" user program which uses the kttcp
pseudo-device.

Largely written by Frank van der Linden, with some modifications
from me.
2002-06-28 23:27:13 +00:00
drochner ac1165c19c whitespace 2002-06-28 22:32:58 +00:00
drochner 9b3975fd12 clean up font handling:
-treat the builtin font like any other font at runtime
-for that, copy it to malloc()'d memory during attach()
-in early console initialization, if we have to consider a broken card
 (VGA_CONSOLE_ATI_BROKEN_FONTSEL), copy the builtin font to another
 location in font ram; the attach() code will do the rest
put the "quirk" code into effect again
2002-06-28 22:24:11 +00:00
thorpej 969b2f1817 Fix a comment. 2002-06-28 18:46:46 +00:00
thorpej 9066ce1621 When stopping the various functional blocks of the chip, clear the
bit and then read it back in a loop (with appropriate delays) waiting
for it to read back clear.

This fixes a problem where the bus would hang when bringing down
the interface or changing interface flags on a system with a
sufficiently fast CPU (e.g. 2GHz P4 Xeon).
2002-06-28 18:44:45 +00:00
fvdl 50ade28e9b Rearrange alignment code a bit. 2002-06-28 18:39:45 +00:00
tsutsui cb383cb5db Define MSGBUFSIZE here only if it's not specified by options(4). 2002-06-28 17:40:20 +00:00
yamt ec594e3ef5 do previous differently for wddump case. 2002-06-28 16:50:30 +00:00
yamt 2d80988a26 - remove big buffers on stack. discussed on tech-kern.
- constify.
2002-06-28 16:40:50 +00:00
yamt 5154ea5e5b constify diskerr(). 2002-06-28 16:37:20 +00:00
briggs 1b3d605b4e Remove complaint: bus_dmamap_destroy() called for map with valid
mappings bus_dma(9) states: "In the event that the DMA handle contains
a valid mapping, the mapping will be unloaded via the same mechanism
used by bus_dmamap_unload()."  And some drivers do mean to skip the
unload step.
2002-06-28 15:21:00 +00:00
junyoung a52db40372 Do the necessaries when the builtin font gets saved in slot 1. 2002-06-28 03:38:13 +00:00
matt 3043c05326 Add common routines to do BAT initialization, trap vector setup,
interrupt vector installation, VM initialization, core-dumps (stubbed),
and network soft interrupts.  Also kvtop and mapiodev.
2002-06-28 02:32:16 +00:00
matt f7a6553147 Add common syscall dispatcher. Also put child_return in here. 2002-06-28 02:30:06 +00:00
itojun 67c6a98161 disallow ktrace on P_SUGID. from openbsd 2002-06-28 01:59:36 +00:00
thorpej 6abec8e2a2 Increase previously added delays from 2us to 10us. 2002-06-28 01:10:06 +00:00
thorpej 90bf67b885 * Only set the jumbo frame capability if we are able to allocate
jumbo frame buffers.
* Garbage-collect some stuff we don't need.
* Fix timeout detection in the firmware handshake.
2002-06-28 00:55:20 +00:00
thorpej 7778c16e7c Use a table to match BCM570x products. 2002-06-27 23:56:20 +00:00
thorpej b7af161065 Don't call m_aux_find() in the inner loop when creating the Tx
descriptor list.  Instead, call it once and remember the result,
and only call it looking for VLAN tags if VLANs are configured
on the interface.
2002-06-27 23:21:34 +00:00
thorpej 68be8ecae4 Put some delay in the loops that poll for MII transaction
completion.  Without this, reading the PHY can hang the bus
on a sufficiently fast CPU.
2002-06-27 22:31:30 +00:00
fvdl 8a454b46d0 Disable TCP/UDP checksums on the receive side again. 2002-06-27 22:10:11 +00:00
matt 511223b674 If ALTIVEC is not defined, treat EXC_VEC|EXC_USER exceptions as PGM
exceptions.  [Note that we still can't trap these due to issues in
trap_subr.S which are (yet) fixed]
2002-06-27 21:15:35 +00:00
pooka c558b464ba Assign COPTS instead of adding to it, avoids situation where -mi386
is mixed with -march=something_incompatible

suggested by thorpej
2002-06-27 20:44:08 +00:00
drochner 3825b247fb Only allow the bus_dmamem_alloc() code to sleep if no physically contigous
pages are insisted in.
Atm, the pglistalloc code does the same automatically, but this might change.
2002-06-27 18:37:10 +00:00
ross 686a24e882 add bktr 2002-06-27 18:34:32 +00:00
drochner e14af78731 Big cleanup and speed improvements to pglist_alloc code:
-pass vm_physseg* instead of physseg index, and PFN (int) instead
 of physical address (could be done even more)
-simplify detection of boundary crossing and behave more intelligently
 in this case
-take stuff out of the inner loops, or put into "#ifdef DEBUG"
 (because we move along physsegs we don't need to check that the
  pages are physically contigous)
-make the "simple" and "contigous" branches look more uniform; at
 least the outer loops might coalesce one day
2002-06-27 18:05:29 +00:00
itojun 2169d69bcf correct %d/%u mismatch. sync w/kame 2002-06-27 14:39:45 +00:00
christos c96f693db0 PR/17407: Jim Wise: Systrace does not work without procfs.
FIX: use process_domem as thorpej suggested.
2002-06-27 13:22:54 +00:00
itojun d7006267f3 reduce kernel stack usage by separating struct secasindex. sync w/kame
From: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
2002-06-27 12:12:49 +00:00
pooka 48e1ffa97b regen 2002-06-27 09:52:53 +00:00
pooka 107e651a5f two AVM isdn interfaces 2002-06-27 09:50:06 +00:00
gmcgarry f7458b82ef Back out part of revision 1.20 which was causing PROM re-entry
to fail.  Reported by Jarle Greipsland <jarle@uninett.no>.
2002-06-27 08:45:25 +00:00
junyoung 75cfc612c3 Whitespace KNF. 2002-06-27 06:44:17 +00:00
junyoung db4ede9522 Add VGA_CONSOLE_ATI_BROKEN_FONTSEL (disabled by default). 2002-06-27 06:34:23 +00:00
junyoung 754342aeb8 - Work around a hardware bug that loaded fonts don't work, which is
found on many (all?) of PCI-based ATI graphics cards. It is fully optional
  and can be enabled by adding `options VGA_CONSOLE_ATI_BROKEN_FONTSEL'
  to config file.
- Temporarily remove `quirk' mechanism. Similar code already exists
  in pci_quirks.c.
2002-06-27 06:26:51 +00:00
leo 4fdfe6f24c Exclude the Atari/Milan floppy driver from being a RAID capable device. 2002-06-27 05:13:33 +00:00
simonb a441a7dffa Remove some clocktick debug code. 2002-06-27 04:09:15 +00:00
simonb 7471732325 Add the 20Kc processor ID. 2002-06-27 03:43:45 +00:00
briggs bea68a808c Change a 'continue' to a 'break' in switch configuring 64-bit devices.
Add a little more debugging code.
2002-06-27 00:59:21 +00:00
christos 71dcc987cd PR/17402: Add wsmoused support by providing get/set char and events. 2002-06-26 23:05:33 +00:00
matt cd85109523 Make traps even smaller by noticing the checking of privilege mode and
use of curpcb/USPACE is common and move that into the common trap processing.
2002-06-26 20:00:17 +00:00
drochner 6aa49848cf 2 fixes:
-Don't assume fonts to start with character 0, load at the
 right offset. Now we can use eg wsfont/bold8x16.h which
 starts with chr(1).
-Don't touch the hardware if a font is set for a screen which is
 not active.
2002-06-26 16:33:18 +00:00
drochner 8e82746524 avoid assembler warning 2002-06-26 12:20:29 +00:00
cjs 6f2291b427 Match newer NetGear GA302T cards. 2002-06-26 10:48:18 +00:00
cjs f4ba5fb7fc Regenerate. 2002-06-26 10:09:16 +00:00
cjs c3d906554c Add Altima AC9100 Gigabit Ethernet ID. This may not be the correct name.
However, it's the chip on the NetGear GA302T card.
2002-06-26 10:03:58 +00:00
simonb 8c2c311f56 Add evbmips to the list of platforms supported by this driver. 2002-06-26 09:47:08 +00:00
cjs 79a06f07ff Regenerate. 2002-06-26 09:42:44 +00:00
simonb be77ae0cf5 Whitespace KNF. 2002-06-26 09:38:37 +00:00
cjs 0ef3b7e33b Add a couple more TI IEEE 1394 host controllers. 2002-06-26 09:33:50 +00:00
yamt 175fe41cad stack frames can be overwrapped for eg. softintr. 2002-06-26 08:18:01 +00:00
matt 1a5c0cf685 When not using the OLD pmap, bump kernel KVA space to 512MB (OLD pmap stays
at 256MB).
2002-06-26 01:16:22 +00:00
matt 7a12a9737c Revamp how SR(s) are loaded on the user/kernel boundary. We now load all
16 SR registers when transitioning between kernel and user.  Also, don't
reload the kernel SR(s) on every trap but only on traps from user space.
Instead of loading magic SRs for the kernel, load the kernel SRs from the
kernel_pmap_.  This makes trap_subr.S completely ignorant of SR uses and
so they can change with having to change trap_subr.S.  Also note that
since the user and kernel get complete SR sets, user VA space can now be
increased to 4GB if desired.
2002-06-26 01:14:45 +00:00
matt 7c77963b01 Set SR_PRKEY for user pmaps. For the kernel SR(s) set SR_SUKEY|SR_PRKEY.
Note that we never use a PTE PP of 0 or 1 (supervisor protection) so the
"key" is basically unused.  However, use SR_PRKEY for user space is
conceptionally the right thing to do.  Currently the kernel_pmap SR(s) are
ignored but that is going to be fixed shortly.
2002-06-26 01:10:20 +00:00
thorpej a572f8f4a5 Report stray interrupts. 2002-06-26 01:06:44 +00:00
drochner a548b203d4 use PCI_ID_CODE instead of a local macro (cosmetics) 2002-06-25 21:18:32 +00:00
drochner f9d6718ab9 allow to overwrite the builtin VGA font if necessary,
make the number of available font slots variable,
set up a "quirk" mechanism to tell the generic vga code about crippled
VGA adapters which ignore the "fontsel" TS register,
initiate the quirk table with an ATI chip which happened to be on a board
I tested with.
Afaik quite a number of ATI chips suffers from the "loaded fonts don't
work" problem - these should be added.
Bad side effect of my change: The builtin font will be kicked out
always if a VGA_CONSOLE_SCREENTYPE is specified which needs a loaded
font. In early console initialization, we don't know much about the
graphics card, so we have to assume the worst (ie ATI:-).
2002-06-25 21:07:42 +00:00
thorpej 7704072be3 Correct a comment. 2002-06-25 19:41:08 +00:00
thorpej fea38885e8 * Interrupt status is in cp13.4, not cp13.1 (D'oh!)
* Fix an inverted test.
2002-06-25 19:40:46 +00:00
thorpej f2bff71e47 Interrupt steering register is cp13.8, not cp13.2 (D'oh!). 2002-06-25 19:39:51 +00:00
eeh debc8b26aa Fix ktrace call for 32-bit kernels. 2002-06-25 17:37:03 +00:00
itojun d2fb91c184 tabify 2002-06-25 16:31:43 +00:00
drochner 8d07c19c5e regen 2002-06-25 12:26:28 +00:00