Commit Graph

8368 Commits

Author SHA1 Message Date
Maxim Sobolev
3f1a8e9371 Allow bit 21 of EFLAGS register (PSL_ID) be changed in the use-mode without
ill effects. This should fix problems threaded programs are having with
auto-detecting CPU type.

Reported by:	Joe Clarke <marcus@marcuscom.com>
Tested by:	Joe Clarke <marcus@marcuscom.com>
Reviewed by:	jhb
MFC after:	1 week
2001-11-15 23:01:29 +00:00
Jeroen Ruigrok van der Werven
a9032e75b2 Document the atkbd flags of 0x03 and be explicit to mention this might
fit some dockingstation keyboard probing.

PR:		23681
Submitted by:	yokota [PR issued by:
				Claude Lefrancois <lmcclef@lmc.ericsson.se>]
2001-11-15 19:42:07 +00:00
John Baldwin
07da19144f - Don't enable interrupts in trap() if we trapped while holding a spin
lock as this usually makes the problem worse.
- If we get a page fault while holding a spin lock, treat it as a fatal
  trap and don't even bother calling into the VM since calling into the
  VM will panic when trying to lock Giant before we can get a useful
  message anyways.
2001-11-15 17:29:36 +00:00
John Baldwin
2ffc1262b0 Axe NFS_NOSERVER since it doesn't do anything anymore. Remove NFSSERVER
from your config file instead.
2001-11-15 16:03:24 +00:00
Giorgos Keramidas
6ba3aeb390 Replace use of "0" constraints in inline asm with "+" constraints,
when an operand is used both for input and output.

Reviewed by:	jhb
2001-11-13 19:55:20 +00:00
Giorgos Keramidas
a98556d61f Change constraints to use "+" in inline asm instead of mapping input
to output parameters with "0".

Reviewed by:	jhb
2001-11-12 21:58:27 +00:00
John Baldwin
d900909439 Use newer constraints for atomic_cmpset().
Requested by:	bde
2001-11-12 18:53:45 +00:00
John Baldwin
20a2016a81 Use newer constraints for inline assembly for an operand that is both an
input and an output by using the '+' modifier rather than listing the
operand in both the input and output sections.

Reviwed by:	bde
2001-11-12 16:57:33 +00:00
Warner Losh
8c2e69fe8d Back out last commit, it was accidental 2001-11-11 20:19:36 +00:00
Warner Losh
269b3a8211 s/PCCARD_/PCMCIA_/g in NEWCARD device tables to enable easier NetBSD sharing 2001-11-11 20:17:10 +00:00
Mitsuru IWASAKI
9c4223b4b6 Add two minor changes.
- clean up wakeup routing fixup code by using macros.
 - allocate pte object temporary for kernel thread to avoid kernel
   panic by events from sleep button or lid switch.
2001-11-11 15:51:30 +00:00
David E. O'Brien
7e46cddb17 Fix tab damage in rev 1.326. 2001-11-06 16:15:47 +00:00
Mitsuru IWASAKI
1611ea8727 Add S4BIOS sleep (BIOS hibernation) and DSDT overriding support.
- Add S4BIOS sleep implementation.  This will works well if MIB
   hw.acpi.s4bios is set (and of course BIOS supports it and hibernation
   is enabled correctly).
 - Add DSDT overriding support which is submitted by takawata originally.
   If loader tunable acpi_dsdt_load="YES" and DSDT file is set to
   acpi_dsdt_name (default DSDT file name is /boot/acpi_dsdt.aml),
   ACPI CA core loads DSDT from given file rather than BIOS memory block.
   DSDT file can be generated by iasl in ports/devel/acpicatools/.
 - Add new files so that we can add our proposed additional code to Intel
   ACPI CA into these files temporary.  They will be removed when
   similar code is added into ACPI CA officially.
2001-11-06 15:00:30 +00:00
Poul-Henning Kamp
e1a7c5c881 GC userconfig after Peter axed it 15 months ago. 2001-11-05 21:46:35 +00:00
Poul-Henning Kamp
e315b6d75b Also remove the .h files for the old rp driver. 2001-11-05 21:23:24 +00:00
Poul-Henning Kamp
0d60c3f5cf Remove the old RocketPort driver which was left behind in favour
of the new driver.  The new driver works, the old one is 1+ year behind.
2001-11-05 20:49:30 +00:00
Poul-Henning Kamp
0ac42ec512 Don't call cdevsw_add(). 2001-11-04 09:09:41 +00:00
Poul-Henning Kamp
9f441d5a6d Don't call devsw_add(). 2001-11-04 09:07:23 +00:00
Poul-Henning Kamp
8fb6b29956 Don't call cdevsw_add(). 2001-11-04 08:58:22 +00:00
Poul-Henning Kamp
d7297990fa Don't call cdevsw_add() 2001-11-04 08:54:15 +00:00
Poul-Henning Kamp
54056d2da9 Call to cdevsw_add() no longer needed. 2001-11-04 08:49:51 +00:00
Mike Barcroft
0ac2d551f2 o Add new header <sys/stdint.h>.
o Make <stdint.h> a symbolic link to <sys/stdint.h>.
o Move most of <sys/inttypes.h> into <sys/stdint.h>, as per C99.
o Remove <sys/inttypes.h>.
o Adjust includes in sys/types.h and boot/efi/include/ia64/efibind.h
  to reflect new location of integer types in <sys/stdint.h>.
o Remove previously symbolicly linked <inttypes.h>, instead create a
  new file.
o Add MD headers <machine/_inttypes.h> from NetBSD.
o Include <sys/stdint.h> in <inttypes.h>, as required by C99; and
  include <machine/_inttypes.h> in <inttypes.h>, to fill in the
  remaining requirements for <inttypes.h>.
o Add additional integer types in <machine/ansi.h> and
  <machine/limits.h> which are included via <sys/stdint.h>.

Partially obtain from:	NetBSD
Tested on:		alpha, i386
Discussed on:		freebsd-standards@bostonradio.org
Reviewed by:		bde, fenner, obrien, wollman
2001-11-02 18:05:43 +00:00
Warner Losh
06a9ff8e81 The sound drivers live in sound/driver, not sound/drivers
submitted by: Alex Kapranoff <alex@kapran.bitmcnit.bryansk.su>
2001-11-02 16:40:06 +00:00
Mitsuru IWASAKI
f9390180fe Some fix for the recent apm module changes.
- Now that apm loadable module can inform its existence to other kernel
   components  (e.g. i386/isa/clock.c:startrtclock()'s TCS hack).
 - Exchange priority of SI_SUB_CPU and SI_SUB_KLD for above purpose.
 - Add simple arbitration mechanism for APM vs. ACPI.  This prevents
   the kernel enables both of them.
 - Remove obsolete `#ifdef DEV_APM' related code.
 - Add abstracted interface for Powermanagement operations.  Public apm(4)
   functions, such as apm_suspend(), should be replaced new interfaces.
   Currently only power_pm_suspend (successor of apm_suspend) is implemented.

Reviewed by:	peter, arch@ and audit@
2001-11-01 16:34:07 +00:00
Peter Wemm
e258f08ad8 Skip PG_UNMANAGED pages when we're shooting everything down to try and
reclaim pv_entries.  PG_UNMANAGED pages dont have pv_entries to reclaim.

Reported by:	David Xu <davidx@viasoft.com.cn>
2001-11-01 06:48:04 +00:00
Matt Jacob
ff6164046e Remove previous revision. smp_started back in subr_smp where it belongs. 2001-10-31 23:54:27 +00:00
Matt Jacob
6b094090d4 Make the actual volatile int smp_started live *somewhere*. This is
a temporary fix so that we can compile kernels. I waited 30 minutes
for a response from the person who would likely know, but any longer
is too long to wait with breakage at ToT.
2001-10-31 20:43:48 +00:00
Robert Watson
0ef2717b32 Spell deivces as devices. 2001-10-31 20:15:18 +00:00
Matthew Dillon
e302698320 Don't let pmap_object_init_pt() exhaust all available free pages
(allocating pv entries w/ zalloci) when called in a loop due to
an madvise().  It is possible to completely exhaust the free page list and
cause a system panic when an expected allocation fails.
2001-10-31 03:06:33 +00:00
Mike Smith
a91d0e1ccf Don't try to probe the PnP BIOS if ACPI is active. 2001-10-31 02:36:07 +00:00
Brian Feldman
4a44bd4b4a Add kmupetext(), a function that expands the range of memory covered
by the profiler on a running system.  This is not done sparsely, as
memory is cheaper than processor speed and each gprof mcount() and
mexitcount() operation is already very expensive.

Obtained from:	NAI Labs CBOSS project
Funded by:	DARPA
2001-10-30 15:04:57 +00:00
Warner Losh
823a5e8365 MFGeneric: ->1.327 Sync with GENERIC 2001-10-30 06:11:15 +00:00
Warner Losh
8f3a0dd489 Move device lnc to isa section, since it no longer uses the compat shims.
Add comment about lnc.
Remove probe order comment from isa_compat.c.  That appears to no longer
be the case.
2001-10-30 06:08:56 +00:00
John Baldwin
d01404c828 Fix a typo in comment and #ifdef fixes: GRAP_PRIO -> GRAB_PRIO so that
x86 SMP kernels actually boot again to single user mode.

Pointy hat to:	jhb
Noticed by:	jlemon
2001-10-30 00:19:42 +00:00
Bruce Evans
3f91265a4c Don't set CR0_NE in cpu_setregs() for the SMP case, since setting it
is npx.c's job and setting it here breaks the edit-time option of not
setting it in npx.c.  (It is not set in the right places for the SMP
case, but always setting it here is harmless because there isn't even
an edit-time option to not set it.)
2001-10-29 16:31:15 +00:00
John Baldwin
9869fa1db8 - More whitespace and comment cleanups.
- Remove unused sw1a label.  A breakpoint can be set in choosethread() for
  the same effect.

Reviewed by:	bde
Submitted by:	bde (partly)
2001-10-28 16:18:22 +00:00
Dag-Erling Smørgrav
a08d68de5b Eliminate the prefix parameter to linux_emul_find(), which was always
linux_emul_path anyway.  Linux_emul_find() has interesting bugs in its
prefix handling (which luckily are not currently exploitable); this
commit is preliminary to an attempt at cleaning it up.

Approved by:	marcel
2001-10-27 11:15:19 +00:00
Mitsuru IWASAKI
f86214b6b8 Add APM compatibility feature to ACPI.
This emulates APM device node interface APIs (mainly ioctl) and
provides APM services for the applications.  The goal is to support
most of APM applications without any changes.
Implemented ioctls in this commit are:
 - APMIO_SUSPEND (mapped ACPI S3 as default but changable by sysctl)
 - APMIO_STANDBY (mapped ACPI S1 as default but changable by sysctl)
 - APMIO_GETINFO and APMIO_GETINFO_OLD
 - APMIO_GETPWSTATUS

With above, many APM applications which get batteries, ac-line
info. and transition the system into suspend/standby mode (such as
wmapm, xbatt) should work with ACPI enabled kernel (if ACPI works well :-)

Reviewed by:	arch@, audit@ and some guys
2001-10-26 17:43:05 +00:00
John Baldwin
8e2e767b1f Add a per-thread ucred reference for syscalls and synchronous traps from
userland.  The per thread ucred reference is immutable and thus needs no
locks to be read.  However, until all the proc locking associated with
writes to p_ucred are completed, it is still not safe to use the per-thread
reference.

Tested on:	x86 (SMP), alpha, sparc64
2001-10-26 08:12:54 +00:00
Jeroen Ruigrok van der Werven
9c59aa470c Remove wx driver, which got recently removed.
Submitted by:	revamped kernincludes.sh
2001-10-25 19:45:39 +00:00
Jeroen Ruigrok van der Werven
0297dba19f Unbreak NEWCARD by removing options NFS and replacing it with the
new NFSCLIENT and NFSSERVER options.

Submitted by:	revamped kernincludes.sh
2001-10-25 19:41:13 +00:00
John Baldwin
e0e3030796 Currently no code does a CROSSJUMP() to sw1a, so we don't need a
CROSSJUMPTARGET() for it.

Submitted by:	bde
2001-10-25 16:54:21 +00:00
John Baldwin
02c41f11e3 Use %ecx instead of %ebx for the scratch register while updating %dr7 since
%ecx isn't a call safe register and thus we don't have to save and restore
it.

Submitted by:	bde
2001-10-25 16:52:43 +00:00
John Baldwin
7df8a724c2 - Fix typo in comment from previous revision.
- Fix a bug in the LDT changes where the wrong argument was passed to
  set_user_ldt() from cpu_switch().  The bug was passing a pointer to the
  ldt, but set_user_ldt() takes a pointer to the process' mdproc structure.

Submitted by:	bde
2001-10-25 16:50:16 +00:00
John Baldwin
163fd6fb97 Whitespace, comment, and string fixes.
Submitted by:	bde (mostly)
2001-10-25 16:47:01 +00:00
Bruce Evans
42108a7706 Fixed misformatting of options line for COMPAQ_M610 and EICON_DIVA in
rev.1.974.

Fixed previous misformatting of options line for ACCEPT_FILTER_DATA,
ACCEPT_FILTER_HTTP, ACPI_DEBUG, COMPAT_SVR4, DEBUG_SVR4, ED_NO_MIIBUS,
IFS, PCFCLOCK_MAX_RETRIES, PCFCLOCK_VERBOSE, PECOFF_DEBUG, PECOFF_SUPPORT,
PPC_PROBE_CHIPSET, RANDOM_IP_ID, REGRESSION, SC_CUT_SEPCHARS,
SC_CUT_SPACES2TABS, SES_ENABLE_PASSTHROUGH, UFS_DIRHASH, UFS_EXTATTR
and UFS_EXTATTR_AUTOSTART.
2001-10-25 12:05:45 +00:00
Bruce Evans
c797ab47ab Fixed bugs in rev.1.973. Actually enable PCI_ENABLE_IO_MODES. It
defeats the point of LINT to comment out positive options.

Fixed style bugs in rev.1.973:
- disordering of PCI options list.
- missing space after "options".
- line longer than 80 characters.
- bogus quoting of "BIOS".
2001-10-25 11:46:54 +00:00
Hellmuth Michaelis
0103e55f3f add options line for Compaq Microcom 610 ISDN card. 2001-10-25 11:14:46 +00:00
Jonathan Lemon
ae4da68827 Add PCI_ENABLE_IO_MODES option, for BIOSen that neglect this.
Submitted by: Andrew R. Reiter arr@watson.org
2001-10-25 04:44:50 +00:00
Luigi Rizzo
c5ca4c7e6e Backout 1.61 -- both intrcnt and intrnames are already exported
via sysctl under "hw".
2001-10-25 01:32:24 +00:00
John Baldwin
24db04598b Split the per-process Local Descriptor Table out of the PCB and into
struct mdproc.

Submitted by:	Andrew R. Reiter <arr@watson.org>
Silence on:	-current
2001-10-25 00:53:43 +00:00
John Baldwin
c5ca5a55a1 - Clean up the comments slightly here to make them more readable.
- Set the type and trapframe number for the F00F workaround since type
  can be used later by sv_transtrap().  Debuggers might also want to look
  at the type in the trapframe.

Submitted by:	bde (mostly)
2001-10-24 17:38:40 +00:00
John Baldwin
a33cbf355e Set the code and signal for the F00F hack fault directly instead of
changing the code in the trapframe and looping back to the top of trap
again.

Tested by:	cjc
2001-10-23 22:29:16 +00:00
Jonathan Lemon
991f976036 Implement multiple low-level console support. 2001-10-23 20:25:50 +00:00
Mike Barcroft
3a72286480 Remove funky right justification.
Pointed out by:	bde
2001-10-23 00:42:15 +00:00
Warner Losh
9e90edd49a wx is an ex-parrot. wx doesn't exist any more, so remove it. 2001-10-22 16:02:51 +00:00
Dag-Erling Smørgrav
7c62990641 Move procfs_* from procfs_machdep.c into sys_process.c, and rename them to
proc_* in the process; procfs_machdep.c is no longer needed.

Run-tested on i386, build-tested on Alpha, untested on other platforms.
2001-10-21 23:57:24 +00:00
Dag-Erling Smørgrav
1f04261973 [partially forced commit due to pilot error in earlier commit attempt]
{set,fill}_{,fp,db}regs() fixup:

 - Add dummy {set,fill}_dbregs() on architectures that don't have them.

 - KSEfy the powerpc versions (struct proc -> struct thread).

 - Some architectures had the prototypes in md_var.h, some in reg.h, and
   some in both; for consistency, move them to reg.h on all platforms.

These functions aren't really MD (the implementation is MD, but the interface
is MI), so they should move to an MI header, but I haven't figured out which
one yet.

Run-tested on i386, build-tested on Alpha, untested on other platforms.
2001-10-21 22:16:48 +00:00
Hellmuth Michaelis
676ccc0cd0 Add a driver for the Compaq Microcom 610 ISDN (Compaq series PSB2222I) ISA PnP
card.

Submitted by:   Steve Looman
Reviewed by:    hm
MFC after:      1 month
2001-10-21 09:20:52 +00:00
Bruce Evans
08b00f49c3 MFi386:
- sys/pc98/pc98/npx.c 1.87 (2001/09/15; author: imp)
  I don't think pc98 has acpi at all, so ifdef the acpi attachments for
  now.

This completes merging sys/pc98/pc98/npx.c into sys/i386/isa/npx.c so
that the former can be removed.
2001-10-21 06:05:08 +00:00
Bruce Evans
abfde38316 MFpc98: fundamental differences. The magic numbers for the i/o port
and the irq are different for pc98, and are not very well handled (we
use a historical mess of hard-coded values, values from header files
and values from hints).
2001-10-21 05:56:03 +00:00
Bruce Evans
40d8c8da95 MFpc98: all changes in sys/pc98/pc98/npx.c related to FPU_ERROR_BROKEN.
- 1.58 (2000/09/01; author: kato)
  Fixed FPU_ERROR_BROKEN code.  It had old-isa code.
- 1.33 (1998/03/09; author: kato)
  Make FPU_ERROR_BROKEN a new-style option.
- 1.7 (1996/10/09; author: asami)
  Make sure FPU is recognized for non-Intel CPUs.

The log for rev.1.7 should have said something like:
Added FPU_ERROR_BROKEN option.  This forces a successful probe for
exception 16, so that hardware with a broken FPU error signal can sort
of work.
2001-10-21 05:18:30 +00:00
Matt Jacob
8c7c272c5a Remove wx. 2001-10-20 18:50:31 +00:00
David E. O'Brien
c932615213 Drop support for x87 emulation. Any CPU one would dare to run 5-CURRENT
on would have built-in FP support.
2001-10-20 01:15:54 +00:00
Ruslan Ermilov
c3917acb86 Fix the typedef of va_list. 2001-10-19 20:07:46 +00:00
David E. O'Brien
9f9bd82e15 Try two on the preprocessing logic.
Reviewed by:	ru
2001-10-19 20:01:01 +00:00
David E. O'Brien
4b16cf4f8a Blah, fix braino where ru had to remind me of proper preprocessor syntax.
Bad fingers, no cookie.
2001-10-19 19:17:11 +00:00
Jonathan Lemon
bb373620cb Fix the le driver - it has been broken for a while and these fixes have
been sitting neglected in my tree.
2001-10-19 15:47:41 +00:00
Jonathan Lemon
e903bd58a6 Add entry for the PRO/1000. 2001-10-19 02:28:12 +00:00
Warner Losh
0e3d06b12c Add verbage for MODULES_OVERRIDE. 2001-10-18 19:44:13 +00:00
David E. O'Brien
e3ddd70789 My attempts at minimizing the number of #def's got me in trouble. 2001-10-18 16:07:21 +00:00
Hellmuth Michaelis
8f3a90354e Add experimental support for sending keypad facility messages.
MFC after: 2 months
2001-10-18 11:58:49 +00:00
David E. O'Brien
4a3391b5a1 Add support for "__gnuc_va_list". Some overly "smart" libraries assume
the existence of the __gnuc_va_list type[*] because our compiler is GCC.

[*] __gnuc_va_list is defined in the GCC ginclude/stdarg.h replacement
headerwhich we don't use.
2001-10-18 00:27:39 +00:00
David E. O'Brien
1f3efe7fe4 Minor comment tweaking. 2001-10-17 23:59:29 +00:00
Dag-Erling Smørgrav
b37831146b Back out previous revision. TCBHASHSIZE isn't an option, despite what I'd
been misled to believe by unknown parties.  It probably *should* be an option,
but the runtime value is controlled by a tunable, which Ought To Be Enough.
2001-10-17 04:30:04 +00:00
Matt Jacob
aaeac4f6c3 Make SCSI changer and SES devices standard in generic kernels.
Reviewed by:	ken@kdm.org
2001-10-16 22:22:58 +00:00
Dag-Erling Smørgrav
446975de60 Document TCBHASHSIZE. 2001-10-16 21:53:27 +00:00
Bruce Evans
265e95d904 Deleted most of npxprobe(), and merged npxprobe1() back into npxprobe().
Use the normal interrupt handler (npx_intr()) instead of a special
probe-time interrupt handler, although this causes problems due to
the bus_teardown_intr() not actually even tearing down the interrupt
(these problems were avoided by doing interrupt attachment for the
special interrupt handler directly).  Fixed minor bitrot in comments.

The reason for the npxprobe()/npxprobe1() split mostly went away at
about the same time it was made (in 1992 or 1993 just before the
beginning of history).  386BSD ran all probes with interrupts completely
masked, and I didn't want to disturb this when I added an irq probe
to npxprobe().  An irq (not necessarily npx) must be acked for at least
external npx's to take the cpu out of the wait state that it enters
when an npx error occurs, so the probe must be done with a suitable
irq unmasked.  npxprobe() went to great lengths to unmask precisely
the npx irq.

Running probes with all interrupts masked was never really needed in
FreeBSD, since FreeBSD always masked interrupts well enough using
splhigh(), but it wasn't until rev.1.48 (1995/12/12) of autoconf.c
that all probes were run with CPU interrupts enabled.  This permits
npxprobe() to probe its irq using normal interrupt resources.  Note
that most drivers still can't depend on this.  It depends on the
interrupt handler being fast and the irq not being shared.
2001-10-16 14:12:35 +00:00
Bruce Evans
2504f76272 Commit my old fixes for cosmetic bugs in npxprobe() so that they aren't
lost when the buggy code goes away completely:
- don't assume that the npx irq number is >= 8.  Rev.1.73 only reversed
  part of the hard-coding of it to 13 in rev.1.66.
- backed out the part of rev.1.84 that added a highly confused comment
  about an enable_intr() being "highly bogus".  The whole reason for
  existence of npxprobe() (separate from the main probe, npxprobe1())
  is to handle the complications to make this enable_intr() safe.
- backed out the part of rev.1.94 that modified npxprobe().  It mainly
  broke the enable_intr() to restore_intr().  Restoring the interrupt
  state in a nested way is precisely what is not wanted here.  It was
  harmless in practice because npxprobe() is called with interrupts
  enabled, so restoring the interrupt state enables interrupts.  Most
  of npxprobe() is a no-op for the same reason...
2001-10-16 12:55:38 +00:00
Marcel Moolenaar
4c1e3817c4 Implement linux_chown and linux_lchown. The fchown syscall maps
directly to the native syscall, because no filename handling
needs to be done.

Tested by: Martin Blapp <mb@imp.ch>
2001-10-16 06:15:36 +00:00
Marcel Moolenaar
2bf1eed95b o Change prototype of linux_lchown and linux_chown so that the
argument names match those on Alpha.
o  Map the fchown directly to FreeBSD. Since the old version of
   fchown is also mapped to the native fchown, give the new one
   type NODEF.

Tested by: Martin Blapp <mb@imp.ch>
2001-10-16 06:11:11 +00:00
Tor Egge
4c8f0aced5 Explicitly initialize the fpu when SSE is enabled since this no
longer happens as a side effect of calling npxsave.

Reviewed by:	peter, bde
2001-10-15 20:18:06 +00:00
Dag-Erling Smørgrav
268aeb1ed3 In FreeBSD's ifreq, ifr_ifru.ifru_flags is an array of two chars, while Linux
defines it as a short.  Change that to an array of one short so that FreeBSD's
ifr_flags macro will work (it evaluates to ifr_ifru.ifru_flags[0]).
2001-10-15 20:06:34 +00:00
Tor Egge
10ad529832 Change vmapbuf() to use pmap_qenter() and vunmapbuf() to use pmap_qremove().
This significantly reduces the number of TLB shootdowns caused by
vmapbuf/vunmapbuf when performing many large reads from raw disk devices.

Reviewed by:	dillon
2001-10-14 21:09:04 +00:00
Tor Egge
2334091845 Reduce the number of TLB shootdowns caused by a call to pmap_qenter()
from number of pages mapped to 1.

Reviewed by:	dillon
2001-10-14 20:56:55 +00:00
John Polstra
215e696b60 Correct the input/output/clobber specifications for the cpuid
instruction.  Stefan Keller <dres@earth.serd.org> noticed that CPU
identification was broken when compiled with -O2, and tracked it
down to the asm statement, which was storing values into memory
without specifying that memory was modified.  He submitted a patch
which added "memory" as a clobber, but I refined it further to
arrive at this version.

MFC after:	3 days
2001-10-12 16:49:28 +00:00
John Baldwin
fa78c35ad2 Oops, these already included sys/lock.h, they just did so after
sys/mutex.h which is too late.
2001-10-11 18:25:57 +00:00
John Baldwin
61d80e90a9 Add missing includes of sys/ktr.h. 2001-10-11 17:53:43 +00:00
John Baldwin
7106ca0d1a Add missing includes of sys/lock.h. 2001-10-11 17:52:20 +00:00
Crist J. Clark
4479e72cc6 Documentation nitpick. IPFIREWALL_VERBOSE logging really has nothing
to do with "dropped packets." Any packets matching rules with the
'log' directive are logged regardless of the action, drop, pass,
divert, pipe, etc.

MFC after:	1 day
2001-10-11 11:21:18 +00:00
Paul Saab
cbc89bfbfe Make MAXTSIZ, DFLDSIZ, MAXDSIZ, DFLSSIZ, MAXSSIZ, SGROWSIZ loader
tunable.

Reviewed by:	peter
MFC after:	2 weeks
2001-10-10 23:06:54 +00:00
Ian Dowse
3c7bcedd06 Remove the Xresume* labels from the i386 interrupt handlers; the
code in ipl.s and icu_ipl.s that used them was removed when the
interrupt thread system was committed. Debuggers also knew about
Xresume* because these labels hide the real names of the interrupt
handlers (Xintr*), and debuggers need to special-case interrupt
handlers to get the interrupt frame.

Both gdb and ddb will now use the Xintr* and Xfastintr* symbols to
detect interrupt frames. Fast interrupt frames were never identified
correctly before, so this fixes the problem of the running stack
frame getting lost in a ddb or gdb trace generated from a fast
interrupt - e.g. when debugging a simple infinite loop in the kernel
using a serial console, the frame containing the loop would never
appear in a gdb or ddb trace.

Reviewed by:	jhb, bde
2001-10-09 19:54:52 +00:00
Robert Drehmel
1e8ff53804 Remove an unneeded variable declaration and statement.
Approved by:	jake
2001-10-09 16:06:28 +00:00
Matt Jacob
572ce00d3e Note that this driver is soon to be deprecated and removed from FreeBSD. 2001-10-09 00:14:41 +00:00
John Baldwin
f955d6dc66 Don't attempt to initialize the pcaudio device on open. The attach routine
already does the initialization (though it didn't set pca_initialized, so
we always initialized twice) and since attach calls make_dev(), there's no
way that pcaopen() can be called before pcaattach().
2001-10-08 23:35:40 +00:00
John Baldwin
2a89a48fbd Allow atomic ops to be somewhat safely used in userland. We always use
lock prefixes in the userland case so that the binaries will work on both
SMP and UP systems.
2001-10-08 20:58:24 +00:00
Dag-Erling Smørgrav
3da3249106 Dissociate ptrace from procfs.
Until now, the ptrace syscall was implemented as a wrapper that called
various functions in procfs depending on which ptrace operation was
requested.  Most of these functions were themselves wrappers around
procfs_{read,write}_{,db,fp}regs(), with only some extra error checks,
which weren't necessary in the ptrace case anyway.

This commit moves procfs_rwmem() from procfs_mem.c into sys_process.c
(renaming it to proc_rwmem() in the process), and implements ptrace()
directly in terms of procfs_{read,write}_{,db,fp}regs() instead of
having it fake up a struct uio and then call procfs_do{,db,fp}regs().

It also moves the prototypes for procfs_{read,write}_{,db,fp}regs()
and proc_rwmem() from proc.h to ptrace.h, and marks all procfs files
except procfs_machdep.c as "optional procfs" instead of "standard".
2001-10-07 20:08:42 +00:00
Luigi Rizzo
7d4b046991 Export interrupt statistics via sysctl.
MFC-after: 3 days
2001-10-07 17:03:56 +00:00
Ian Dowse
c6cd7661ed Mention that ed requires miibus.
Suggested by:	Eugene Grosbein <eugen@grosbein.pp.ru>
2001-10-07 16:39:40 +00:00
Yoshihiro Takahashi
f2eeb19063 Rewrite the pc98 bus_space stuff.
The type of bus_space_tag_t is now a pointer to bus_space_tag structure,
and the bus_space_tag structure saves pointers to functions for direct
access and relocate access.

Added bsh_bam member to the bus_space_handle structure, it saves access
method either direct access or relocate access which is called by
bus_space_* functions.

Added the mecia device support. If the bs_da and bs_ra in bus tag are set
NEPC_io_space_tag and NEPC_mem_space_tag respectively, new bus_space stuff
changes the register of mecia automatically for 16bit access.

Obtained from:	NetBSD/pc98
2001-10-07 10:04:18 +00:00
Yoshihiro Takahashi
31b2da2bea - Moved the bus_dma declarations from bus_{at386,pc98}.h into bus_dma.h.
(bus_dma.h is repo-copied from bus_at386.h)
- Added '#include <machine/bus_dma.h>' into bus.h for backward compatibility.
2001-10-06 16:27:21 +00:00
Peter Wemm
5e0f6bc415 Fix a warning. (unused p if not INVARIANTS) 2001-10-06 02:13:58 +00:00
Mark Peek
ec84f10383 Add nmdm driver.
PR:		31027
Submitted by:	Edwin Groothuis <edwin@mavetju.org>
MFC after:	1 day
2001-10-04 15:37:55 +00:00
John Baldwin
9d60f0cbdb Comment out RESTARTABLE_PANICS so that it is not defined in LINT. It
introduces many useless warnings obscuring the useful ones.
2001-10-04 10:31:51 +00:00
Bruce Evans
05e47d1f21 Fixed a missing proc -> thread substitution.
Broke future detection of this bug in userland by not declaring kernel
prototypes in userland.
2001-10-03 17:23:26 +00:00
Matt Jacob
22883e3c68 Fix problem where a user buffer outside of the area being tested
will be corrupted.

PR:		29194
Obtained from:	Tor.Egge@fast.no
MFC after:	2 weeks
2001-10-02 18:34:20 +00:00
Ian Dowse
9b04180c2c Add an option ED_NO_MIIBUS, which causes the `ed' driver to be
built without support for miibus PHYs. Most ed cards don't need
miibus support, so it's useful to be able to avoid the bloat of
all the mii devices for small fixed-purpose kernels.
2001-09-29 22:32:03 +00:00
Marcel Moolenaar
745190dc80 Regen: Stop using linux_getpgid(). Use the native getpgid()
instead.

PR: kern/21402
2001-09-28 01:32:27 +00:00
Marcel Moolenaar
52e9761e22 Stop using linux_getpgid(). The implementation at this time is
broken and fixing it only creates a duplicate of what is already
in the FreeBSD kernel. Therefore, map the syscall directly to
getpgid().

PR: kern/21402
Submitted by: Christian Weisgerber <naddy@mips.inka.de>
2001-09-28 01:30:59 +00:00
Bill Paul
95d674824f Add device driver support for the Broadcom BCM570x family of gigabit
ethernet controllers. This adds support for the 3Com 3c996-T, the
SysKonnect SK-9D21 and SK-9D41, and the built-in gigE NICs on
Dell PowerEdge 2550 servers. The latter configuration hauls ass:
preliminary measurements show TCP speeds of over 900Mbps using
only normal size frames.

TCP/IP checksum offload, jumbo frames and VLAN tag insertion/stripping
are supported, as well as interrupt moderation.

Still need to fix autonegotiation support for 1000baseSX NICs, but
beyond that, driver is pretty solid.
2001-09-27 23:55:28 +00:00
Brooks Davis
373791582d Add the new ng_gif, ng_gif_demux, and ng_ip_input nodes to NOTES so they
get compiled with LINT.
2001-09-27 22:11:37 +00:00
John Baldwin
bf2965ed32 Disable the check in icu_setup() to see if a handler was already used as
the current interrupt thread routines will guarantee the condition this is
checking for at a higher level but inthand_add() and inthand_remove() as
they currently exist don't satisfy this condition.  (Which does need to be
fixed but which will take a bit more work.)  This fixes shared interrupts.
2001-09-27 19:03:52 +00:00
Murray Stokely
fd197202f9 Update a comment to reflect the param.c -> subr_param.c move.
PR:		kern/30766
Submitted by:	Kevin Way <kevin.way@overtone.org>
2001-09-27 09:58:30 +00:00
Jonathan Lemon
fe16674a74 Return EINVAL if the passed intr is out of bounds.
PR: 30857
Submitted by: David Xu <davidx@viasoft.com.cn>
MFC: 1 week
2001-09-27 02:46:47 +00:00
Brooks Davis
efacde1bcc The number of ccd(4) devices is no longer set at compile time so stop
trying to do it in the examples and config files.
2001-09-26 22:41:02 +00:00
Brooks Davis
2862fc7a49 Call securelevel_gt with a credential. Also, s/p/td->td_proc/.
Submitted by:	LINT
2001-09-26 22:02:01 +00:00
Robert Watson
41c42188c8 o Modify access control checks in linux_iopl() to use securelevel_gt()
rather than direct variable checks.  (Yet another API to perform
  direct hardware I/O.)

Obtained from:	TrustedBSD Project
2001-09-26 20:22:38 +00:00
Robert Watson
ce3a32b6da o Modify pcvt ioctl() security checks to use securelevel_gt() instead
of direct securelevel variable checks.  (Yet another API to perform
  direct hardware I/O using KDENABIO.)

Obtained from:	TrustedBSD Project
2001-09-26 20:21:28 +00:00
Robert Watson
9997f52470 o Modify spigot_open() to use securelevel_gt() instead of direct
securelevel variable checks.

Obtained from:	TrustedBSD Project
2001-09-26 20:20:05 +00:00
Robert Watson
330e78897a o Modify i386_set_ioperm() to use securelevel_gt() instead of
direct securelevel variable checks.

Obtained from:	TrustedBSD Project
2001-09-26 20:08:15 +00:00
Robert Watson
1851c8fd41 o Modify device open access control for /dev/mem and friends to use
securelevel_gt() instead of direct securelevel variable checks.

Obtained from:	TrustedBSD Project
2001-09-26 20:08:02 +00:00
Brooks Davis
2f65332817 The faith(4) device is no longer a count device so don't specify a count. 2001-09-25 18:56:40 +00:00
David E. O'Brien
090905a55c + Fix misplacement of `txp'
+ Document our -CURRENT debugging bits
2001-09-24 03:23:48 +00:00
Chris D. Faulhaber
22374865a2 Update NFS_ROOT comments to reflect the NFSCLIENT option
instead of the depricated NFS option.

Reviewed by:	peter
2001-09-22 19:02:18 +00:00
Maxim Sobolev
78f45204d9 Introduce new syscons(4) kernel options:
- SC_CUT_SPACES2TABS - when copying text into the cut buffer convert leading
  spaces into the tabs;
- SC_CUT_SEPCHARS="XYZ" - treat supplied characters as possible words
  separators when the driver searches for words boundaries when doing cut
  operation.

Also unify cut code a bit to decrease amount of duplicated code. This fixes
line cut mode, so that it is no longer pads line with useless spaces.

Approved by:	ru
2001-09-21 20:41:24 +00:00
Peter Wemm
9789c757b9 Add some comments about KVA_PAGES and a test. 2001-09-21 06:34:01 +00:00
Peter Wemm
f83fbaf22d Introduce a new option, KVA_SPACE, which can be used to reconfigure
the size of the kernel virtual address space relatively painlessly.
Userland will adapt via the exported kernbase symbol.  Increasing
this causes the user part of address space to reduce.
2001-09-21 06:23:03 +00:00
Peter Wemm
e5a860ebb4 Reserve an extra 16 bytes in case we have to grow the trapframe into
a vm86trapframe for switching to vm86 [unlikely] while exiting.
I lost this when doing the pcb move that went in with the KSE commit.

Reviewed by: jake
2001-09-19 05:44:12 +00:00
Peter Wemm
2f01a0c097 Fix a mistake I made with the pcb movement relative to the stack in the
KSE patch.  We need to leave the 16 bytes here for enabling the trapframe
to be converted to a vm86trapframe if we're switching *to* a vm86 context.
2001-09-19 05:34:12 +00:00
Peter Wemm
eb25edbda3 Cleanup and split of nfs client and server code.
This builds on the top of several repo-copies.
2001-09-18 23:32:09 +00:00
Julian Elischer
f5b93d4aac Remove accidentally included debug stuff.
Noticed by:	jhb
2001-09-18 22:52:42 +00:00
John Baldwin
fdca1cb1ef Whitespace fixes. 2001-09-18 21:52:15 +00:00
John Baldwin
fd54558a83 - If we ever do the per-cpu KTR stuff, the index won't be volatile as it
will be private to each CPU.
- Re-style(9) the globaldata structures.  There really needs to be a MI
  struct pcpu that has a MD struct mdpcpu member at some point.
2001-09-18 21:46:26 +00:00
John Baldwin
9ed316e3a7 If we have a p variable pointing to td->td_proc already, use it instead of
needlessly repeating the indirection in several places.  Half of the places
used td->td_proc, and half used p.  They are now consistent with each other
and all use p.
2001-09-18 21:20:58 +00:00
John Baldwin
659209e636 Whitespace fixes. 2001-09-18 21:05:04 +00:00
John Baldwin
2509e6c20b Add a lock assertion to linux_sendsig() to match other sendsig functions. 2001-09-17 17:22:31 +00:00
Doug Rabson
3a0b4f259c Fill out some gaps in ia64 DDB support. This involves generalising DDB's
breakpoint handling slightly to cope with the fact that ia64 instructions
are not located on byte boundaries.
2001-09-15 11:06:07 +00:00
Michael Reifenberger
b8febfd1f2 Add a wrapper for linux_getsid -> getsid Syscall. 2001-09-15 09:57:30 +00:00
Michael Reifenberger
a6e5348e22 Implement LINUX_[SEM|IPC]_[STAT|INFO]
to make /compat/linux/usr/bin/ipcs -s happy.

PR:		kern/29698 (part)
Reviewed by:	audit
2001-09-15 09:50:38 +00:00
Jeroen Ruigrok van der Werven
e469dc2c99 Place CPU_UPGRADE_HW_CACHE in the right section. 2001-09-14 12:32:04 +00:00
Warner Losh
8b8a72ee71 s/thread'/thread's/ 2001-09-14 04:40:44 +00:00
Julian Elischer
b40ce4165d KSE Milestone 2
Note ALL MODULES MUST BE RECOMPILED
make the kernel aware that there are smaller units of scheduling than the
process. (but only allow one thread per process at this time).
This is functionally equivalent to teh previousl -current except
that there is a thread associated with each process.

Sorry john! (your next MFC will be a doosie!)

Reviewed by: peter@freebsd.org, dillon@freebsd.org

X-MFC after:    ha ha ha ha
2001-09-12 08:38:13 +00:00
Gary Jennejohn
cc3ee09cd3 Increase AUTHNAME to 42 bytes for users of T-Online, which requires 41
bytes.

MFC after:	2 weeks
2001-09-12 08:27:54 +00:00
Kris Kennaway
bf61e26696 Fix some signed/unsigned integer confusion, and add bounds checking of
arguments to some functions.

Obtained from:	NetBSD
Reviewed by:	peter
MFC after:	2 weeks
2001-09-10 11:28:07 +00:00
Marcel Moolenaar
e061a6ca19 Fix LINT breakage caused by previous commit. The linux_rt_sendsig
and linux_sendsig functions guarded their debugging output with
ldebug(sigreturn). This has been mistaken for a cut-n-paste bug,
and was replaced by ldebug(rt_sendsig) and ldebug(sendsig) resp.
Since the sendsig functions are not syscalls, this brokei any
build that defines DEBUG.

The fix maps both functions to the unused syscall 0 so that they
can be enabled/disabled independently from sigreturn, but not
independently from each other.
2001-09-10 07:00:17 +00:00
Peter Wemm
eb30c1c0b9 Rip some well duplicated code out of cpu_wait() and cpu_exit() and move
it to the MI area.  KSE touched cpu_wait() which had the same change
replicated five ways for each platform.  Now it can just do it once.
The only MD parts seemed to be dealing with fpu state cleanup and things
like vm86 cleanup on x86.  The rest was identical.

XXX: ia64 and powerpc did not have cpu_throw(), so I've put a functional
stub in place.

Reviewed by:	jake, tmm, dillon
2001-09-10 04:28:58 +00:00
Peter Wemm
e11e07928b gcc-3 has objections about the bluetrap6 and bluetrap13 inline asm
functions.  Apparently multi-line string asm arguments are deprecated.
2001-09-10 04:22:20 +00:00
Peter Wemm
660c5377fd Missing part of dillon's coredump commit. cpu_coredump() was still
passing IO_NODELOCKED to vn_rdwr(), this would cause operations on the
unlocked core vnode and softupdates nastiness if an a.out binary cored.
2001-09-08 22:18:58 +00:00
Marcel Moolenaar
5002a60f9b Round of cleanups and enhancements. These include (in random order):
o  Introduce private types for use in linux syscalls for two reasons:
   1. establish type independence for ease in porting and,
   2. provide a visual queue as to which syscalls have proper
      prototypes to further cleanup the i386/alpha split.
   Linuxulator types are prefixed by 'l_'. void and char have not
   been "virtualized".

o  Provide dummy functions for all syscalls and remove dummy functions
   or implementations of truely obsolete syscalls.

o  Sanitize the shm*, sem* and msg* syscalls.

o  Make a first attempt to implement the linux_sysctl syscall. At this
   time it only returns one MIB (KERN_VERSION), but most importantly,
   it tells us when we need to add additional sysctls :-)

o  Bump the kenel version up to 2.4.2 (this is not the same as the
   KERN_VERSION MIB, BTW).

o  Implement new syscalls, of which most are specific to i386. Our
   syscall table is now up to date with Linux 2.4.2. Some highlights:
   -  Implement the 32-bit uid_t and gid_t bases syscalls.
   -  Implement a couple of 64-bit file size/offset bases syscalls.

o  Fix or improve numerous syscalls and prototypes.

o  Reduce style(9) violations while I'm here. Especially indentation
   inconsistencies within the same file are addressed. Re-indenting
   did not obfuscate actual changes to the extend that it could not
   be combined.

NOTE: I spend some time testing these changes and found that if there
      were regressions, they were not caused by these changes AFAICT.
      It was observed that installing a RH 7.1 runtime environment
      did make matters worse. Hangs and/or reboots have been observed
      with and without these changes, so when it failed to make life
      better in cases it doesn't look like it made it worse.
2001-09-08 19:07:04 +00:00
Marcel Moolenaar
f981a79ed9 o Introduce private types for use in linux syscalls for two reasons:
1. establish type independence for ease in porting and,
   2. provide a visual queue as to which syscalls have proper
      prototypes to further cleanup the i386/alpha split.
   Linuxulator types are prefixed by 'l_'. void and char have not
   been "virtualized".

o  Remove dummy functions for syscalls that are now truely
   unimplemented.

o  Rename syscalls so they match the names used in the Linux kernel.
   Also, provide more accurate prototypes. This generally improves
   cross-referencing and reduces head-scratching.

o  Provide seperate implementations for the 16-bit uid_t and gid_t
   based syscalls as Linux used to have. The new 32-bit uid_t and
   gid_t based syscalls now map to their FreeBSD equivalents.

o  Fix the linux_ipc syscall so that it doesn't force the shm*, sem*
   and msg* syscalls to have the same syscall. The prototypes for
   these syscalls now match the those used on Alpha. While here,
   add the same kludge for MSGRCV as is present in the Linux kernel.

o  Implement the following syscalls:
     linux_stat64, linux_lstat64 and linux_fstat64
     linux_sysctl

o  Added syscalls numbered 198 - 221. This include:
     - the 32-bit uid_t and gid_t bases syscalls
     - 64-bit file offset/size based syscalls
2001-09-08 18:48:40 +00:00