Commit Graph

9728 Commits

Author SHA1 Message Date
John Baldwin
44c99fac14 Sync up MP safe flags with global syscalls.master. This includes write(),
close(), getpid(), ibcs2_setuid(), getuid(), ptrace(), ibcs2_pause(),
ibcs2_nice(), ibcs2_kill(), ibcs2_pgrpsys(), dup(), pipe(), ibcs2_setgid(),
getgid(), umask(), and sigreturn().
2004-02-06 20:20:07 +00:00
Alexander Kabaev
dec8868dcc Rename cn_unavailable to cnunavailable for little more consistency.
Garbage collect unused cndebug() function.

Suggested by:	bde
2004-02-05 17:35:28 +00:00
Roman Kurakin
6f97087e27 Updates cx driver information (Cronyx-Sigma)
Approved by:	imp (mentor)
2004-02-05 13:02:14 +00:00
Peter Pentchev
f7644f46f0 Fix a typo in kan's last commit: cnavaiable() -> cnavailable() 2004-02-05 10:02:20 +00:00
Alexander Kabaev
e99c09e2dc Eliminate global cons_unavailable flag and replace it by the status
bit maintained on a per-device basis. Single variable is inadequate
on machines running with multiple consoles enabled.
2004-02-05 01:56:43 +00:00
John Baldwin
0804ed5acc Regen. 2004-02-04 22:00:44 +00:00
John Baldwin
c3b612d935 The following compat syscalls are now mpsafe: linux_getrlimit(),
linux_setrlimit(), linux_old_getrlimit(), osf1_getrlimit(),
osf1_setrlimit(), svr4_sys_ulimit(), svr4_sys_setrlimit(),
svr4_sys_getrlimit(), svr4_sys_setrlimit64(), svr4_sys_getrlimit64(),
ibcs2_sysconf(), and ibcs2_ulimit().
2004-02-04 21:57:00 +00:00
John Baldwin
91d5354a2c Locking for the per-process resource limits structure.
- struct plimit includes a mutex to protect a reference count.  The plimit
  structure is treated similarly to struct ucred in that is is always copy
  on write, so having a reference to a structure is sufficient to read from
  it without needing a further lock.
- The proc lock protects the p_limit pointer and must be held while reading
  limits from a process to keep the limit structure from changing out from
  under you while reading from it.
- Various global limits that are ints are not protected by a lock since
  int writes are atomic on all the archs we support and thus a lock
  wouldn't buy us anything.
- All accesses to individual resource limits from a process are abstracted
  behind a simple lim_rlimit(), lim_max(), and lim_cur() API that return
  either an rlimit, or the current or max individual limit of the specified
  resource from a process.
- dosetrlimit() was renamed to kern_setrlimit() to match existing style of
  other similar syscall helper functions.
- The alpha OSF/1 compat layer no longer calls getrlimit() and setrlimit()
  (it didn't used the stackgap when it should have) but uses lim_rlimit()
  and kern_setrlimit() instead.
- The svr4 compat no longer uses the stackgap for resource limits calls,
  but uses lim_rlimit() and kern_setrlimit() instead.
- The ibcs2 compat no longer uses the stackgap for resource limits.  It
  also no longer uses the stackgap for accessing sysctl's for the
  ibcs2_sysconf() syscall but uses kernel_sysctl() instead.  As a result,
  ibcs2_sysconf() no longer needs Giant.
- The p_rlimit macro no longer exists.

Submitted by:	mtm (mostly, I only did a few cleanups and catchups)
Tested on:	i386
Compiled on:	alpha, amd64
2004-02-04 21:52:57 +00:00
John Baldwin
7a9d7023a2 Revert the skipping of segment register reloads as it appears to actually
be a pessimization on non Pentium4 CPUs.  More importantly, it is buggy as
it can cause GPF's when using APM or vm86.
2004-02-03 22:00:42 +00:00
Bruce Evans
ab2bf9ff6a Removed bogus checks that (PCPU_GET(curpcb) != NULL). Rev.1.586 of
machdep.c fixed the missing early initialization of curpcb, so curpcb
is now always set together with curthread and it cannot be NULL except
before the IDT has been set up (so trap() is unreachable) or after a
memory error.  In any case, it was often used without checking.

curcpb shouldn't exist anyway.  It doesn't exist for most non-i386 arches.
It just caches curthread->td_pcb in a global.  This was a better idea
before it was per-cpu.  trap() and some other places can get at it more
efficiently using td->td_pcb instead of PCPU_GET(curpcb).  The main
exception is support.s which mostly wants only curpcb->pcb_onfault.
2004-02-03 06:35:29 +00:00
John Baldwin
b71aa5f5e9 Set PCPU_GET(curpcb) for the BSP to thread0's pcb. Otherwise, the boot CPU
doesn't have a pcb until after it's first context switch.  This can cause
secondary panics if a page fault happens during bootup.
2004-02-02 23:22:24 +00:00
Jeff Roberson
fe5efaede8 - Make sure the apic is idle before sending an IPI. This is required on
non-X-APIC machines.  Previously this was only done in the
   DETECT_DEADLOCK case when really it is needed in all cases.

Reminded by:	jhb
2004-02-02 09:50:43 +00:00
Alan Cox
8600a4122a Eliminate all TLB shootdowns by pmap_pte_quick(): By temporarily pinning
the thread that calls pmap_pte_quick() and by virtue of the page queues
lock being held, we can manage PADDR1/PMAP1 as a CPU private mapping.

The most common effect of this change is to reduce the overhead of the page
daemon on multiprocessors.

In collaboration with:  tegge
2004-02-01 20:14:00 +00:00
Takeshi Shibagaki
386a89ed83 Compiled longrun.c when defined options CPU_ENABLE_LONGRUN,
and fixed wrong comparation in cpu vendor. Longrun function
was re-enabled.
2004-01-31 20:14:44 +00:00
Jens Schweikhardt
08e33a7ff1 Consistently capitalize acronyms like POSIX and NIC. Style. 2004-01-29 21:24:53 +00:00
Jens Schweikhardt
495b73cfe0 Fix typos and remove whitespace at EOL. 2004-01-29 21:07:54 +00:00
John Baldwin
5352136a25 Optimize the i386 interrupt entry code to not reload the segment registers
if they already contain the correct kernel selectors.

Reviewed by:	peter
Suggested by:	peter
2004-01-28 20:44:08 +00:00
Robert Watson
265ef81196 Remove process lock XXX's, fixed in src/sys/sys/proc.h:1.366. 2004-01-28 06:48:31 +00:00
Robert Watson
bfd8097a69 Stick two XXX's in the syscall() code: we call STOPEVENT() twice for
every system call, and that grabs and release the process lock each
time.  Don't fix it (yet), but document it so we know to fix it.
Also should be a 5.3-RELEASE todo item.
2004-01-27 04:40:19 +00:00
John Baldwin
afa632035c - Call acpi_Startup() before parsing interrupt-related APIC resources so we
can look at the ACPI tables.  If the startup fails, we panic and tell the
  user to try rebooting with ACPI disabled.  Previously in this case we
  would try to use $PIR interrupt routing which only works for the atpic
  while using the apic to handle interrupts which would result in misrouted
  interrupts and a hang at boot time with no error message.
- Read the SCI out of the FADT instead of hardcoding 9 when checking to see
  if an interrupt override entry is for the SCI.
- Try to work around some BIOS brain damage for the SCI's programming by
  forcing the SCI to be level triggered and active low if it is routed
  to a non-ISA interrupt (greater than 15) or if it is identity mapped with
  edge trigger and active high polarity.  This should fix some of the hangs
  with device apic and ACPI that some people see.

Reviewed by:	njl
2004-01-26 19:34:24 +00:00
Maxim Sobolev
87b4a80d97 Move LongRun support out of identcpu.c, where it hardly belongs, into its
own file and make it opt-in, not mandatory, depending on CPU_ENABLE_LONGRUN
config(8) option.

Discussed with: nate
MFC after:      2 weeks
2004-01-25 09:59:16 +00:00
Jeff Roberson
f67fdc737e - Now that both schedulers support temporary cpu pinning use this rather
than the switchin functions to guarantee that we're operating with the
   correct tlb entry.
 - Remove the post copy/zero tlb invalidations.  It is faster to invalidate
   an entry that is known to exist and so it is faster to invalidate after
   use.  However, some architectures implement speculative page table
   prefetching so we can not be guaranteed that the invalidated entry is still
   invalid when we re-enter any of these functions.  As a result of this we
   must always invalidate before use to be safe.
2004-01-25 08:04:45 +00:00
Jeff Roberson
1a9b9c9837 - Don't define DETECT_DEADLOCK. I don't know that this code has detected
a deadlock in several years.  Furthermore, the IPI code is currently
   protected by a seperate spinlock.  This only served to make IPIs twice as
   expensive as they had to be which severely slowed down the IPI heavy ULE
   scheduler.
2004-01-25 05:03:14 +00:00
Jeff Roberson
048ac395be - Recruit some new ULE users by making it the default scheduler in GENERIC.
ULE will be in a probationary period to determine whether it will be left
   as the default in 5.3 which would likely mean the rest of the 5.x series.
2004-01-24 21:38:52 +00:00
Maxim Sobolev
983a9b60e6 - Move performance-controlling sysctls into hw.p4tcc.* tree;
Suggested by:   nate

- get rid of "magick" values in code and make sysctl's reflecting reality
  on processor versions which have one or another frequency "forbidden"
  due to errata.

MFC after:      2 weeks
2004-01-24 21:13:13 +00:00
Maxim Sobolev
82b95ace07 - Move performance-controlling sysctls into hw.p4tcc.* tree;
Suggested by:   nate

- get rid of "magick" values in code and make sysctl's reflecting reality
  on processor versions which have one or another frequency "forbidden"
  due to errata.

PR:
Submitted by:
Reviewed by:
Approved by:
Obtained from:
MFC after:      2 weeks
2004-01-24 21:13:12 +00:00
Jeff Roberson
b9509b56fa - Move smp_topology to subr_smp.c so that it is defined on all architectures. 2004-01-24 19:52:48 +00:00
Jacques Vidrine
5864cda7c6 Add PFIL_HOOKS to the GENERIC kernel configuration, primarily so
that one can load the IPFilter module (which requires PFIL_HOOKS).

Requested by:	Many, for over a year
2004-01-24 14:59:51 +00:00
Poul-Henning Kamp
50d23be140 Add linenumber and source filename to panic(9) output.
Ideally a traceback should be printed too, any takers ?
2004-01-19 21:27:11 +00:00
Bruce Evans
389ed6f873 Fixed misplacement and bitrot in the cy driver's configuration in
rev.1.1040.  It is a miscellaneous isa+pci driver, but came back
described as a pci-only driver and placed in an i4b pci subsection
after its migration to /sys/conf/NOTES.  Put it back where it used to
be, fully unsorted in the `Miscellaneous hardware' section.  Reduced
nearby disorder in this section by moving configuration of the digi
driver to where it was for the old digiboard drivers, so that the
order at least matches the order in the table of contents.
2004-01-19 02:18:34 +00:00
Bruce Evans
1d34d1e618 Removed some garbage comments:
- references to removed math emulators for NPX_DEBUG
- header for the null set of mandatory devices
- reference to the removed (and bogus when it existed) sysctl
  kern.timecounter.method.
2004-01-19 01:44:06 +00:00
Bruce Evans
645267ebdc Fixed formatting of sentence breaks. Use 2 spaces for all of them instead
of for about 3/4 of them.
2004-01-19 01:26:59 +00:00
Bruce Evans
b0d6888131 FIxed unsorting in previous commit (description of CPU_ENABLE_TCC).
FIxed some nearby disorder (descriptions of CPU_BLUELIGHTNING_3X,
CPU_DIRECT_MAPPED_CACHE, CPU_DISABLE_CMPXCHG, CPU_DISABLE_SSE,
CPU_ELAN_XTAL and CPU_SOEKRIS, and options for all of these except
CPU_DIRECT_MAPPED_CACHE).
2004-01-19 01:07:18 +00:00
Maxim Sobolev
4168deefd6 Add new CPU_ENABLE_TCC option, from NOTES:
CPU_ENABLE_TCC enables Thermal Control Circuitry (TCC) found in some
Pentium(tm) 4 and (possibly) later CPUs. When enabled and detected,
TCC allows to restrict power consumption by using machdep.cpuperf*
sysctls. This operates independently of SpeedStep and is useful on
systems where other mechanisms such as apm(4) or acpi(4) don't work.

Given the fact that many, even modern, notebooks don't work properly
with Intel ACPI, this is indeed very useful option for notebook owners.

Obtained from:  OpenBSD
MFC after:      2 weeks
2004-01-18 21:18:00 +00:00
Maxim Sobolev
e7846ad79e Add new CPU_ENABLE_TCC option, from NOTES:
CPU_ENABLE_TCC enables Thermal Control Circuitry (TCC) found in some
Pentium(tm) 4 and (possibly) later CPUs. When enabled and detected,
TCC allows to restrict power consumption by using machdep.cpuperf*
sysctls. This operates independently of SpeedStep and is useful on
systems where other mechanisms such as apm(4) or acpi(4) don't work.

Given the fact that many, even modern, notebooks don't work properly
with Intel ACPI, this is indeed very useful option for notebook owners.

Obtained from:	OpenBSD
MFC after:	2 weeks
2004-01-18 21:06:56 +00:00
Nate Lawson
b9585d5e60 Only remove the handler if we installed it. 2004-01-12 19:35:31 +00:00
Nate Lawson
1114c59266 Clean up the probe message and sort the function table according to
the function order in the file.
2004-01-12 06:55:50 +00:00
Alex Dupre
fd4b744b5b Update list of device drivers that support polling.
Remove redundancy in NOTES.

PR:		docs/61195
Submitted by:	Xin LI <delphij@frontfree.net>
Approved by:	blackend (mentor)
MFC after:	1 week
2004-01-11 22:07:19 +00:00
Nate Lawson
65c0f49140 Add the ACPI Toshiba extras driver (hotkeys, LCD backlight, video output,
forced fan control, and CPU throttling).

PR:
Submitted by:	Hiroyuki Aizu <aizu@navi.org>
Reviewed by:
Approved by:
Obtained from:
MFC after:
2004-01-11 19:18:39 +00:00
Nate Lawson
4fd3a4fdd2 Add the ACPI Toshiba extras driver (hotkeys, LCD backlight, video output,
forced fan control, and CPU throttling).

Submitted by:	Hiroyuki Aizu <aizu@navi.org>
2004-01-11 19:18:38 +00:00
Alan Cox
7fac6d07f6 Include "opt_cpu.h" and related #ifdef's for SSE so that pagezero()
actually includes the call to sse2_pagezero().
2004-01-11 03:02:25 +00:00
Jacques Vidrine
e4dc8baa84 Provide sysarch(2) prototypes in the MD sysarch.h headers. While I'm
at it, use the ANSI C generic pointer type for the second argument,
thus matching the documentation.

Remove the now extraneous (and now conflicting) function declarations
in various libc sources.  Remove now unnecessary casts.

Reviewed by:	bde
2004-01-09 16:52:09 +00:00
Joerg Wunsch
d93dea685d Fix a long-standing bug that had been introduced in rev 1.24 with the
replacement of struct proc by struct thread.  This bug could cause a
NULL pointer dereferencation under certain circumstances (e. g. while
running /etc/rc.d/pcvt).
2004-01-07 10:12:59 +00:00
John Baldwin
c8d7ed0d05 - Use i8259A register defines from shared sys/dev/ic/i8259.h rather than
from the i386-specific icu.h.
- Replace PC98 magic numbers with equivalent register define values along
  with comments about PC-98 "quirks".
2004-01-06 19:07:08 +00:00
Jacques Vidrine
1d0342a3d5 Use ANSI C function definition for _mcount' and remove static'
prototype from header file.

Discussed with:	bde, maybe one year ago
2004-01-06 18:49:54 +00:00
Poul-Henning Kamp
883bd55abd Add struct definition of the Elan MMCR registers (from jb@)
Put a CTASSERT() on the size of the struct.

Use the struct where it is easy to do so in elan_mmcr.c

Add the Elan specific hardware reset code (also from jb@).
2004-01-05 12:00:59 +00:00
David E. O'Brien
c53cdbeb95 Attempt to make the proper changes here for the proc.h commit:
Make sigaltstack as per-threaded, because per-process sigaltstack state
  is useless for threaded programs, multiple threads can not share same
  stack.
  The alternative signal stack is private for thread, no lock is needed,
  the orignal P_ALTSTACK is now moved into td_pflags and renamed to
  TDP_ALTSTACK.
  For single thread or Linux clone() based threaded program, there is no
  semantic changed, because those programs only have one kernel thread
  in every process.

which left out SVR4 bits.
2004-01-05 00:29:00 +00:00
David Xu
9b778a1611 Make sigaltstack as per-threaded, because per-process sigaltstack state
is useless for threaded programs, multiple threads can not share same
stack.
The alternative signal stack is private for thread, no lock is needed,
the orignal P_ALTSTACK is now moved into td_pflags and renamed to
TDP_ALTSTACK.
For single thread or Linux clone() based threaded program, there is no
semantic changed, because those programs only have one kernel thread
in every process.
2004-01-03 23:31:29 +00:00
Poul-Henning Kamp
c991bedb18 Hook the CPU_GEODE option up.
This option is mandatory on platforms like the Soekris 4801 because the
i8254 hardware is buggy.
2004-01-03 18:43:37 +00:00
David Xu
a30ec4b99c Make sigaltstack as per-threaded, because per-process sigaltstack state
is useless for threaded programs, multiple threads can not share same
stack.
The alternative signal stack is private for thread, no lock is needed,
the orignal P_ALTSTACK is now moved into td_pflags and renamed to
TDP_ALTSTACK.
For single thread or Linux clone() based threaded program, there is no
semantic changed, because those programs only have one kernel thread
in every process.

Reviewed by: deischen, dfr
2004-01-03 02:02:26 +00:00
Nate Lawson
0906e0c58f Use <machine/asmacros.h> since <machine/asm.h> is a userland-only header
and gives very wrong macros for ENTRY(), etc. for kernel programs.

PR:
Suggested by:	bde
Reviewed by:
Approved by:
Obtained from:
MFC after:
2004-01-01 22:57:22 +00:00
John Baldwin
21e25fa607 Replace an outb() during the test for configuration mechanism #1 with a
DELAY(1) instead.  After wading through old commit logs, I found that the
outb() was added not as part of the test but as an intentional delay. In
fact, according to Shanley's PCI book, the configuration 1 data and address
ports should only be accessed using aligned 32-bit accesses (i.e. inl()
and outl()).  Thus, using outb() to just the last byte of the port violates
the PCI spec it would seem.  On at least one box doing so broke the probe
for PCI, whereas changing it to a DELAY(1) fixed the probe.

Reported by:	Sean Welch <welchsm@earthlink.net>
MFC after:	1 week
2003-12-31 16:56:32 +00:00
Bruce Evans
42033f49c1 Garbage-collected CLK_USE_TSC_CALIBRATION.
i386/conf/NOTES, pc98/conf/NOTES:
Fixed the descriptions of the other CLK_* options.
2003-12-30 07:28:54 +00:00
Bruce Evans
ff22c670d9 Sorted includes. Removed duplicates exposed by this. 2003-12-29 06:51:10 +00:00
Bruce Evans
6d7d464994 Sorted includes. 2003-12-29 06:47:38 +00:00
Alan Cox
a41c6c2ad6 Don't bother clearing PG_ZERO on the page table page in _pmap_allocpte();
it serves no purpose.
2003-12-28 23:57:09 +00:00
Mike Silbersack
ddeb5b242e Track three new sendfile-related statistics:
- The number of times sendfile had to do disk I/O
- The number of times sfbuf allocation failed
- The number of times sfbuf allocation had to wait
2003-12-28 08:57:09 +00:00
Alan Cox
8eaddab161 Don't bother clearing and setting PG_BUSY on page table directory pages. 2003-12-28 05:10:21 +00:00
Mike Silbersack
5caf2b00f0 Move the declaration of sfbufspeak and sfbufsused to mbuf.h,
and use imax instead of max, as sfbufspeak and sfbufsused
are signed.

Submitted by:   bde
2003-12-28 01:43:22 +00:00
Mike Silbersack
5eda9873e9 Track current and peak sfbuf usage, export the values via sysctl. 2003-12-27 07:52:47 +00:00
Peter Wemm
c15e347e22 GC the unused <machine/kse.h> file. 2003-12-24 00:51:30 +00:00
Peter Wemm
bdbbbb1bb9 GC unused 'syshide' override to /dev/null. This was here to disable
the output of the namespc column.  Its functionality was removed some time
ago, but the overrides and the namespc column remained.
2003-12-24 00:32:07 +00:00
Peter Wemm
78cb533a0c Oops, remove references to namespc column in comment (I'm not going to
bother regenerating after this)
2003-12-24 00:17:24 +00:00
Peter Wemm
18513a2e43 Regen. (This should have been a NOP except it hasn't been regenerated
after makesyscalls.sh changes and the last few syscall.master changes, and
there have been some tree-sweeps that have touched generated files).
2003-12-24 00:15:20 +00:00
Peter Wemm
17ac3054d4 GC namespc column and unwrap long lines that now fit. 2003-12-24 00:14:08 +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
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
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
John Baldwin
1c0e864486 MFamd64: Remove i386_protection_init() and the protection_codes[] array
and replace them with a simple if test to turn on PG_RW.  i386 != vax.
2003-12-18 21:15:18 +00:00
Brian Feldman
4d33ee7c6a Hey, how about we NOT make modules crash 486s? 2003-12-17 00:51:47 +00:00
Jeff Roberson
7085b1c597 - Call mp_topology() after all CPUs have been probed. 2003-12-11 03:49:02 +00:00
Jeff Roberson
59f3a8e626 - Add the mp_topology() function to mp_machdep.c. This function builds up
the smp_topology structure to reflect the layout of HTT enabled machines.
 - Add a prototype for mp_topology() in smp.h
2003-12-11 03:48:31 +00:00
John Baldwin
d7944232dd Delete old and unused APIC_IRQ defines. 2003-12-10 21:33:07 +00:00
John Baldwin
62d1198ba5 Use NAPICID for the maximum number of local APICs rather than MAXCPU when
doing the HTT fixup.   This is a step closer to possibly having an apic.ko
module someday.
2003-12-10 19:29:39 +00:00
John Baldwin
3f19e465b9 Correct usage of MAXCPU. The MAXCPU value itself is not a valid CPU ID
value as it is a count of maximum values.

Reported by:	bde
2003-12-10 19:28:37 +00:00
David E. O'Brien
70005bdb38 Add just enough of i386/include/pcvt_ioctl.h to amd64/include/pcvt_ioctl.h
such that 'ispcvt' can build.  Unforunately 'ispcvt' is needed in order for
/etc/rc.d/syscons to run.  This fixes the bug where I could not get my
keymap effective at boot.
2003-12-10 02:49:17 +00:00
Nate Lawson
cac6460cfe Use the ACPI-CA definitions for the various APIC tables instead of our
own.
2003-12-09 03:04:19 +00:00
David E. O'Brien
a5b5101f5e Move the bktr(4) <arch>/include/ioctl_{bt848,meteor}.h files to dev/bktr
as these ioctl's aren't MD.  This also means they are installed in
/usr/include/dev/bktr now.  Also provide compatability wrappers for
where these headers lived in 4.x.
2003-12-08 07:22:42 +00:00
Alan Cox
a5819cb5b5 Don't remove the virtual-to-physical mapping when an sf_buf is freed.
Instead, allow the mapping to persist, but add the sf_buf to a free list.
If a later sendfile(2) or zero-copy send resends the same physical page,
perhaps with the same or different contents, then the mapping overhead is
avoided and the sf_buf is simply removed from the free list.

In other words, the i386 sf_buf implementation now behaves as a cache of
virtual-to-physical translations using an LRU replacement policy on
inactive sf_bufs.  This is similar in concept to a part of
http://www.cs.princeton.edu/~yruan/debox/ patch, but much simpler in
implementation.  Note: none of this is required on alpha, amd64, or ia64.
They now use their direct virtual-to-physical mapping to avoid any
emphemeral mapping overheads in their sf_buf implementations.
2003-12-07 22:49:25 +00:00
Warner Losh
05a463a03d Ooops. These are still used by the bktr driver. David O'Brien has
plans for dealing, but I'll let him deal.

Pointy hat to: imp@
2003-12-07 06:37:32 +00:00
Warner Losh
65b4a1b917 Remote meteor driver. It hasn't compiled in over 3 years. If someone
makes it compile again, and can test it, we can restore the driver to
the tree.
2003-12-07 04:41:11 +00:00
Warner Losh
6ee2f106aa The dgb driver is redundant with the digi driver in the tree. It uses
lots of old interfaces, and digi now supports all cards that dgb
supported.  The author of the driver says that this is no longer
necessary.

Approved by: babkin@
2003-12-07 04:18:52 +00:00
Warner Losh
6631471980 First part of the removal of drivers for hardware that isn't relevant
or whose drivers haven't even compiled for years.

The loran hardware was very unique, and only a few copies of it ever
existed.  It used the old COMPAT_ISA_DRIVER and when the author was
contacted, he indicated that he had no intention of ever updating this
driver and it was no longer relevant to the FreeBSD world and can be
removed without impact to anybody.

Approved by: phk
2003-12-07 03:51:19 +00:00
Warner Losh
29aad12185 File forgotten in the cx shuffle.
Pointed out by: Roman Kurakin
Approved by: re@ <scottl> (under go ahead and commit new cx approval)
2003-12-05 06:52:05 +00:00
Poul-Henning Kamp
5d341674fe Fix yet an oversight in my ELAN_* to CPU_ELAN_* debrucification commit.
Approved by:	re@
2003-12-04 19:57:56 +00:00
Warner Losh
b8b831f0ad Remove cx in its old location.
Approved by: re@ <scottl>
2003-12-03 23:07:37 +00:00
Warner Losh
ac44076d62 Connect the cx driver to its new location in the tree.
Update notes to reflect that cx is no longer a counted device
Update options for new cx option
# commented out ELAN_PPS and ELAN_XTAL since they produced errors

Submitted by: rik@cronyx.ru
Approved by: re@ <scottl>
2003-12-03 23:06:30 +00:00
John Baldwin
8eca42d505 - Reenable building of the ACPI module on i386.
- Remove 'device acpi' from i386 GENERIC and revert back to using ACPI as
  a module by default.

Approved by:	re (scottl / blanket)
2003-12-03 21:13:06 +00:00
John Baldwin
4a211a60e5 - Remove the hack to prevent the acpi module from loading.
- Add a really, really, nasty hack to provide stub versions of all of
  the 'device apic' functions used by the ACPI MADT APIC enumerator if
  'device apic' is not compiled into the kernel.  This is gross but is
  the best we can do with the current kernel linker implementation.

Approved by:	re (scottl / blanket)
2003-12-03 21:12:09 +00:00
John Baldwin
6afad3b055 - Reorder the APIC enumerator SYSINIT's to register enumeators at
SI_SUB_CPU - 1 and probe enumerators, probe CPUs, and setup the local
  APIC programming all at SI_SUB_CPU / SI_ORDER_FIRST.  This is needed to
  help get the ACPI module working again as it moves the APIC enumeration
  code after SI_SUB_KLD.
- In the MADT parser, use mp_maxid rather than MAXCPU to terminate a loop
  when assigning per-cpu ACPI IDs to avoid a dependency on 'options SMP'.
- Allow the apic device to be disabled via 'hint.apic.0.disabled' from the
  loader.  Note that since this is done in the local APIC code, it works
  for both the ACPI and non-ACPI cases.

Approved by:	re (scott / blanket)
2003-12-03 20:33:18 +00:00
John Baldwin
b6c71225a9 Fix all users of mp_maxid to use the same semantics, namely:
1) mp_maxid is a valid FreeBSD CPU ID in the range 0 .. MAXCPU - 1.
2) For all active CPUs in the system, PCPU_GET(cpuid) <= mp_maxid.

Approved by:	re (scottl)
Tested on:	i386, amd64, alpha
2003-12-03 14:57:26 +00:00
Warner Losh
88afb90f3c Updated cx driver commit part 1: bring in the new kernel driver.
This is the vastly updated cx drvier from Roman Kurakin <rik@cronyx.ru>
who has been patiently waiting for this update for sometime.

The driver is mostly a rewrite from the version we have in the tree.
While some similarities remain, losing the little history that the old
driver has is not a big loss, and the re@ felt it was easier this way (less
error prone).

The userland parts of this update will be committed shortly.

The driver is not connected to the build yet.  I want to make sure I
don't break any platform at any time, so I want to test that with
these files in the tree before I continue (on the off chance I'm
forgetting a file).

I changed the DEBUG macro to CX_DEBUG from the code that was submitted
(to not break when we go to building with opt_global.h after the
release), as well adding $FreeBSD$.

Submitted by: Roman Kurakin
Approved by: re@ <scottl>
2003-12-03 07:29:38 +00:00
Bruce Evans
4e72678dee Fixed panics in apic interrupt handlers if kernel profiling is turned
on.  MCOUNT and FAKE_MCOUNT() may clobber all the call-used registers,
and one FAKE_MCOUNT() was placed so that an active %eax was clobbered.
The fix is to move this FAKE_MCOUNT() earlier where it should have
been anyway.

Fixed 3 layers of bitrot in the comment about why this FAKE_MCOUNT()
was where it was by removing the comment.  (mcount() should be called
as early as possible after entering a new level, but an implementation
detail got in the way until 3 layers of changes ago.)

Kernel profiling still gives wrong results because the new interrupt
code rearranged object files too much.  mcount() depends on trap,
syscall and interrupt handlers being between certain magic labels with
interrupt handlers last, and on nothing else being there.  Splitting
up exception.o moved the magic labels to effectively random places
relative to what they are supposed to delimit.  This mainly broke the
call graph; the flat profile is still usable.
2003-12-02 15:02:12 +00:00
Bruce Evans
933a354fe5 Fixed breakage of the pci case of the cy driver by the new interrupt
code.  Both the driver and the new code were wrong.  Driver interrupt
handlers are supposed to take "void *vsc" arg, but some including all
COMPAT_ISA drivers and the pci part of the cy driver want an "int unit"
arg.  They got this using bogus casts of function pointers which should
have kept working despite their bogusness.  However, the new interrupt
code doesn't honor requests to pass an arg of ((void *)0), so things
are very broken if the arg is actually a representation of unit 0.

The fix is to use a normal "void *vsc" arg for the pci case and a
wrapper for the COMPAT_ISA case (of the cy driver).  This cleans up
new-busification of the pci case but takes the COMPAT_ISA case a little
further from new-bus.  The corresponding bug for the COMPAT_ISA case
has already been fixed similarly using a wrapper in compat_isa.c and
we need another wrapper just to undo that.

Fixed some directly related style bugs (mainly by removing compatibility
cruft).

cy.c:
Fixed an indirectly related old bug in cyattach_common().  A wrong status
was returned in the unlikely event that malloc() failed.

Approved by:	re (scottl)
2003-12-02 12:36:00 +00:00
Poul-Henning Kamp
173c971bd6 Refactor AMD Elan 520 CPU support.
Make it possible to configure GPIO pins as led(4) devices, PPS inputs
and PPS-echo outputs with a sysctl.  Led(4) and PPS-echo can be configured
for active-high or active-low.

Be more complete in initialization of timecounter hardware.

Approved by:	re@
2003-11-27 20:27:29 +00:00
John Baldwin
798a45964d - Split cpu_mp_probe() into two parts. cpu_mp_setmaxid() is still called
very early (SI_SUB_TUNABLES - 1) and is responsible for setting mp_maxid.
  cpu_mp_probe() is now called at SI_SUB_CPU and determines if SMP is
  actually present and sets mp_ncpus and all_cpus.  Splitting these up
  allows an architecture to probe CPUs later than SI_SUB_TUNABLES by just
  setting mp_maxid to MAXCPU in cpu_mp_setmaxid().  This could allow the
  CPU probing code to live in a module, for example, since modules
  sysinit's in modules cannot be invoked prior to SI_SUB_KLD.  This is
  needed to re-enable the ACPI module on i386.
- For the alpha SMP probing code, use LOCATE_PCS() instead of duplicating
  its contents in a few places.  Also, add a smp_cpu_enabled() function
  to avoid duplicating some code.  There is room for further code
  reduction later since much of this code is also present in cpu_mp_start().
- All archs besides i386 still set mp_maxid to the same values they set it
  to before this change.  i386 now sets mp_maxid to MAXCPU.

Tested on:	alpha, amd64, i386, ia64, sparc64
Approved by:	re (scottl)
2003-11-21 22:23:26 +00:00
Peter Wemm
c287f723c4 MFamd64: use a less compiler-intensive MD implementation of 'curthread'
so that the compiler doesn't have to do so much work.

Approved by:  re (jhb)
2003-11-20 23:23:22 +00:00
John Baldwin
6006b8f4c6 Add a special check for a stray IRQ 7 or IRQ 15 to see if it is actually
a spurious interrupt from one of the 8259As.  If so, don't log it as a
stray IRQ, but just silently ignore it.

Approved by:	re (rwatson)
2003-11-19 15:40:23 +00:00
John Baldwin
8c770ed571 - Add counts to the ATPIC interrupt sources and point the ATPIC interrupt
source count pointers at them so that intr_execute_handlers() won't
  choke when it tries to handle an unregisterd ATPIC interrupt source.
- Install the low-level ATPIC interrupt handlers when we first program the
  ATPIC in atpic_startup() rather than at SI_SUB_INTR.  This is only
  necessary to work around buggy code that enables interrupts too early
  in the boot process (namely, the vm86 code).

Approved by:	re (rwatson)
2003-11-19 15:38:56 +00:00