Commit Graph

44112 Commits

Author SHA1 Message Date
Alfred Perlstein
1805ed0772 Introduce mp_maxcpus which can be used by libkvm utils to find out
how many CPUs the system was compiled for.
Export the variable via a sysctl node 'kern.smp.maxcpus' as well.
2003-12-23 13:54:16 +00:00
Ruslan Ermilov
78e2d2bd28 Fix a problem introduced in revision 1.84: m_pullup() does not
necessarily return the same mbuf chain so we need to recompute
mtod() consumers after pulling up.
2003-12-23 13:33:23 +00:00
Poul-Henning Kamp
8592d7a760 Prevent withering of the provider we're orphaning from happening until
we do it ourselves.

Nailed by:	Simon Heath <heath@cng.fr>
2003-12-23 11:37:05 +00:00
Hajimu UMEMOTO
a46f7e7c92 Catch a few places where NULL (pointer) was used where 0 (integer) was
expected (fix build).
2003-12-23 11:01:17 +00:00
Bill Paul
ee422a28d6 Re-do the handling of ndis_buffers. The NDIS_BUFFER structure is
supposed to be opaque to the driver, however it is exposed through
several macros which expect certain behavior. In my original
implementation, I used the mappedsystemva member of the structure
to hold a pointer to the buffer and bytecount to hold the length.
It turns out you must use the startva pointer to point to the
page containing the start of the buffer and set byteoffset to
the offset within the page where the buffer starts. So, for a buffer
with address 'baseva,' startva is baseva & ~(PAGE_SIZE -1) and
byteoffset is baseva & (PAGE_SIZE -1). We have to maintain this
convention everywhere that ndis_buffers are used.

Fortunately, Microsoft defines some macros for initializing and
manipulating NDIS_BUFFER structures in ntddk.h. I adapted some
of them for use here and used them where appropriate.

This fixes the discrepancy I observed between how RX'ed packet sizes
were being reported in the Broadcom wireless driver and the sample
ethernet drivers that I've tested. This should also help the
Intel Centrino wireless driver work.

Also try to properly initialize the 802.11 BSS and IBSS channels.
(Sadly, the channel value is meaningless since there's no way
in the existing NDIS API to get/set the channel, but this should
take care of any 'invalid channel (NULL)' messages printed on
the console.
2003-12-23 04:08:22 +00:00
Peter Wemm
d1d7ef3e23 Regen (should be a NOP except for rcsid) 2003-12-23 04:07:47 +00:00
Peter Wemm
151e298ec2 GC unused namespc column. 2003-12-23 04:07:22 +00:00
Peter Wemm
ff7a52b4b5 Regen (should be a NOP except for rcsid changes) 2003-12-23 03:55:06 +00:00
Peter Wemm
eca6e6472d GC unused third namespace column. 2003-12-23 03:54:40 +00:00
Peter Wemm
b368159c7f GC unused namespace column. Unwrap some long lines that now fit. 2003-12-23 03:53:21 +00:00
Peter Wemm
2c74309622 Regen - this should be essentially a NOP, except for rcsid changes. 2003-12-23 03:52:14 +00:00
Peter Wemm
eec525a435 Remove namespc column and attempt to un-fold some of the longer lines
that now fit.
2003-12-23 03:51:36 +00:00
Peter Wemm
1a58b07149 Remove the namespace column from the syscalls tables. We don't actually
use it, if we ever did.  They have been been VERY poorly maintained for
some time, possibly because they were a NOP.  FWIW, This brings our table
formats back closer to the other *BSD's.
2003-12-23 03:50:43 +00:00
Peter Wemm
cb925bec10 Regen 2003-12-23 03:21:49 +00:00
Peter Wemm
c725485111 freebsd32_fstat(2) is now MPSAFE 2003-12-23 03:21:06 +00:00
Peter Wemm
34eda6348d Rather than screw around with the (unsafe) stackgap, call vn_stat/fo_stat
directly for stat/fstat/lstat syscall emulation.  It turns out not only
safer, but the code is smaller this way too.
2003-12-23 03:20:49 +00:00
Peter Wemm
096cced7fb Regen 2003-12-23 02:48:58 +00:00
Peter Wemm
5cb0e301a4 Eliminate stackgap usage for the (woefully incomplete) path translations
since it isn't needed here anymore.
Use standard open(2)/access(2) and chflags(2) syscalls now.
2003-12-23 02:48:11 +00:00
Peter Wemm
9b68618df0 Add an additional field to the elf brandinfo structure to support
quicker exec-time replacement of the elf interpreter on an emulation
environment where an entire /compat/* tree isn't really warranted.
2003-12-23 02:42:39 +00:00
Peter Wemm
feb5832efb Add a reminder note about removing the amd64 test here once the gcc33 port
has been updated.
2003-12-23 02:38:55 +00:00
Peter Wemm
a89ec05e3e Catch a few places where NULL (pointer) was used where 0 (integer) was
expected.
2003-12-23 02:36:43 +00:00
Peter Wemm
98ef6ed422 Don peril sensitive sunglasses and set NULL to an actual pointer type,
but *only* for the kernel.  We can do this because the kernel is not a
standard C application environment.  This would have stopped the recent
mtx_* arg NULL/MTX_DEF mixups from going unnoticed for so long.
2003-12-23 02:34:25 +00:00
Peter Wemm
8070ad52a1 Don't use NULL (pointer) when we're testing for a count of 0 (integer). 2003-12-23 02:29:46 +00:00
Peter Wemm
55cdddc0d8 Don't use NULL (pointer) when we mean 0 (integer) for the number of ticks
in msleep.
2003-12-23 02:28:42 +00:00
MIHIRA Sanpei Yoshiro
6724255495 resort device list 2003-12-22 19:58:27 +00:00
Takeshi Shibagaki
8eabf88dd3 Fixed incomplete initialization in some ohci controllers with
broken BIOS. Separate ohci_controller_init() from ohci_init(),
and call ohci_controller_init() at resume process once more.

Discussed on [bsd-nomads:16737] - [bsd-nomads:16746].

Submitted by Hiroyuki Aizu <eyes@navi.org> [bsd-nomads:16741]
2003-12-22 15:40:10 +00:00
Takeshi Shibagaki
e394a3e85d Enable support for DEVICE_SUSPEND, DEVICE_RESUME and DEVICE_SHUTDOWN
methods for USB devices in the same way of uhci driver. But this change
is not complete because some ohci controlers are not initialized completely.
So "kernel: usb0: 1 scheduling overruns" interrupt will generate many times.

This change will be same one in PR kern/60099.

Discussed on [bsd-nomads:16737] - [bsd-nomads:16746].
2003-12-22 15:18:46 +00:00
Tim J. Robbins
07a65634d9 Make oldsize in smbfs_getattr() 64 bits wide instead of 32 to avoid
truncation when files are larger than 4GB.
2003-12-22 12:33:31 +00:00
Bill Paul
55971c63cd Some minor touchups:
In NdisQueryBuffer() and NdisQueryBufferSafe(), the vaddr argument is
optional, so test it before trying to dereference it.

Also correct NdisGetFirstBufferFromPacket()/NdisGetFirstBufferFromPacketSafe():
we need to use nb_mappedsystemva from the buffer, not nb_systemva.
2003-12-22 10:22:57 +00:00
Bill Paul
d7d29b16e0 Now that I finally have power back, implement a couple more NDIS API
routines: NdisUnchainBufferAtBack(), NdisGetFirstBufferFromPacketSafe()
and NdisGetFirstBufferFromPacket(). This should bring us a little
closer to getting the Intel centrino wireless NIC to work.

Note: I have not actually tested these additions since I don't
have a driver that calls them, however they're pretty simple, and
one of them is taken pretty much directly from the Windows ndis.h
header file, so I'm fairly confident they work, but disclaimers
apply.
2003-12-22 08:24:32 +00:00
Warner Losh
3c4c657681 Fix typo in ENE CB710 description. It isn't a 720. 2003-12-22 06:09:35 +00:00
SUZUKI Shinsuke
aef03e952d fixed a bug that IPv6 routing header does not work properly if specified from userland application
reviewed by: ume
2003-12-22 03:12:13 +00:00
Alan Cox
9582cd94cb - Create an unmapped guard page to trap access to vm_page_array[-1].
This guard page would have trapped the problems with the MFC of the PAE
   support to RELENG_4 at an earlier point in the sequence of events.

Submitted by:	tegge
2003-12-22 02:04:08 +00:00
Alan Cox
925692caa5 - Significantly reduce the number of preallocated pv entries in
pmap_init().  Such a large preallocation is unnecessary and wastes
   nearly eight megabytes of kernel virtual address space per gigabyte
   of managed physical memory.
 - Increase UMA_BOOT_PAGES by two.  This enables the removal of
   pmap_pv_allocf().  (Note: this function was only used during
   initialization, specifically, after pmap_init() but before
   pmap_init2().  During pmap_init2(), a new allocator is installed.)
2003-12-22 01:01:32 +00:00
Jeff Roberson
52b3d5c3b7 - Cleanup some garbage left by KSE. There is still much garbage left to be
removed, see the 110 instances of "XXXKSE" in src/sys for examples.
2003-12-21 13:47:42 +00:00
Peter Grehan
e49e14200a - Add ':' as a separator between the OpenFirmware device space and
the file path. Commonly used on Macs e.g. "hd:9".
- Update the ofw_setcurrdev routine to match libstand setenv prototype

Not objected to by: sparc64
2003-12-21 12:38:25 +00:00
Peter Grehan
bca2f486f0 Make __elfN(ofw_loadfile) match parameter declaration for file_format
in boot/common/bootstrap.h. Having a 32-bit size when a 64-bit param
is declared wreaks havoc on PPC.

Not objected to by: sparc64
2003-12-21 12:27:01 +00:00
Peter Grehan
934eb1922a Only print out an error if returned data size is < 0. A value of 0
happens almost every time at the end of a file when using NFS.

No objection by: sparc64
2003-12-21 12:19:38 +00:00
Peter Grehan
e2776725d7 Use daddr_t instead of u_long for byte offset in strategy
routine to avoid >4G truncation on 32-bit systems.

no objection by: sparc64
2003-12-21 12:16:58 +00:00
Peter Grehan
69a8dff7af - use correct pointer arithmetic in heapsize calculation
- handle multiple Ofw memory regions when determining mem size
- allow currdev to be set as a loader command-line option.
  parse() is used to allow future options to be processed.
2003-12-21 12:11:31 +00:00
Alan Cox
cafe836a56 - Correct an error in mincore(2) that has existed since its introduction:
mincore(2) should check that the page is valid, not just allocated.
   Otherwise, it can return a false positive for a page that is not yet
   resident because it is being read from disk.
2003-12-21 06:03:40 +00:00
Bill Paul
b4f5e8d8cd Big round of updates:
- Make ndis_get_info()/ndis_set_info() sleep on the setdone/getdone
  routines if they get back NDIS_STATUS_PENDING.

- Add a bunch of net80211 support so that 802.11 cards can be twiddled
  with ifconfig. This still needs more work and is not guaranteed to
  work for everyone. It works on my 802.11b/g card anyway.

The problem here is Microsoft doesn't provide a good way to a) learn
all the rates that a card supports (if it has more than 8, you're
kinda hosed) and b) doesn't provide a good way to distinguish between
802.11b, 802.11b/g an 802.11a/b/g cards, so you sort of have to guess.

Setting the SSID and switching between infrastructure/adhoc modes
should work. WEP still needs to be implemented. I can't find any API
for getting/setting the channel other than the registry/sysctl keys.
2003-12-21 00:00:08 +00:00
Jeff Roberson
249e0bea8f - Make our transfer decisions based on load and not transferable load. A
cpu could have been bogged down with non-transferable load and still not
   migrated a new thread to an idle cpu.  This required some benchmarking and
   tuning to get right as the comment above it suggests.
2003-12-20 22:35:20 +00:00
Jeff Roberson
e7a976f415 - Enable ithread migration on x86. This is done to work around a bug in the
IO APIC on Xeons that prevents round-robin interrupt assignment from
   working.
2003-12-20 20:36:19 +00:00
Alan Cox
35833d6a20 Since we have additional kernel virtual address space, allow the buffer
cache to grow to 400M bytes.
2003-12-20 20:03:10 +00:00
Alan Cox
96a7b42213 Remove a variable that has been initialized but otherwise unused since
revision 1.315.
2003-12-20 19:46:21 +00:00
Sam Leffler
ededbec187 o move mutex init/destroy logic to the module load/unload hooks;
otherwise they are initialized twice when the code is statically
  configured in the kernel because the module load method gets
  invoked before the user application calls ip_mrouter_init
o add a mutex to synchronize the module init/done operations; this
  sort of was done using the value of ip_mroute but X_ip_mrouter_done
  sets it to NULL very early on which can lead to a race against
  ip_mrouter_init--using the additional mutex means this is safe now
o don't call ip_mrouter_reset from ip_mrouter_init; this now happens
  once at module load and X_ip_mrouter_done does the appropriate
  cleanup work to insure the data structures are in a consistent
  state so that a subsequent init operation inherits good state

Reviewed by:	juli
2003-12-20 18:32:48 +00:00
David E. O'Brien
1d582fe320 Make the multiple include guard correct for this file location.
This fixes a bug where the guard conflicted with machine/ioctl_*.
2003-12-20 17:12:25 +00:00
Jeff Roberson
670c524f08 - In kseq_transfer() return if smp has not been started.
- In sched_add(), do the idle check prior to the transfer check so that we
   don't try to transfer load from an idle cpu.  This fixes panics caused by
   IPIs on UP machines running SMP kernels.

Reported/Debugged by:	seanc
2003-12-20 14:03:14 +00:00
Jeff Roberson
9b5f6f623d - Running interactive tasks with the minimum time-slice is fine for vi and
sh, but not so great for mozilla, X, etc.  Add a fixed define for the slice
   size granted to interactive KSEs.
2003-12-20 12:54:35 +00:00