History log of /freebsd-10.0-release/sys/pc98/pc98/machdep.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 259065 07-Dec-2013 gjb

- Copy stable/10 (r259064) to releng/10.0 as part of the
10.0-RELEASE cycle.
- Update __FreeBSD_version [1]
- Set branch name to -RC1

[1] 10.0-CURRENT __FreeBSD_version value ended at '55', so
start releng/10.0 at '100' so the branch is started with
a value ending in zero.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 258559 25-Nov-2013 emaste

MFC r258135: x86: Allow users to change PSL_RF via ptrace(PT_SETREGS...)

Debuggers may need to change PSL_RF. Note that tf_eflags is already stored
in the signal context during signal handling and PSL_RF previously could
be modified via sigreturn, so this change should not provide any new
ability to userspace.

For background see the thread at:
http://lists.freebsd.org/pipermail/freebsd-i386/2007-September/005910.html

Reviewed by: jhb, kib

Sponsored by: DARPA, AFRL
Approved by: re (gjb)


# 256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


# 254663 22-Aug-2013 jkim

MFi386: r254619

Reimplement atomic_load_acq_64() and atomic_store_rel_64() for i386.

Noticed by: tinderbox


# 254025 07-Aug-2013 jeff

Replace kernel virtual address space allocation with vmem. This provides
transparent layering and better fragmentation.

- Normalize functions that allocate memory to use kmem_*
- Those that allocate address space are named kva_*
- Those that operate on maps are named kmap_*
- Implement recursive allocation handling for kmem_arena in vmem.

Reviewed by: alc
Tested by: pho
Sponsored by: EMC / Isilon Storage Division


# 251222 01-Jun-2013 nyan

MFi386: revision 251039

Use slightly more idiomatic expression to get the address of array.


# 248084 09-Mar-2013 attilio

Switch the vm_object mutex to be a rwlock. This will enable in the
future further optimizations where the vm_object lock will be held
in read mode most of the time the page cache resident pool of pages
are accessed for reading purposes.

The change is mostly mechanical but few notes are reported:
* The KPI changes as follow:
- VM_OBJECT_LOCK() -> VM_OBJECT_WLOCK()
- VM_OBJECT_TRYLOCK() -> VM_OBJECT_TRYWLOCK()
- VM_OBJECT_UNLOCK() -> VM_OBJECT_WUNLOCK()
- VM_OBJECT_LOCK_ASSERT(MA_OWNED) -> VM_OBJECT_ASSERT_WLOCKED()
(in order to avoid visibility of implementation details)
- The read-mode operations are added:
VM_OBJECT_RLOCK(), VM_OBJECT_TRYRLOCK(), VM_OBJECT_RUNLOCK(),
VM_OBJECT_ASSERT_RLOCKED(), VM_OBJECT_ASSERT_LOCKED()
* The vm/vm_pager.h namespace pollution avoidance (forcing requiring
sys/mutex.h in consumers directly to cater its inlining functions
using VM_OBJECT_LOCK()) imposes that all the vm/vm_pager.h
consumers now must include also sys/rwlock.h.
* zfs requires a quite convoluted fix to include FreeBSD rwlocks into
the compat layer because the name clash between FreeBSD and solaris
versions must be avoided.
At this purpose zfs redefines the vm_object locking functions
directly, isolating the FreeBSD components in specific compat stubs.

The KPI results heavilly broken by this commit. Thirdy part ports must
be updated accordingly (I can think off-hand of VirtualBox, for example).

Sponsored by: EMC / Isilon storage division
Reviewed by: jeff
Reviewed by: pjd (ZFS specific review)
Discussed with: alc
Tested by: pho


# 247454 28-Feb-2013 davide

MFcalloutng:
When CPU becomes idle, cpu_idleclock() calculates time to the next timer
event in order to reprogram hw timer. Return that time in sbintime_t to
the caller and pass it to acpi_cpu_idle(), where it can be used as one
more factor (quite precise) to extimate furter sleep time and choose
optimal sleep state. This is a preparatory change for further callout
improvements will be committed in the next days.

The commmit is not targeted for MFC.


# 242869 10-Nov-2012 nyan

Reduce diffs against i386.


# 242868 10-Nov-2012 nyan

Fix some KASSERTs.
They are missing changes from r208833, r227394 and r227442.


# 242867 10-Nov-2012 nyan

MFi386: r211924

Register an interrupt vector for DTrace return probes.


# 241880 22-Oct-2012 eadler

The 'testing memory' patch gets printed too many times

Approved by: cperciva (implicit)


# 241850 22-Oct-2012 eadler

Explain the upcoming delay by printing a message when the kernel
is about to begin testing memory.

Reviewed by: dteske, adri
Approved by: cperciva
MFC after: 1 week


# 241371 09-Oct-2012 attilio

Reverts r234074,234105,234564,234723,234989,235231-235232 and part of
r234247.
Use, instead, the static intializer introduced in r239923 for x86 and
sparc64 intr_cpus, unwinding the code to the initial version.

Reviewed by: marius


# 240855 23-Sep-2012 nyan

MFi386: revision 237445

Commit changes missed from r237435. Properly calculate the signal
trampoline addresses after the shared page is enabled. Handle FreeBSD
ABIs without shared page support too.

MFi386: revision 238792

Introduce curpcb magic variable.


# 238310 09-Jul-2012 jhb

Partially revert r217515 so that the mem_range_softc variable is always
present on x86 kernels. This fixes the build of kernels that include
'device acpi' but do not include 'device mem'.

MFC after: 1 month


# 235622 18-May-2012 iwasaki

Add SMP/i386 suspend/resume support.
Most part is merged from amd64.

- i386/acpica/acpi_wakecode.S
Replaced with amd64 code (from realmode to paging enabling code).

- i386/acpica/acpi_wakeup.c
Replaced with amd64 code (except for wakeup_pagetables stuff).

- i386/include/pcb.h
- i386/i386/genassym.c
Added PCB new members (CR0, CR2, CR4, DS, ED, FS, SS, GDT, IDT, LDT
and TR) needed for suspend/resume, not for context switch.

- i386/i386/swtch.s
Added suspendctx() and resumectx().
Note that savectx() was not changed and used for suspending (while
amd64 code uses it).
BSP and AP execute the same sequence, suspendctx(), acpi_wakecode()
and resumectx() for suspend/resume (in case of UP system also).

- i386/i386/apic_vector.s
Added cpususpend().

- i386/i386/mp_machdep.c
- i386/include/smp.h
Added cpususpend_handler().

- i386/include/apicvar.h
- kern/subr_smp.c
- sys/smp.h
Added IPI_SUSPEND and suspend_cpus().

- i386/i386/initcpu.c
- i386/i386/machdep.c
- i386/include/md_var.h
- pc98/pc98/machdep.c
Moved initializecpu() declarations to md_var.h.

MFC after: 3 days


# 234723 26-Apr-2012 attilio

Clean up the intr* MD KPI from the SMP dependency, removing a cause of
discrepancy between modules and kernel, but deal with SMP differences
within the functions themselves.

As an added bonus this also helps in terms of code readability.

Requested by: gibbs
Reviewed by: jhb, marius
MFC after: 1 week


# 234564 22-Apr-2012 nyan

MFi386: revisions 234074 and 234105

- Adding the BSP as an interrupt target directly in cpu_startup().


# 233031 16-Mar-2012 nyan

- Fix to build a native i386 kernel without the SMP and atpic.
- Merge r232744 changes to pc98.
(Allow a kernel to be built with 'nodevice atpic'.)
- Move ICU related defines from x86/isa/atpic.c to x86/isa/icu.h and
use them in x86/x86/intr_machdep.c.

Reviewed by: jhb


# 230426 21-Jan-2012 kib

Add support for the extended FPU states on amd64, both for native
64bit and 32bit ABIs. As a side-effect, it enables AVX on capable
CPUs.

In particular:

- Query the CPU support for XSAVE, list of the supported extensions
and the required size of FPU save area. The hw.use_xsave tunable is
provided for disabling XSAVE, and hw.xsave_mask may be used to
select the enabled extensions.

- Remove the FPU save area from PCB and dynamically allocate the
(run-time sized) user save area on the top of the kernel stack,
right above the PCB. Reorganize the thread0 PCB initialization to
postpone it after BSP is queried for save area size.

- The dumppcb, stoppcbs and susppcbs now do not carry the FPU state as
well. FPU state is only useful for suspend, where it is saved in
dynamically allocated suspfpusave area.

- Use XSAVE and XRSTOR to save/restore FPU state, if supported and
enabled.

- Define new mcontext_t flag _MC_HASFPXSTATE, indicating that
mcontext_t has a valid pointer to out-of-struct extended FPU
state. Signal handlers are supplied with stack-allocated fpu
state. The sigreturn(2) and setcontext(2) syscall honour the flag,
allowing the signal handlers to inspect and manipilate extended
state in the interrupted context.

- The getcontext(2) never returns extended state, since there is no
place in the fixed-sized mcontext_t to place variable-sized save
area. And, since mcontext_t is embedded into ucontext_t, makes it
impossible to fix in a reasonable way. Instead of extending
getcontext(2) syscall, provide a sysarch(2) facility to query
extended FPU state.

- Add ptrace(2) support for getting and setting extended state; while
there, implement missed PT_I386_{GET,SET}XMMREGS for 32bit binaries.

- Change fpu_kern KPI to not expose struct fpu_kern_ctx layout to
consumers, making it opaque. Internally, struct fpu_kern_ctx now
contains a space for the extended state. Convert in-kernel consumers
of fpu_kern KPI both on i386 and amd64.

First version of the support for AVX was submitted by Tim Bird
<tim.bird am sony com> on behalf of Sony. This version was written
from scratch.

Tested by: pho (previous version), Yamagi Burmeister <lists yamagi org>
MFC after: 1 month


# 225977 04-Oct-2011 nyan

MFi386: revision 225936

Add some improvements in the idle table callbacks:
- Replace instances of manual assembly instruction "hlt" call
with halt() function calling.
- In cpu_idle_mwait() avoid races in check to sched_runnable() using
the same pattern used in cpu_idle_hlt() with the 'hlt' instruction.
- Add comments explaining the logic behind the pattern used in
cpu_idle_hlt() and other idle callbacks.


# 225617 16-Sep-2011 kmacy

In order to maximize the re-usability of kernel code in user space this
patch modifies makesyscalls.sh to prefix all of the non-compatibility
calls (e.g. not linux_, freebsd32_) with sys_ and updates the kernel
entry points and all places in the code that use them. It also
fixes an additional name space collision between the kernel function
psignal and the libc function of the same name by renaming the kernel
psignal kern_psignal(). By introducing this change now we will ease future
MFCs that change syscalls.

Reviewed by: rwatson
Approved by: re (bz)


# 225048 20-Aug-2011 bz

In HEAD when doing no further checkes there is no reason use the
temporary variable and check with if as TUNABLE_*_FETCH do not
alter values unless successfully found the tunable.

Reported by: jhb, bde
MFC after: 3 days
X-MFC with: r224516
Approved by: re (kib)


# 224516 30-Jul-2011 bz

Introduce a tunable to disable the time consuming parts of bootup
memtesting, which can easily save seconds to minutes of boot time.
The tunable name is kept general to allow reusing the code in
alternate frameworks.

Requested by: many
Discussed on: arch (a while a go)
Obtained from: Sandvine Incorporated
Reviewed by: sbruno
Approved by: re (kib)
MFC after: 2 weeks


# 222853 08-Jun-2011 avg

remove code for dynamic offlining/onlining of CPUs on x86

The code has definitely been broken for SCHED_ULE, which is a default
scheduler. It may have been broken for SCHED_4BSD in more subtle ways,
e.g. with manually configured CPU affinities and for interrupt devilery
purposes.
We still provide a way to disable individual CPUs or all hyperthreading
"twin" CPUs before SMP startup. See the UPDATING entry for details.

Interaction between building CPU topology and disabling CPUs still
remains fuzzy: topology is first built using all availble CPUs and then
the disabled CPUs should be "subtracted" from it. That doesn't work
well if the resulting topology becomes non-uniform.

This work is done in cooperation with Attilio Rao who in addition to
reviewing also provided parts of code.

PR: kern/145385
Discussed with: gcooper, ambrisko, mdf, sbruno
Reviewed by: attilio
Tested by: pho, pluknet
X-MFC after: never


# 220583 12-Apr-2011 jkim

Reinstate cpu_est_clockrate() support for P-state invariant TSC if APERF and
MPERF MSRs are available. It was disabled in r216443. Remove the earlier
hack to subtract 0.5% from the calibrated frequency as DELAY(9) is little
bit more reliable now.


# 220433 07-Apr-2011 jkim

Use atomic load & store for TSC frequency. It may be overkill for amd64 but
safer for i386 because it can be easily over 4 GHz now. More worse, it can
be easily changed by user with 'machdep.tsc_freq' tunable (directly) or
cpufreq(4) (indirectly). Note it is intentionally not used in performance
critical paths to avoid performance regression (but we should, in theory).
Alternatively, we may add "virtual TSC" with lower frequency if maximum
frequency overflows 32 bits (and ignore possible incoherency as we do now).


# 220404 06-Apr-2011 jkim

Implement atomic_load_acq_64(9) and atomic_store_rel_64(9) for i386. These
functions are implemented with CMPXCHG8B instruction where it is available,
i. e., all Pentium-class and later processors. Note this instruction is
also used for atomic_store_rel_64() because a simple XCHG-like instruction
for 64-bit memory access does not exist, unfortunately. If the processor
lacks the instruction, i. e., 80486-class CPUs, two 32-bit load/store are
performed with interrupt temporarily disabled, assuming it does not support
SMP. Although this assumption may be little naive, it is true in reality.
This implementation is inspired by Linux.


# 219673 15-Mar-2011 jkim

Deprecate tsc_present as the last of its real consumers finally disappeared.


# 219473 10-Mar-2011 jkim

Add a tunable "machdep.disable_tsc" to turn off TSC. Specifically, it turns
off boot-time CPU frequency calibration, DELAY(9) with TSC, and using TSC as
a CPU ticker. Note tsc_present does not change by this tunable.


# 219461 10-Mar-2011 jkim

Deprecate rarely used tsc_is_broken. Instead, we zero out tsc_freq because
it is almost always used with tsc_freq any way.


# 218843 19-Feb-2011 nyan

MFi386: revision 218744

To avoid excessive code duplication create wrapper for fill regs
from stack frame.


# 218391 07-Feb-2011 nyan

MFi386: revision 218329

Fix linking of the kernel without device npx.


# 218390 07-Feb-2011 nyan

MFi386: revision 218327

Clear the padding when returning context to the usermode, for
MI ucontext_t and x86 MD parts.
Kernel allocates the structures on the stack, and not clearing
reserved fields and paddings causes leakage.


# 218389 07-Feb-2011 nyan

MFi386: revision 217886

Set td_kstack_pages for thread0.


# 217688 21-Jan-2011 pluknet

Make MSGBUF_SIZE kernel option a loader tunable kern.msgbufsize.

Submitted by: perryh pluto.rain.com (previous version)
Reviewed by: jhb
Approved by: kib (mentor)
Tested by: universe


# 217539 18-Jan-2011 nyan

MFi386: revision 217515

The mem_range_softc is defined in mem.c.


# 216892 02-Jan-2011 gavin

MFi386 r216012 by kib:

Calling fill_fpregs() for curthread is legitimate, and ELF coredump
does this.

Discussed with: kib
MFC after: 3 days


# 216312 08-Dec-2010 jkim

Do not subtract 0.5% from estimated frequency if DELAY(9) is driven by TSC.
Remove a confusing comment about converting to MHz as we never did.


# 215865 26-Nov-2010 kib

Remove npxgetregs(), npxsetregs(), fpugetregs() and fpusetregs()
functions, they are unused. Remove 'user' from npxgetuserregs()
etc. names.

For {npx,fpu}{get,set}regs(), always use pcb->pcb_user_save for FPU
context storage. This eliminates the need for ugly copying with
overwrite of the newly added and reserved fields in ucontext on i386
to satisfy alignment requirements for fpusave() and fpurstor().

pc98 version was copied from i386.

Suggested and reviewed by: bde
Tested by: pho (i386 and amd64)
MFC after: 1 week


# 214835 05-Nov-2010 jhb

Adjust the order of operations in spinlock_enter() and spinlock_exit() to
work properly with single-stepping in a kernel debugger. Specifically,
these routines have always disabled interrupts before increasing the nesting
count and restored the prior state of interrupts after decreasing the nesting
count to avoid problems with a nested interrupt not disabling interrupts
when acquiring a spin lock. However, trap interrupts for single-stepping
can still occur even when interrupts are disabled. Now the saved state of
interrupts is not saved in the thread until after interrupts have been
disabled and the nesting count has been increased. Similarly, the saved
state from the thread cannot be read once the nesting count has been
decreased to zero. To fix this, use temporary variables to store interrupt
state and shuffle it between the thread's MD area and the appropriate
registers.

In cooperation with: bde
MFC after: 1 month


# 214630 01-Nov-2010 jhb

Move the <machine/mca.h> header to <x86/mca.h>.


# 214258 24-Oct-2010 nyan

MFi386: the part of revision 213226.

Rewrite the i386 memory probe:
- Move the base memory setup into a new basemem_setup() routine.

MFC after: 1 week


# 213748 12-Oct-2010 jkim

Remove trailing ", " from `sysctl machdep.idle_available' output.


# 212541 13-Sep-2010 mav

Refactor timer management code with priority to one-shot operation mode.
The main goal of this is to generate timer interrupts only when there is
some work to do. When CPU is busy interrupts are generating at full rate
of hz + stathz to fullfill scheduler and timekeeping requirements. But
when CPU is idle, only minimum set of interrupts (down to 8 interrupts per
second per CPU now), needed to handle scheduled callouts is executed.
This allows significantly increase idle CPU sleep time, increasing effect
of static power-saving technologies. Also it should reduce host CPU load
on virtualized systems, when guest system is idle.

There is set of tunables, also available as writable sysctls, allowing to
control wanted event timer subsystem behavior:
kern.eventtimer.timer - allows to choose event timer hardware to use.
On x86 there is up to 4 different kinds of timers. Depending on whether
chosen timer is per-CPU, behavior of other options slightly differs.
kern.eventtimer.periodic - allows to choose periodic and one-shot
operation mode. In periodic mode, current timer hardware taken as the only
source of time for time events. This mode is quite alike to previous kernel
behavior. One-shot mode instead uses currently selected time counter
hardware to schedule all needed events one by one and program timer to
generate interrupt exactly in specified time. Default value depends of
chosen timer capabilities, but one-shot mode is preferred, until other is
forced by user or hardware.
kern.eventtimer.singlemul - in periodic mode specifies how much times
higher timer frequency should be, to not strictly alias hardclock() and
statclock() events. Default values are 2 and 4, but could be reduced to 1
if extra interrupts are unwanted.
kern.eventtimer.idletick - makes each CPU to receive every timer interrupt
independently of whether they busy or not. By default this options is
disabled. If chosen timer is per-CPU and runs in periodic mode, this option
has no effect - all interrupts are generating.

As soon as this patch modifies cpu_idle() on some platforms, I have also
refactored one on x86. Now it makes use of MONITOR/MWAIT instrunctions
(if supported) under high sleep/wakeup rate, as fast alternative to other
methods. It allows SMP scheduler to wake up sleeping CPUs much faster
without using IPI, significantly increasing performance on some highly
task-switching loads.

Tested by: many (on i386, amd64, sparc64 and powerc)
H/W donated by: Gheorghe Ardelean
Sponsored by: iXsystems, Inc.


# 210294 20-Jul-2010 tijl

Store fsbase and gsbase in the right fields of the mcontext. They were
switched.

PR: i386/148344
Approved by: kib (mentor)
MFC after: 1 week


# 209613 30-Jun-2010 jhb

Move prototypes for kern_sigtimedwait() and kern_sigprocmask() to
<sys/syscallsubr.h> where all other kern_<syscall> prototypes live.


# 209463 23-Jun-2010 kib

Fix bugs on pc98, use npxgetuserregs() instead of npxgetregs() for
get_fpcontext(), and npxsetuserregs() for set_fpcontext). Also,
note that usercontext is not initialized anymore in fpstate_drop().

Systematically replace references to npxgetregs() and npxsetregs()
by npxgetuserregs() and npxsetuserregs() in comments.

Noted by: bde


# 209462 23-Jun-2010 kib

After the FPU use requires #MF working due to INT13 FPU exception handling
removal, MFi386 r209198:
Use critical sections instead of disabling local interrupts to ensure
the consistency between PCPU fpcurthread and the state of FPU.

Reviewed by: bde
Tested by: pho


# 208833 05-Jun-2010 kib

Introduce the x86 kernel interfaces to allow kernel code to use
FPU/SSE hardware. Caller should provide a save area that is chained
into the stack of the areas; pcb save_area for usermode FPU state is
on top. The pcb now contains a pointer to the current FPU saved area,
used during FPUDNA handling and context switches. There is also a
facility to allow the kernel thread to use pcb save_area.

Change the dreaded warnings "npxdna in kernel mode!" into the panics
when FPU usage is not registered.

KPI discussed with: fabient
Tested by: pho, fabient
Hardware provided by: Sentex Communications
MFC after: 1 month


# 208639 29-May-2010 nyan

MFi386: the part of revision 181809

Use SEL_KPL macro.


# 208638 29-May-2010 nyan

MFi386: revision 178471

- Add an integer argument to idle to indicate how likely we are to wake
from idle over the next tick.
- Add a new MD routine, cpu_wake_idle() to wakeup idle threads who are
suspended in cpu specific states. This function can fail and cause the
scheduler to fall back to another mechanism (ipi).
- Implement support for mwait in cpu_idle() on i386/amd64 machines that
support it. mwait is a higher performance way to synchronize cpus
as compared to hlt & ipis.
- Allow selecting the idle routine by name via sysctl machdep.idle. This
replaces machdep.cpu_idle_hlt. Only idle routines supported by the
current machine are permitted.


# 208634 29-May-2010 nyan

Reduce diffs against i386.


# 208633 29-May-2010 nyan

MFi386: revision 208621

Defer initializing machine checks for the boot CPU until the local APIC is
fully configured.


# 208632 29-May-2010 nyan

MFi386: revision 208604

Clarify a potential issue in get_fpcontext() use.


# 207355 29-Apr-2010 nyan

MFi386: revision 206553

- Change printf() calls to uprintf() for sigreturn().
- Normalize the messages to include both pid and thread name.


# 205642 25-Mar-2010 nwhitehorn

Change the arguments of exec_setregs() so that it receives a pointer
to the image_params struct instead of several members of that struct
individually. This makes it easier to expand its arguments in the future
without touching all platforms.

Reviewed by: jhb


# 204309 25-Feb-2010 attilio

Introduce the new kernel sub-tree x86 which should contain all the code
shared and generalized between our current amd64, i386 and pc98.

This is just an initial step that should lead to a more complete effort.
For the moment, a very simple porting of cpufreq modules, BIOS calls and
the whole MD specific ISA bus part is added to the sub-tree but ideally
a lot of code might be added and more shared support should grow.

Sponsored by: Sandvine Incorporated
Reviewed by: emaste, kib, jhb, imp
Discussed on: arch
MFC: 3 weeks


# 198507 27-Oct-2009 kib

In r197963, a race with thread being selected for signal delivery
while in kernel mode, and later changing signal mask to block the
signal, was fixed for sigprocmask(2) and ptread_exit(3). The same race
exists for sigreturn(2), setcontext(2) and swapcontext(2) syscalls.

Use kern_sigprocmask() instead of direct manipulation of td_sigmask to
reschedule newly blocked signals, closing the race.

Reviewed by: davidxu
Tested by: pho
MFC after: 1 month


# 194784 23-Jun-2009 jeff

Implement a facility for dynamic per-cpu variables.
- Modules and kernel code alike may use DPCPU_DEFINE(),
DPCPU_GET(), DPCPU_SET(), etc. akin to the statically defined
PCPU_*. Requires only one extra instruction more than PCPU_* and is
virtually the same as __thread for builtin and much faster for shared
objects. DPCPU variables can be initialized when defined.
- Modules are supported by relocating the module's per-cpu linker set
over space reserved in the kernel. Modules may fail to load if there
is insufficient space available.
- Track space available for modules with a one-off extent allocator.
Free may block for memory to allocate space for an extent.

Reviewed by: jhb, rwatson, kan, sam, grehan, marius, marcel, stas


# 192323 18-May-2009 marcel

Add cpu_flush_dcache() for use after non-DMA based I/O so that a
possible future I-cache coherency operation can succeed. On ARM
for example the L1 cache can be (is) virtually mapped, which
means that any I/O that uses temporary mappings will not see the
I-cache made coherent. On ia64 a similar behaviour has been
observed. By flushing the D-cache, execution of binaries backed
by md(4) and/or NFS work reliably.
For Book-E (powerpc), execution over NFS exhibits SIGILL once in
a while as well, though cpu_flush_dcache() hasn't been implemented
yet.

Doing an explicit D-cache flush as part of the non-DMA based I/O
read operation eliminates the need to do it as part of the
I-cache coherency operation itself and as such avoids pessimizing
the DMA-based I/O read operations for which D-cache are already
flushed/invalidated. It also allows future optimizations whereby
the bcopy() followed by the D-cache flush can be integrated in a
single operation, which could be implemented using on-chips DMA
engines, by-passing the D-cache altogether.


# 192106 14-May-2009 nyan

MFi386: revision 192050

Implement simple machine check support.


# 190928 11-Apr-2009 nyan

MFi386: revision 190919

Simplify in/out functions.

Remove a hack to generate more efficient code for port numbers below
0x100, which has been obsolete for at least ten years, because GCC has
an asm constraint to specify that.


# 190840 08-Apr-2009 nyan

MFi386: revision 190617

Fill the fsbase and gsbase fields of the mcontext structure on i386.


# 190459 27-Mar-2009 nyan

MFi386: r190447

Convert gdt_segs and ldt_segs initialization to C99 style.


# 189446 06-Mar-2009 nyan

MFi386: 189423

A better fix for handling different FPU initial control words for different
ABIs.


# 178471 25-Apr-2008 jeff

- Add an integer argument to idle to indicate how likely we are to wake
from idle over the next tick.
- Add a new MD routine, cpu_wake_idle() to wakeup idle threads who are
suspended in cpu specific states. This function can fail and cause the
scheduler to fall back to another mechanism (ipi).
- Implement support for mwait in cpu_idle() on i386/amd64 machines that
support it. mwait is a higher performance way to synchronize cpus
as compared to hlt & ipis.
- Allow selecting the idle routine by name via sysctl machdep.idle. This
replaces machdep.cpu_idle_hlt. Only idle routines supported by the
current machine are permitted.

Sponsored by: Nokia


# 178429 22-Apr-2008 phk

Now that all platforms use genclock, shuffle things around slightly
for better structure.

Much of this is related to <sys/clock.h>, which should really have
been called <sys/calendar.h>, but unless and until we need the name,
the repocopy can wait.

In general the kernel does not know about minutes, hours, days,
timezones, daylight savings time, leap-years and such. All that
is theoretically a matter for userland only.

Parts of kernel code does however care: badly designed filesystems
store timestamps in local time and RTC chips almost universally
track time in a YY-MM-DD HH:MM:SS format, and sometimes in local
timezone instead of UTC. For this we have <sys/clock.h>

<sys/time.h> on the other hand, deals with time_t, timeval, timespec
and so on. These know only seconds and fractions thereof.

Move inittodr() and resettodr() prototypes to <sys/time.h>.
Retain the names as it is one of the few surviving PDP/VAX references.

Move startrtclock() to <machine/clock.h> on relevant platforms, it
is a MD call between machdep.c/clock.c. Remove references to it
elsewhere.

Remove a lot of unnecessary <sys/clock.h> includes.

Move the machdep.disable_rtc_set sysctl to subr_rtc.c where it belongs.
XXX: should be kern.disable_rtc_set really, it's not MD.


# 177253 16-Mar-2008 rwatson

In keeping with style(9)'s recommendations on macros, use a ';'
after each SYSINIT() macro invocation. This makes a number of
lightweight C parsers much happier with the FreeBSD kernel
source, including cflow's prcc and lxr.

MFC after: 1 month
Discussed with: imp, rink


# 177145 13-Mar-2008 kib

Since version 4.3, gcc changed its behaviour concerning the i386/amd64
ABI and the direction flag, that is it now assumes that the direction
flag is cleared at the entry of a function and it doesn't clear once
more if needed. This new behaviour conforms to the i386/amd64 ABI.

Modify the signal handler frame setup code to clear the DF {e,r}flags
bit on the amd64/i386 for the signal handlers.

jhb@ noted that it might break old apps if they assumed DF == 1 would be
preserved in the signal handlers, but that such apps should be rare and
that older versions of gcc would not generate such apps.

Submitted by: Aurelien Jarno <aurelien aurel32 net>
PR: 121422
Reviewed by: jhb
MFC after: 2 weeks


# 177091 12-Mar-2008 jeff

Remove kernel support for M:N threading.

While the KSE project was quite successful in bringing threading to
FreeBSD, the M:N approach taken by the kse library was never developed
to its full potential. Backwards compatibility will be provided via
libmap.conf for dynamically linked binaries and static binaries will
be broken.


# 176655 29-Feb-2008 nyan

MFi386: revision 1.658

Add "show sysregs" command to ddb. On i386, this gives gdt, idt, ldt,
cr0-4, etc. Support should be added for other platforms that have a
different set of registers for system use.


# 174898 25-Dec-2007 rwatson

Add a new 'why' argument to kdb_enter(), and a set of constants to use
for that argument. This will allow DDB to detect the broad category of
reason why the debugger has been entered, which it can use for the
purposes of deciding which DDB script to run.

Assign approximate why values to all current consumers of the
kdb_enter() interface.


# 173607 14-Nov-2007 nyan

MFi386: revision 1.661

Drastically simplify the i386 pcpu backend by merging parts of the
amd64 mechanism over.


# 173361 05-Nov-2007 kib

Fix for the panic("vm_thread_new: kstack allocation failed") and
silent NULL pointer dereference in the i386 and sparc64 pmap_pinit()
when the kmem_alloc_nofault() failed to allocate address space. Both
functions now return error instead of panicing or dereferencing NULL.

As consequence, vmspace_exec() and vmspace_unshare() returns the errno
int. struct vmspace arg was added to vm_forkproc() to avoid dealing
with failed allocation when most of the fork1() job is already done.

The kernel stack for the thread is now set up in the thread_alloc(),
that itself may return NULL. Also, allocation of the first process
thread is performed in the fork1() to properly deal with stack
allocation failure. proc_linkup() is separated into proc_linkup()
called from fork1(), and proc_linkup0(), that is used to set up the
kernel process (was known as swapper).

In collaboration with: Peter Holm
Reviewed by: jhb


# 170372 06-Jun-2007 nyan

MFi386: revision 1.657

Backout experimental adaptive-spin umtx code.


# 170325 05-Jun-2007 nyan

MFi386: revision 1.656

Add the machine-specific definitions for configuring the new physical
memory allocator.

Set the size of phys_avail[] and dump_avail[] using one of these
definitions.


# 170307 04-Jun-2007 jeff

Commit 14/14 of sched_lock decomposition.
- Use thread_lock() rather than sched_lock for per-thread scheduling
sychronization.
- Use the per-process spinlock rather than the sched_lock for per-process
scheduling synchronization.

Tested by: kris, current@
Tested on: i386, amd64, ULE, 4BSD, libthr, libkse, PREEMPTION, etc.
Discussed with: kris, attilio, kmacy, jhb, julian, bde (small parts each)


# 170170 31-May-2007 attilio

Revert VMCNT_* operations introduction.
Probabilly, a general approach is not the better solution here, so we should
solve the sched_lock protection problems separately.

Requested by: alc
Approved by: jeff (mentor)


# 170136 30-May-2007 nyan

MFi386: revision 1.653.


# 169827 21-May-2007 nyan

MFi386: revision 1.652

- Move GDT/LDT locking into a seperate spinlock, removing the global
scheduler lock from this responsibility.


# 169667 18-May-2007 jeff

- define and use VMCNT_{GET,SET,ADD,SUB,PTR} macros for manipulating
vmcnts. This can be used to abstract away pcpu details but also changes
to use atomics for all counters now. This means sched lock is no longer
responsible for protecting counts in the switch routines.

Contributed by: Attilio Rao <attilio@FreeBSD.org>


# 167673 18-Mar-2007 nyan

MFi386: revision 1.650

Eliminate an unused parameter.


# 166303 28-Jan-2007 nyan

MFi386: revision 1.647.

exclude the icu and clock lock from LOCK_PROFILING


# 166189 23-Jan-2007 bde

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.


# 165858 07-Jan-2007 nyan

MFi386: revision 1.646.


# 164951 06-Dec-2006 sobomax

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


# 164936 06-Dec-2006 julian

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.


# 164438 20-Nov-2006 nyan

MFi386: revisions from 1.641 to 1.643.


# 164113 09-Nov-2006 nyan

MFi386: revisions 1.634 and 1.639.


# 163709 26-Oct-2006 jb

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@


# 162958 02-Oct-2006 phk

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.


# 162954 02-Oct-2006 phk

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.


# 162839 30-Sep-2006 phk

Remove the no longer relevant or correct bootinfo sysctls.


# 160312 12-Jul-2006 jhb

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.


# 159252 05-Jun-2006 nyan

MFi386: revisions 1.627, 1.628 and 1.629.


# 158445 11-May-2006 phk

Clean out sysctl machdep.* related defines.

The cmos clock related stuff should really be in MI code.


# 158359 08-May-2006 nyan

Remove unneeded include.


# 157933 21-Apr-2006 nyan

MFi386: revision 1.625.


# 156706 14-Mar-2006 jhb

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


# 155470 09-Feb-2006 nyan

MFi386: revision 1.622.

> Clear carry flag in get_mcontext so that setcontext does not
> return a bogus error.

MFC after: 3 days


# 153731 26-Dec-2005 nyan

MFi386: revision 1.621


# 152753 24-Nov-2005 ru

Add missing "struct" in i386/i386/machdep.c,v 1.497 by deischen@.


# 151376 16-Oct-2005 nyan

Reduce diffs from i386/i386/machdep.c


# 151346 14-Oct-2005 jhb

Merge over the remaining changes from i386 of the ksiginfo_t changes so
that this compiles.

Pointy hat to: davidxu


# 151316 14-Oct-2005 davidxu

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


# 150128 14-Sep-2005 nyan

Add some defines for EPSON machines and use them.


# 147951 13-Jul-2005 nyan

MFi386: revision 1.617.


# 147741 02-Jul-2005 delphij

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)


# 147701 30-Jun-2005 nyan

MFi386: revision 1.615 (change kernel crashdump format to ELF).

Approved by: re (scottl)


# 146210 14-May-2005 nyan

MFi386: revision 1.614.


# 146049 10-May-2005 nyan

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


# 145070 14-Apr-2005 nyan

MFi386: revision 1.612.


# 145012 13-Apr-2005 nyan

- Remove ifdef PC98.
- Reduce diffs from i386.


# 144637 04-Apr-2005 jhb

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


# 143174 06-Mar-2005 nyan

MFi386: revisions 1.609 and 1.610.


# 143127 04-Mar-2005 nyan

Don't use the ptoa() to set the 'realmem' variable. Because F/pc98's policy
is to keep the same as F/i386.


# 142956 01-Mar-2005 wes

Attempt to doff the pointy hat: implement 'hw.realmem' on remaining
architectures. Pointed out by O'Brien, ScottL via email.

Reviewed by: obrien (various)


# 142379 24-Feb-2005 nyan

Fix to support Buffalo HYPERMEMORY.

Submitted by: Chiharu Shibata
MFC after: 3 days


# 141389 06-Feb-2005 nyan

Sort includes and remove duplicate include.


# 141388 06-Feb-2005 nyan

MFi386: revision 1.606.


# 141378 05-Feb-2005 njl

Finish the job of sorting all includes and fix the build by including
malloc.h before proc.h on sparc64. Noticed by das@

Compiled on: alpha, amd64, i386, pc98, sparc64


# 141276 04-Feb-2005 nyan

MFi386: revision 1.605.


# 138129 27-Nov-2004 das

Don't include sys/user.h merely for its side-effect of recursively
including other headers.


# 137912 20-Nov-2004 das

U areas are going away, so don't allocate one for process 0.

Reviewed by: arch@


# 137784 16-Nov-2004 jhb

Initiate deorbit burn sequence for 80386 support in FreeBSD: Remove
80386 (I386_CPU) support from the kernel.


# 137117 01-Nov-2004 jhb

- Change the ddb paging "support" to use a variable (db_lines_per_page) to
control the number of lines per page rather than a constant. The variable
can be examined and changed in ddb as '$lines'. Setting the variable to
0 will effectively turn off paging.
- Change db_putchar() to force out pending whitespace before outputting
newlines and carriage returns so that one can rub out content on the
current line via '\r \r' type strings.
- Change the simple pager to rub out the --More-- prompt explicitly when
the routine exits.
- Add some aliases to the simple pager to make it more compatible with
more(1): 'e' and 'j' do a single line. 'd' does half a page, and
'f' does a full page.

MFC after: 1 month
Inspired by: kris


# 137069 30-Oct-2004 nyan

MFi386: revision 1.599 (Preserve dcons(4) buffer passed by loader(8).)


# 134791 05-Sep-2004 julian

Refactor a bunch of scheduler code to give basically the same behaviour
but with slightly cleaned up interfaces.

The KSE structure has become the same as the "per thread scheduler
private data" structure. In order to not make the diffs too great
one is #defined as the other at this time.

The KSE (or td_sched) structure is now allocated per thread and has no
allocation code of its own.

Concurrency for a KSEGRP is now kept track of via a simple pair of counters
rather than using KSE structures as tokens.

Since the KSE structure is different in each scheduler, kern_switch.c
is now included at the end of each scheduler. Nothing outside the
scheduler knows the contents of the KSE (aka td_sched) structure.

The fields in the ksegrp structure that are to do with the scheduler's
queueing mechanisms are now moved to the kg_sched structure.
(per ksegrp scheduler private data structure). In other words how the
scheduler queues and keeps track of threads is no-one's business except
the scheduler's. This should allow people to write experimental
schedulers with completely different internal structuring.

A scheduler call sched_set_concurrency(kg, N) has been added that
notifies teh scheduler that no more than N threads from that ksegrp
should be allowed to be on concurrently scheduled. This is also
used to enforce 'fainess' at this time so that a ksegrp with
10000 threads can not swamp a the run queue and force out a process
with 1 thread, since the current code will not set the concurrency above
NCPU, and both schedulers will not allow more than that many
onto the system run queue at a time. Each scheduler should eventualy develop
their own methods to do this now that they are effectively separated.

Rejig libthr's kernel interface to follow the same code paths as
linkse for scope system threads. This has slightly hurt libthr's performance
but I will work to recover as much of it as I can.

Thread exit code has been cleaned up greatly.
exit and exec code now transitions a process back to
'standard non-threaded mode' before taking the next step.
Reviewed by: scottl, peter
MFC after: 1 week


# 133169 05-Aug-2004 nyan

MFi386: revision 1.597.


# 132395 19-Jul-2004 nyan

MFi386: revision 1.596.


# 132088 13-Jul-2004 davidxu

Add ptrace_clear_single_step(), alpha already has it for years, the function
will be used by ptrace to clear a thread's single step state.


# 131947 10-Jul-2004 marcel

MFi386: Update for the KDB framework:
o Implement makectx().
o Call kdb_enter() instead of Debugger().
o Remove implementation of Debugger().


# 130923 22-Jun-2004 nyan

MFi386: revision 1.592.


# 130585 16-Jun-2004 phk

Do the dreaded s/dev_t/struct cdev */
Bump __FreeBSD_version accordingly.


# 130344 11-Jun-2004 phk

Deorbit COMPAT_SUNOS.

We inherited this from the sparc32 port of BSD4.4-Lite1. We have neither
a sparc32 port nor a SunOS4.x compatibility desire these days.


# 130312 10-Jun-2004 jhb

Remove atdevbase and replace it's remaining uses with direct references to
KERNBASE instead.


# 127519 28-Mar-2004 nyan

MFi386: revision 1.586.


# 124370 11-Jan-2004 nyan

MFi386: revision 1.583.


# 124092 03-Jan-2004 davidxu

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


# 122756 15-Nov-2003 nyan

opt_apic.h is not needed.


# 122364 09-Nov-2003 marcel

Change the clear_ret argument of get_mcontext() to be a flags argument.
Since all callers either passed 0 or 1 for clear_ret, define bit 0 in
the flags for use as clear_ret. Reserve bits 1, 2 and 3 for use by MI
code for possible (but unlikely) future use. The remaining bits are for
use by MD code.

This change is triggered by a need on ia64 to have another knob for
get_mcontext().


# 122052 04-Nov-2003 nyan

MFi386: revision 1.580


# 121804 31-Oct-2003 nyan

MFi386: revision 1.579.


# 121800 31-Oct-2003 nyan

MFi386: revision 1.578.


# 121243 19-Oct-2003 nyan

MFi386: revision 1.577.


# 121000 11-Oct-2003 nyan

MFi386: revision 1.576.


# 120800 05-Oct-2003 nyan

MFi386: revisions 1.572, 1.573 and 1.574.


# 119988 11-Sep-2003 nyan

MFi386 revisions 1.570 and 1.571.


# 118235 30-Jul-2003 peter

Cosmetic: fix disorder of opt_kstack_pages.h include.


# 117600 14-Jul-2003 davidxu

Rename thread_siginfo to cpu_thread_siginfo.

Suggested by: jhb


# 116979 28-Jun-2003 nyan

MFi386: revision 1.566.


# 116958 28-Jun-2003 davidxu

Add a machine depended function thread_siginfo, SA signal code
will use the function to construct a siginfo structure and use
the result to export to userland.

Reviewed by: julian


# 115001 14-May-2003 jhb

Fix a typo that broke the pc98 kernel build.

Reported by: des@'s tinderbox
Pointy hat to: jhb
Approved by: re (blanket/scottl)


# 114983 13-May-2003 jhb

- Merge struct procsig with struct sigacts.
- Move struct sigacts out of the u-area and malloc() it using the
M_SUBPROC malloc bucket.
- Add a small sigacts_*() API for managing sigacts structures: sigacts_alloc(),
sigacts_free(), sigacts_copy(), sigacts_share(), and sigacts_shared().
- Remove the p_sigignore, p_sigacts, and p_sigcatch macros.
- Add a mutex to struct sigacts that protects all the members of the struct.
- Add sigacts locking.
- Remove Giant from nosys(), kill(), killpg(), and kern_sigaction() now
that sigacts is locked.
- Several in-kernel functions such as psignal(), tdsignal(), trapsignal(),
and thread_stopped() are now MP safe.

Reviewed by: arch@
Approved by: re (rwatson)


# 113998 24-Apr-2003 deischen

Add an argument to get_mcontext() which specified whether the
syscall return values should be cleared. The system calls
getcontext() and swapcontext() want to return 0 on success
but these contexts can be switched to at a later time so
the return values need to be cleared in the saved register
sets. Other callers of get_mcontext() would normally want
the context without clearing the return values.

Remove the i386-specific context saving from the KSE code.
get_mcontext() is not i386-specific any more.

Fix a bad pointer in the alpha get_mcontext() code. The
context was being bcopy()'d from &td->tf_frame, but tf_frame
is itself a pointer, so the thread was being copied instead.
Spotted by jake.

Glanced at by: jake
Reviewed by: bde (months ago)


# 113682 18-Apr-2003 jhb

Hold the proc lock for curproc around sigonstack().


# 113015 03-Apr-2003 nyan

MFi386: revision 1.561


# 112975 02-Apr-2003 nyan

MFi386: revisions 1.556 and 1.557.
Backout revision 1.312.


# 112898 31-Mar-2003 jeff

- Define a new md function 'casuptr'. This atomically compares and sets
a pointer that is in user space. It will be used as the basic primitive
for a kernel supported user space lock implementation.
- Implement this function in x86's support.s
- Provide stubs that return -1 in all other architectures. Implementations
will follow along shortly.

Reviewed by: jake


# 112888 31-Mar-2003 jeff

- Move p->p_sigmask to td->td_sigmask. Signal masks will be per thread with
a follow on commit to kern_sig.c
- signotify() now operates on a thread since unmasked pending signals are
stored in the thread.
- PS_NEEDSIGCHK moves to TDF_NEEDSIGCHK.


# 112883 31-Mar-2003 jeff

- Change trapsignal() to accept a thread and not a proc.
- Change all consumers to pass in a thread.

Right now this does not cause any functional changes but it will be important
later when signals can be delivered to specific threads.


# 112569 24-Mar-2003 jake

- Add vm_paddr_t, a physical address type. This is required for systems
where physical addresses larger than virtual addresses, such as i386s
with PAE.
- Use this to represent physical addresses in the MI vm system and in the
i386 pmap code. This also changes the paddr parameter to d_mmap_t.
- Fix printf formats to handle physical addresses >4G in the i386 memory
detection code, and due to kvtop returning vm_paddr_t instead of u_long.

Note that this is a name change only; vm_paddr_t is still the same as
vm_offset_t on all currently supported platforms.

Sponsored by: DARPA, Network Associates Laboratories
Discussed with: re, phk (cdevsw change)


# 111310 23-Feb-2003 nyan

MFi386: revision 1.554.


# 109994 28-Jan-2003 jake

Remove BDE_DEBUGGER.

Discussed with: bde


# 109068 10-Jan-2003 nyan

MFi386: revision 1.552.


# 107586 04-Dec-2002 nyan

MFi386: revision 1.551.

Approved by: re (jhb)


# 106997 17-Nov-2002 nyan

MFi386: revision 1.550.


# 106697 09-Nov-2002 des

Print real / avail memory in megabytes rather than kilobytes.


# 106605 07-Nov-2002 tmm

Move the definitions of the hw.physmem, hw.usermem and hw.availpages
sysctls to MI code; this reduces code duplication and makes all of them
available on sparc64, and the latter two on powerpc.
The semantics by the i386 and pc98 hw.availpages is slightly changed:
previously, holes between ranges of available pages would be included,
while they are excluded now. The new behaviour should be more correct
and brings i386 in line with the other architectures.

Move physmem to vm/vm_init.c, where this variable is used in MI code.


# 106503 06-Nov-2002 jmallett

Remove what was a temporary bogus assignment of bits of siginfo_t, as it does
not look like the prerequisites to fill it in properly will be in the tree
for the upcoming release, but it's mostly done, so there is no need for these
to stay around to remind us.


# 105991 26-Oct-2002 nyan

MFi386: revisions 1.544 and 1.545.


# 105715 22-Oct-2002 nyan

MFi386: revision 1.543.


# 104965 12-Oct-2002 jeff

- kserunnable() is now sched_runnable() change instances of these where
appropriate.
- include sched.h to see this new api.


# 104675 08-Oct-2002 nyan

MFi386: revisions 1.539, 1.540 and 1.541.


# 103879 24-Sep-2002 nyan

MFi386: revisions 1.536 and 1.538.


# 103703 20-Sep-2002 phk

For reasons now lost in historical fog, the bounds_check_with_label()
function were put in i386/i386/machdep.c from where it has been
cut and pasted to other architectures with only minor corruption.

Disklabel is really a MI format in many ways, at least it certainly
is when you operate on struct disklabel.

Put bounds_check_with_label() back in subr_disklabel.c where it belongs.

Sponsored by: DARPA & NAI Labs.


# 103638 19-Sep-2002 nyan

MFi386: revisions 1.534 and 1.535.


# 103367 15-Sep-2002 julian

Allocate KSEs and KSEGRPs separatly and remove them from the proc structure.
next step is to allow > 1 to be allocated per process. This would give
multi-processor threads. (when the rest of the infrastructure is
in place)

While doing this I noticed libkvm and sys/kern/kern_proc.c:fill_kinfo_proc
are diverging more than they should.. corrective action needed soon.


# 103081 07-Sep-2002 jmallett

Fill out two fields (si_pid, si_uid) in the siginfo structure handed back
to userland in the signal handler that were not being iflled out before, but
should and can be.

This part of sendsig could be slightly refactored to use an MI interface, or
ideally, *sendsig*() would have an API change to accept a siginfo_t, which
would be filled out by an MI function in the level above sendsig, and said MI
function would make a small call into MD code to fill out the MD parts (some
of which may be bogus, such as the si_addr stuff in some places). This would
eventually make it possible for parts of the kernel sending signals to set up
a siginfo with meaningful information.

Reviewed by: mux
MFC after: 2 weeks


# 103077 07-Sep-2002 jmallett

Diff reduction in comments for filling the siginfo structure - refer to
filling in the POSIX parts, when doing the same thing in every port of
FreeBSD.


# 103064 07-Sep-2002 peter

Automatically enable CPU_ENABLE_SSE (detect and enable SSE instructions)
if compiling with I686_CPU as a target. CPU_DISABLE_SSE will prevent
this from happening and will guarantee the code is not compiled in.

I am still not happy with this, but gcc is now generating code that uses
these instructions if you set CPUTYPE to p3/p4 or athlon-4/mp/xp or higher.


# 102666 31-Aug-2002 peter

Take a shot at fixing up a whole stack of style and other embarresing
unforced errors that Bruce identified. I have not yet addressed all of
his concerns.


# 102600 30-Aug-2002 peter

Change hw.physmem and hw.usermem to unsigned long like they used to be
in the original hardwired sysctl implementation.

The buf size calculator still overflows an integer on machines with large
KVA (eg: ia64) where the number of pages does not fit into an int. Use
'long' there.

Change Maxmem and physmem and related variables to 'long', mostly for
completeness. Machines are not likely to overflow 'int' pages in the
near term, but then again, 640K ought to be enough for anybody. This
comes for free on 32 bit machines, so why not?


# 102561 29-Aug-2002 jake

Renamed poorly named setregs to exec_setregs. Moved its prototype to
imgact.h with the other exec support functions.


# 100275 17-Jul-2002 peter

Use pmap_kenter() rather than vtopte() and bashing the page tables
directly.


# 100236 17-Jul-2002 nyan

MFi386: revision 1.524.


# 99948 14-Jul-2002 kato

MFi386: sys/i386/i386/machdep.c revision 1.522.


# 99567 07-Jul-2002 peter

s/procrunnable/kserunnable/ in a comment


# 99131 30-Jun-2002 nyan

MFi386: revision 1.521


# 98808 25-Jun-2002 kato

MFi386: sys/i386/i386/machdep.c rev. 1.520.


# 96577 14-May-2002 nyan

MFi386: revision 1.519


# 94936 17-Apr-2002 mux

Rework the kernel environment subsystem. We now convert the static
environment needed at boot time to a dynamic subsystem when VM is
up. The dynamic kernel environment is protected by an sx lock.

This adds some new functions to manipulate the kernel environment :
freeenv(), setenv(), unsetenv() and testenv(). freeenv() has to be
called after every getenv() when you have finished using the string.
testenv() only tests if an environment variable is present, and
doesn't require a freeenv() call. setenv() and unsetenv() are self
explanatory.

The kenv(2) syscall exports these new functionalities to userland,
mainly for kenv(1).

Reviewed by: peter


# 94417 11-Apr-2002 kato

MFi386: revision 1.517.


# 94275 09-Apr-2002 phk

GC various bits and pieces of USERCONFIG from all over the place.


# 94151 07-Apr-2002 phk

GC the "dumplo" variable, which is no longer used.

A lot of sys/*/*/machdep.c seems not to be.


# 93818 04-Apr-2002 jhb

Change callers of mtx_init() to pass in an appropriate lock type name. In
most cases NULL is passed, but in some cases such as network driver locks
(which use the MTX_NETWORK_LOCK macro) and UMA zone locks, a name is used.

Tested on: i386, alpha, sparc64


# 93793 04-Apr-2002 bde

Moved signal handling and rescheduling from userret() to ast() so that
they aren't in the usual path of execution for syscalls and traps.
The main complication for this is that we have to set flags to control
ast() everywhere that changes the signal mask.

Avoid locking in userret() in most of the remaining cases.

Submitted by: luoqi (first part only, long ago, reorganized by me)
Reminded by: dillon


# 93702 02-Apr-2002 jhb

- Move the MI mutexes sched_lock and Giant from being declared in the
various machdep.c's to being declared in kern_mutex.c.
- Add a new function mutex_init() used to perform early initialization
needed for mutexes such as setting up thread0's contested lock list
and initializing MI mutexes. Change the various MD startup routines
to call this function instead of duplicating all the code themselves.

Tested on: alpha, i386


# 93593 01-Apr-2002 jhb

Change the suser() API to take advantage of td_ucred as well as do a
general cleanup of the API. The entire API now consists of two functions
similar to the pre-KSE API. The suser() function takes a thread pointer
as its only argument. The td_ucred member of this thread must be valid
so the only valid thread pointers are curthread and a few kernel threads
such as thread0. The suser_cred() function takes a pointer to a struct
ucred as its first argument and an integer flag as its second argument.
The flag is currently only used for the PRISON_ROOT flag.

Discussed on: smp@


# 93469 31-Mar-2002 kato

MFi386: revision 1.508.


# 93414 30-Mar-2002 nyan

MFi386: revision 1.506.


# 93278 27-Mar-2002 kato

MFi386: revision 1.507.


# 93264 27-Mar-2002 dillon

Compromise for critical*()/cpu_critical*() recommit. Cleanup the interrupt
disablement assumptions in kern_fork.c by adding another API call,
cpu_critical_fork_exit(). Cleanup the td_savecrit field by moving it
from MI to MD. Temporarily move cpu_critical*() from <arch>/include/cpufunc.h
to <arch>/<arch>/critical.c (stage-2 will clean this up).

Implement interrupt deferral for i386 that allows interrupts to remain
enabled inside critical sections. This also fixes an IPI interlock bug,
and requires uses of icu_lock to be enclosed in a true interrupt disablement.

This is the stage-1 commit. Stage-2 will occur after stage-1 has stabilized,
and will move cpu_critical*() into its own header file(s) + other things.
This commit may break non-i386 architectures in trivial ways. This should
be temporary.

Reviewed by: core
Approved by: core


# 92791 20-Mar-2002 kato

MFi386: revision 1.505 (remove __P.)


# 92790 20-Mar-2002 kato

MFi386: revision 1.504.


# 92789 20-Mar-2002 kato

MFi386: revision 1.503.


# 92229 13-Mar-2002 nyan

MFi386: revision 1.502


# 91981 10-Mar-2002 nyan

MFi386: revision 1.501


# 91566 02-Mar-2002 nyan

MFi386: revision 1.498.


# 90953 20-Feb-2002 nyan

MFi386: revision 1.497


# 90726 16-Feb-2002 nyan

MFi386: revisions 1.495 and 1.496


# 90398 08-Feb-2002 nyan

MFi386: revisions 1.493 and 1.494.


# 90361 07-Feb-2002 julian

Pre-KSE/M3 commit.
this is a low-functionality change that changes the kernel to access the main
thread of a process via the linked list of threads rather than
assuming that it is embedded in the process. It IS still embeded there
but remove all teh code that assumes that in preparation for the next commit
which will actually move it out.

Reviewed by: peter@freebsd.org, gallatin@cs.duke.edu, benno rice,


# 90132 03-Feb-2002 bde

Use osigreturn(2) instead of sigreturn(2) plus broken magic for returning
from old signal handlers. This is simpler and faster, and fixes (new)
sigreturn(2) when %eip in the new signal context happens to match the
magic value (0x1d516). 0x1d516 is below the default ELF text section,
so this probably never broken anything in practice.

locore.s:
In addition, don't build the signal trampoline for old signal handlers
when it is not used.

alpha:
Not fixed, but seems to be even less broken in practice due to more
advanced magic. A false match occurs for register #32 in mc_regs[].
Since there is no hardware register #32, a false match is only possible
for direct calls to sigreturn(2) that happen to have the magic number
in the spare mc_regs[32] field.


# 90128 03-Feb-2002 bde

Improve the change in the previous commit: use a stub for osigreturn()
when it is not really used instead of unconditionalizing all of it.


# 90065 01-Feb-2002 bde

Compile osigreturn() unconditionally since it will always be needed on
some arches and the syscall table is machine-independent. It was
(bogusly) conditional on COMPAT_43, so this usually makes no difference.

ia64: in addition:
- replace the bogus cloned comment before osigreturn() by a correct one.
osigreturn() is just a stub fo ia64's.
- fix the formatting of cloned comment before sigreturn().
- fix the return code. use nosys() instead of returning ENOSYS to get
the same semantics as if the syscall is not in the syscall table.
Generating SIGSYS is actually correct here.
- fix style bugs.

powerpc: copy the cleaned up ia64 stub. This mainly fixes a bogus comment.

sparc64: copy the cleaned up the ia64 stub, since there was no stub before.


# 90013 31-Jan-2002 nyan

MFi386: revision 1.489.


# 89484 18-Jan-2002 nyan

MFi386: revision 1.487


# 89195 10-Jan-2002 bde

Clear the single-step flag for signal handlers. This fixes bogus trace
traps on the first instruction of signal handlers.

In trap.c:syscall(), fake a trace trap if the single-step flag was set
on entry to the kernel, not if it will be set on exit from the kernel.
This fixes bogus trace traps after the last instruction of signal handlers.

gdb-4.18 (the version in FreeBSD) still has problems with the program in
the PR. These seem to be due to bugs in gdb and not in FreeBSD, and are
fixed in gdb-5.1 (the distribution version).

PR: 33262
Tested by: k Macy <kip_macy@yahoo.com>
MFC after: 1 day


# 88386 21-Dec-2001 nyan

MFi386: revision 1.486


# 87730 12-Dec-2001 nyan

MFi386: revision 1.485 (the previous commit is not completely)


# 87702 11-Dec-2001 jhb

Overhaul the per-CPU support a bit:

- The MI portions of struct globaldata have been consolidated into a MI
struct pcpu. The MD per-CPU data are specified via a macro defined in
machine/pcpu.h. A macro was chosen over a struct mdpcpu so that the
interface would be cleaner (PCPU_GET(my_md_field) vs.
PCPU_GET(md.md_my_md_field)).
- All references to globaldata are changed to pcpu instead. In a UP kernel,
this data was stored as global variables which is where the original name
came from. In an SMP world this data is per-CPU and ideally private to each
CPU outside of the context of debuggers. This also included combining
machine/globaldata.h and machine/globals.h into machine/pcpu.h.
- The pointer to the thread using the FPU on i386 was renamed from
npxthread to fpcurthread to be identical with other architectures.
- Make the show pcpu ddb command MI with a MD callout to display MD
fields.
- The globaldata_register() function was renamed to pcpu_init() and now
init's MI fields of a struct pcpu in addition to registering it with
the internal array and list.
- A pcpu_destroy() function was added to remove a struct pcpu from the
internal array and list.

Tested on: alpha, i386
Reviewed by: peter, jake


# 87546 08-Dec-2001 dillon

Allow maxusers to be specified as 0 in the kernel config, which will
cause the system to auto-size to between 32 and 512 depending on the
amount of memory.

MFC after: 1 week


# 86492 17-Nov-2001 nyan

MFi386: revision 1.483


# 85713 29-Oct-2001 nyan

MFi386: sys/i386/i386/machdep.c revisions 1.481 and 1.482


# 83423 14-Sep-2001 imp

Merge from sys/i386/i386/machdep.c 1.480 (Julian's KSE changes)

Reviewed by: julian, bde, jhb


# 83366 12-Sep-2001 julian

KSE Milestone 2
Note ALL MODULES MUST BE RECOMPILED
make the kernel aware that there are smaller units of scheduling than the
process. (but only allow one thread per process at this time).
This is functionally equivalent to teh previousl -current except
that there is a thread associated with each process.

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

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

X-MFC after: ha ha ha ha


# 83362 12-Sep-2001 kato

Merged from sys/i386/i386/machdep.c revision 1.479.


# 82939 04-Sep-2001 peter

Zap #if 0'ed map init code that got moved to the MI area.
Convert the powerpc tree to use the common code.


# 82393 27-Aug-2001 peter

Enable hardwiring of things like tunables from embedded enironments
that do not start from loader(8).


# 82309 25-Aug-2001 peter

Optionize UPAGES for the i386. As part of this I split some of the low
level implementation stuff out of machine/globaldata.h to avoid exposing
UPAGES to lots more places. The end result is that we can double
the kernel stack size with 'options UPAGES=4' etc.

This is mainly being done for the benefit of a MFC to RELENG_4 at some
point. -current doesn't really need this so much since each interrupt
runs on its own kstack.


# 82166 22-Aug-2001 peter

Fix a #endif misplacement in 1.231 due to misapplied patch

Pointy hat to: peter


# 82164 22-Aug-2001 peter

Merge i386/machdep.c rev 1.474: dont overextend %cs. (finally, it doesn't
conflict with unmerged changes)


# 82163 22-Aug-2001 peter

Merge i386/machdep.c rev 1.469: whitespace changes to fit 80 columns

Forgotten by: jhb


# 82162 22-Aug-2001 peter

Merge i386/machdep.c rev 1.468: make breakpoint/trace interrupt instead
of trap gates

Forgotten by: bde


# 82161 22-Aug-2001 peter

Merge 386/machdep.c rev 1.467: fix bugs/miscalculations

Forgotten by: iwasaki


# 82160 22-Aug-2001 peter

Identical to i386/machdep.c rev 1.473: move submap initialization to MI.


# 82159 22-Aug-2001 peter

Merge i386/machdep.c rev 1.472: Fix bug in physmem_est and maxbcache
calculation

Forgotten by: dillon


# 82158 22-Aug-2001 peter

Merge i386/machdep.c rev 1.470. Limit KVM for buffer cache etc.

Forgotten by: dillon


# 82025 21-Aug-2001 peter

Make COMPAT_43 optional again. XXX we need COMPAT_FBSD3 etc for this
stuff.


# 81265 08-Aug-2001 peter

Zap 'ptrace(PT_READ_U, ...)' and 'ptrace(PT_WRITE_U, ...)' since they
are a really nasty interface that should have been killed long ago
when 'ptrace(PT_[SG]ETREGS' etc came along. The entity that they
operate on (struct user) will not be around much longer since it
is part-per-process and part-per-thread in a post-KSE world.

gdb does not actually use this except for the obscure 'info udot'
command which does a hexdump of as much of the child's 'struct user'
as it can get. It carries its own #defines so it doesn't break
compiles.


# 80421 26-Jul-2001 peter

Call the early tunable setup functions as soon as kern_envp is available.
Some things depend on hz being set not long after this.


# 79942 19-Jul-2001 kato

Merged from sys/i386/i386/machdep.c revisions 1.462 and 1.464.


# 79610 12-Jul-2001 peter

Apply the i386 SSE mods to pc98 as well.


# 79378 07-Jul-2001 nyan

Merged from sys/i386/i386/machdep.c revisions 1.459 and 1.460.


# 79224 04-Jul-2001 dillon

With Alfred's permission, remove vm_mtx in favor of a fine-grained approach
(this commit is just the first stage). Also add various GIANT_ macros to
formalize the removal of Giant, making it easy to test in a more piecemeal
fashion. These macros will allow us to test fine-grained locks to a degree
before removing Giant, and also after, and to remove Giant in a piecemeal
fashion via sysctl's on those subsystems which the authors believe can
operate without Giant.


# 78962 29-Jun-2001 jhb

Add a new MI pointer to the process' trapframe p_frame instead of using
various differently named pointers buried under p_md.

Reviewed by: jake (in principle)


# 78653 23-Jun-2001 kato

Merged from sys/i386/i386/machdep.c revisions 1.456 and 1.457.


# 78135 12-Jun-2001 peter

Hints overhaul:
- Replace some very poorly thought out API hacks that should have been
fixed a long while ago.
- Provide some much more flexible search functions (resource_find_*())
- Use strings for storage instead of an outgrowth of the rather
inconvenient temporary ioconf table from config(). We already had a
fallback to using strings before malloc/vm was running anyway.


# 77621 02-Jun-2001 nyan

Merged from sys/i386/i386/machdep.c revision 1.454.


# 77618 02-Jun-2001 nyan

Disabled unneeded code for PC98.

Submitted by: NOKUBI Hirotaka <nokubi@ff.iij4u.or.jp>


# 76931 21-May-2001 nyan

Update pc98 memory probe functions.
- pc98_getmemsize() function returns available memory size under 16MB.
- getmemsize() function is merged from PC-AT's one.

Submitted by: chi@bd.mbn.or.jp (Chiharu Shibata) and
NOKUBI Hirotaka <nokubi@ff.iij4u.or.jp>


# 76928 21-May-2001 nyan

Merged from sys/i386/i386/machdep.c revisions 1.452 and 1.453.


# 76650 15-May-2001 jhb

Remove unneeded includes of sys/ipl.h and machine/ipl.h.


# 76614 15-May-2001 kato

Merged from sys/i386/i386/machdep.c revision 1.450.


# 76440 10-May-2001 jhb

- Split out the support for per-CPU data from the SMP code. UP kernels
have per-CPU data and gdb on the i386 at least needs access to it.
- Clean up includes in kern_idle.c and subr_smp.c.

Reviewed by: jake


# 76308 06-May-2001 kato

Merged from sys/i386/i386/machdep.c revision 1.448.


# 76208 02-May-2001 kato

Merged the rest of changes in sys/i386/i386/machdep.c revision 1.447.


# 76078 27-Apr-2001 jhb

Overhaul of the SMP code. Several portions of the SMP kernel support have
been made machine independent and various other adjustments have been made
to support Alpha SMP.

- It splits the per-process portions of hardclock() and statclock() off
into hardclock_process() and statclock_process() respectively. hardclock()
and statclock() call the *_process() functions for the current process so
that UP systems will run as before. For SMP systems, it is simply necessary
to ensure that all other processors execute the *_process() functions when the
main clock functions are triggered on one CPU by an interrupt. For the alpha
4100, clock interrupts are delievered in a staggered broadcast fashion, so
we simply call hardclock/statclock on the boot CPU and call the *_process()
functions on the secondaries. For x86, we call statclock and hardclock as
usual and then call forward_hardclock/statclock in the MD code to send an IPI
to cause the AP's to execute forwared_hardclock/statclock which then call the
*_process() functions.
- forward_signal() and forward_roundrobin() have been reworked to be MI and to
involve less hackery. Now the cpu doing the forward sets any flags, etc. and
sends a very simple IPI_AST to the other cpu(s). AST IPIs now just basically
return so that they can execute ast() and don't bother with setting the
astpending or needresched flags themselves. This also removes the loop in
forward_signal() as sched_lock closes the race condition that the loop worked
around.
- need_resched(), resched_wanted() and clear_resched() have been changed to take
a process to act on rather than assuming curproc so that they can be used to
implement forward_roundrobin() as described above.
- Various other SMP variables have been moved to a MI subr_smp.c and a new
header sys/smp.h declares MI SMP variables and API's. The IPI API's from
machine/ipl.h have moved to machine/smp.h which is included by sys/smp.h.
- The globaldata_register() and globaldata_find() functions as well as the
SLIST of globaldata structures has become MI and moved into subr_smp.c.
Also, the globaldata list is only available if SMP support is compiled in.

Reviewed by: jake, peter
Looked over by: eivind


# 75055 01-Apr-2001 nyan

Merged from sys/i386/i386/machdep.c revision 1.446.


# 74679 23-Mar-2001 kato

Merged from sys/i386/i386/machdep.c revision 1.445.


# 73929 07-Mar-2001 jhb

Grab the process lock while calling psignal and before calling psignal.


# 73019 25-Feb-2001 kato

Merged from sys/i386/i386/machdep.c revision 1.443.


# 72930 22-Feb-2001 peter

Activate USER_LDT by default. The new thread libraries are going to
depend on this. The linux ABI emulator tries to use it for some linux
binaries too. VM86 had a bigger cost than this and it was made default
a while ago.

Reviewed by: jhb, imp


# 72791 21-Feb-2001 kato

Merged from sys/i386/i386/machdep.c revision 1.441.


# 72226 09-Feb-2001 jhb

Move the initailization of the proc lock for proc0 very early into the MD
startup code.


# 72200 09-Feb-2001 bmilekic

Change and clean the mutex lock interface.

mtx_enter(lock, type) becomes:

mtx_lock(lock) for sleep locks (MTX_DEF-initialized locks)
mtx_lock_spin(lock) for spin locks (MTX_SPIN-initialized)

similarily, for releasing a lock, we now have:

mtx_unlock(lock) for MTX_DEF and mtx_unlock_spin(lock) for MTX_SPIN.
We change the caller interface for the two different types of locks
because the semantics are entirely different for each case, and this
makes it explicitly clear and, at the same time, it rids us of the
extra `type' argument.

The enter->lock and exit->unlock change has been made with the idea
that we're "locking data" and not "entering locked code" in mind.

Further, remove all additional "flags" previously passed to the
lock acquire/release routines with the exception of two:

MTX_QUIET and MTX_NOSWITCH

The functionality of these flags is preserved and they can be passed
to the lock/unlock routines by calling the corresponding wrappers:

mtx_{lock, unlock}_flags(lock, flag(s)) and
mtx_{lock, unlock}_spin_flags(lock, flag(s)) for MTX_DEF and MTX_SPIN
locks, respectively.

Re-inline some lock acq/rel code; in the sleep lock case, we only
inline the _obtain_lock()s in order to ensure that the inlined code
fits into a cache line. In the spin lock case, we inline recursion and
actually only perform a function call if we need to spin. This change
has been made with the idea that we generally tend to avoid spin locks
and that also the spin locks that we do have and are heavily used
(i.e. sched_lock) do recurse, and therefore in an effort to reduce
function call overhead for some architectures (such as alpha), we
inline recursion for this case.

Create a new malloc type for the witness code and retire from using
the M_DEV type. The new type is called M_WITNESS and is only declared
if WITNESS is enabled.

Begin cleaning up some machdep/mutex.h code - specifically updated the
"optimized" inlined code in alpha/mutex.h and wrote MTX_LOCK_SPIN
and MTX_UNLOCK_SPIN asm macros for the i386/mutex.h as we presently
need those.

Finally, caught up to the interface changes in all sys code.

Contributors: jake, jhb, jasone (in no particular order)


# 71984 04-Feb-2001 peter

All the world is not an i386. Merge rev 1.438 of i386/i386/machdep.c.
Make buffer_map a system map.


# 71785 29-Jan-2001 peter

Send "#if NISA > 0" to the bit-bucket and replace it with an option.
These were compile-time "is the isa code present?" tests and not
'how many isa busses' tests.


# 71736 28-Jan-2001 kato

Synced with sys/i386/i386/machdep.c revision 1.436.


# 71320 21-Jan-2001 jasone

Remove MUTEX_DECLARE() and MTX_COLD. Instead, postpone full mutex
initialization until after malloc() is safe to call, then iterate through
all mutexes and complete their initialization.

This change is necessary in order to avoid some circular bootstrapping
dependencies.


# 71261 19-Jan-2001 peter

Zap unused #include "apm.h"


# 71257 19-Jan-2001 peter

Use #ifdef DEV_NPX from opt_npx.h instead of #if NNPX > 0 from npx.h


# 71228 18-Jan-2001 bmilekic

Implement MTX_RECURSE flag for mtx_init().
All calls to mtx_init() for mutexes that recurse must now include
the MTX_RECURSE bit in the flag argument variable. This change is in
preparation for an upcoming (further) mutex API cleanup.
The witness code will call panic() if a lock is found to recurse but
the MTX_RECURSE bit was not set during the lock's initialization.

The old MTX_RECURSE "state" bit (in mtx_lock) has been renamed to
MTX_RECURSED, which is more appropriate given its meaning.

The following locks have been made "recursive," thus far:
eventhandler, Giant, callout, sched_lock, possibly some others declared
in the architecture-specific code, all of the network card driver locks
in pci/, as well as some other locks in dev/ stuff that I've found to
be recursive.

Reviewed by: jhb


# 71098 16-Jan-2001 peter

Stop doing runtime checking on i386 cpus for cpu class. The cpu is
slow enough as it is, without having to constantly check that it really
is an i386 still. It was possible to compile out the conditionals for
faster cpus by leaving out 'I386_CPU', but it was not possible to
unconditionally compile for the i386. You got the runtime checking whether
you wanted it or not. This makes I386_CPU mutually exclusive with the
other cpu types, and tidies things up a little in the process.

Reviewed by: alfred, markm, phk, benno, jlemon, jhb, jake, grog, msmith,
jasone, dcs, des (and a bunch more people who encouraged it)


# 70968 12-Jan-2001 kato

Merged from sys/i386/i386/machdep.c revisions 1.427 and 1.428.


# 70745 07-Jan-2001 kato

Merged from sys/i386/i386/machdep.c revision 1.426.


# 70085 16-Dec-2000 kato

Merged from sys/i386/i386/machdep.c revision 1.425.


# 69613 05-Dec-2000 kato

Merged from sys/i386/i386/machdep.c revision 1.424.


# 69379 30-Nov-2000 marcel

Don't use p->p_sigstk.ss_flags to keep state of whether the
process is on the alternate stack or not. For compatibility
with sigstack(2) state is being updated if such is needed.

We now determine whether the process is on the alternate
stack by looking at its stack pointer. This allows a process
to siglongjmp from a signal handler on the alternate stack
to the place of the sigsetjmp on the normal stack. When
maintaining state, this would have invalidated the state
information and causing a subsequent signal to be delivered
on the normal stack instead of the alternate stack.

PR: 22286


# 69193 26-Nov-2000 kato

Merged from sys/i386/i386/machdep.c revision 1.422.


# 68936 20-Nov-2000 kato

Merged from sys/i386/i386/machdep.c revision 1.421.


# 68360 05-Nov-2000 nyan

Merged from the following changes.

sys/conf/Makefile.i386 1.211
sys/conf/files.i386 1.329
sys/isa/fd.c 1.186, 1.188 and 1.189
sys/isa/sio.c 1.305 and 1.317
sys/i386/conf/GENERIC 1.270, 1.281, 1.282 and 1.284
sys/i386/i386/machdep.c 1.419
sys/i386/i386/userconfig.c 1.184


# 67786 28-Oct-2000 nyan

Fixed extention memory check routine.

Submitted by: chi@bd.mbn.or.jp (Chiharu Shibata)


# 67708 27-Oct-2000 phk

Convert all users of fldoff() to offsetof(). fldoff() is bad
because it only takes a struct tag which makes it impossible to
use unions, typedefs etc.

Define __offsetof() in <machine/ansi.h>

Define offsetof() in terms of __offsetof() in <stddef.h> and <sys/types.h>

Remove myriad of local offsetof() definitions.

Remove includes of <stddef.h> in kernel code.

NB: Kernelcode should *never* include from /usr/include !

Make <sys/queue.h> include <machine/ansi.h> to avoid polluting the API.

Deprecate <struct.h> with a warning. The warning turns into an error on
01-12-2000 and the file gets removed entirely on 01-01-2001.

Paritials reviews by: various.
Significant brucifications by: bde


# 67367 20-Oct-2000 kato

Merged from sys/i386/i386/machdep.c revisions 1.417 and 1.418.


# 67282 18-Oct-2000 kato

Merged from sys/i386/i386/machdep.c revision 1.416.


# 66735 06-Oct-2000 kato

Merged from sys/i386/i386/machdep.c revision 1.415.


# 66585 03-Oct-2000 kato

Merged from sys/i386/i386/machdep.c revision 1.414.


# 66536 02-Oct-2000 kato

Merged from sys/i368/i386/machdep.c revision 1.413.


# 66475 30-Sep-2000 bmilekic

Big mbuf subsystem diff #1: incorporate mutexes and fix things up somewhat
to accomodate the changes.

Here's a list of things that have changed (I may have left out a few); for a
relatively complete list, see http://people.freebsd.org/~bmilekic/mtx_journal

* Remove old (once useful) mcluster code for MCLBYTES > PAGE_SIZE which
nobody uses anymore. It was great while it lasted, but now we're moving
onto bigger and better things (Approved by: wollman).

* Practically re-wrote the allocation macros in sys/sys/mbuf.h to accomodate
new allocations which grab the necessary lock.

* Make sure that necessary mbstat variables are manipulated with
corresponding atomic() routines.

* Changed the "wait" routines, cleaned it up, made one routine that does
the job.

* Generalized MWAKEUP() macro. Got rid of m_retry and m_retryhdr, as they
are now included in the generalized "wait" routines.

* Sleep routines now use msleep().

* Free lists have locks.

* etc... probably other stuff I'm missing...

Things to look out for and work on later:

* find a better way to (dynamically) adjust EXT_COUNTERS

* move necessity to recurse on a lock from drain routines by providing
lock-free lower-level version of MFREE() (and possibly m_free()?).

* checkout include of mutex.h in sys/sys/mbuf.h - probably violating
general philosophy here.

The code has been reviewed quite a bit, but problems may arise... please,
don't panic! Send me Emails: bmilekic@freebsd.org

Reviewed by: jlemon, cp, alfred, others?


# 66294 23-Sep-2000 kato

Merged from sys/i386/i386/machdep.c revision 1.411.


# 66248 22-Sep-2000 kato

Merged from sys/i386/i386/machdep.c revision 1.410.


# 65875 15-Sep-2000 kato

Merged from sys/i386/i386/machdep.c revision 1.408.


# 65856 14-Sep-2000 jhb

Remove the mtx_t, witness_t, and witness_blessed_t types. Instead, just
use struct mtx, struct witness, and struct witness_blessed.

Requested by: bde


# 65608 08-Sep-2000 kato

Merged from sys/i386/i386/machdep.c revision 1.407.


# 65569 07-Sep-2000 kato

Merged from sys/i386/i386/machdep.c revision 1.406.


# 65410 03-Sep-2000 kato

Merged from sys/i386/i386/machdep.c revision 1.405.


# 65408 03-Sep-2000 kato

Merged from sys/i386/i386/machdep.c rev. 1.404 just for keeping
similarity. No PC-98 may have ACPI feature, but I'm not 100%
sure.


# 64837 19-Aug-2000 dwmalone

Replace the mbuf external reference counting code with something
that should be better.

The old code counted references to mbuf clusters by using the offset
of the cluster from the start of memory allocated for mbufs and
clusters as an index into an array of chars, which did the reference
counting. If the external storage was not a cluster then reference
counting had to be done by the code using that external storage.

NetBSD's system of linked lists of mbufs was cosidered, but Alfred
felt it would have locking issues when the kernel was made more
SMP friendly.

The system implimented uses a pool of unions to track external
storage. The union contains an int for counting the references and
a pointer for forming a free list. The reference counts are
incremented and decremented atomically and so should be SMP friendly.
This system can track reference counts for any sort of external
storage.

Access to the reference counting stuff is now through macros defined
in mbuf.h, so it should be easier to make changes to the system in
the future.

The possibility of storing the reference count in one of the
referencing mbufs was considered, but was rejected 'cos it would
often leave extra mbufs allocated. Storing the reference count in
the cluster was also considered, but because the external storage
may not be a cluster this isn't an option.

The size of the pool of reference counters is available in the
stats provided by "netstat -m".

PR: 19866
Submitted by: Bosko Milekic <bmilekic@dsuper.net>
Reviewed by: alfred (glanced at by others on -net)


# 64813 18-Aug-2000 kato

Merged from sys/i386/i386/machdep.c revision 1.402.


# 64636 14-Aug-2000 kato

Merged from sys/i386/i386/machdep.c revision 1.401.


# 64552 12-Aug-2000 kato

Merged from sys/i386/i386/machdep.c revision 1.400.


# 62876 10-Jul-2000 kris

Don't call printf without a format string.


# 62573 04-Jul-2000 phk

Previous commit changing SYSCTL_HANDLER_ARGS violated KNF.

Pointed out by: bde


# 62454 03-Jul-2000 phk

Style police catches up with rev 1.26 of src/sys/sys/sysctl.h:

Sanitize SYSCTL_HANDLER_ARGS so that simplistic tools can grog our
sources:

-sysctl_vm_zone SYSCTL_HANDLER_ARGS
+sysctl_vm_zone (SYSCTL_HANDLER_ARGS)


# 62068 25-Jun-2000 markm

Remove the old /dev/random device. There is a new machine-independant
version.
Reviewed by: dfr


# 61626 13-Jun-2000 kato

Merged from sys/i386/i386/machdep.c rev 1.395.


# 61330 06-Jun-2000 kato

Merged from sys/i386/i386/machdep.c revision 1.394.


# 60041 05-May-2000 phk

Separate the struct bio related stuff out of <sys/buf.h> into
<sys/bio.h>.

<sys/bio.h> is now a prerequisite for <sys/buf.h> but it shall
not be made a nested include according to bdes teachings on the
subject of nested includes.

Diskdrivers and similar stuff below specfs::strategy() should no
longer need to include <sys/buf.> unless they need caching of data.

Still a few bogus uses of struct buf to track down.

Repocopy by: peter


# 59839 01-May-2000 peter

Move the MSG* and SEM* options to opt_sysvipc.h
Remove evil allocation macros from machdep.c (why was that there???) and
use malloc() instead.
Move paramters out of param.h and into the code itself.
Move a bunch of internal definitions from public sys/*.h headers (without
#ifdef _KERNEL even) into the code itself.

I had hoped to make some of this more dynamic, but the cost of doing
wakeups on all sleeping processes on old arrays was too frightening.
The other possibility is to initialize on the first use, and allow
dynamic sysctl changes to parameters right until that point. That would
allow /etc/rc.sysctl to change SEM* and MSG* defaults as we presently
do with SHM*, but without the nightmare of changing a running system.


# 59779 30-Apr-2000 nyan

Clean up MAXMEM routine.

Submitted by: "K.Magara" <magara@maizuru-ct.ac.jp>


# 59688 27-Apr-2000 nyan

machine/random.h -> sys/random.h


# 59249 15-Apr-2000 phk

Complete the bio/buf divorce for all code below devfs::strategy

Exceptions:
Vinum untouched. This means that it cannot be compiled.
Greg Lehey is on the case.

CCD not converted yet, casts to struct buf (still safe)

atapi-cd casts to struct buf to examine B_PHYS


# 58934 02-Apr-2000 phk

Move B_ERROR flag to b_ioflags and call it BIO_ERROR.

(Much of this done by script)

Move B_ORDERED flag to b_ioflags and call it BIO_ORDERED.

Move b_pblkno and b_iodone_chain to struct bio while we transition, they
will be obsoleted once bio structs chain/stack.

Add bio_queue field for struct bio aware disksort.

Address a lot of stylistic issues brought up by bde.


# 58820 30-Mar-2000 peter

Make sysv-style shared memory tuneable params fully runtime adjustable
via sysctl. It's done pretty simply but it should be quite adequate.
Also move SHMMAXPGS from $machine/include/vmparam.h as the comments that
went with it were wrong... we don't allocate KVM space for the pages so
that comment is bogus.. The only practical limit is how much physical
ram you want to lock up as this stuff isn't paged out or swap backed.


# 58741 28-Mar-2000 kato

Merged from sys/i386/i386/machdep.c revision 1.387.


# 58345 20-Mar-2000 phk

Remove B_READ, B_WRITE and B_FREEBUF and replace them with a new
field in struct buf: b_iocmd. The b_iocmd is enforced to have
exactly one bit set.

B_WRITE was bogusly defined as zero giving rise to obvious coding
mistakes.

Also eliminate the redundant struct buf flag B_CALL, it can just
as efficiently be done by comparing b_iodone to NULL.

Should you get a panic or drop into the debugger, complaining about
"b_iocmd", don't continue. It is likely to write on your disk
where it should have been reading.

This change is a step in the direction towards a stackable BIO capability.

A lot of this patch were machine generated (Thanks to style(9) compliance!)

Vinum users: Greg has not had time to test this yet, be careful.


# 58145 16-Mar-2000 nyan

Fixed to probe extended memory for over 256M or under 64M.

Submitted by: chi@bd.mbn.or.jp (Chiharu Shibata)


# 57656 01-Mar-2000 kato

Merged from sys/i386/i386/machdep.c revisions 1.384 and 1.385.


# 57178 13-Feb-2000 peter

Clean up some loose ends in the network code, including the X.25 and ISO
#ifdefs. Clean out unused netisr's and leftover netisr linker set gunk.
Tested on x86 and alpha, including world.

Approved by: jkh


# 55104 26-Dec-1999 kato

- Cut down amount of memory in 64MB when BIOS tells the amount of
memory >= 64MB.
- Don't perform destructive memory inspection for 15 - 16MB system
area.

Submitted by: NOKUBI Hirotaka <hnokubi@yyy.or.jp>
chi@bd.mbn.or.jp (Chiharu Shibata)


# 54188 06-Dec-1999 luoqi

User ldt sharing.


# 54124 04-Dec-1999 nyan

Sync with sys/i386/i386/machdep.c revision up to 1.381.


# 53687 25-Nov-1999 nyan

Sync with sys/i386/i386/machdep.c revision up to 1.378.


# 53648 23-Nov-1999 archie

Change the prototype of the strto* routines to make the second
parameter a char ** instead of a const char **. This make these
kernel routines consistent with the corresponding libc userland
routines.

Which is actually 'correct' is debatable, but consistency and
following the spec was deemed more important in this case.

Reviewed by (in concept): phk, bde


# 53503 21-Nov-1999 phk

s/p_cred->pc_ucred/p_ucred/g


# 53107 12-Nov-1999 nyan

Sync with sys/i386/i386/machdep.c revision 1.375.


# 52826 03-Nov-1999 nyan

Sync with sys/i386/i386/machdep.c revision 1.371.


# 52720 31-Oct-1999 alc

The useracc() calls in osigreturn() and sigreturn() should specify
VM_PROT_READ rather than VM_PROT_WRITE. (This mistake predates
the B_READ/B_WRITE -> VM_PROT_READ/VM_PROT_WRITE change.)

Submitted by: bde


# 52644 30-Oct-1999 phk

Change useracc() and kernacc() to use VM_PROT_{READ|WRITE|EXECUTE} for the
"rw" argument, rather than hijacking B_{READ|WRITE}.

Fix two bugs (physio & cam) resulting by the confusion caused by this.

Submitted by: Tor.Egge@fast.no
Reviewed by: alc, ken (partly)


# 52635 29-Oct-1999 phk

useracc() the prequel:

Merge the contents (less some trivial bordering the silly comments)
of <vm/vm_prot.h> and <vm/vm_inherit.h> into <vm/vm.h>. This puts
the #defines for the vm_inherit_t and vm_prot_t types next to their
typedefs.

This paves the road for the commit to follow shortly: change
useracc() to use VM_PROT_{READ|WRITE} rather than B_{READ|WRITE}
as argument.


# 52206 13-Oct-1999 kato

Sync with sys/i386/i386/machdep.c revision 1.370.


# 52140 11-Oct-1999 luoqi

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


# 52024 08-Oct-1999 marcel

Synchronize with i386 rev 1.367


# 51942 04-Oct-1999 marcel

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


# 51838 01-Oct-1999 kato

Sync w/ sys/i386/i386/machdep.c revision 1.364.


# 51792 29-Sep-1999 marcel

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.


# 51105 09-Sep-1999 kato

Merge from sys/i386/i386/machdep.c revision 1.361.


# 50477 27-Aug-1999 peter

$Id$ -> $FreeBSD$


# 50007 18-Aug-1999 kato

Merge from sys/i386/i386/machdep.c revision 1.359.


# 49558 09-Aug-1999 phk

Merge the cons.c and cons.h to the best of my ability. alpha may or
may not compile, I can't test it.


# 49259 30-Jul-1999 kato

Sync with sys/i386/i386/machdep.c revision 1.357.


# 49118 26-Jul-1999 kato

Sync with sys/i386/i386/machdep.c revision 1.356.


# 48699 09-Jul-1999 kato

Sync with sys/i386/i386/machdep.c revision 1.355.


# 48681 08-Jul-1999 kato

Sync with sys/i386/i386/machdep.c revision up to 1.354.


# 48579 05-Jul-1999 msmith

Move the initialisation/tuning of nmbclusters from param.c/machdep.c
into uipc_mbuf.c. This reduces three sets of identical tunable code to
one set, and puts the initialisation with the mbuf code proper.

Make NMBUFs tunable as well.

Move the nmbclusters sysctl here as well.

Move the initialisation of maxsockets from param.c to uipc_socket2.c,
next to its corresponding sysctl.

Use the new tunable macros for the kern.vm.kmem.size tunable (this should have
been in a separate commit, whoops).


# 48513 03-Jul-1999 kato

Sync with sys/i386/i386/machdep.c revision 1.349.


# 48375 30-Jun-1999 kato

Sync with sys/i386/i386/machdep.c revision 1.345.


# 48320 28-Jun-1999 kato

Sync with sys/i386/i386/machdep.c revision 1.344.


# 48068 21-Jun-1999 kato

Sync with sys/i386/i386/machdep.c revision 1.342.


# 47977 17-Jun-1999 kato

Sync with sys/i386/i386/machdep.c revision up to 1.341.


# 47713 03-Jun-1999 kato

Sync with sys/i386/i386/machdep.c revision 1.339.

New function getmemsize_pc98 is added in this commit, since PC98 is
quite different in obtaining memory size from IBM-PC. Many lines of
this function is shareable with IBM-PC's getmemsize function, but
sharing needs many #ifdef PC98 statements. Therefore, I gave up
sharing code with IBM-PC's and just added new function.


# 47081 12-May-1999 luoqi

Unbreak VESA on SMP.


# 46539 05-May-1999 luoqi

Initialize dblfault_tss.tss_fs to the per-cpu private data segment selector.


# 46537 05-May-1999 luoqi

Do not set curproc until proc0 is fully initialized (in proc0_init()).


# 46147 28-Apr-1999 kato

Sync with sys/i386/i386/machdep.c revision 1.332.


# 45857 20-Apr-1999 kato

Sync with sys/i386/i386/machdep.c revision 1.330.


# 45783 18-Apr-1999 kato

Sync with follwing files:

Path Revision
i386/conf/GENERIC 1.162
i386/conf/Makefile.i386 1.146
i386/conf/files.i386 1.236
i386/conf/options.i386 1.111
i386/i386/machdep.c 1.329
i386/i386/userconfig.c 1.134
i386/isa/fd.c 1.135
i386/isa/if_ed.c 1.151
i386/isa/isa_dam.c 1.1
i386/isa/npx.c 1.67
isa/sio.c 1.224
dev/syscons/syscons.c 1.300
i386/isa/wd.c 1.194
isa/vga_isa.c 1.5
isa/atkbd_isa.c 1.3
isa/syscons_isa.c 1.2

Submitted by: Takahashi Yoshihiro <nyan@wyvern.cc.kogakuin.ac.jp>


# 45270 03-Apr-1999 jdp

Restore support for executing BSD/OS binaries on the i386 by passing
the address of the ps_strings structure to the process via %ebx.
For other kinds of binaries, %ebx is still zeroed as before.

Submitted by: Thomas Stephens <tas@stephens.org>
Reviewed by: jdp


# 44514 06-Mar-1999 kato

Sync with sys/i386/i386/machdpe.c revision 1.327.


# 44079 16-Feb-1999 kato

Sync with sys/i386/i386/machdep.c revision 1.326.


# 43922 12-Feb-1999 kato

Sync with sys/i386/i386/machdep.c revision 1.325.


# 43589 04-Feb-1999 kato

Sync with sys/i386/i386/machdep.c revision 1.324.


# 43389 29-Jan-1999 kato

Sync with sys/i386/i386/machdep.c revision 1.323.


# 42723 16-Jan-1999 kato

Sync with sys/i386/i386/machdep.c revision up to 1.322.


# 42403 08-Jan-1999 kato

Sync with sys/i386/i386/machdep.c revision 1.320.


# 41871 16-Dec-1998 bde

Removed the cast to a pointer in the definition of PS_STRINGS and
adjusted related casts to match (only in the kernel in this commit).
The pointer was only wanted in one place in kern_exec.c. Applications
should use the kern.ps_strings sysctl instead of PS_STRINGS, so they
shouldn't notice this change.


# 41675 11-Dec-1998 kato

Sync with sys/i386/i386/machdep.c revision 1.317.


# 41454 02-Dec-1998 kato

- For some old Cyrix CPUs, %cr2 is clobbered by interrupts. This
problem is worked around by using an interrupt gate for the page
fault handler. This code was originally made for NetBSD/pc98 by
Naofumi Honda <honda@kururu.math.sci.hokudai.ac.jp> and has already
been in PC98 tree. Because of this bug, trap_fatal cannot show
correct page fault address if %cr2 is obtained in this function.
Therefore, trap_fatal uses the value from trap() function.
- The trap handler always enables interruption when buggy application
or kernel code has disabled interrupts and then trapped. This code
was prepared by Bruce Evans <bde@FreeBSD.org>.

Submitted by: Bruce Evans <bde@FreeBSD.org>
Naofumi Honda <honda@kururu.math.sci.hokudai.ac.jp>


# 40956 06-Nov-1998 kato

Sync with sys/i386/i386/machdep.c revision up to 1.315.


# 40223 11-Oct-1998 kato

Sync with sys/i386/i386/machdep.c revision 1.313.


# 40120 09-Oct-1998 kato

Sync with sys/i386/i386/machdep.c revision 1.312.


# 39820 30-Sep-1998 kato

Sync with sys/i386/i386/machdep.c revision 1.311.


# 39710 28-Sep-1998 kato

Sync with sys/i386/i386/machdep.c revision 1.310.


# 39205 15-Sep-1998 kato

Sync with sys/i386/i386/machdep.c revision up to 1.309.


# 38726 01-Sep-1998 kato

Sync with sys/i386/i386/machdep.c revision 1.306.


# 38717 01-Sep-1998 kato

- Fix style bug.
- hw.ispc98 -> machdep.ispc98.

Submitted by: Garrett Wollman (hw -> machdep)


# 38673 31-Aug-1998 kato

- hw.machine_arch returns cpu architecture type.
- moved definition of MACHINE_ARCH from cpu.h to parm.h as alpha.
- Added definitions of _MACHINE and _MACHINE_ARCH.
- Added hw.ispc98. The hw.ispc98 is 1 in PC98 kernel and is 0 in
IBM-PC kernel.

Discussed with: John Birrell <jb@FreeBSD.ORG>


# 38436 19-Aug-1998 kato

Sync with sys/i386/i386/machdep.c revision 1.304.


# 37567 11-Jul-1998 kato

Sync with sys/i386/i386/machdep.c revision 1.303.


# 37337 02-Jul-1998 kato

Sync with sys/i386/i386/machdep.c revision 1.302.


# 37108 22-Jun-1998 kato

Sync with sys/i386/i386/machdep.c revision 1.301.


# 37039 17-Jun-1998 kato

Sync with sys/i386/i386/machdep.c revision 1.300.


# 36762 08-Jun-1998 kato

Merge 64bit portability fixes from sys/i386 stuff.


# 36608 03-Jun-1998 kato

Sync with sys/i386/i386/machdep.c revision 1.298.


# 36447 28-May-1998 kato

Sync with sys/i386/i386/machdep.c revision 1.297.


# 36187 19-May-1998 kato

Sync with sys/i386/i386/machdep.c revision 1.296.


# 35092 07-Apr-1998 kato

Sync with sys/i386/i386/machdep.c revision 1.294.


# 34863 24-Mar-1998 kato

Sync with sys/i386/i386/machdep.c and trap.c revisions 1.293 and
1.123, respectively.


# 34225 08-Mar-1998 kato

Sync with sys/i386/i386/machdep.c revision 1.292.


# 34186 07-Mar-1998 kato

Sync with sys/i386/i386/machdep.c revision 1.291.


# 33993 02-Mar-1998 kato

Sync with sys/i386/i386/machdep.c revision 1.290.


# 33190 09-Feb-1998 kato

Sync with sys/i386/i386/machdep.c revision 1.289.


# 33134 06-Feb-1998 eivind

Back out DIAGNOSTIC changes.


# 33115 05-Feb-1998 kato

Sync with sys/i386/i386/machdep.c and trap.c reivsions 1.287 and
1.121, respectively.


# 33079 04-Feb-1998 kato

Sync with sys/i386/i386/machdep.c revision 1.286.


# 32890 30-Jan-1998 kato

Sync with sys/i386/i386/machdep.c revision 1.285.


# 32765 25-Jan-1998 kato

Even though BIOS writer's guide recommends cpuid instruction of Cyrix
6x86MX CPU is enabled (BIOS should not disable it), some BIOS disables
it via CCR4. In this case, cpu variable becomes CPU_486 and
identblue() is called. Because Cyrix 6x86MX has MSR and doesn't have
MSR1002, wrmsr instruction generates general protection fault.

Tested by: Simon Coggins <chaos@ultra.net.au>


# 32729 24-Jan-1998 kato

Sync with sys/i386/i386/machdep.c revision 1.283.


# 32727 24-Jan-1998 kato

Sync with sys/i386/i386/machdep.c revision 1.282.


# 32481 12-Jan-1998 kato

Sync with sys/i386/i386/machdep.c revision 1.281.


# 32318 07-Jan-1998 kato

1: Fixed compile error when WB_CACH is defined.
2: Fixed !M_EPSON_PC98 case.

Reviewed by: Chiharu Shibata <chi@rd.njk.co.jp>


# 32010 27-Dec-1997 peter

#include "opt_user_ldt.h" so that the #ifdef USER_LDT checks can work, as
commented about at length in the PR audit trail.

PR: 2412


# 31770 16-Dec-1997 kato

Don't use PG_N if EPSON PC-486HX/HG/HA (PC-9801 compatible) are
detected. These machine cannot make L2 cache write-through by PG_N,
and only I/O access (undocumented) can do that. If PG_N is used,
system hangs.

Reviewed by: tos@fa2.so-net.or.jp (Toshiyuki Kawashima)


# 31716 14-Dec-1997 kato

Sync with sys/i386/i386/machdep.c revision 1.279.


# 31554 05-Dec-1997 kato

Sync with sys/i386/i386/machdep.c and trap.c revisions 1.278 and
1.118, respectively.


# 31513 03-Dec-1997 kato

Sync with sys/i386/i386/machdep.c and trap.c revisions 1.275 and
1.116, respectively.


# 31410 25-Nov-1997 kato

Sync with sys/i386/i386/machdep.c revision up to 1.274.


# 31018 07-Nov-1997 kato

Sync with following files:
- sys/i386/i386/machdep.c revision 1.271
- sys/i386/i386/trap.c revision 1.114
- sys/i386/isa/if_ed.c revision 1.128
- sys/i386/isa/if_fe.c revision 1.34
- sys/i386/isa/syscons.c revision 1.238.
- sys/i386/isa/wd.c revision 1.144


# 30366 13-Oct-1997 kato

Synchronize with sys/i386/i386/machdep.c revision 1.269.


# 30328 12-Oct-1997 kato

Synchronize with sys/i386/i386/machdep.c revision 1.268.


# 29873 26-Sep-1997 kato

Synchronize with sys/i386/i386/machdep.c revision 1.266.


# 29714 22-Sep-1997 kato

Synchronize with sys/i386/i386/machdep.c and trap.c reivisions 1.265
and 1.111, respectively.


# 29132 05-Sep-1997 kato

Synchronize with sys/i386/i386/machdep.c revision up to 1.263.


# 29075 03-Sep-1997 kato

Synchronize with sys/i386/i386/machdep.c and microtime.s revisions
1.261 and 1.32, respectively.


# 29007 01-Sep-1997 kato

Synchronize with sys/i386/i386/machdep.c revision 1.260.


# 28831 27-Aug-1997 kato

Synchronize with sys/i386/i386/machdep.c and trap.c revision 1.258 and
1.108, respectively.


# 28525 21-Aug-1997 kato

Synchronize with sys/i386/i386/machdep.c, trap.c and
sys/i386/isa/npx.c revisions 1.257, 1.107 and 1.52, respectively.


# 28373 18-Aug-1997 kato

Synchronize with sys/i386/i386/machdep.c, trapc and sys/i386/isa/npx.c
revisions 1.256, 1.105 and 1.51, respectively.


# 28004 08-Aug-1997 kato

Synchronize with sys/i386/i386/machdep.c revision 1.255.


# 27939 06-Aug-1997 kato

Synchronize with sys/i386/i386/machdep.c revision 1.254.


# 27576 21-Jul-1997 kato

Synchronize with sys/i386/i386/machdep.c and trap.c revisions 1.253
and 1.101, respectively.


# 27102 30-Jun-1997 kato

Synchronize with sys/i386/i386/machdep.c revision 1.252.


# 26843 23-Jun-1997 kato

Synchronize with following changes:

> Revision Changes Path
> 1.250 +1 -18 src/sys/i386/i386/machdep.c
> 1.48 +1 -7 src/sys/i386/conf/options.i386
> 1.251 +19 -46 src/sys/i386/i386/machdep.c
> 1.24 +2 -6 src/sys/i386/i386/microtime.s
> 1.100 +4 -15 src/sys/i386/i386/trap.c
> 1.46 +6 -7 src/sys/i386/isa/npx.c


# 26661 15-Jun-1997 kato

Synchronize with sys/i386/i386/machdep.c revision up to 1.249.


# 26526 09-Jun-1997 kato

Synchronize with sys/i386/i386/machdep.c and trap.c revisions 1.247
and 1.99, respectively.


# 26384 02-Jun-1997 kato

Synchronize with following files:

Revision Changes Path
> 1.165 +2 -1 src/sys/i386/conf/files.i386
> 1.246 +2 -1 src/sys/i386/i386/machdep.c
> 1.98 +2 -2 src/sys/i386/i386/trap.c
> 1.87 +2 -2 src/sys/i386/isa/clock.c
> 1.89 +2 -356 src/sys/i386/isa/isa.c
> 1.45 +2 -1 src/sys/i386/isa/npx.c


# 26226 28-May-1997 kato

Synchronize with sys/i386/i386/machdep.c revision up to 1.245.


# 26059 23-May-1997 kato

Synchronize with sys/i386/i386/machdep.c revision 1.242.


# 25748 12-May-1997 kato

Synchronize with sys/i386/i386/machdep.c revision 1.241.


# 25576 08-May-1997 kato

Synchronize with sys/i386/i386/machdep.c revision 1.240.


# 25195 27-Apr-1997 kato

Merge SMP code from IBM-PC tree into PC-98 tree.


# 25088 22-Apr-1997 kato

Synchronize with sys/i386/conf/Makefile.i386, sys/i386/i386/machdep.c
and sys/i386/isa/npx.c revisions 1.94, 1.238 and 1.41, respectively.


# 24854 13-Apr-1997 kato

Synchronize with sys/i386/i386/machdep.c revision 1.237.


# 24701 07-Apr-1997 kato

Synchronize with sys/i386/i386{machdep.c,trap.c} revisions 1.236 and
1.91, respectively.


# 24437 31-Mar-1997 dg

Changed the way that the exec image header is read to be filesystem-
centric rather than VM-centric to fix a problem with errors not being
detectable when the header is read.
Killed exech_map as a result of these changes.
There appears to be no performance difference with this change.


# 24358 29-Mar-1997 kato

Synchronize with sys/i386/i386/machdep.c revision 1.233.


# 24285 26-Mar-1997 kato

Synchronize with sys/i386/i386/machdep.c revision 1.232.


# 24209 24-Mar-1997 bde

Don't include <sys/ioctl.h> in the kernel. Stage 9: same changes
in pc98 as in isa.


# 24112 22-Mar-1997 kato

Improved CPU identification and initialization routines. This
supports All Cyrix CPUs, IBM Blue Lightning CPU and NexGen (now AMD)
Nx586 CPU, and initialize special registers of Cyrix CPU and msr of
IBM Blue Lightning CPU.

If revision of Cyrix 6x86 CPU < 2.7, CPU cache is enabled in
write-through mode. This can be disabled by kernel configuration
options.

Reviewed by: Bruce Evans <bde@freebsd.org> and
Jordan K. Hubbard <jkh@freebsd.org>


# 23116 25-Feb-1997 kato

Synchronize with sys/i386/i386/machdep.c revision 1.229.


# 22975 22-Feb-1997 peter

Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are not
ready for it yet.


# 22533 10-Feb-1997 kato

Synchronize with Lite/2 commit: i386/i386/machdep.c, i386/i386/trap.c,
i386/isa/fd.c and i386/isa/wd.c revisions 1.227, 1.87, 1.96 and 1.123,
respectively.


# 22002 25-Jan-1997 kato

Synchronize with sys/i386/i386/machdep.c rev. 1.226.


# 21842 18-Jan-1997 kato

Synchronize with sys/i386/i386/machdep.c (revision 1.225).


# 21673 14-Jan-1997 jkh

Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.


# 21011 29-Dec-1996 kato

Synchronize with sys/i386/i386/machdep.c revision 1.223 (clean-up of
useracc call).


# 20657 18-Dec-1996 kato

Sync with sys/i386/i386/machdep.c revision 1.222 (move printing of
BIOS geometry).


# 20587 17-Dec-1996 kato

Sync with i386/i386/machdep.c revision 1.221 (fix nbuf calculation).


# 20496 15-Dec-1996 kato

Synchronize with sys/i386/i386/machdep.c revision 1.220.
Definite 2.2 candidate.


# 20364 12-Dec-1996 kato

Synchronize with sys/i386/i386/machdep.c revision 1.219.
2.2 candidate.


# 20327 11-Dec-1996 kato

Sync with sys/i386/i386/machdep.c revision 1.218.
It's not 2.2 candidate.


# 20176 06-Dec-1996 kato

Synchronize with sys/i386/i386/machdep.c revision 1.217.
This should not be in 2.2 until original change is merged.


# 20129 04-Dec-1996 asami

Syncronize.

Submitted by: The FreeBSD(98) Development Team


# 20127 04-Dec-1996 asami

Synchronize with the RELENG_2_2 branch.

Definite 2.2 candidate.

Submitted by: The FreeBSD(98) Development Team


# 20070 01-Dec-1996 bde

Removed all references to b_cylinder (aka b_cylin). It was evil and
hasn't been used for a year or two since disksort() started sorting
on b_pblkno.


# 19701 13-Nov-1996 asami

Another round of resync and some added sound support.

sys/pc98/i386/machdep.c: sync with i386/i386/machdep.c
sys/pc98/conf/options.pc98: sync with i386/conf/options.i386

sys/i386/isa/sound: DMA auto initialize mode support for PC98.
contributed by: Akio Morita <amorita@bird.scphys.kyoto-u.ac.jp>

Definite 2.2 material, I believe.

Submitted by: The FreeBSD (98) Development Team


# 19326 02-Nov-1996 asami

The last update/merge of PC98 stuff before 2.2. The whole
pc98/pc98/sound directory has vanished now!

Submitted by: FreeBSD(98) Development Team


# 19248 29-Oct-1996 asami

Another round of merge/updates.

(1) Add #ifdef PC98:

sys/pc98/boot/biosboot/boot2.S

(2) Fix bug that made it impossible to boot from sd's other than unit 0:
sys/pc98/boot/biosboot/sys.c

(3) Delete redundant $Id$:

sys/pc98/pc98/clock.c (reject?\027$B$5$l$k$+$b$7$l$J$$?\027(B)

(4) unt -> u_int:
sys/pc98/pc98/if_ed.c

(5) Add support for rebooting by the hot-key sequence:

sys/pc98/pc98/kbdtables.h

(6) Display now looks like PC/AT version:

sys/pc98/pc98/npx.c

(7) Change comment to match that of PC/AT version:

sys/pc98/pc98/pc98.c

(8) Add function prototypes:

sys/pc98/pc98/pc98_machdep.c

(9) Include PC98 headers:

sys/pc98/pc98/sound/adlib_card.c
sys/pc98/pc98/sound/audio.c
sys/pc98/pc98/sound/dev_table.c
sys/pc98/pc98/sound/dmabuf.c
sys/pc98/pc98/sound/midi_synth.c
sys/pc98/pc98/sound/midibuf.c
sys/pc98/pc98/sound/opl3.c
sys/pc98/pc98/sound/oatmgr.c
sys/pc98/pc98/sound/sb16_dsp.c
sys/pc98/pc98/sound/sb16_midi.c
sys/pc98/pc98/sound/sb_card.c
sys/pc98/pc98/sound/sb_dsp.c
sys/pc98/pc98/sound/sb_midi.c
sys/pc98/pc98/sound/sb_mixer.c
sys/pc98/pc98/sound/sequencer.c
sys/pc98/pc98/sound/sound_config.h
sys/pc98/pc98/sound/sound_switch.c
sys/pc98/pc98/sound/soundcard.c
sys/pc98/pc98/sound/sys_timer.c

(10) Merge in PC98 changes:

sys/i386/isa/sound/os.h

(11) Deleted as result of 9. and 10. above:

sys/pc98/pc98/sound/ad1848_mixer.h
sys/pc98/pc98/sound/aedsp16.c
sys/pc98/pc98/sound/coproc.h
sys/pc98/pc98/sound/finetune.h
sys/pc98/pc98/sound/gus_hw.h
sys/pc98/pc98/sound/gus_linearvol.h
sys/pc98/pc98/sound/hex2hex.h
sys/pc98/pc98/sound/mad16.h
sys/pc98/pc98/sound/midi_ctrl.h
sys/pc98/pc98/sound/midi_synth.h
sys/pc98/pc98/sound/opl3.h
sys/pc98/pc98/sound/os.h
sys/pc98/pc98/sound/pas.h
sys/pc98/pc98/sound/sb_mixer.h
sys/pc98/pc98/sound/soundvers.h
sys/pc98/pc98/sound/tuning.h

Submitted by: The FreeBSD(98) Development Team


# 19122 23-Oct-1996 asami

Another round of merge.

(1) Bug fix (pass boot drive):

pc98/boot/biosboot/boot2.S

(2) Delete code for unsupported high-resolution modes and move old
Epson notebook code to epsonio.h:

pc98/boot/biosboot/io.c
pc98/i386/vm_machdep.c
pc98/pc98/fd.c
pc98/pc98/pc98.c
pc98/pc98/pc98.h
pc98/pc98/epsonio.h (new)

(3) Change aic driver so that PCMCIA cards (I/O port same as PC/AT)
and PC-9801-100 cards can be selected with a flag in kernel config
file:

pc98/pc98/aic6360.c
pc98/pc98/aic_98.h (new)

(4) Fix wcd entry (it was broken). Delete mcd, it doesn't work on
98. Change aic entry according to above:

pc98/conf/GENERIC98

(5) Move pc98_machdep.c to top of files in pc98/pc98:

pc98/conf/files.pc98

(6) Delete empty lines:

pc98/i386/locore.s

(7) Fix (it didn't work if I586 was specified):

pc98/pc98/clock.c

(8) Staticize:

pc98/pc98/pc98_machdep.c

(9) Enable workaround for Cyrix bug for 5x86 also:

pc98/i386/machdep.c
pc98/i386/trap.c

All the above deletes this file too:

pc98/i386/pmap.c

(phew!)
Submitted by: The FreeBSD(98) Development Team


# 18846 09-Oct-1996 asami

Another round of updates. Highlights:

(1) Merged i386/i386/sb.h, deleted pc98/pc98/sb.h.

(2) pc98/conf/GENERIC8 looks more like i386/conf/GENERIC now.

(3) Fixed display bug in pc98/boot/biosboot/io.c.

(4) Prepare to merge memory allocation routines:

pc98/i386/locore.s
pc98/i386/machdep.c
pc98/pc98/pc98_machdep.c
pc98/pc98/pc98_machdep.h

(5) Support new board "C-NET(98)":

pc98/pc98/if_ed98.h
pc98/pc98/if_ed.c

(6) Make sure FPU is recognized for non-Intel CPUs:

pc98/pc98/npx.c

(7) Do not expect bss to be zero-allocated:

pc98/pc98/pc98.c

Submitted by: The FreeBSD(98) Development Team


# 18265 12-Sep-1996 asami

Another round of merge/update.

(1) Add PC98 support to apm_bios.h and ns16550.h, remove pc98/pc98/ic
(2) Move PC98 specific code out of cpufunc.h (to pc98.h)
(3) Let the boot subtrees look more alike

Submitted by: The FreeBSD(98) Development Team
<freebsd98-hackers@jp.freebsd.org>


# 18208 10-Sep-1996 asami

More merge. Change "pc98" to "isa" in a few places. Misc. cleanup.
Add some more devices to userconfig.c.

Submitted by: The FreeBSD(98) Development Team


# 18095 07-Sep-1996 asami

Yet another merge. Remove support.s by deleting memcopy. Remove
autoconf.c by merging icu.h. Fix a couple of typos.

Submitted by: The FreeBSD(98) Development Team.


# 18029 04-Sep-1996 asami

More merge.

(1) Remove mk30line (moved to /usr/sbin, but not in our source tree yet)

(2) Delete unneeded (well, harmful now :) code to prohibit #including
of isa_device.h from PC98 sources.

(3) Remove files now equal to their ISA/PC-AT counterparts.

Submitted by: The FreeBSD(98) Development Team


# 18010 03-Sep-1996 asami

Second phase of merge, get rid of more machine-independent-dependencies.
Get rid of pc98/pc98/pc98_device.h.

Submitted by: The FreeBSD(98) Development Team


# 17947 30-Aug-1996 asami

Re-sync with the state of PC98 world. This will be the last commit before
we start merging things in earnest...

Submitted by: The FreeBSD(98) Development Team


# 17256 23-Jul-1996 asami

Update to current state of PC98 world.

Submitted by: The FreeBSD(98) development team


# 16359 14-Jun-1996 asami

The PC98-specific files.

Ok'd by: core
Submitted by: FreeBSD(98) development team