Commit Graph

888 Commits

Author SHA1 Message Date
Mitsuru IWASAKI
29803c2003 i8254_restore is called from apm_default_resume() to reload
the countdown register.
this should not be necessary but there are broken laptops that
do not restore the countdown register on resume.
when it happnes, it messes up the hardclock interval and system clock,
which leads to the infamous "calcru: negative time" problem.

Submitted by:	kjc, iwasaki
Reviewed by:	Steve O'Hara-Smith <steveo@eircom.net> and committers.
Obtained from:	PAO3
1999-10-30 14:56:01 +00:00
Tor Egge
64793e7fe2 Eliminate remaining part of incorrect PCI bus numbering sanity check on systems with more than one PCI bus. 1999-10-15 21:38:15 +00:00
Doug Rabson
45f0aa1f0e * Implement bus_set/get/delete_resource for pci.
* Change the hack used on the alpha for mapping devices into DENSE or
  BWX memory spaces to a simpler one. Its still a hack and should be
  a seperate api to explicitly map the resource.
* Add $FreeBSD$ as necessary.
1999-10-14 21:38:33 +00:00
Luoqi Chen
645682fd40 Add a per-signal flag to mark handlers registered with osigaction, so we
can provide the correct context to each signal handler.

Fix broken sigsuspend(): don't use p_oldsigmask as a flag, use SAS_OLDMASK
as we did before the linuxthreads support merge (submitted by bde).

Move ps_sigstk from to p_sigacts to the main proc structure since signal
stack should not be shared among threads.

Move SAS_OLDMASK and SAS_ALTSTACK flags from sigacts::ps_flags to proc::p_flag.
Move PS_NOCLDSTOP and PS_NOCLDWAIT flags from proc::p_flag to procsig::ps_flag.

Reviewed by:	marcel, jdp, bde
1999-10-11 20:33:17 +00:00
Peter Wemm
01fb93b213 Zap unneeded #includes
Submitted by:	phk
1999-10-11 14:50:03 +00:00
Marcel Moolenaar
210430fd8d Simplification of the signal trampoline and other cleanups.
o  Remove unused defines from genassym.c that were needed
   by the trampoline.
o  Add load_gs_param function to support.s that catches
   a fault when %gs is loaded with an invalid descriptor.
   The function returns EFAULT in that case.
o  Remove struct trapframe from mcontext_t and replace it
   with the list of registers.
o  Modify sendsig and sigreturn accordingly.

This commit contains a patch by bde.

Reviewed by: luoqi, jdp
1999-10-07 12:40:34 +00:00
Marcel Moolenaar
c5c6b7b38e Re-introduction of sigcontext.
struct sigcontext and ucontext_t/mcontext_t are defined in such
a way that both (ie struct sigcontext and ucontext_t) can be
passed on to sigreturn. The signal handler is still given a
ucontext_t for maximum flexibility.

For backward compatibility sigreturn restores the state for the
alternate signal stack from sigcontext.sc_onstack and not from
ucontext_t.uc_stack. A good way to determine which value the
application has set and thus which value to use, is still open
for discussion.

NOTE: This change should only affect those binaries that use
      sigcontext and/or ucontext_t. In the source tree itself
      this is only doscmd. Recompilation is required for those
      applications.

This commit also fixes a lot of style bugs without hopefully
adding new ones.

NOTE: struct sigaltstack.ss_size now has type size_t again. For
      some reason I changed that into unsigned int.

Parts submitted by: bde
sigaltstack bug found by: bde
1999-10-04 19:33:58 +00:00
Peter Wemm
693612eb0b Use the rev 1.1.2.1 code from RELENG_3 for atomic operations rather
than the non-atomic C macros.
1999-10-04 16:24:08 +00:00
Peter Wemm
b87104737a Typo: s/__GNUC_MINOR_/__GNUC_MINOR__/
(__GNUC_MINOR__ on egcs in -current is "91" and is going to be "95" soon)
1999-10-04 16:18:04 +00:00
Marcel Moolenaar
576642ef6f Fix style bug: order includes
Submitted by: bde
1999-10-04 13:55:35 +00:00
Eivind Eklund
181d21375b Allow compilation with older versions of GCC, in order to make it possible
to bootstrap and work with -current from older versions of FreeBSD.
1999-10-03 21:15:25 +00:00
Marcel Moolenaar
0afa439d45 Fix style bugs caused by using the wrong file to copy from. That one
gets fixed later on.

Reinstate the mysterious 4th argument to signal handlers and add some
comments on that.
1999-10-03 12:55:58 +00:00
Marcel Moolenaar
91078fca0c sigset_t change (part 3 of 5)
-----------------------------

By introducing a new sigframe so that the signal handler operates
on the new siginfo_t and on ucontext_t instead of sigcontext, we
now need two version of sendsig and sigreturn.

A flag in struct proc determines whether the process expects an
old sigframe or a new sigframe. The signal trampoline handles
which sigreturn to call. It does this by testing for a magic
cookie in the frame.

The alpha uses osigreturn to implement longjmp. This means that
osigreturn is not only used for compatibility with existing
binaries. To handle the new sigset_t, setjmp saves it in
sc_reserved (see NOTE).

the struct sigframe has been moved from frame.h to sigframe.h
to handle the complex header dependencies that was caused by
the new sigframe.

NOTE: For the i386, the size of jmp_buf has been increased to hold
      the new sigset_t. On the alpha this has been prevented by
      using sc_reserved in sigcontext.
1999-09-29 15:06:27 +00:00
Matt Jacob
f327fe4c57 Fix from Tor so that if we enter the debugger in the tristate going to
SMP (other CPUs stopped but SMP mode not really started).

Obtained from:Tor.Egge@fast.no
1999-09-25 18:36:31 +00:00
Matthew Dillon
8b22cebb2c Back out a portion of the last commit. DFLTPHYS and MAXPHYS cannot
be set by a kernel conf option due to the struct buf structural
    dependancy (sizing of b_pages[]) creating a conflict with modules
    (which are not compiled with kernel config options overrides).

    We'll be able to sysctl these two later on when the buffer subsystem
    is revamped.
1999-09-22 05:48:31 +00:00
Matthew Dillon
a59d364a23 Change default block size for user VBLK device access from 2K to PAGE_SIZE
(4K on an i386, 8K on an alpha).

    Make BLKDEV_IOSIZE, DFLTPHYS, and MAXPHYS kernel-configurable.
1999-09-22 04:11:55 +00:00
Peter Wemm
1a16554b8f Make pmap_mapdev() deal with non-page-aligned requests.
Add a corresponding pmap_unmapdev() to release the KVM back to kernel_map.
1999-09-11 20:31:32 +00:00
Peter Wemm
ebb30c0b3a Add the CR4 values for P3 SIMD enabling support. FXSR tells the cpu that
the OS does FXSAVE/FXRESTOR instructions (fast FPU save/restore) during
context switching and also enables SIMD since this enables saving the
extra CPU context that isn't saved with normal FPU regs.  The other
enables the SIMD instructions to use exception 16 (FPU) error reporting.
Note, this doesn't turn on SIMD, just defines the bits.
1999-09-10 15:51:44 +00:00
Mike Smith
97ecdb1d58 Invoke smp_rendezvous_action() using the a.out compatible asnames.h
technique (bleagh).
1999-09-10 01:17:01 +00:00
Peter Wemm
05385ecdf7 Set up FPU state on the AP.
Tested by:	phk
1999-09-05 20:17:40 +00:00
Peter Wemm
ae04ca6157 Don't install stubs, make a compat symlink at buildworld time.
All internal references to <machine/soundcard.h> are (hopefully :-) gone.
1999-09-04 15:46:31 +00:00
Doug Rabson
3e05dd9c7c Make <machine/soundcard.h> a stub which includes <sys/soundcard.h> 1999-09-04 14:35:18 +00:00
Luoqi Chen
7a2bb3b800 Some reorganization of sysarch() interface:
1. Move definitions of struct i386_*_args to the header file sysarch.h,
   since they are part of the sysarch API. struct i386_get_ldt_args and
   i386_set_ldt_args were identical, therefore make them into one
   struct i386_ldt_args. Libc should use these definitions as well.
2. Return a more sensible EOPNOTSUPP for unknown operations.

Reviewed by:	marcel
1999-09-02 20:59:50 +00:00
Peter Wemm
c3aac50f28 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
Jonathan Lemon
7e42e2f811 Reference the correct gdt[] entry on SMP. Remove the `generation' flag,
and always reload the selectors for every bios call.
1999-08-27 19:39:20 +00:00
Poul-Henning Kamp
c1df7a7420 Remove unneeded prototypes. 1999-08-24 18:31:06 +00:00
Alan Cox
a236cb64a9 Modify the macros IMASK_UNLOCK, CPL_UNLOCK, and REL_FAST_INTR_LOCK
to perform the s_unlock inline.
1999-08-23 19:14:18 +00:00
Alan Cox
e7dcbbe297 Make "s_unlock" an inline function. (Inlining this function takes
less space than calling it.  A callable version still exists for
use by some assembly code.)
1999-08-22 05:37:18 +00:00
Peter Wemm
264c3d8738 Undo my previous commit and do it differently. Break the ffs() etc macros
into two parts - one to do the bsfl and the other to convert the result
(base 0) to ffs()-like (base 1) in inline C.  This enables the optimizer
to be a lot smarter in certain cases, like where it knows that the argument
is non-zero and we want ffs(known non zero arg) - 1.  This appears to
produce identical code to the old inline when the argument is unknown.
1999-08-19 14:54:40 +00:00
Peter Wemm
bb41d37104 Try using the builtin ffs() for egcs, it (by random inspection)
generates slightly better code and avoids the incl then subl when
using ffs(foo) - 1.
1999-08-19 00:32:48 +00:00
Peter Wemm
ebf9e95f31 Update for MI switch code, and trim a heap of unused (I believe) entries. 1999-08-19 00:20:10 +00:00
Alan Cox
08c40841d8 Create callable (non-inline) versions of the atomic_OP_TYPE functions
that are linked into the kernel.  The KLD compilation options are
changed to call these functions, rather than in-lining the
atomic operations.

This approach makes atomic operations from KLDs significantly
faster on UP systems (though somewhat slower on SMP systems).

PR:		i386/13111
Submitted by:	peter.jeremy@alcatel.com.au
1999-08-18 04:08:31 +00:00
Mike Smith
dc055b0c58 Remove the SMBIOS detection and definitions; this should be handled in a
loadable module (under development).
1999-08-18 02:20:04 +00:00
Kazutaka YOKOTA
64eed277c5 Add definitions for Interlink VersaPad. 1999-08-17 12:12:44 +00:00
Mike Smith
cb5f885bdf Search for and interrogate the PnP BIOS if found. This code just prints
the PnP device IDs in verbose mode; it does not (yet) save any resource
data or contribute to the PnP process nor resource management.
1999-08-17 07:10:34 +00:00
Mike Smith
7880e8b2d5 Mindbogglingly, many BIOS vendors expect to be able to load %ds with
0x40 and then access data stored in real-mode segment 0x40, even when
called in protected mode.  Microsoft unfortunately coddle these individuals,
and so must we if we want to run their code.

This change works around GPFs in some APM and PnP BIOS implementations.

Obtained from:	Linux
1999-08-17 07:09:13 +00:00
Poul-Henning Kamp
ce9edcf5b5 Merge the cons.c and cons.h to the best of my ability. alpha may or
may not compile, I can't test it.
1999-08-09 10:35:05 +00:00
Hellmuth Michaelis
0df6adec74 updating isdn4bsd to beta version 0.83 1999-08-06 14:05:10 +00:00
Mike Smith
600d8382d9 Reenable the APMIO_BIOS ioctl and translate arguments into the new format
(which is more like the old than I thought).

Requested-by:	imp
1999-07-30 19:35:03 +00:00
Mike Smith
733e6274d7 Remove all vestiges of APMIO_BIOS
Submitted by:	N. Dudorov <nnd@mail.nsk.ru>
1999-07-30 08:24:23 +00:00
Mike Smith
496027bf08 Major update to the kernel's BIOS-calling ability.
- Add support for calling 32-bit code in other segments
 - Add support for calling 16-bit protected mode code

Update APM to use this facility.

Submitted by:	jlemon
1999-07-29 01:49:19 +00:00
Doug Rabson
aa595accc9 Add support for SYS_RES_DENSE and SYS_RES_BWX resource types. These are
equivalent to SYS_RES_MEMORY for x86 but for alpha, the rman_get_virtual()
address of the resource is initialised to point into either dense-mapped
or bwx-mapped space respectively, allowing direct memory pointers to be
used to device memory.

Reviewed by: Andrew Gallatin <gallatin@cs.duke.edu>
1999-07-28 07:57:48 +00:00
Martin Cracauer
784648c675 Various formatting fixes on my FPE trapcode commit.
Submitted by:	BDE
1999-07-26 05:47:31 +00:00
Martin Cracauer
a7674320e9 On FPU exceptions, pass a useful error code (one of the FPE_...
macros) to the signal handler, for old-style BSD signal handlers as
the second (int) argument, for SA_SIGINFO signal handlers as
siginfo_t->si_code. This is source-compatible with Solaris, except
that we have no <siginfo.h> (which isn't even mentioned in POSIX
1003.1b).

An rather complete example program is at
  http://www3.cons.org/cracauer/freebsd-signal.c
This will be added to the regression tests in src/.

This commit also adds code to disable the (hardware) FPU from
userconfig, so that you can use a software FP emulator on a machine
that has hardware floating point. See LINT.
1999-07-25 13:16:09 +00:00
David Greenman
6704748cf6 Increased max kmem to 200MB. This should fix some out-of-kmem panics on
large systems.
1999-07-24 22:26:42 +00:00
Alan Cox
03e3bc8e62 atomic.h:
Change "void *" to "volatile TYPE *", improving type safety
	and eliminating some warnings (e.g., mp_machdep.c rev 1.106).

cpufunc.h:
	Eliminate setbits.  As defined, it's not precisely correct;
	and it's redundant.  (Use atomic_set_int instead.)

ipl_funcs.c:
	Use atomic_set_int instead of setbits.

systm.h:
	Include atomic.h.

Reviewed by:	bde
1999-07-23 23:45:50 +00:00
Mike Smith
91fe3dc1e1 Implement an all-CPU shootdown-style rendezvous facility. This allows
the caller to specify a function to be guarded between an entry and exit
barrier, as well as pre- and post-barrier functions.

The primary use for this function is synchronised update of per-cpu private
data.  The implementation is almost (but not quite) MI; with a better
mechanism for masking per-CPU interrupts it could probably be hoisted.

Reviewed by:	peter (partially)
1999-07-20 06:52:35 +00:00
Alan Cox
47b8bc92e8 Commit the correct patch, i.e., the one that actually corresponds
to the rev 1.2 log entry.
1999-07-13 06:35:25 +00:00
Alan Cox
e58bb1c453 Changed the implementation of the primitives to guarantee atomicity
with respect to interrupts on UP systems.  (The upgrade from gcc 2.7.x
to egcs 1.1.2 produced at least one non-atomic code sequence in
swap_pager_getpages.)

In addition, the primitives are now SMP-safe, but only on SMPs.  (For
portability between SMPs and UPs, modules are compiled with the SMP-safe
versions.)

Submitted by:	dillon and myself
Reviewed by:	bde
1999-07-13 03:32:17 +00:00
Kazutaka YOKOTA
01533d852e Improve Logitech MouseMan+ protocol support. 1999-07-12 15:16:14 +00:00