Commit Graph

2572 Commits

Author SHA1 Message Date
Pawel Jakub Dawidek
57bcf75fd2 Add UFS_GJOURNAL options to the GENERIC kernel.
Approved by:	re (kensmith)
2007-04-10 16:49:41 +00:00
Yoshihiro Takahashi
41f5bd0f6d Don't call bus_deactivate_resource() explicitly before calling
bus_release_resource().  This is needed for pc98 by upcoming nexus related
change.
2007-03-21 03:38:37 +00:00
Yoshihiro Takahashi
c47456c322 MFi386: revision 1.650
Eliminate an unused parameter.
2007-03-18 03:25:40 +00:00
Yoshihiro Takahashi
2e4114e463 - Use mtx_{lock,unlock}_spin rather than {disable,enable}_intr.
- Remove unnecessary findcpuspeed() function.
- Initialize the timer_freq in i8254_init().
- Fix inittodr() and resettodr().  These are broken by rev.1.154.
2007-03-04 11:36:16 +00:00
Yoshihiro Takahashi
1523f7902c Reduce diffs with i386. 2007-03-04 04:59:39 +00:00
John Baldwin
84d37a463a Use pause() rather than tsleep() on explicit global dummy variables. 2007-02-27 17:22:30 +00:00
Paolo Pisati
20c24107ca Garbage collect a reference to INTR_FAST. 2007-02-25 14:53:55 +00:00
Paolo Pisati
e251ed48e9 o break newbus api: add a new argument of type driver_filter_t to
bus_setup_intr()

o add an int return code to all fast handlers

o retire INTR_FAST/IH_FAST

For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current

Approved by: re (implicit?)
2007-02-23 20:11:27 +00:00
Paolo Pisati
ef544f6312 o break newbus api: add a new argument of type driver_filter_t to
bus_setup_intr()

o add an int return code to all fast handlers

o retire INTR_FAST/IH_FAST

For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current

Reviewed by: many
Approved by: re@
2007-02-23 12:19:07 +00:00
Brooks Davis
983f970981 Include GEOM_LABEL in GENERIC. It's very useful and not well publicized
enough.

Approved by:	pjd
2007-02-09 19:03:18 +00:00
Marcel Moolenaar
1d3aed33e8 Evolve the ctlreq interface added to geom_gpt into a generic
partitioning class that supports multiple schemes. Current
schemes supported are APM (Apple Partition Map) and GPT.
Change all GEOM_APPLE anf GEOM_GPT options into GEOM_PART_APM
and GEOM_PART_GPT (resp).

The ctlreq interface supports verbs to create and destroy
partitioning schemes on a disk; to add, delete and modify
partitions; and to commit or undo changes made.
2007-02-07 18:55:31 +00:00
Yoshihiro Takahashi
f67d792692 MFi386: revision 1.647.
exclude the icu and clock lock from LOCK_PROFILING
2007-01-28 07:19:14 +00:00
Bruce Evans
cec54a8d96 Oops, pc98 is independent of i386 for clock.c and machdep.c but not
for clock.h, so changing th i386 clock.h broke it.  MFi386 (not tested):

Cleaned up declaration and initialization of clock_lock.  It is only
used by clock code, so don't export it to the world for machdep.c to
initialize.  There is a minor problem initializing it before it is
used, since although clock initialization is split up so that parts
of it can be done early, the first part was never done early enough
to actually work.  Split it up a bit more and do the first part as
late as possible to document the necessary order.  The functions that
implement the split are still bogusly exported.

Cleaned up initialization of the i8254 clock hardware using the new
split.  Actually initialize it early enough, and don't work around it
not being initialized in DELAY() when DELAY() is called early for
initialization of some console drivers.

This unfortunately moves a little more code before the early debugger
breakpoint so that it is harder to debug.  The ordering of console and
related initialization is delicate because we want to do as little as
possible before the breakpoint, but must initialize a console.
2007-01-23 08:48:26 +00:00
Yoshihiro Takahashi
d19e3538ae MFi386: revision 1.646. 2007-01-07 12:13:10 +00:00
Maxim Sobolev
efa43a53bd Allow machdep.cpu_idle_hlt to be set from the loader. This should allow
to workaround the problem with SMP kernels on Turion64 X2 processors
described in kern/104678 and may be useful in other situations too.

MFC after:	3 days
2006-12-06 18:27:17 +00:00
Julian Elischer
ad1e7d285a Threading cleanup.. part 2 of several.
Make part of John Birrell's KSE patch permanent..
Specifically, remove:
Any reference of the ksegrp structure. This feature was
never fully utilised and made things overly complicated.
All code in the scheduler that tried to make threaded programs
fair to unthreaded programs.  Libpthread processes will already
do this to some extent and libthr processes already disable it.

Also:
Since this makes such a big change to the scheduler(s), take the opportunity
to rename some structures and elements that had to be moved anyhow.
This makes the code a lot more readable.

The ULE scheduler compiles again but I have no idea if it works.

The 4bsd scheduler still reqires a little cleaning and some functions that now do
ALMOST nothing will go away, but I thought I'd do that as a separate commit.

Tested by David Xu, and Dan Eischen using libthr and libpthread.
2006-12-06 06:34:57 +00:00
Yoshihiro Takahashi
6bdb8f0897 MFi386: revisions from 1.641 to 1.643. 2006-11-20 12:32:04 +00:00
Yoshihiro Takahashi
14a2c27d00 MFi386: revisions 1.634 and 1.639. 2006-11-09 08:03:37 +00:00
Robert Watson
acd3428b7d Sweep kernel replacing suser(9) calls with priv(9) calls, assigning
specific privilege names to a broad range of privileges.  These may
require some future tweaking.

Sponsored by:           nCircle Network Security, Inc.
Obtained from:          TrustedBSD Project
Discussed on:           arch@
Reviewed (at least in part) by: mlaier, jmg, pjd, bde, ceri,
                        Alex Lyashkov <umka at sevcity dot net>,
                        Skip Ford <skip dot ford at verizon dot net>,
                        Antoine Brodin <antoine dot brodin at laposte dot net>
2006-11-06 13:42:10 +00:00
John Birrell
8391a99bf7 Remove the KDTRACE option again because of the complaints about having
it as a default.

For the record, the KDTRACE option caused _no_ additional source files
to be compiled in; certainly no CDDL source files. All it did was to
allow existing BSD licensed kernel files to include one or more CDDL
header files.

By removing this from DEFAULTS, the onus is on a kernel builder to add
the option to the kernel config, possibly by including GENERIC and
customising from there. It means that DTrace won't be a feature
available in FreeBSD by default, which is the way I intended it to be.

Without this option, you can't load the dtrace module (which contains
the dtrace device and the DTrace framework). This is equivalent to
requiring an option in a kernel config before you can load the linux
emulation module, for example.

I think it is a mistake to have DTrace ported to FreeBSD, but not
to have it available to everyone, all the time. The only exception
to this is the companies which distribute systems with FreeBSD embedded.
Those companies will customise their systems anyway. The KDTRACE
option was intended for them, and only them.
2006-11-04 23:50:12 +00:00
John Birrell
1f80cd9398 Build in kernel support for loading DTrace modules by default. This
adds the hooks that DTrace modules register with, and adds a few functions
which have the dtrace_ prefix to allow the DTrace FBT (function boundary
trace) provider to avoid tracing because they are called from the DTtrace
probe context.

Unlike other forms of tracing and debug, DTrace support in the kernel
incurs negligible run-time cost.

I think the only reason why anyone wouldn't want to have kernel support
enabled for DTrace would be due to the license (CDDL) under which DTrace
is released.
2006-11-04 04:58:10 +00:00
John Birrell
3750d1ecad Remove the KSE option now that it's in DEFAULTS on these arches/machines.
The 'nooption' kernel config entry has to be used to turn KSE off now.
This isn't my preferred way of dealing with this, but I'll defer to
scottl's experience with the io/mem kernel option change and the grief
experienced over that.

Submitted by:	scottl@
2006-10-26 22:11:35 +00:00
John Birrell
013d6d8cb4 Add 'options KSE' to the kernel config DEFAULTS on all arches/machines
except sun4v.

This change makes the transition from a default to an option more
transparent and is an attempt to head off all the compliants that are
likely from people who don't read UPDATING, based on experience with
the io/mem change.

Submitted by:	scottl@
2006-10-26 22:05:25 +00:00
John Birrell
8460a577a4 Make KSE a kernel option, turned on by default in all GENERIC
kernel configs except sun4v (which doesn't process signals properly
with KSE).

Reviewed by:	davidxu@
2006-10-26 21:42:22 +00:00
Ruslan Ermilov
837f167eb2 Move "device splash" back to MI NOTES and "files", it's MI. 2006-10-23 13:23:14 +00:00
Ruslan Ermilov
9fae53b036 Mechanically kill redundant nodevice/nooption/nomakeoption, i.e.,
those that do not exist in MI NOTES or switched on/off in the MD
NOTES.
2006-10-23 09:45:22 +00:00
Yoshihiro Takahashi
d0ea53f561 - MFi386: Remove 'device io'.
- Remove duplicate options.
- 'nomakeoption ATKBD_DFLT_KEYMAP' is not needed anymore.
2006-10-20 11:48:46 +00:00
Dag-Erling Smørgrav
c43ac89acc Move more MD devices and options out of MI NOTES. 2006-10-20 09:52:27 +00:00
Warner Losh
e54ad0a189 Remove references to pccard.conf 2006-10-19 05:17:55 +00:00
Simon L. B. Nielsen
4517aab293 - Remove SCHED_ULE from GENERIC to better avoid foot-shooting by
unsuspecting users.
- Add a comment in NOTES about experimental status of SCHED_ULE.
- Make warning about experimental status in sched_ule(4) a bit
  stronger.

Suggested and reviewed by:	dougb
Discussed on:			developers
MFC after:			3 days
2006-10-05 20:31:58 +00:00
Poul-Henning Kamp
add846a989 Use Calendrical Calculations from subr_clock.c instead of home copy&pasted. 2006-10-02 16:21:16 +00:00
Poul-Henning Kamp
b69f71eb29 Second part of a little cleanup in the calendar/timezone/RTC handling.
Split subr_clock.c in two parts (by repo-copy):
   subr_clock.c contains generic RTC and calendaric stuff. etc.
   subr_rtc.c contains the newbus'ified RTC interface.

Centralize the machdep.{adjkerntz,disable_rtc_set,wall_cmos_clock}
sysctls and associated variables into subr_clock.c.  They are
not machine dependent and we have generic code that relies on being
present so they are not even optional.
2006-10-02 15:42:02 +00:00
Poul-Henning Kamp
f645b0b51c First part of a little cleanup in the calendar/timezone/RTC handling.
Move relevant variables to <sys/clock.h> and fix #includes as necessary.

Use libkern's much more time- & spamce-efficient BCD routines.
2006-10-02 12:59:59 +00:00
Poul-Henning Kamp
c29ba5fe6e Remove the no longer relevant or correct bootinfo sysctls. 2006-09-30 10:08:09 +00:00
Ruslan Ermilov
9fddcc6661 Fix our ioctl(2) implementation when the argument is "int". New
ioctls passing integer arguments should use the _IOWINT() macro.
This fixes a lot of ioctl's not working on sparc64, most notable
being keyboard/syscons ioctls.

Full ABI compatibility is provided, with the bonus of fixing the
handling of old ioctls on sparc64.

Reviewed by:	bde (with contributions)
Tested by:	emax, marius
MFC after:	1 week
2006-09-27 19:57:02 +00:00
Ruslan Ermilov
6c9fdda750 Added COMPAT_FREEBSD6 option. 2006-09-26 12:36:34 +00:00
Jung-uk Kim
0da90eb878 Fix style nits. No md5 changes in .o's. ;-) 2006-09-08 21:46:01 +00:00
Warner Losh
c70759dcdd Add pc98 specific code to adjust the firmware geometry when it differs
from the actual geometry.  This enables support of disks larger than
~120GB on pc98 boxes.  They make great little network appliances.
I've been using these changes for the past year or so on my network
storage pc98 box :-).
2006-08-09 18:25:07 +00:00
Marcel Moolenaar
302981e72a Remove sio(4) and related options from MI files to amd64, i386
and pc98 MD files. Remove nodevice and nooption lines specific
to sio(4) from ia64, powerpc and sparc64 NOTES. There were no
such lines for arm yet.
sio(4) is usable on less than half the platforms, not counting
a future mips platform. Its presence in MI files is therefore
increasingly becoming a burden.
2006-07-29 18:38:54 +00:00
John Baldwin
19e9205a23 Simplify the pager support in DDB. Allowing different db commands to
install custom pager functions didn't actually happen in practice (they
all just used the simple pager and passed in a local quit pointer).  So,
just hardcode the simple pager as the only pager and make it set a global
db_pager_quit flag that db commands can check when the user hits 'q' (or a
suitable variant) at the pager prompt.  Also, now that it's easy to do so,
enable paging by default for all ddb commands.  Any command that wishes to
honor the quit flag can do so by checking db_pager_quit.  Note that the
pager can also be effectively disabled by setting $lines to 0.

Other fixes:
- 'show idt' on i386 and pc98 now actually checks the quit flag and
  terminates early.
- 'show intr' now actually checks the quit flag and terminates early.
2006-07-12 21:22:44 +00:00
Matt Jacob
626b06c711 Make the firmware assist driver resident in
preparation for isp using it.

Reviewed by:	sam, max
2006-07-09 16:41:22 +00:00
Sergey Babkin
d81175c738 Backed out the change by request from rwatson.
PR:		kern/14584
2006-06-26 22:03:22 +00:00
Sergey Babkin
7a799f1ef0 The common UID/GID space implementation. It has been discussed on -arch
in 1999, and there are changes to the sysctl names compared to PR,
according to that discussion. The description is in sys/conf/NOTES.
Lines in the GENERIC files are added in commented-out form.
I'll attach the test script I've used to PR.

PR:		kern/14584
Submitted by:	babkin
2006-06-25 18:37:44 +00:00
Alexander Leidinger
28a3ae7f88 Remove COMPAT_43 from GENERIC (and other kernel configs). For amd64 there's
an explicit comment that it's needed for the linuxolator. This is not the
case anymore. For all other architectures there was only a "KEEP THIS".
I'm (and other people too) running a COMPAT_43-less kernel since it's not
necessary anymore for the linuxolator. Roman is running such a kernel for a
for longer time. No problems so far. And I doubt other (newer than ia32
or alpha) architectures really depend on it.

This may result in a small performance increase for some workloads.

If the removal of COMPAT_43 results in a not working program, please
recompile it and all dependencies and try again before reporting a
problem.

The only place where COMPAT_43 is needed (as in: does not compile without
it) is in the (outdated/not usable since too old) svr4 code.

Note: this does not remove the COMPAT_43TTY option.

Nagging by:	rdivacky
2006-06-15 19:58:53 +00:00
Marius Strobl
acb8c14985 Make the ISAPNP code optional and only enable it on i386 and pc98 (used
for CBUS-PNP cards there) by default, as there are no amd64 and sparc64
machines with ISA slots and which therefore could make use of this code
known to exist. For sparc64 this additionally allows to get rid of the
compat shims for in{b,w,l}()/out{b,w,l}() etc and the associated hacks.

OK'ed by:	imp, peter
2006-06-12 21:07:13 +00:00
John Baldwin
e3d7caf487 Enable a few more things in x86 NOTES to get broader LINT coverage:
- Turn on iwi(4), ipw(4), and ndis(4) on amd64 and i386.
- Turn on ral(4) and ural(4) on i386, pc98, and amd64.
2006-06-12 20:38:17 +00:00
Warner Losh
78878cef94 Add the ability to subset the devices that UART pulls in. This allows
the arm to compile without all the extras that don't appear, at least
not in the flavors of ARM I deal with.  This helps us save about 100k.

If I've botched the available devices on a platform, please let me
know and I'll correct ASAP.
2006-06-12 04:21:50 +00:00
Yoshihiro Takahashi
261fe6f6c9 MFi386: revisions 1.627, 1.628 and 1.629. 2006-06-05 11:53:36 +00:00
Yoshihiro Takahashi
b6e3627ecb typo. 2006-05-27 04:40:41 +00:00
Poul-Henning Kamp
a67173a28a Aling to new console and gdb_port semantics 2006-05-26 13:33:28 +00:00
Marius Strobl
136eda1dc3 - Add C-bus and ISA front-ends for le(4) so it can actually replace
lnc(4) on PC98 and i386. The ISA front-end supports the same non-PNP
  network cards as lnc(4) did and additionally a couple of PNP ones.
  Like lnc(4), the C-bus front-end of le(4) only supports C-NET(98)S
  and is untested due to lack of such hardware, but given that's it's
  based on the respective lnc(4) and not too different from the ISA
  front-end it should be highly likely to work.
- Remove the descriptions of le(4), which where converted from lnc(4),
  from sys/i386/conf/NOTES and sys/pc98/conf/NOTES as there's a common
  one in sys/conf/NOTES.
2006-05-17 21:25:23 +00:00
Marius Strobl
dcaf1a3834 - As only the PCI front-end of le(4) is common to all platforms move its
entry to the PCI NICs section so it's in the same spot in all GENERIC
  config files.
- Add a note to the description of pcn(4) informing that is has precedence
  over le(4).
2006-05-17 20:44:01 +00:00
Poul-Henning Kamp
f6ce2a64f7 Send the pcvt(4) driver off to retirement. 2006-05-17 09:33:15 +00:00
Poul-Henning Kamp
c40da00ca3 Since DELAY() was moved, most <machine/clock.h> #includes have been
unnecessary.
2006-05-16 14:37:58 +00:00
Ruslan Ermilov
155d9f6a98 Kill more references to lnc(4).
Submitted by:	grep(1)
2006-05-16 12:15:39 +00:00
Yoshihiro Takahashi
7d11a60e60 Switch from the lnc driver to the le driver. But C-NET(98)S support is
dropped.
2006-05-15 11:15:34 +00:00
Poul-Henning Kamp
5405ab4889 Clean out sysctl machdep.* related defines.
The cmos clock related stuff should really be in MI code.
2006-05-11 17:29:25 +00:00
Doug Ambrisko
32397ce071 Add in linsysfs. A linux 2.6 like sys filesystem to pacify the Linux
LSI MegaRAID SAS utility.

Sponsored by:		IronPort Systems
Man page help from:	brueffer
2006-05-09 22:27:01 +00:00
Yoshihiro Takahashi
ecad9def1d Remove unneeded include. 2006-05-08 12:05:04 +00:00
Yoshihiro Takahashi
56c134bef1 - Move defines for PC-98 machine type from pc98/cbus/cbus.h into
pc98/pc98/pc98_machdep.h.
- Fix PC98_SYSTEM_PARAMETER_SIZE.
- Remove unused defines.
2006-05-08 12:03:58 +00:00
Yoshihiro Takahashi
9f61d3129a Add the ath and the wlan crypto support. 2006-05-08 11:55:57 +00:00
Marcel Moolenaar
64220a7e28 Rewrite of puc(4). Significant changes are:
o  Properly use rman(9) to manage resources. This eliminates the
   need to puc-specific hacks to rman. It also allows devinfo(8)
   to be used to find out the specific assignment of resources to
   serial/parallel ports.
o  Compress the PCI device "database" by optimizing for the common
   case and to use a procedural interface to handle the exceptions.
   The procedural interface also generalizes the need to setup the
   hardware (program chipsets, program clock frequencies).
o  Eliminate the need for PUC_FASTINTR. Serdev devices are fast by
   default and non-serdev devices are handled by the bus.
o  Use the serdev I/F to collect interrupt status and to handle
   interrupts across ports in priority order.
o  Sync the PCI device configuration to include devices found in
   NetBSD and not yet merged to FreeBSD.
o  Add support for Quatech 2, 4 and 8 port UARTs.
o  Add support for a couple dozen Timedia serial cards as found
   in Linux.
2006-04-28 21:21:53 +00:00
Marcel Moolenaar
cea4d8752f o Move ISA specific code from ppc.c to ppc_isa.c -- a bus front-
end for isa(4).
o  Add a seperate bus frontend for acpi(4) and allow ISA DMA for
   it when ISA is configured in the kernel. This allows acpi(4)
   attachments in non-ISA configurations, as is possible for ia64.
o  Add a seperate bus frontend for pci(4) and detect known single
   port parallel cards.
o  Merge PC98 specific changes under pc98/cbus into the MI driver.
   The changes are minor enough for conditional compilation and
   in this form invites better abstraction.
o  Have ppc(4) usabled on all platforms, now that ISA specifics
   are untangled enough.
2006-04-24 23:31:51 +00:00
Yoshihiro Takahashi
c64cc84500 Add minidump.h for pc98. 2006-04-21 12:13:59 +00:00
Yoshihiro Takahashi
23fc45b550 MFi386: revision 1.625. 2006-04-21 12:12:21 +00:00
John Baldwin
39092e79ed Don't allow userland to set hardware watch points on kernel memory at all.
Previously, we tried to allow this only for root.  However, we were calling
suser() on the *target* process rather than the current process.  This
means that if you can ptrace() a process running as root you can set a
hardware watch point in the kernel.  In practice I think you probably have
to be root in order to pass the p_candebug() checks in ptrace() to attach
to a process running as root anyway.  Rather than fix the suser(), I just
axed the entire idea, as I can't think of any good reason _at all_ for
userland to set hardware watch points for KVM.

MFC after:	3 days
Also thinks hardware watch points on KVM from userland are bad:	bde, rwatson
2006-03-14 16:13:55 +00:00
Yoshihiro Takahashi
ed40c5a34d MFi386: revision 1.1220. 2006-03-04 07:31:58 +00:00
John Baldwin
57fb5e6097 - Use bus_setup_intr() and bus_teardown_intr() to register device driver
interrupt handlers rather than BUS_SETUP_INTR() and BUS_TEARDOWN_INTR().
  Uses of the BUS_*() versions in the implementation of foo_intr methods
  in bus drivers were not changed.  Mostly this just means that some
  drivers might start printing diagnostic messages like [FAST] when
  appropriate as well as honoring mpsafenet=0.
- Fix two more of the ppbus drivers' identify routines to function
  correctly in the mythical case of a machine with more than one ppbus.
2006-02-22 18:16:26 +00:00
Yoshihiro Takahashi
d41b34d1cd MFi386: revision 1.622.
> Clear carry flag in get_mcontext so that setcontext does not
> return a bogus error.

MFC after:	3 days
2006-02-09 11:50:22 +00:00
Yoshihiro Takahashi
2afd016ce3 The asr driver was moved to NOTES for i386. So 'nodevice asr' is not
needed anymore.
2006-02-09 11:43:13 +00:00
Yoshihiro Takahashi
df55e78b6f MFi386: Enable the ce(4). 2006-02-02 11:14:13 +00:00
Poul-Henning Kamp
d3e64681d6 Move the old BSD4.3 tty compatibility from (!BURN_BRIDGES && COMPAT_43)
to COMPAT_43TTY.

Add COMPAT_43TTY to NOTES and */conf/GENERIC

Compile tty_compat.c only under the new option.

Spit out
	#warning "Old BSD tty API used, please upgrade."
if ioctl_compat.h gets #included from userland.
2006-01-10 09:19:10 +00:00
Warner Losh
d5e61c97a6 By popular demand, move __HAVE_ACPI and __PCI_REROUTE_INTERRUPT into
param.h.  Per request, I've placed these just after the
_NO_NAMESPACE_POLLUTION ifndef.  I've not renamed anything yet, but
may since we don't need the __.

Submitted by: bde, jhb, scottl, many others.
2006-01-09 06:05:57 +00:00
Warner Losh
501755f4f6 Define __HAVE_ACPI and/or __PCI_REROUTE_INTERRUPT, as appropriate for
each platform.  These will be used in the pci code in preference to
the complicated #ifdefs we have there now.
2006-01-01 20:59:28 +00:00
Yoshihiro Takahashi
3b52aaddac MFi386: revision 1.621 2005-12-26 12:46:36 +00:00
Yoshihiro Takahashi
d0873c5d1d Fix build error. 2005-12-23 12:14:55 +00:00
John Baldwin
b439e431bf Tweak how the MD code calls the fooclock() methods some. Instead of
passing a pointer to an opaque clockframe structure and requiring the
MD code to supply CLKF_FOO() macros to extract needed values out of the
opaque structure, just pass the needed values directly.  In practice this
means passing the pair (usermode, pc) to hardclock() and profclock() and
passing the boolean (usermode) to hardclock_cpu() and hardclock_process().
Other details:
- Axe clockframe and CLKF_FOO() macros on all architectures.  Basically,
  all the archs were taking a trapframe and converting it into a clockframe
  one way or another.  Now they can just extract the PC and usermode values
  directly out of the trapframe and pass it to fooclock().
- Renamed hardclock_process() to hardclock_cpu() as the latter is more
  accurate.
- On Alpha, we now run profclock() at hz (profhz == hz) rather than at
  the slower stathz.
- On Alpha, for the TurboLaser machines that don't have an 8254
  timecounter, call hardclock() directly.  This removes an extra
  conditional check from every clock interrupt on Alpha on the BSP.
  There is probably room for even further pruning here by changing Alpha
  to use the simplified timecounter we use on x86 with the lapic timer
  since we don't get interrupts from the 8254 on Alpha anyway.
- On x86, clkintr() shouldn't ever be called now unless using_lapic_timer
  is false, so add a KASSERT() to that affect and remove a condition
  to slightly optimize the non-lapic case.
- Change prototypeof  arm_handler_execute() so that it's first arg is a
  trapframe pointer rather than a void pointer for clarity.
- Use KCOUNT macro in profclock() to lookup the kernel profiling bucket.

Tested on:	alpha, amd64, arm, i386, ia64, sparc64
Reviewed by:	bde (mostly)
2005-12-22 22:16:09 +00:00
Yoshihiro Takahashi
6a901529f5 Enable the cs and disable the amdsmb and nfsmb on pc98. 2005-12-22 16:16:42 +00:00
Warner Losh
b0493a9984 Move device 'cs' into i386/pc98 specific NOTES. It is broken on ppc
because it uses i386 specific calls.  Maybe it could be added to
amd64, but I'm not so sure it would work there so I've not added it
there.
2005-12-20 23:00:11 +00:00
Yoshihiro Takahashi
b8a8ce140f Merged from sys/dev/sio/sio.c revision 1.463. 2005-12-18 11:16:31 +00:00
Yoshihiro Takahashi
944b597264 Switch MACHINE to "pc98" on FreeBSD/pc98.
Add copyright.

Approved by:	FreeBSD/pc98 development team.
2005-12-08 12:35:12 +00:00
Ruslan Ermilov
5219ffdbe0 cpp(1) only understand integer arithmetical expressions, so
_MACHINE == i386 test always succeeds, even on non-i386 (both
sides of expressions become 0).  Remove the comment since
_MACHINE and _MACHINE_ARCH are going away.
2005-12-06 13:22:14 +00:00
Ruslan Ermilov
44e09d2fa2 Fix -Wundef warnings from compiling GENERIC and LINT kernels of
all architectures.
2005-12-06 11:19:37 +00:00
Ruslan Ermilov
342ed5d948 Fix -Wundef warnings found when compiling i386 LINT, GENERIC and
custom kernels.
2005-12-05 11:58:35 +00:00
Yoshihiro Takahashi
54586e49a3 MFi386: revision 1.1215 (add savagedrm). 2005-11-30 11:58:01 +00:00
Ruslan Ermilov
6646524f34 - Allow duplicate "machine" directives with the same arguments.
- Move existing "machine" directives to DEFAULTS.
2005-11-27 23:17:00 +00:00
Ruslan Ermilov
1a581012df Add missing "struct" in i386/i386/machdep.c,v 1.497 by deischen@. 2005-11-24 08:16:18 +00:00
John Baldwin
1dab802e37 Garbage collect machine/smptests.h now that it is empty and no longer used. 2005-11-22 22:55:48 +00:00
John Baldwin
7417e80b4e Don't enable PUC_FASTINTR by default in the source. Instead, enable it
via the DEFAULTS kernel configs.  This allows folks to turn it that option
off in the kernel configs if desired without having to hack the source.
This is especially useful since PUC_FASTINTR hangs the kernel boot on my
ultra60 which has two uart(4) devices hung off of a puc(4) device.

I did not enable PUC_FASTINTR by default on powerpc since powerpc does not
currently allow sharing of INTR_FAST with non-INTR_FAST like the other
archs.
2005-11-21 20:22:35 +00:00
Yoshihiro Takahashi
643d537fcd MFi386: Remove obsolete options. 2005-11-09 12:26:37 +00:00
Yoshihiro Takahashi
4cf092a1fa Move the isa, npx, mem and io devices and the PC98 option from GENERIC
into DEFAULTS.
2005-10-28 15:30:51 +00:00
Ruslan Ermilov
c9003bc7fa Catch up with new interrupt handling code. 2005-10-26 06:44:59 +00:00
John Baldwin
58553b9925 Rename the KDB_STOP_NMI kernel option to STOP_NMI and make it apply to all
IPI_STOP IPIs.
- Change the i386 and amd64 MD IPI code to send an NMI if STOP_NMI is
  enabled if an attempt is made to send an IPI_STOP IPI.  If the kernel
  option is enabled, there is also a sysctl to change the behavior at
  runtime (debug.stop_cpus_with_nmi which defaults to enabled).  This
  includes removing stop_cpus_nmi() and making ipi_nmi_selected() a
  private function for i386 and amd64.
- Fix ipi_all(), ipi_all_but_self(), and ipi_self() on i386 and amd64 to
  properly handle bitmapped IPIs as well as IPI_STOP IPIs when STOP_NMI is
  enabled.
- Fix ipi_nmi_handler() to execute the restart function on the first CPU
  that is restarted making use of atomic_readandclear() rather than
  assuming that the BSP is always included in the set of restarted CPUs.
  Also, the NMI handler didn't clear the function pointer meaning that
  subsequent stop and restarts could execute the function again.
- Define a new macro HAVE_STOPPEDPCBS on i386 and amd64 to control the use
  of stoppedpcbs[] and always enable it for i386 and amd64 instead of
  being dependent on KDB_STOP_NMI.  It works fine in both the NMI and
  non-NMI cases.
2005-10-24 21:04:19 +00:00
Poul-Henning Kamp
733634738e Eliminate two unused arguments to ttycreate(). 2005-10-16 20:22:56 +00:00
Yoshihiro Takahashi
cb614592cf Reduce diffs from i386/i386/machdep.c 2005-10-16 12:33:14 +00:00
John Baldwin
4fdd2813ff Merge over the remaining changes from i386 of the ksiginfo_t changes so
that this compiles.

Pointy hat to:	davidxu
2005-10-14 22:03:39 +00:00
John Baldwin
021eda1d85 Remove the sx(4) driver at the request of the author. The author
originally wrote it for 4.x and hasn't really had the time to fully update
it to 5.x and later.  Also, the author doesn't use the hardware anymore as
well.  If someone does need this driver they can always resurrect it from
the Attic.

Requested by:	Frank Mayhar frank at exit dot com
2005-10-14 18:24:58 +00:00
David Xu
9104847f21 1. Change prototype of trapsignal and sendsig to use ksiginfo_t *, most
changes in MD code are trivial, before this change, trapsignal and
   sendsig use discrete parameters, now they uses member fields of
   ksiginfo_t structure. For sendsig, this change allows us to pass
   POSIX realtime signal value to user code.

2. Remove cpu_thread_siginfo, it is no longer needed because we now always
   generate ksiginfo_t data and feed it to libpthread.

3. Add p_sigqueue to proc structure to hold shared signals which were
   blocked by all threads in the proc.

4. Add td_sigqueue to thread structure to hold all signals delivered to
   thread.

5. i386 and amd64 now return POSIX standard si_code, other arches will
   be fixed.

6. In this sigqueue implementation, pending signal set is kept as before,
   an extra siginfo list holds additional siginfo_t data for signals.
   kernel code uses psignal() still behavior as before, it won't be failed
   even under memory pressure, only exception is when deleting a signal,
   we should call sigqueue_delete to remove signal from sigqueue but
   not SIGDELSET. Current there is no kernel code will deliver a signal
   with additional data, so kernel should be as stable as before,
   a ksiginfo can carry more information, for example, allow signal to
   be delivered but throw away siginfo data if memory is not enough.
   SIGKILL and SIGSTOP have fast path in sigqueue_add, because they can
   not be caught or masked.
   The sigqueue() syscall allows user code to queue a signal to target
   process, if resource is unavailable, EAGAIN will be returned as
   specification said.
   Just before thread exits, signal queue memory will be freed by
   sigqueue_flush.
   Current, all signals are allowed to be queued, not only realtime signals.

Earlier patch reviewed by: jhb, deischen
Tested on: i386, amd64
2005-10-14 12:43:47 +00:00
Gleb Smirnoff
9c26aa3c12 Polling is now configured with help of ifconfig(8), not sysctl.
Prodded by:     maxim
2005-10-07 09:23:51 +00:00
Yoshihiro Takahashi
ea7d61cd29 Use 'PC Card' 2005-09-30 13:17:54 +00:00
Yoshihiro Takahashi
819766797e Switch from OLDCARD to NEWCARD on pc98. 2005-09-27 13:10:24 +00:00
Warner Losh
f31f999d7d Remove references to OLDCARD. 2005-09-25 21:26:09 +00:00
Christian S.J. Peron
33cdc78d01 Introduce a kernel config for the Mandatory Access Control framework.
This kernel config briefly describes some of the major MAC policies
available on FreeBSD. The hope is that this will raise the awareness
about MAC and get more people interested.

Discussed with:	scottl
2005-09-18 03:15:36 +00:00
Yoshihiro Takahashi
f7b1bf814d Add some defines for EPSON machines and use them. 2005-09-14 12:42:39 +00:00
Yoshihiro Takahashi
42244f27c2 Remove EPSON PC-386 note A/W/AE/WR support. 2005-09-14 12:39:06 +00:00
Yoshihiro Takahashi
74a91701b2 Remove unused functions. 2005-09-13 11:34:07 +00:00
Yoshihiro Takahashi
e3dd1d33b2 Remove EPSON_NRDISK support. 2005-09-13 11:33:25 +00:00
Yoshihiro Takahashi
4f6c3d8332 MFi386: revision 1.1204. 2005-07-21 11:13:12 +00:00
Ken Smith
22e59cec3b Add recently invented COMPAT_FREEBSD5 option.
MFC after:	3 days
2005-07-14 15:39:06 +00:00
John Baldwin
db015a9153 Fixup some more fallout from the lapic/i8254 changes:
- Make sure timer0_max_count is set to a correct value in the lapic case.
- Revert i8254_restore() to explicitly reprogram timer 0 rather than
  calling set_timer_freq() to do it.  set_timer_freq() only reprograms
  the counter if the max count changes which it never does on resume.  This
  unbreaks suspend/resume for several people.

Tested by:	marks, others
Reviewed by:	bde
MFC after:	3 days
2005-07-13 15:43:21 +00:00
Yoshihiro Takahashi
501bf5644b MFi386: revision 1.617. 2005-07-13 12:06:57 +00:00
John Baldwin
623b1a868e Remove a || 1 that crept into the i8254 commit and was subsequently
copied and pasted.  I had actually tested without this change in my
trees as had the other testers.

Reported by:	bde, Rostislav Krasny rosti dot bsd at gmail dot com
Approved by:	re (scottl)
Pointy hat to:	jhb
2005-07-05 20:13:12 +00:00
Yoshihiro Takahashi
811d79106f MFi386: r1.221 (Use a simpler implementation for the i8254 timecounter).
Approved by:	re (scottl)
2005-07-03 14:19:29 +00:00
Xin LI
60baed3742 Remove the CPU_ENABLE_SSE option from the i386 and pc98 architectures,
as they are already default for I686_CPU for almost 3 years, and
CPU_DISABLE_SSE always disables it.  On the other hand, CPU_ENABLE_SSE
does not work for I486_CPU and I586_CPU.

This commit has:
	- Removed the option from conf/options.*
	- Removed the option and comments from MD NOTES files
	- Simplified the CPU_ENABLE_SSE ifdef's so they don't
	  deal with CPU_ENABLE_SSE from kernel configuration. (*)

For most users, this commit should be largely no-op.  If you used to
place CPU_ENABLE_SSE into your kernel configuration for some reason,
it is time to remove it.

(*) The ifdef's of CPU_ENABLE_SSE are not removed at this point, since
    we need to change it to !defined(CPU_DISABLE_SSE) && defined(I686_CPU),
    not just !defined(CPU_DISABLE_SSE), if we really want to do so.

Discussed on:	-arch
Approved by:	re (scottl)
2005-07-02 20:06:44 +00:00
Yoshihiro Takahashi
aa6218d73b MFi386: revision 1.615 (change kernel crashdump format to ELF).
Approved by:	re (scottl)
2005-06-30 15:26:03 +00:00
Jean-Sébastien Pédron
aa84cd8e9e Connect reiserfs build to every platforms, not only i386 and pc98.
Reviewed by:	mux (mentor)
Approved by:	re (dougb)
2005-06-21 12:59:53 +00:00
David E. O'Brien
c3e0dfa1f8 Add .cvsignore files just like in sys/<arch>/compiled, this keeps CVS from
questing kernel config files not in CVS.

Approved by:	re(kensmith)
2005-06-20 16:52:59 +00:00
Yoshihiro Takahashi
6fd53a4f81 Sync with syscons update (Add new member to struct sc_rndr_sw). 2005-05-29 11:53:14 +00:00
Yoshihiro Takahashi
d4fcf3cba5 Remove bus_{mem,p}io.h and related code for a micro-optimization on i386
and amd64.  The optimization is a trivial on recent machines.

Reviewed by:	-arch (imp, marcel, dfr)
2005-05-29 04:42:30 +00:00
Yoshihiro Takahashi
f7965374d4 Change the spkr_set_pitch() function to a macro to fix low level profiling. 2005-05-28 13:40:27 +00:00
Yoshihiro Takahashi
6ff766dcdf MFi386: Add ReiserFS 2005-05-25 12:32:06 +00:00
Damien Bergamini
0b090f4153 Add new ral(4) and ural(4) drivers.
Approved by:	silby (mentor)
2005-05-24 16:48:07 +00:00
Yoshihiro Takahashi
914ee8ba4b Fix my copyright. 2005-05-14 10:51:16 +00:00
Yoshihiro Takahashi
b22bf66063 - Move bus dependent defines to {isa,cbus}_dmareg.h.
- Use isa/isareg.h rather than <arch>/isa/isa.h.

Tested on: i386, pc98
2005-05-14 10:14:56 +00:00
Yoshihiro Takahashi
24072ca35b - Move timerreg.h to <arch>/include and split i8253 specific defines into
i8253reg.h, and add some defines to control a speaker.
- Move PPI related defines from i386/isa/spkr.c into ppireg.h and use them.
- Move IO_{PPI,TIMER} defines into ppireg.h and timerreg.h respectively.
- Use isa/isareg.h rather than <arch>/isa/isa.h.

Tested on: i386, pc98
2005-05-14 09:10:02 +00:00
Yoshihiro Takahashi
bc3729b63f MFi386: revision 1.614. 2005-05-14 08:52:04 +00:00
Yoshihiro Takahashi
77bcc9ce35 Move the pc98 keymap define into pckbdtables.h because it should be used
only on the pckbd driver.
2005-05-12 13:39:31 +00:00
Yoshihiro Takahashi
164e09ddb4 - Move the NPX_DEBUG option to options.{i386,pc98} and use opt_npx.h.
- Move npx related defines to {i386,pc98}/include/npx.h to remove #include
  {isa,cbus}.h.
2005-05-12 12:47:41 +00:00
Yoshihiro Takahashi
257d63789e - Move lptreg.h into pc98/cbus and rename to olptreg.h.
- Remove ifdef pc98.
2005-05-10 12:30:30 +00:00
Yoshihiro Takahashi
d1725ef7ff Change a directory layout for pc98.
- Move MD files into <arch>/<arch>.
  - Move bus dependent files into <arch>/<bus>.
Rename some files to more suitable names.

Repo-copied by:	peter
Discussed with:	imp
2005-05-10 12:02:18 +00:00
Yoshihiro Takahashi
fb4c2dbf41 MFi386: revision 1.1198 (add KDB_STOP_NMI option). 2005-05-01 04:00:12 +00:00
Marcel Moolenaar
d47cce3ec8 Revert previous commit: The hwpmc(4) driver compiles on all platforms. 2005-04-20 22:19:51 +00:00
Yoshihiro Takahashi
10687779a9 Rename from apm_bioscall.s to apm_bioscall.S for removing a special rule
to build a module.  A repo-copy is not done because it has no important logs.

Pointed out by: ru
2005-04-20 12:28:20 +00:00
Warner Losh
f13ea502b5 Move this to the specific architectures that are supported. #ifdef foo
in sys/pmc.h precludes it from working on !i386, !amd64.  When that changes,
it can be moved back into conf/NOTES.
2005-04-19 22:16:46 +00:00
Warner Losh
bfe85d43c0 There's no need to include all the detauls of struct bus_space_{tag,handle}
in _bus.h when the typedef of the struct pointer will do.
2005-04-19 21:07:00 +00:00
Warner Losh
a32057cea5 Since pmc is a CPU feature, grab the mdep file from the i386 directory. 2005-04-19 21:06:06 +00:00
Warner Losh
5b930f51c9 Unbreak the pc98 build by including enough information in the _bus.h
for _bus.h to compile.

Pointy hat to: imp
Breakage noted by: nyan-san
2005-04-19 03:19:19 +00:00
Warner Losh
06db52b609 Break out the definition of bus_space_{tag,handle}_t and a few other types
into _bus.h to help with name space polution from including all of bus.h.
In a few days, I'll commit changes to the MI code to take advantage of thse
sepration (after I've made sure that these changes don't break anything in
the main tree, I've tested in my trees, but you never know...).

Suggested by: bde (in 2002 or 2003 I think)
Reviewed in principle by: jhb
2005-04-18 21:45:34 +00:00
Yoshihiro Takahashi
3033cea56c MFi386: revision 1.1194 (Update the drm driver). 2005-04-17 10:43:43 +00:00
Yoshihiro Takahashi
19983c91ba Remove unneeded include. 2005-04-17 09:44:17 +00:00
John Baldwin
133539f2aa Really remove the last vestiges of mixed mode from all but amd64. 2005-04-15 06:56:52 +00:00
Yoshihiro Takahashi
6ed58b70cf MFi386: revision 1.612. 2005-04-14 14:19:47 +00:00
Yoshihiro Takahashi
ce45d2c162 - Remove ifdef PC98.
- Reduce diffs from i386.
2005-04-13 13:26:48 +00:00
Yoshihiro Takahashi
aaaf1a6d53 Remove a meaningless include. 2005-04-13 13:18:32 +00:00
Yoshihiro Takahashi
91649ac9bd Move pc98 specific parts to the pc98 specific file. 2005-04-13 13:12:12 +00:00
Yoshihiro Takahashi
07665b88f4 Oops, correct typo. 2005-04-10 03:36:13 +00:00
Yoshihiro Takahashi
afa7e54ab7 Fix pc98 includes. 2005-04-08 03:38:13 +00:00
Yoshihiro Takahashi
cefad5bb41 Remove the wl driver. The devices don't work on pc98. 2005-04-08 03:36:32 +00:00
John Baldwin
c6a37e8413 Divorce critical sections from spinlocks. Critical sections as denoted by
critical_enter() and critical_exit() are now solely a mechanism for
deferring kernel preemptions.  They no longer have any affect on
interrupts.  This means that standalone critical sections are now very
cheap as they are simply unlocked integer increments and decrements for the
common case.

Spin mutexes now use a separate KPI implemented in MD code: spinlock_enter()
and spinlock_exit().  This KPI is responsible for providing whatever MD
guarantees are needed to ensure that a thread holding a spin lock won't
be preempted by any other code that will try to lock the same lock.  For
now all archs continue to block interrupts in a "spinlock section" as they
did formerly in all critical sections.  Note that I've also taken this
opportunity to push a few things into MD code rather than MI.  For example,
critical_fork_exit() no longer exists.  Instead, MD code ensures that new
threads have the correct state when they are created.  Also, we no longer
try to fixup the idlethreads for APs in MI code.  Instead, each arch sets
the initial curthread and adjusts the state of the idle thread it borrows
in order to perform the initial context switch.

This change is largely a big NOP, but the cleaner separation it provides
will allow for more efficient alternative locking schemes in other parts
of the kernel (bare critical sections rather than per-CPU spin mutexes
for per-CPU data for example).

Reviewed by:	grehan, cognet, arch@, others
Tested on:	i386, alpha, sparc64, powerpc, arm, possibly more
2005-04-04 21:53:56 +00:00
Warner Losh
b756200647 Move pc98 specific parts to the pc98 specific file. 2005-04-03 23:27:11 +00:00