Commit Graph

912 Commits

Author SHA1 Message Date
Bruce Evans
be16a3aba0 Fixed the profiling version ALTENTRY(). Again. The previous version
didn't set up the frame pointer before calling mcount, and then jumped
to the wrong place in ENTRY() to defeat the point of the jump.
2000-01-25 09:01:55 +00:00
Roger Hardiman
cfa7b44621 Update to driver 2.07
Add new Channel Set for France. Submitted by Daniel Dagneaux <dagneaux@lure.u-psud.fr>
2000-01-24 14:00:34 +00:00
Peter Wemm
36cb9d91a7 Remove old specialix pre-newbus specialix driver. It lives on in
sys/dev/si now, including with a theoretically working eisa attachment.
2000-01-24 08:18:26 +00:00
Jason Evans
ed25321907 Move ENTRY and ALTENTRY definitions to asm.h where they belong.
Unbreak profiling.  Again.

Submitted by:	bde
2000-01-20 03:15:01 +00:00
Sheldon Hearn
ade4d795c2 Protect the i386 machine-dependant type definitions of __int64_t
and __uint64_t from lint(1) with /* LONGLONG */ comments.
2000-01-14 10:41:39 +00:00
Matthew N. Dodd
de9cfdd736 Allow SMP systems with an MCA bus to work properly.
Reviewed by:	peter
2000-01-13 09:09:02 +00:00
Bruce Evans
c83b1328f1 Fixed style bugs related to the access functions for the bsfl and bsrl
i386 instructions.
2000-01-09 16:46:03 +00:00
Luoqi Chen
5c8b298e0e Allow SMP && NCPU == 1 to work. From now on, there's no restriction on the
value of NCPU relative to the number of cpus physically present, the actual
number of cpus utilized will be the smaller of the two.
2000-01-07 08:49:25 +00:00
Tor Egge
82916a1126 ISA device drivers use the ISA source interrupt number in locations where
the low level interrupt handler number should be used.  Change
setup_apic_irq_mapping() to allocate low level interrupt handler X (Xintr${X})
for any ISA interrupt X mentioned in the MP table.

Remove an assumption in the driver for the system clock (clock.c) that
interrupts mentioned in the MP table as delivered to IOAPIC #0 intpin Y
is handled by low level interrupt handler Y (Xintr${Y}) but don't assume
that low level interrupt handler 0 (Xintr0) is used.

Don't allocate two low level interrupt handlers for the system clock.
Reviewed by:	NOKUBI Hirotaka <hnokubi@yyy.or.jp>
2000-01-04 22:24:59 +00:00
Peter Wemm
664a31e496 Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"
is an application space macro and the applications are supposed to be free
to use it as they please (but cannot).  This is consistant with the other
BSD's who made this change quite some time ago.  More commits to come.
1999-12-29 04:46:21 +00:00
Hellmuth Michaelis
a622c05e96 update to isdn4bsd beta release 0.90 1999-12-14 20:54:38 +00:00
Peter Wemm
7ba4a77549 Reclaim UPAGES_HOLE (8k) that was chopped out of process address space.
The UPAGES have not been there since Jan '96, but the hole was preserved
for BSD/OS binary compatability.  This has been fixed other ways (%ebx
now has a pointer to PS_STRINGS), and the stack is nowhere near where
it used to be so this hack isn't required anymore.
1999-12-11 10:54:06 +00:00
Luoqi Chen
91c28bfde0 User ldt sharing. 1999-12-06 04:53:08 +00:00
Peter Wemm
46db6cf83b Switch over to using the generic joy driver 1999-12-05 20:02:19 +00:00
Marcel Moolenaar
204fed67d2 oszsigcode -> szosigcode
Pointed out by: bde
1999-12-04 10:53:39 +00:00
Marcel Moolenaar
ec1d9fe8ff Fix type of sf_addr.
Pointed out by: bde
1999-12-04 10:40:24 +00:00
Bruce Evans
8a9d4d98b1 Moved scheduling-related code to kern_synch.c so that it is easier to fix
and extend.  The new function containing the code is named schedclock()
as in NetBSD, but it has slightly different semantics (it already handles
incrementation of p->p_cpticks, and it should handle any calling frequency).

Agreed with in principle by:	dufault
1999-11-27 12:32:27 +00:00
Bill Paul
dda0e6f54e Update the WaveLAN/IEEE driver:
- Convert to new bus attachment scheme. Thanks to Blaz Zupan for doing
  the initial work here. One thing I changed was to have the attach
  and detach routines work like the PCI drivers, which means that in
  theory you should be able to load and unload the driver like the PCI
  NIC drivers, however the pccard support for this hasn't settled down
  yet so it doesn't quite work. Once the pccard work is done, I'll have
  to revisit this.

- Add device wi0 to PCCARD. If we're lucky, people should be able to
  install via their WaveLAN cards now.

- Add support for signal strength caching. The wicontrol utility has
  also been updated to allow zeroing and displaying the signal strength
  cache.

- Add a /sys/modules/wi directory and fix a Makefile to builf if_wi.ko.
  Currently this module is only built for the i386 platform, though once
  the pccard stuff is done it should be able to work on the alpha too.
  (Theoretically you should be able to plug one of the WaveLAN/IEEE ISA
  cards into an alpha with an ISA slot, but we'll see how that turns out.

- Update LINT to use only device wi0. There is no true ISA version of
  the WaveLAN/IEEE so we'll never use an ISA attachment.

- Update files.i386 so that if_wi is dependent on card.
1999-11-25 20:45:49 +00:00
Matthew Dillon
f94f8efc61 Optimize two cases in the MP locking code. First, it is not necessary
to use a locked cmpexg when unlocking a lock that we already hold, since
      nobody else can touch the lock while we hold it.  Second, it is not
      necessary to use a locked cmpexg when locking a lock that we already
      hold, for the same reason.  These changes will allow MP locks to be used
      recursively without impacting performance.

      Modify two procedures that are called only by assembly and are already
      NOPROF entries to pass a critical argument in %edx instead of on the
      stack, removing a significant amount of code from the critical path
      as a consequence.

Reviewed by:	Alfred Perlstein <bright@wintelcom.net>, Peter Wemm <peter@netplex.com.au>
1999-11-19 22:47:19 +00:00
Matthew Dillon
cd906fe3de Optimize two cases in the MP locking code. First, it is not necessary
to use a locked cmpexg when unlocking a lock that we already hold, since
    nobody else can touch the lock while we hold it.  Second, it is not
    necessary to use a locked cmpexg when locking a lock that we already
    hold, for the same reason.  These changes will allow MP locks to be used
    recursively without impacting performance.

    Modify two procedures that are called only by assembly and are already
    NOPROF entries to pass a critical argument in %edx instead of on the
    stack, removing a significant amount of code from the critical path
    as a consequence.

Reviewed by:	Alfred Perlstein <bright@wintelcom.net>, Peter Wemm <peter@netplex.com.au>
1999-11-19 16:49:30 +00:00
Luoqi Chen
e870e9b278 Segment registers can be read(write) to(from) memory locations as well as
general registers.
1999-11-15 19:45:19 +00:00
David E. O'Brien
dfe41fc832 Fix clobbers so that GENERIC may compile with GCC 2.95.2.
Historically, the documentation of extended asm was lacking, namely you
should NOT specify the same register as an input, and a clobber.
If the register is clobbered, it should be specified as an output as well,
e.g., by linking input and output through the "number" notation.
(Beware of lvalues, some local variables needed...)

URL:http://egcs.cygnus.com/faq.html

In versions up to egcs-1.1.1, the compiler did not even warn about it,
but it was liable to output bad code. Newer egcs are pickier and simply
refuse to swallow such code.

Note, since *addr changes, it needs to be an output operand.
We might be excessive in saying that all memory has changed.

Obtained from:	OpenBSD
		w/extra thanks to Marc Espie <Marc.Espie@liafa.jussieu.fr>
1999-11-14 03:36:34 +00:00
Marcel Moolenaar
e6daa89c15 Reserve space for FPU state in struct sigcontext. Fix some style bugs
and comments while there.

Submitted by: bde
1999-11-12 13:52:11 +00:00
Marcel Moolenaar
4c53edc53b Change the type of sf_addr in struct {o}sigframe from char* to
register_t.

Fix some style bugs and bitrotted comments.

Submitted by: bde
1999-11-12 11:21:34 +00:00
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