Commit Graph

9315 Commits

Author SHA1 Message Date
David E. O'Brien
1e514ebb71 Only i386 has npx device. 2003-02-13 21:55:13 +00:00
Peter Wemm
939a4397b1 Oops. I mis-remembered about the P4 problems. It was 5.0-DP2 that
was shipped with DISABLE_PG_G and DISABLE_PSE, not 5.0-REL.  *blush*
Disable the code - but still leave it there in case its still lurking.
2003-02-13 02:42:06 +00:00
Peter Wemm
521871f1fa Turn of PG_PS and PG_G for Pentium-4 cpus at boot time. This is so
that we can stop turning off PG_G and PG_PS globally for releases.
2003-02-13 01:52:44 +00:00
Alan Cox
393a225ced Remove kptobj. Instead, use VM_ALLOC_NOOBJ. 2003-02-12 04:35:37 +00:00
Poul-Henning Kamp
70d8e2e9aa Switch to using the TSC code in i386/i386/tsc.c. 2003-02-11 11:43:25 +00:00
Mike Barcroft
8cf5ed5125 Implement fpclassify():
o Add a MD header private to libc called _fpmath.h; this header
  contains bitfield layouts of MD floating-point types.
o Add a MI header private to libc called fpmath.h; this header
  contains bitfield layouts of MI floating-point types.
o Add private libc variables to lib/libc/$arch/gen/infinity.c for
  storing NaN values.
o Add __double_t and __float_t to <machine/_types.h>, and provide
  double_t and float_t typedefs in <math.h>.
o Add some C99 manifest constants (FP_ILOGB0, FP_ILOGBNAN, HUGE_VALF,
  HUGE_VALL, INFINITY, NAN, and return values for fpclassify()) to
  <math.h> and others (FLT_EVAL_METHOD, DECIMAL_DIG) to <float.h> via
  <machine/float.h>.
o Add C99 macro fpclassify() which calls __fpclassify{d,f,l}() based
  on the size of its argument.  __fpclassifyl() is never called on
  alpha because (sizeof(long double) == sizeof(double)), which is good
  since __fpclassifyl() can't deal with such a small `long double'.

This was developed by David Schultz and myself with input from bde and
fenner.

PR:		23103
Submitted by:	David Schultz <dschultz@uclink.Berkeley.EDU>
		(significant portions)
Reviewed by:	bde, fenner (earlier versions)
2003-02-08 20:37:55 +00:00
Alan Cox
571cd8a190 MF alpha
- Synchronize access to the allpmaps list with a mutex.
2003-02-08 05:41:41 +00:00
Peter Wemm
e2294003a2 Commit some cosmetic changes I had laying around and almost included
with another commit.  Unwrap a line.  Unexpand a pmap_kenter().
2003-02-07 01:52:06 +00:00
Poul-Henning Kamp
dd43ae4272 This file has no longer any content from the original Berkeley file so
replace the UCB copyright with a FreeBSD 2 clause thing.

Remove some no longer relevant comments.
2003-02-05 11:11:39 +00:00
Poul-Henning Kamp
d1b40f007d i386/i386/tsc.c was repo-copied from i386/isa/clock.c.
Remove all the stuff that does not relate to the TSC.

Change the calibration to use DELAY(1000000) rather than trying to check
it against the CMOS RTC, this drastically increases precision:

Using 25 samples on a Athlon 700MHz UP machine I find:

                stddev          min          max        average
CMOS             22200 Hz    -74980 Hz     34301 Hz   704928721 Hz
DELAY             1805 Hz     -1984 Hz      2678 Hz   704937583 Hz

(The difference between the two averages is not statistically significant.)

expressed in PPM of the frequency:
                stddev          min          max
CMOS             31.49 PPM  -106.37 PPM    48.66 PPM
DELAY             2.56 PPM     2.81 PPM     3.80 PPM

This code will not be used until a followup commit to sys/isa/clock.c
and sys/pc98/pc98/clock.c which will only happen after some field testing.
2003-02-05 09:20:40 +00:00
Poul-Henning Kamp
553ebddc59 Make get_cyclecount() use binuptime() when no tsc is available: it is cheaper. 2003-02-05 08:55:10 +00:00
Hartmut Brandt
e557905435 Fix a problem in bus_dmamap_load_{mbuf,uio} when the first mbuf or the first
uio segment is empty. In this case no dma segment is create by
bus_dmamap_load_buffer, but the calling routine clears the first flag.
Under certain combinations of addresses of the first and second mbuf/uio
buffer this leads to corrupted DMA segment descriptors. This was already
fixed by tmm in sparc64/sparc64/iommu.c.

PR:		kern/47733
Reviewed by:	sam
Approved by:	jake (mentor)
2003-02-04 16:30:27 +00:00
Poul-Henning Kamp
91f1c2b3cc Split the global timezone structure into two integer fields to
prevent the compiler from optimizing assignments into byte-copy
operations which might make access to the individual fields non-atomic.

Use the individual fields throughout, and don't bother locking them with
Giant: it is no longer needed.

Inspired by:    tjr
2003-02-03 19:49:35 +00:00
Jake Burkholder
238dd3209a Split statclock into statclock and profclock, and made the method for driving
statclock based on profhz when profiling is enabled MD, since most platforms
don't use this anyway.  This removes the need for statclock_process, whose
only purpose was to subdivide profhz, and gets the profiling clock running
outside of sched_lock on platforms that implement suswintr.
Also changed the interface for starting and stopping the profiling clock to
do just that, instead of changing the rate of statclock, since they can now
be separate.

Reviewed by:	jhb, tmm
Tested on:	i386, sparc64
2003-02-03 17:53:15 +00:00
Hajimu UMEMOTO
ca26842e2a Add IPv6 support for Linuxlator.
Reviewed by:	dwmalone
MFC after:	10 days
2003-02-03 17:43:20 +00:00
Alan Cox
ca380469a2 - Make allpmaps static.
- Use atomic subtract to update the global wired pages count.  (See
   also vm/vm_page.c revision 1.233.)
 - Assert that the page queue lock is held in pmap_remove_entry().
2003-02-03 00:05:11 +00:00
Alfred Perlstein
04738e99b5 Catch more uses of MIN(). 2003-02-02 13:30:00 +00:00
Alfred Perlstein
8deebb0160 Consolidate MIN/MAX macros into one place (param.h).
Submitted by: Hiten Pandya <hiten@unixdaemons.com>
2003-02-02 13:17:30 +00:00
Josef Karthauser
c0c9e71f9a Put replace spaces with tabs in keeping with the rest of the file. 2003-02-01 18:45:18 +00:00
Poul-Henning Kamp
5d4a99771a add PST to i386 notes. 2003-02-01 17:23:20 +00:00
Julian Elischer
6f8132a867 Reversion of commit by Davidxu plus fixes since applied.
I'm not convinced there is anything major wrong with the patch but
them's the rules..

I am using my "David's mentor" hat to revert this as he's
offline for a while.
2003-02-01 12:17:09 +00:00
Poul-Henning Kamp
3c99c0bc50 Make tsc_freq a 64bit quantity.
Inspired by:    http://www.theinquirer.net/?article=7481
2003-01-29 11:36:39 +00:00
Scott Long
5193a34646 Implement bus_dmamem_alloc_size() and bus_dmamem_free_size() as
counterparts to bus_dmamem_alloc() and bus_dmamem_free().  This allows
the caller to specify the size of the allocation instead of it defaulting
to the max_size field of the busdma tag.

This is intended to aid in converting drivers to busdma.  Lots of
hardware cannot understand scatter/gather lists, which forces the
driver to copy the i/o buffers to a single contiguous region
before sending it to the hardware.  Without these new methods, this
would require a new busdma tag for each operation, or a complex
internal allocator/cache for each driver.

Allocations greater than PAGE_SIZE are rounded up to the next
PAGE_SIZE by contigmalloc(), so this is not suitable for multiple
static allocations that would be better served by a single
fixed-length subdivided allocation.

Reviewed by:	jake (sparc64)
2003-01-29 07:25:27 +00:00
Jake Burkholder
aff81a81d6 Remove BDE_DEBUGGER.
Discussed with:	bde
2003-01-28 19:05:44 +00:00
Alan Cox
d6d92c84c1 Merge pmap_testbit() and pmap_is_modified(). The latter is the only caller
of the former.
2003-01-28 03:01:35 +00:00
Julian Elischer
a18b6f65d0 Fix KSE related patch.
Make it compile for the SMP case..
statclock_process() has changed prototypes.
2003-01-26 21:32:08 +00:00
David Xu
0dbb100b9b Move UPCALL related data structure out of kse, introduce a new
data structure called kse_upcall to manage UPCALL. All KSE binding
and loaning code are gone.

A thread owns an upcall can collect all completed syscall contexts in
its ksegrp, turn itself into UPCALL mode, and takes those contexts back
to userland. Any thread without upcall structure has to export their
contexts and exit at user boundary.

Any thread running in user mode owns an upcall structure, when it enters
kernel, if the kse mailbox's current thread pointer is not NULL, then
when the thread is blocked in kernel, a new UPCALL thread is created and
the upcall structure is transfered to the new UPCALL thread. if the kse
mailbox's current thread pointer is NULL, then when a thread is blocked
in kernel, no UPCALL thread will be created.

Each upcall always has an owner thread. Userland can remove an upcall by
calling kse_exit, when all upcalls in ksegrp are removed, the group is
atomatically shutdown. An upcall owner thread also exits when process is
in exiting state. when an owner thread exits, the upcall it owns is also
removed.

KSE is a pure scheduler entity. it represents a virtual cpu. when a thread
is running, it always has a KSE associated with it. scheduler is free to
assign a KSE to thread according thread priority, if thread priority is changed,
KSE can be moved from one thread to another.

When a ksegrp is created, there is always N KSEs created in the group. the
N is the number of physical cpu in the current system. This makes it is
possible that even an userland UTS is single CPU safe, threads in kernel still
can execute on different cpu in parallel. Userland calls kse_create to add more
upcall structures into ksegrp to increase concurrent in userland itself, kernel
is not restricted by number of upcalls userland provides.

The code hasn't been tested under SMP by author due to lack of hardware.

Reviewed by: julian
2003-01-26 11:41:35 +00:00
Jeff Roberson
4183d949e0 - Remove a redundant scheduler option.
Pointy hat to:	jeff
Spotted by:	dillon
2003-01-26 06:37:43 +00:00
Jeff Roberson
c3384118a1 - Introduce the SCHED_ULE and SCHED_4BSD options for compile time selection
of the scheduler.
 - Add SCHED_4BSD as the scheduler for all kernel config files in cvs.
2003-01-26 05:29:12 +00:00
Peter Wemm
99ebb0bfba Clean up some junk defines, and GC the TPR options. 2003-01-23 01:04:27 +00:00
Peter Wemm
904639d710 Nuke CHEAP_TPR stuff, including LOPRIO_LEVEL (bogus) and ALLHWI_LEVEL
(which we never used).  There is no need to tweak the TPR anymore and
only causes problems.
2003-01-23 01:03:34 +00:00
Peter Wemm
2fbe601a5d Now that TPR isn't bogusly raised at boot, there is no need to clear
it at context switch.
2003-01-23 01:01:35 +00:00
Peter Wemm
e0d92cd4d9 Dont raise the TPR register at initialization time. It only causes
problems and we only ever clear it.
2003-01-23 01:00:58 +00:00
John Baldwin
10deca7e68 - Move enable_sse()'s prototype to machine/md_var.h.
- Sort definition of cpu_* variables appropriately.
- Move cpu_fxsr out of the magic non-BSS set of variables and stick it in
  the BSS along with hw_instruction_sse (make the latter static as well).

Submitted by:	bde (partially)
2003-01-22 18:18:45 +00:00
John Baldwin
caf3197636 Rename cpuid_cpuinfo to cpu_procinfo. bde requested that I rename this
variable to something in the cpu_* namespace since that's what all the
other cpuid variables were named and cpu_procinfo is what I came up with.

Requested by:	bde
2003-01-22 17:54:12 +00:00
John Baldwin
f4e27c448b Bah, add in a missing space char I noticed when MFC'ing this. 2003-01-22 17:26:18 +00:00
Warner Losh
cf19012356 Needs wlan for wi. 2003-01-21 13:31:52 +00:00
Alfred Perlstein
44956c9863 Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.
Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
2003-01-21 08:56:16 +00:00
Jake Burkholder
7251b4bf93 Resolve relative relocations in klds before trying to parse the module's
metadata.  This fixes module dependency resolution by the kernel linker on
sparc64, where the relocations for the metadata are different than on other
architectures; the relative offset is in the addend of an Elf_Rela record
instead of the original value of the location being patched.
Also fix printf formats in debug code.

Submitted by:	Hartmut Brandt <brandt@fokus.gmd.de>
PR:		46732
Tested on:	alpha (obrien), i386, sparc64
2003-01-21 02:42:44 +00:00
Jimmy Olgeni
1897ae9644 Fix typo in comment: inlcude -> include. 2003-01-20 20:23:56 +00:00
Marcel Moolenaar
9d683ffd4b o Move the contents of <machine/floatingpoint.h> over to
<machine/ieeefp.h> where it belongs.
o  Remove the i386 specific inclusion of <machine/floatingpoint.h>
   from <ieeefp.h>, now that including <machine/ieeefp.h> is enough
   for all architectures.
o  Allow <machine/ieeefp.h> to inline the functions exposed by the
   headers by checking for _IEEEFP_INLINED_ in the MI header. When
   defined, prototypes are not given and it is assumed that the MD
   headers, when inlining only a subset of the functions provide
   prototypes for the functions not being inlined.

Based on patch from: Terry Lambert <tlambert2@mindspring.com>
Tested with: make release.
2003-01-19 06:01:33 +00:00
Matthew N. Dodd
95ca467a68 - Removed unecesary code.
- Correct smapi32_new() asm (still doesn't work.)
- Attach to mainboard not isa.
2003-01-18 04:36:12 +00:00
Matthew N. Dodd
7534ac7ab7 A driver for the System Management Application Program
Interface (SMAPI) BIOS, which is present on some IBM
Thinkpad models (560, 600, 770 to name a few.)

The SMAPI BIOS provides access to System Information,
System Configuration, and Power Management.
2003-01-17 08:10:18 +00:00
Sam Leffler
18bf5d2ba6 wi now needs wlan
Reviewed by:	imp
2003-01-16 00:21:52 +00:00
Matthew Dillon
e3669cee72 Merge all the various copies of vm_fault_quick() into a single
portable copy.
2003-01-16 00:02:21 +00:00
Matthew Dillon
f597900329 Merge all the various copies of vmapbuf() and vunmapbuf() into a single
portable copy.  Note that pmap_extract() must be used instead of
pmap_kextract().

This is precursor work to a reorganization of vmapbuf() to close remaining
user/kernel races (which can lead to a panic).
2003-01-15 23:54:35 +00:00
Poul-Henning Kamp
c441cdb88a Add machdep.elan_freq sysctl which can be used to set the CPU clock
frequency in Hz.  The default is still 33.333 MHz.  Please notice
that the number is round to a multiple of four internally so it may
not read back exactly the same as written.

Add compile time ELAN_XTAL option to override the 33.333 MHz default.

Add compile time ELAN_PPS option to enable code for high precision
(250 nanoseconds) timestamping of external signals.
2003-01-15 20:15:33 +00:00
Matthew N. Dodd
e2fdcaf285 - Add inline functions for {ll,l,}abs() to libkern.
- Remove hand rolled abs() functions.
2003-01-15 02:02:33 +00:00
Matthew Dillon
48e3128b34 Bow to the whining masses and change a union back into void *. Retain
removal of unnecessary casts and throw in some minor cleanups to see if
anyone complains, just for the hell of it.
2003-01-13 00:33:17 +00:00
Matthew Dillon
cd72f2180b Change struct file f_data to un_data, a union of the correct struct
pointer types, and remove a huge number of casts from code using it.

Change struct xfile xf_data to xun_data (ABI is still compatible).

If we need to add a #define for f_data and xf_data we can, but I don't
think it will be necessary.  There are no operational changes in this
commit.
2003-01-12 01:37:13 +00:00
John Baldwin
0d238da886 Remove earlysetcpuclass() as it has been OBE.
Suggested by:	bde
2003-01-09 19:59:28 +00:00
John Baldwin
f85b149dae Rework part of the previous processor name changes so that we read
cpu_exthigh and cpu_brand in printcpuinfo() instead of in identify_cpu().
We also only do it for known-good values of cpu_vendor which is a bit more
conservative.

Reviewed by:	bde (mostly)
2003-01-09 19:54:49 +00:00
John Baldwin
338633abf8 Consistently use spaces in between arguments to strcmp(). Whitespace
only.
2003-01-08 19:16:11 +00:00
John Baldwin
5b1e7cb257 - Use cpu_exthigh instead of executing cpuid again to retrieve it for the
print_AMD_foo() functions.
- Add a brand name table for the brand index provided on Intel CPU's in
  %ebx after cpuid 1.
- For Intel CPUs, if we don't get a processor name from the extended cpuid
  then use the brand index in cpuid_cpuinfo to pick a name from the brand
  table and copy that name into cpu_brand.
- Replace the duplicated code to use the extended cpuid to replace
  cpu_model with the processor name in the AMD and Transmeta sections of
  printcpuinfo() with generic code that replaces cpu_model with
  cpu_brand if cpu_brand is not an empty string.  We also trim leading
  spaces from cpu_brand prior to doing this since at least some processor
  names (notably those of Intel CPUs) have leading spaces in the name.
- Give print_AMD_features() its own private regs[] array since
  printcpuinfo() doesn't use the one it has anymore.
2003-01-08 16:41:48 +00:00
John Baldwin
26aa6d02bf - Add a cpu_exthigh variable to hold the highest extended cpuid value
returned from cpuid 0x80000000.
- Add a cpu_brand char array to hold the processor name returned by
  cpuid 0x80000002-0x80000004 on AMD, Intel, Transmeta, and possibly
  other CPUs.
- Use cpuid to set cpu_exthigh and read the processor name if it is present
  in identify_cpu().
2003-01-08 16:35:59 +00:00
John Baldwin
b33c8e3ded Bah, get the test for more than one logical CPU right so we don't bogusly
claim a CPU has HT support when it lists 0 or 1 logical CPU's per physical
processor.
2003-01-08 16:33:03 +00:00
John Baldwin
f4b4a64293 Enumerate logical hyperthread CPUs manually if they aren't already listed
in the mptable.  The way this works is that we determine if the system
has hyperthreading and how many logical CPU's should be in each physical
CPU by using the information returned by cpuid.  During the first pass of
the mptable, we build a bitmask of the APIC IDs of the CPUs listed in the
mptable.  We then scan that bitmask to see if the CPUs are already listed
by the mptable, or if there are any APIC IDs already in use that would
conflict with the APIC IDs of the logical CPUs.  If that test succeeds,
then we fixup the count of application processors.  Later on during the
second pass of the mptable we create fake processor entries for logical
CPUs and add them to the system.

We only need this type of fixup hack when using the mptable to enumerate
CPUs.  The ACPI MADT table properly enumerates all logical CPUs.
2003-01-08 01:33:18 +00:00
John Baldwin
5460753d55 If the boot processor supports hyperthreading and contains more than one
logical CPU, display the number of logical CPUs per physical processor
underneath the list of CPU features.
2003-01-08 01:23:16 +00:00
John Baldwin
fa896b7280 Add a cpuid_cpuinfo variable to hold the results of %ebx from cpuid with
%eax of 1 and set it in identify_cpu().
2003-01-08 01:20:05 +00:00
John Baldwin
72a1e0e226 - Fix the name of the hyperthreading cpuid feature flag to be HTT instead
of HHT.
- Document fields returned in %ebx by a cpuid with %eax of 1.
2003-01-08 01:15:26 +00:00
John Baldwin
bb69b35d8d Document bit 31 of the cpuid features word as PBE (Pending Break Enable). 2003-01-03 18:54:59 +00:00
Jens Schweikhardt
9d5abbddbf Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,
especially in troff files.
2003-01-01 18:49:04 +00:00
Nate Lawson
d9ce8f5c47 Return an error when r/w is requested on an unsupported device instead of
looping.

Submitted by:	Sean Kelly <smkelly@zombie.org>
Pointed out by:	bde
2002-12-31 21:44:38 +00:00
Jens Schweikhardt
d64ada501a Fix typos, mostly s/ an / a / where appropriate and a few s/an/and/
Add FreeBSD Id tag where missing.
2002-12-30 21:18:15 +00:00
David E. O'Brien
525d98afd8 Change the ident so people know a kernel built with this has SMP support. 2002-12-30 11:36:17 +00:00
David E. O'Brien
5fb4613b6b Sync with GENERIC rev 1.371. 2002-12-30 11:34:45 +00:00
David E. O'Brien
83d06d0529 Using our new wonderful include directive, save our x86 SMP users from
having to edit GENERIC to build a useful kernel.  This also opens the
possibility of including an SMP kernel in the release.
2002-12-30 11:31:58 +00:00
Scott Long
b4b9c52ca4 Add the if_bge driver. I can't find any reason why it's not here, and it's
pretty common on Dell servers and other high-end boxes.
2002-12-28 06:22:17 +00:00
Julian Elischer
93a7aa79d6 Add code to ddb to allow backtracing an arbitrary thread.
(show thread {address})

Remove the IDLE kse state and replace it with a change in
the way threads sahre KSEs. Every KSE now has a thread, which is
considered its "owner" however a KSE may also be lent to other
threads in the same group to allow completion of in-kernel work.
n this case the owner remains the same and the KSE will revert to the
owner when the other work has been completed.

All creations of upcalls etc. is now done from
kse_reassign() which in turn is called from mi_switch or
thread_exit(). This means that special code can be removed from
msleep() and cv_wait().

kse_release() does not leave a KSE with no thread any more but
converts the existing thread into teh KSE's owner, and sets it up
for doing an upcall. It is just inhibitted from being scheduled until
there is some reason to do an upcall.

Remove all trace of the kse_idle queue since it is no-longer needed.
"Idle" KSEs are now on the loanable queue.
2002-12-28 01:23:07 +00:00
Alan Cox
84cdcd85a0 Assert that the page queues lock is held in pmap_testbit(). 2002-12-28 00:19:40 +00:00
David Xu
4b2d2f604c Set %bx register instead of %di register, see vbe3.0, page 45. 2002-12-26 13:20:58 +00:00
Alan Cox
11a2911cec - Hold the page queues lock around calls to vm_page_wakeup() and
vm_page_flag_clear().
2002-12-24 07:32:38 +00:00
Poul-Henning Kamp
152e80d952 Outdent the string rather than use concatenation. 2002-12-23 22:12:17 +00:00
Tim J. Robbins
b30a7779d4 MB_LEN_MAX is not MD, move it to the MI limits.h. 2002-12-22 06:38:45 +00:00
Marcel Moolenaar
91c71b46ed Export the physical address of the RSDP to userland by means
of the `machdep.acpi_root' sysctl. This is required on ia64
because the root pointer hardly ever, if at all, lives in the
first MB of memory and also because scanning the first MB of
memory can cause machine checks.
This provides a save and reliable way for ACPI tools to work
with the tables if ACPI support is present in the kernel. On
ia64 ACPI is non-optional.
2002-12-18 08:47:07 +00:00
Nate Lawson
e38cfb14fe Back out 1.19 to rethink approach
Requested by:	julian@
2002-12-17 05:55:36 +00:00
Nate Lawson
1df5f8294f Automatically issue a "continue" along with the "detach" command. This
fixes the problem of cleanly restarting a target after entering gdb mode.

Reviewed by:	archie@
2002-12-17 01:32:11 +00:00
Julian Elischer
4706b50a40 Reformat last change
Requested by: nate@
2002-12-16 23:25:12 +00:00
Julian Elischer
6b8fc51d28 Don't dump core into a partition that is too small for it.
If we do, we usually wrote backwareds into the proceeding partititon
which is usually the root partition.
2002-12-16 23:04:54 +00:00
Olivier Houchard
47770b6fd5 Add the trm(4) driver.
MFC after:	1 day
2002-12-16 18:47:37 +00:00
Poul-Henning Kamp
a0b3173215 Only dump the BIOS geometry table from bootinfo on PC98, we don't use
the contents on i386 anymore.
2002-12-14 16:11:28 +00:00
Alan Cox
0ced3981d1 Add page locking to pmap_mincore().
Submitted (in part) by:	tjr@
2002-12-14 07:06:27 +00:00
Alfred Perlstein
d1e405c5ce SCARGS removal take II. 2002-12-14 01:56:26 +00:00
Alfred Perlstein
bc9e75d7ca Backout removal SCARGS, the code freeze is only "selectively" over. 2002-12-13 22:41:47 +00:00
Alfred Perlstein
0bbe7292e1 Remove SCARGS.
Reviewed by: md5
2002-12-13 22:27:25 +00:00
Julian Elischer
696058c3c5 Unbreak the KSE code. Keep track of zobie threads using the Per-CPU storage
during the context switch. Rearrange thread cleanups
to avoid problems with Giant. Clean threads when freed or
when recycled.

Approved by:	re (jhb)
2002-12-10 02:33:45 +00:00
John Baldwin
55d7b94047 Add "disabled" hints to all of the uncommon ISA devices that are in
GENERIC.  Each device can be re-enabled at startup time by unsetting the
disabled hint in the loader.

Requested by:	mdodd
Approved by:	re
Prodded by:	rwatson
2002-12-05 22:49:47 +00:00
Alan Cox
a597332c22 Hold the page queues lock around calls to pmap_remove().
Approved by:	re
2002-12-04 18:40:39 +00:00
Poul-Henning Kamp
92a306a2b6 Use the correct value when writing the Day Of Week byte in the CMOS.
The correct range is [1...7] with Sunday=1, but we have been writing
[0...6] with Sunday=0.

The Soekris computers flagged the zero, zapped the date, so if you
rebooted your soekris on a sunday, it would come up with a wrong
date.

Bruce has a more extensive rework of this code, but we will stick with
the minimalist fix for now.

Spotted by:	Soren Kristensen <soren@soekris.com>
Thanks to:	Michael Sierchio <kudzu@tenebras.com>.
Confirmed by:	bde
Approved by:	re
2002-12-04 13:46:49 +00:00
Alan Cox
f4dcf9555e Avoid recursive acquisition of the page queues lock in pmap_unuse_pt().
Approved by:	re
2002-12-03 04:00:42 +00:00
Daniel Eischen
a3dca4517e Align the FPU state in the ucontext and sigcontext to 16 bytes
to accomodate the new SSE/XMM floating point save/restore
instructions.

This commit is mostly from bde and includes some style nits.

Approved by:	re (jhb)
2002-12-02 19:58:55 +00:00
Alan Cox
d79ebb6026 Hold the page queues lock when calling pmap_unwire_pte_hold() or
pmap_remove_pte().  Use vm_page_sleep_if_busy() in
_pmap_unwire_pte_hold() so that the page queues lock is released
when sleeping.

Approved by:	re (blanket)
2002-12-02 04:54:21 +00:00
Alan Cox
e6c90801b3 Assert that the page queues lock is held in pmap_changebit()
and pmap_ts_referenced().

Approved by:	re (blanket)
2002-12-01 00:08:14 +00:00
Alan Cox
0d51d232e5 Assert that the page queues lock is held in pmap_page_exists_quick().
Approved by:	re (blanket)
2002-11-30 17:46:59 +00:00
David E. O'Brien
6380ce4de1 Fix for non-GCC compilers.
Approved by:	re (jhb)
2002-11-27 16:28:18 +00:00
Alan Cox
ffb309581f Assert that the page queues lock is held in pmap_remove_pages().
Approved by:	re (blanket)
2002-11-25 04:45:03 +00:00
Alan Cox
560d1fbc99 Add page queues locking to vunmapbuf(); reduce differences with respect
to the sparc64 implementation.  (Note: With modest effort on the alpha and
ia64 this function could migrate to the MI part of the kernel.)

Approved by:	re (blanket)
2002-11-24 21:37:02 +00:00
Mitsuru IWASAKI
87b45ed576 Add `if (!cold)' checkings for functions which is called via SYSINIT.
Loading acpi.ko with kldload is disallowed, however some
functions were executed unexpectedly.

Approved by:	re
2002-11-24 02:27:07 +00:00
Alan Cox
4817d8e5e6 - Assert that the page queues lock is held in pmap_remove_all().
- Fix a diagnostic message and comment in pmap_remove_all().
 - Eliminate excessive white space from pmap_remove_all().

Approved by:	re
2002-11-23 04:48:13 +00:00
Maxime Henrion
b19d9defef Under certain circumstances, we were calling kmem_free() from
i386 cpu_thread_exit().  This resulted in a panic with WITNESS
since we need to hold Giant to call kmem_free(), and we weren't
helding it anymore in cpu_thread_exit().  We now do this from a
new MD function, cpu_thread_dtor(), called by thread_dtor().

Approved by:	re@
Suggested by:	jhb
2002-11-22 23:57:02 +00:00
John Baldwin
ebff7660a3 *sigh*. It seems that in the ACPICA code, Intel defines its own APIC_IO
macro for use when parsing MADT tables, thus we always tried to set the
interrupt model to APIC.  This proved to be harmful on UP machines with
IO APIC's (or for UP kernels on SMP machines) since the wrong interrupt
routing information would be returned.

Pointy hat to:	jhb
Approved by:	re (rwatson)
2002-11-21 20:55:22 +00:00
Daniel Eischen
2be05b70c9 Add getcontext, setcontext, and swapcontext as system calls.
Previously these were libc functions but were requested to
be made into system calls for atomicity and to coalesce what
might be two entrances into the kernel (signal mask setting
and floating point trap) into one.

A few style nits and comments from bde are also included.

Tested on alpha by: gallatin
2002-11-16 06:35:53 +00:00
Sam Leffler
6fc32a2495 network interface and link layer changes:
o on input don't strip the Ethernet header from packets
o input packet handling is now done with if_input
o track changes to ether_ifattach/ether_ifdetach API
o track changes to bpf tapping
o call ether_ioctl for default handling of ioctl's
o use constants from net/ethernet.h where possible

Reviewed by:	many
Approved by:	re
2002-11-15 00:00:15 +00:00
Warner Losh
a4bbd12ff1 MFp4:
o Fix small style nit.  This was supposed to be part of the last batch of
  style fixes, but somehow didn't get merged.
2002-11-14 05:22:37 +00:00
Peter Wemm
41f778bb99 Recognize the Serverworks CIOB30 host to pci bridge. 2002-11-13 21:30:44 +00:00
Maxime Henrion
a1bbb9f95c Remove a commented out #include "opt_pci.h", it doesn't
exist anymore.
2002-11-13 17:50:59 +00:00
Matthew N. Dodd
d7545b110c Loader tunable 'machdep.disable_mtrrs'.
Sysctl of same name to reflect status.

Submitted by:	 jhb
Approved by:	 re (murray)
MFC after:	 1 day
2002-11-13 09:37:43 +00:00
Alan Cox
eea85e9bb6 Move pmap_collect() out of the machine-dependent code, rename it
to reflect its new location, and add page queue and flag locking.

Notes: (1) alpha, i386, and ia64 had identical implementations
of pmap_collect() in terms of machine-independent interfaces;
(2) sparc64 doesn't require it; (3) powerpc had it as a TODO.
2002-11-13 05:39:58 +00:00
Alan Cox
6372d61e3e - Clear the page's PG_WRITEABLE flag in the i386's pmap_changebit()
if we're removing write access from the page's PTEs.
 - Export pmap_remove_all() on alpha, i386, and ia64.  (It's already
   exported on sparc64.)
2002-11-11 05:17:34 +00:00
Mitsuru IWASAKI
2be7d43928 Add a new loader tunable, hw.hasbrokenint12, to indicate that BIOS
has broken int 12H.
If hw.hasbrokenint12="1" in loader environment, kernel never use BIOS
INT 12 call to determine base memory size.
Otherwise, kernel use INT 12 in old behaviour.
This should fix kernel panic problem caused by 1.544 changes.

MFC after:	1 day
2002-11-09 21:17:41 +00:00
Dag-Erling Smørgrav
97b67f3141 Print real / avail memory in megabytes rather than kilobytes. 2002-11-09 16:19:14 +00:00
Alfred Perlstein
29f194457c Fix instances of macros with improperly parenthasized arguments.
Verified by: md5
2002-11-09 12:55:07 +00:00
John Baldwin
f6af4ff6cb Make 3dfx i386-only. The memrange API it uses may be defined in an MI
header, but it is only implemented on i386.
2002-11-08 20:04:38 +00:00
John Baldwin
787f149830 Move rc(4) over to MI notes and enable it as a MI module. 2002-11-08 19:34:26 +00:00
John Baldwin
2d2f7b6292 Make xrpu(4) i386-only. Consumers of i386_btop() are not MI. 2002-11-08 15:05:16 +00:00
David Xu
4e0a2def06 adjust critical section to only wrap around vm86_bioscall(). 2002-11-08 03:07:52 +00:00
David Xu
b3925aab09 use critical_enter/exit to add a critical section around BIOS call,
this unbreaks WITNESS.

Pointed out by: jhb
2002-11-08 01:09:16 +00:00
Thomas Moestl
0fca57b8b8 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.
2002-11-07 23:57:17 +00:00
Alfred Perlstein
4ef42f2b0f Properly parenthesize the DBREG_DRX macro's variables to allow for
DBREG_DRX(&dbregs, n) usage.
2002-11-07 22:42:31 +00:00
John Baldwin
1786a481d7 Move sr(4) over to i386-only as it is yet another user of kvtop(). 2002-11-07 21:15:29 +00:00
Alan Cox
aa8e11b6c4 Simplify and optimize pmap_object_init_pt(). More specifically,
take advantage of the fact that the vm object's list of pages is
now ordered to reduce the overhead of finding the desired set of
pages to be mapped.  (See revision 1.215 of vm/vm_page.c.)
2002-11-07 18:33:55 +00:00
John Baldwin
7d2ba89bbf Move firewire back to being MI. 2002-11-07 16:19:43 +00:00
David Xu
8c132e9fae 1.Fix smp race between kernel vm86 BIOS calling and userland vm86 mode code,
remove global variable in_vm86call, set vm86 calling flag in PCB flags.

2.Fix vm86 BIOS calling preempted problem by changing vm86_lock mutex type
  from MTX_DEF to MTX_SPIN. vm86pcb is not remembered in thread struct,
  when the thread calling vm86 BIOS is preempted by interrupt thread,
  and later switching back to the thread would cause incorrect context be
  loaded into CPU registers, this leads to kernel crash.
2002-11-07 01:34:23 +00:00
John Baldwin
246d578cba lnc(4) uses kvtop() and is thus i386-only for now. 2002-11-06 22:56:57 +00:00
John Baldwin
c8341b3e2d Make firewire i386-only for now. It doesn't quite handle machines with
64-bit address spaces yet.  Pointy hat to myself for sticking it in the MI
NOTES file to begin with.
2002-11-06 22:30:33 +00:00
John Baldwin
b76c5a11e5 ed(4) uses kvtop() and is thus i386-only. It has several other warnings
related to sizeof(int) != sizeof(void *), but kvtop() is much harder to
fix.

Approved by:	imp
2002-11-06 22:03:53 +00:00
John Baldwin
b180bb1684 Move the drm code to the i386 MD NOTES file. It can be added to other MD
NOTES files if desired, but this code is not MI on FreeBSD.  The Alpha
support is Linux specific and does not compile on FreeBSD.
2002-11-06 21:42:42 +00:00
John Baldwin
cea108a8ce Move digi to the i386 MD NOTES until it stops using inb() and outb().
Please use bus_space functions instead.
2002-11-06 21:11:42 +00:00
John Baldwin
1183b97250 - Move comments regarding flags for dgb(4) over to the MD NOTES file where
dgb(4) lives.
- Move dgb(4) back to where it used to be relative to other drives in the
  old NOTES/LINT file.
2002-11-06 21:07:13 +00:00
John Baldwin
8a651d2c4a Make the ar(4) driver i386-only for now. It has lots of sizeof(int) ==
sizeof(void *) assumptions and doesn't use busdma yet (it uses kvtop()
which is not an MI interface).

Recommended by:	jake, mux
2002-11-06 19:27:09 +00:00
Juli Mallett
751d91aabd 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.
2002-11-06 14:53:35 +00:00
Matthew N. Dodd
6fe8789d6d - Convert to newbus, bus_space etc.
- Move to MI space.

Tested on:	 i386
2002-11-05 09:37:32 +00:00
David Xu
1f82496322 Fix typo. ioport_rid should be irq_rid. 2002-11-05 04:03:42 +00:00
Warner Losh
ce494452fe MFp4:
o It turns out that we always need to try to route the interrupts for
  the case where the $PIR tells us there can be only one.  Some machines
  require this, while others fail when we try to do this (bogusly, imho).
  Since we have no apriori way of knowing which is which, we always try to
  do the routing and hope for the best if things fail.
o Add some additional comments that state the obvious, but amplify it in
  non-obvious ways (judging from the questions I've gotten).

This should un-break older laptops that still have to use PCIBIOS to route
interrupts.

Tested by: sam
2002-11-02 22:35:24 +00:00
Warner Losh
984de797ff Use 0xffffffff instead of -1 for id to compare against.
Use exact width types, since this is a MD file and won't be used elsewhere.
Fix a couple of resulting printf breakages

Bug found by: phk using Flexlint
2002-11-02 22:32:04 +00:00
Marcel Moolenaar
99d45c5f9d bzero() the sigframe before we fill it. This was not done at all in
linux_rt_sendsig() and only done for the fpstate in linux_sendsig().
2002-11-02 07:41:04 +00:00
Matthew N. Dodd
30201b6cef Merge PC98 changes. 2002-11-02 04:18:10 +00:00
Matthew N. Dodd
c7f718ec6a Handle hints for the atspeaker device.
Document same.
2002-10-28 02:00:09 +00:00
John Baldwin
ab79480392 Note that the sched_lock protects md_ldt of struct mdproc. 2002-10-25 20:06:16 +00:00
Peter Wemm
331e4823a2 Finish fixing the 5.x FPU code for dealing with signal handlers.
Obtained from:  bde
2002-10-25 19:12:16 +00:00
Peter Wemm
23eeeff7be Split 4.x and 5.x signal handling so that we can keep 4.x signal
handling clean and functional as 5.x evolves.  This allows some of the
nasty bandaids in the 5.x codepaths to be unwound.

Encapsulate 4.x signal handling under COMPAT_FREEBSD4 (there is an
anti-foot-shooting measure in place, 5.x folks need this for a while) and
finish encapsulating the older stuff under COMPAT_43.  Since the ancient
stuff is required on alpha (longjmp(3) passes a 'struct osigcontext *'
to the current sigreturn(2), instead of the 'ucontext_t *' that sigreturn
is supposed to take), add a compile time check to prevent foot shooting
there too.  Add uniform COMPAT_43 stubs for ia64/sparc64/powerpc.

Tested on: i386, alpha, ia64.  Compiled on sparc64 (a few days ago).
Approved by: re
2002-10-25 19:10:58 +00:00
Mitsuru IWASAKI
fb3a308a4a Change method to determine base memory size.
Try INT 15H/E820H first, then fall back to the old compatibility
method (INT 12H).
This is a workaround for newer machines which have broken INT 12H BIOS
service implementation.

Reviewed by:	-current ML
MFC after:	3 days
2002-10-25 18:46:36 +00:00
Warner Losh
d793791855 Use the correct values for LDBL_*. Libc doesn't completely support
long doubles at the moment (printf truncates them to doubles).
However, long doubles to appear to work to the ranges listed in this
commit on both -stable (4.5) and -current.  There may be some slight
rounding issues with long doubles, but that's an orthogonal issue to
these constants.

I've had this in my local tree for 3 months, and in my company's local
tree for 15 months with no ill effects.

Obtained from: NetBSD
Not likely to like it: bde
2002-10-25 07:02:52 +00:00
Julian Elischer
1434d3fe6f Extract out KSE specific code from machine specific code
so that there is ony one copy of it. Fix that one copy
so that KSEs with no mailbox in a KSE program are not a cause
of page faults (this can legitmatly happen).

Submitted by:	(parts) davidxu
2002-10-24 23:09:48 +00:00
John Baldwin
d2ec391b39 Rename 'device acpica' to 'device acpi'.
Approved by:	msmith, iwasaki
2002-10-24 19:05:04 +00:00
Robert Watson
7aab30d1d8 device rc no longer requires a count since jhb newbussified the rc
device driver.
2002-10-24 16:46:53 +00:00
John Baldwin
599c57a971 - New-bussify the rc(4) device driver.
- Add detach support to the driver so that you can kldunload the module.
  Note that currently rc_detach() fails to detach a unit if any of its
  child devices are open, thus a kldunload will fail if any of the tty
  devices are currently open.
- sys/i386/isa/ic/cd180.h was moved to sys/dev/ic/cd180.h as part of
  this change.

Requested by:	rwatson
Tested by:	rwatson
2002-10-23 15:53:09 +00:00
John Baldwin
08675def10 npx(4) doesn't honor port hints so don't provide an example one. 2002-10-23 14:52:53 +00:00
Mark Murray
64f82235d8 Very minor whitespace/style nit. 2002-10-23 10:14:30 +00:00
John Baldwin
e2ded8bbde - No need for pmtimer hint anymore.
- npx doesn't need an 'at' hint anymore.
2002-10-22 17:32:51 +00:00
John Baldwin
34bf8de99d No need for pmtimer hint anymore. 2002-10-22 17:32:27 +00:00
John Baldwin
8bbdb8e89f Add an identify method that creates a pmtimer0 device if it doesn't alreedy
exist.  Hints are no longer needed to instantiate a pmtimer(4) device.
2002-10-22 17:30:52 +00:00
Brooks Davis
db394c7a54 Use if_printf() instead of printf() to print diagnositic messages in the
form "rdp#: blah".
2002-10-21 14:38:28 +00:00
Brooks Davis
36cee51404 Use if_printf(ifp, "blah") instead of
printf("%s%d: blah", ifp->if_name, ifp->if_unit).
2002-10-21 14:37:31 +00:00
Poul-Henning Kamp
50c026e579 Change the definition of the debugging registers to be an array, so
that we can index into it, rather than do pointer gymnastics on a
structure containing 8 elements.

Verified by:	MD5 hash on the produced .o files.
2002-10-20 20:48:56 +00:00
Poul-Henning Kamp
05f6411a98 Remove a boatload of '&' which are surplus to the requirements.
Validated by:	md5 hash is unchanged.
2002-10-20 18:02:46 +00:00
Poul-Henning Kamp
7f30cdf366 Revert last commit, there actually was a -1 waaaaay down in pcireg_cfgread(). 2002-10-20 17:54:17 +00:00
Poul-Henning Kamp
218565dc75 Hide inline assembly if lint is defined. 2002-10-20 17:30:30 +00:00
Poul-Henning Kamp
a67ee49294 "id" is never going to be -1 when it is unsigned.
Spotted by:	FlexeLint
2002-10-20 17:21:43 +00:00
Marcel Moolenaar
1aeb23cdfa Add two hooks to signal module load and module unload to MD code.
The primary reason for this is to allow MD code to process machine
specific attributes, segments or sections in the ELF file and
update machine specific state accordingly. An immediate use of this
is in the ia64 port where unwind information is updated to allow
debugging and tracing in/across modules. Note that this commit
does not add the functionality to the ia64 port. See revision 1.9
of ia64/ia64/elf_machdep.c.

Validated on: alpha, i386, ia64
2002-10-19 19:16:03 +00:00
Robert Watson
c7063e5913 Permits UFS ACLs to be used with the GENERIC kernel. Due to recent
ACL configuration changes, this shouldn't result in different code paths
for file systems not explicitly configured for ACLs by the system
administrator.  For UFS1, administrators must still recompile their
kernel to add support for extended attributes; for UFS2, it's sufficient
to enable ACLs using tunefs or at mount-time (tunefs preferred for
reliability reasons).  UFS2, for a variety of reasons, including
performance and reliability, is the preferred file system for use with
ACLs.

Approved by:	re
2002-10-19 16:54:15 +00:00
Mark Murray
b07cd97ea8 Style(9). Make some function declarations consistent with the rest,
and remove some nearby extraneous {}'s.
2002-10-19 11:57:38 +00:00
Jim Pirzyk
b2eb172cc3 Add the !define(COMPILING_LINT)
pass the pointy hat...

Requested by: Juli Mallett <jmallett@FreeBSD.org>
2002-10-17 18:17:28 +00:00
Mitsuru IWASAKI
0ebefa8c4e 1. Fix a comment. Locking _is_ needed (but not done).
2. Update a comment.  We now restore much more than RTC updates and
   interrupts.
3. Order change.  Stop interrupts by writing to RTC_STATUSB,
   restore rate bits for the interrupts by writing to RTC_STATUSA,
   then enable interrupts again.
   This seems to be done perfectly backwards in startrtclock().
   Otherwise, the idea for this change was obtained from
   startrtclock().
4. Don't stop the clock (RTCB_HALT).  We only program some control bits
   and don't want to stop the clock.
5. (Not really related.)  Add caveats to the comment about timer_restore().
   The update is non-atomic since locking is not done.

On locking:
6. rtcin() and writertc() are locked() adequately by splhigh() in RELENG_4,
   but this locking is null in -current.
7. Doing things in the correct order in (3) combined with (6) is probably
   enough locking for rtcrestore() in RELENG_4.  In -current, the
   writertc()'s race with rtcintr() unless the BIOS disables RTC interrupts.

Submitted by:	bde (including commit message)
MFC after:	1 week
2002-10-17 13:55:39 +00:00
Bruce Evans
25388b6cc4 Fixed the quoting of the value of SC_CUT_SEPCHARS. The double quotes
needed to be quoted (to get a C string literal), not the value itself.

Fixed the value of SC_CUT_SEPCHARS.  Setting this value would have had no
effect even if it were used, since the value was the same as the default.

The above bugs had no effect except to set bad examples, since test
coverage of SC_CUT_SEPCHARS is broken by enabling a negative option.

Removed (unquoted) double quotes for all options.  They were all bogus
since they had no effect except to make non-strings look like strings.
Most of the non-strings were expressions.  The value of INIT_PATH is
a non-string since it is stringified later (unlike SC_CUT_SEPCHARS).

Fixed parenthesization errors inside bogus quotes (parenthesize values
if they have more than one token in them but don't parenthesize single
tokens).
2002-10-17 13:47:31 +00:00
Jim Pirzyk
c8c1cf0ca7 put an #error directive when SMP and CPU_DISABLE_CMPXCHG are set
together.

Requested by: Lars Eggart <larse@isi.edu>
Enlighted how to do it by: John Baldwin <jhb@freebsd.org>
2002-10-17 05:51:36 +00:00
John Baldwin
a73f15c7a8 Use the global pcib devclass instead of our own static copy. 2002-10-16 18:38:35 +00:00
John Baldwin
90fa95e81d - curproc may be NULL in 4-stable. In that case use the vmspace from
proc0.
- Remove unused include.

Sponsored by:	The Weather Channel
2002-10-16 17:22:03 +00:00
John Baldwin
42233ad3af Include <sys/select.h> on -stable instead of <sys/selinfo.h> to get the
definition of struct selinfo.

Sponsored by:	The Weather Channel
2002-10-16 17:20:43 +00:00
Jim Pirzyk
e22f9477f7 Updated the CPU_DISABLE_CMPXCHG notes to warn users not to also enable
SMP with it.

Requested by:	Lars Eggert <larse@ISI.EDU>
2002-10-16 15:59:07 +00:00
Poul-Henning Kamp
3412120f03 Be consistent about funtions being static.
Spotte by:	FlexeLint.
2002-10-16 10:16:17 +00:00
Poul-Henning Kamp
1eaae5cbe8 Be consistent about functions being static.
Spotted by:	FlexeLint.
2002-10-16 08:57:14 +00:00
Peter Wemm
af3f249f3a The a.out md_coredump stuff isn't referenced anywhere anymore, and
hasn't been filled in for ages..  Nuked.
2002-10-15 00:02:50 +00:00
Jim Pirzyk
77e8341280 Add a knob to turn on and off the CMPXCHG instruction on > i386 IA32 systems.
This is most beneficial for vmware client os installs.

Reviewed by: jmallet, iedowse, tlambert2@mindspring.com
MFC After: never, -STABLE does not currently use this instruction
2002-10-14 19:33:12 +00:00
Mike Barcroft
4275e0d98d Remove the P1003_1B kernel option; it is no longer used. 2002-10-13 16:29:17 +00:00
Mike Barcroft
7a77412855 Add standards visibility conditionals. Change any uses of sigset_t to
struct __sigset to avoid depending on objects from <sys/signal.h>.
2002-10-13 00:31:46 +00:00
Bruce Evans
b45bbfc36c Fixed syntax errors and printf format errors. 2002-10-12 13:48:21 +00:00
Poul-Henning Kamp
1d6055e77c Remove NO_GEOM option. No outstanding show-stoppers.
Sponsored by:	DARPA & NAI Labs.
2002-10-12 07:26:48 +00:00
Jeff Roberson
b43179fbe8 - Create a new scheduler api that is defined in sys/sched.h
- Begin moving scheduler specific functionality into sched_4bsd.c
 - Replace direct manipulation of scheduler data with hooks provided by the
   new api.
 - Remove KSE specific state modifications and single runq assumptions from
   kern_switch.c

Reviewed by:	-arch
2002-10-12 05:32:24 +00:00
Mike Barcroft
2b7f24d210 Change iov_base's type from char *' to the standard void *'. All
uses of iov_base which assume its type is `char *' (in order to do
pointer arithmetic) have been updated to cast iov_base to `char *'.
2002-10-11 14:58:34 +00:00
Maxim Sobolev
3ad9c842d2 - Add support for IPC_64 extensions into shmctl(2), semctl(2) and msgctl(2);
- add wrappers for mmap2(2) and ftruncate64(2) system calls;
- don't spam console with printf's when VFAT_READDIR_BOTH ioctl(2) is invoked;
- add support for SOUND_MIXER_READ_STEREODEVS ioctl(2);
- make msgctl(IPC_STAT) and IPC_SET actually working by converting from
  BSD msqid_ds to Linux and vice versa;
- properly return EINVAL if semget(2) is called with nsems being negative.

Reviewed by:	marcel
Approved by:	marcel
Tested with:	LSB runtime test
2002-10-11 11:43:09 +00:00
John Baldwin
6b4d1b08a2 Use d_thread_t for cdevsw functions instead of struct thread * so that it
is easier to share this code with 4-stable.
2002-10-09 20:39:26 +00:00
John Baldwin
e7ab2f3683 Remove 'at' hints for npx and apm as both drivers have identify routines
that add an instance of themselves.  The npx(4) driver doesn't even check
the npx 'port' hint but hardcodes IO_NPX instead.  The npx(4) driver also
will use isa IRQ 13 (on x86, 8 on pc98) by default if no 'irq' hint is
specified, so we don't need that hint either.
2002-10-09 17:00:46 +00:00
Julian Elischer
48bfcddd94 Round out the facilty for a 'bound' thread to loan out its KSE
in specific situations. The owner thread must be blocked, and the
borrower can not proceed back to user space with the borrowed KSE.
The borrower will return the KSE on the next context switch where
teh owner wants it back. This removes a lot of possible
race conditions and deadlocks. It is consceivable that the
borrower should inherit the priority of the owner too.
that's another discussion and would be simple to do.

Also, as part of this, the "preallocatd spare thread" is attached to the
thread doing a syscall rather than the KSE. This removes the need to lock
the scheduler when we want to access it, as it's now "at hand".

DDB now shows a lot mor info for threaded proceses though it may need
some optimisation to squeeze it all back into 80 chars again.
(possible JKH project)

Upcalls are now "bound" threads, but "KSE Lending" now means that
other completing syscalls can be completed using that KSE before the upcall
finally makes it back to the UTS. (getting threads OUT OF THE KERNEL is
one of the highest priorities in the KSE system.) The upcall when it happens
will present all the completed syscalls to the KSE for selection.
2002-10-09 02:33:36 +00:00
Warner Losh
ea5420299c o go ahead and route the interupt, even if it is supposedly unique.
there are some strange machines that seem to need this.
o delete bogus comment.
o don't use the the bios for read/writing config space.  They interact badly
  with SMP and being called from ISR.  This brings -current in line with
  -stable.

# make the latter #ifdef on USE_PCI_BIOS_FOR_READ_WRITE in case we
# need to go back in a hurry.
2002-10-07 05:15:05 +00:00
Mike Barcroft
ddb056b7d4 Add conditionals to allow va_list to be defined in other headers. 2002-10-06 22:02:06 +00:00
Mike Barcroft
0b058e3cbd o Add conditionals to allow va_list to be defined in other headers.
o Standardize on _MACHINE_STDARG_H_ to allow multiple header includes.
o Restrict the definition of va_copy() to C99 environments.
2002-10-06 22:01:07 +00:00
Poul-Henning Kamp
3bd6561289 NB: This commit does *NOT* make GEOM the default in FreeBSD
NB: But it will enable it in all kernels not having options "NO_GEOM"

Put the GEOM related options into the intended order.

Add "options NO_GEOM" to all kernel configs apart from NOTES.

In some order of controlled fashion, the NO_GEOM options will be
removed, architecture by architecture in the coming days.

There are currently three known issues which may force people to
need the NO_GEOM option:

boot0cfg/fdisk:
        Tries to update the MBR while it is being used to control
        slices.  GEOM does not allow this as a direct operation.

SCSI floppy drives:
        Appearantly the scsi-da driver return "EBUSY" if no media
        is inserted.  This is wrong, it should return ENXIO.

PC98:
        It is unclear if GEOM correctly recognizes all variants of
        PC98 disklabels.  (Help Wanted!  I have neither docs nor HW)

These issues are all being worked.

Sponsored by:	DARPA & NAI Labs.
2002-10-05 16:35:33 +00:00
Daniel Eischen
ef795b8f41 Fix building of minimal kernels without npx by rearranging ifdefs.
Also fix some style bugs in surrounding code, and add a comment
about FP state restoral that seems questionable.

Submitted by:	bde
2002-10-05 14:36:14 +00:00
Mike Barcroft
e61d3b10d7 Fix namespace issues by using visibility conditionals from
<sys/cdefs.h>.
2002-10-05 05:47:56 +00:00
Mike Barcroft
085f8416a2 style(9) <machine/setjmp.h> headers so they look mostly the same. 2002-10-04 22:10:06 +00:00
Sam Leffler
14c17bd293 New bus_dma interfaces for use by crypto device drivers:
o bus_dmamap_load_mbuf
o bus_dmamap_load_uio

Test on i386.  Known to compile on alpha and sparc64, but not tested.
Otherwise untried.
2002-10-04 20:40:39 +00:00
John Baldwin
fa778f80c2 Fix a bogon in previous commit. bcopy() from the malloc'd memory that we
already copied into, rather than doing the bcopy() from the userland
pointer.  "Oops."
2002-10-04 20:19:36 +00:00
Daniel Eischen
80047e95cf Add another temporary hack to allow running older i386 binaries.
This will be removed when new versions of syscalls sigreturn()
and sigaction() are added (mini is working on this but is in
the middle of a move).

This should fix the problem of cvsupd dying.
2002-10-04 14:50:55 +00:00
Matthew N. Dodd
bafe85a4ad Remove duplicate make_dev() calls. 2002-10-04 08:33:10 +00:00
Matthew N. Dodd
3ae5b53264 newbus & bus_space the mcd(4) driver. 2002-10-04 07:14:19 +00:00
Scott Long
0910374b7f Alas, poor matcd, I knew ye well.
It doesn't work.
It cannot be made to work.
Goodbye.

X-MFC after:	ASAP
2002-10-04 06:06:04 +00:00
Matthew N. Dodd
efe66a4be9 Minor style(9) changes. 2002-10-04 02:21:26 +00:00
Matthew N. Dodd
4c7a1919f6 Remove duplicate calls to make_dev(). 2002-10-04 01:58:55 +00:00
Mitsuru IWASAKI
2f00e60504 Add 2 Ids for new ServerWorks host to PCI bridge chipset.
These are still unknown name but these are working as well
as the other ServerWorks chipset.
Description strings should be corrected when the chipsets
are known.

MFC after:	1 week
2002-10-02 17:50:38 +00:00
Scott Long
316ec49abd Some kernel threads try to do significant work, and the default KSTACK_PAGES
doesn't give them enough stack to do much before blowing away the pcb.
This adds MI and MD code to allow the allocation of an alternate kstack
who's size can be speficied when calling kthread_create.  Passing the
value 0 prevents the alternate kstack from being created.  Note that the
ia64 MD code is missing for now, and PowerPC was only partially written
due to the pmap.c being incomplete there.
Though this patch does not modify anything to make use of the alternate
kstack, acpi and usb are good candidates.

Reviewed by:	jake, peter, jhb
2002-10-02 07:44:29 +00:00
Bruce Evans
e0c386dd90 Removed bits related to MBRs now that they have a proper home in
<sys/diskmbr.h>.
2002-10-02 03:29:00 +00:00
Poul-Henning Kamp
b29d22f94e The pmap_prefault_pageorder[] array was initialize with wrong values
due to a missing comma.

I have no idea what trouble, if any, this may have caused.

Pointed out by:	FlexeLint
2002-10-01 20:51:47 +00:00
John Baldwin
a1885c44cf Whitespace nit. 2002-10-01 20:05:58 +00:00
Juli Mallett
1d9c56964d Back our kernel support for reliable signal queues.
Requested by:	rwatson, phk, and many others
2002-10-01 17:15:53 +00:00
Poul-Henning Kamp
c2b6013026 It is too much work convincing lint why we would want empty structures,
so make the non-empty #ifdef lint.
2002-10-01 14:08:08 +00:00
Poul-Henning Kamp
0d5858f265 Use long long to indicate 64bitness in #ifdef lint. 2002-10-01 14:07:18 +00:00
Poul-Henning Kamp
7e9bac35e2 A more lint friendly #ifdef lint section. 2002-10-01 14:01:58 +00:00
Juli Mallett
37a0dda0c0 Add a missing include. 2002-10-01 02:58:38 +00:00
Juli Mallett
5cd192f4b2 When working with sigset_t's, and needing to perform masking operations based
on a process's pending signals, use the signal queue flattener,
ksiginfo_to_sigset_t, on the process, and on a local sigset_t, and then work
with that as needed.
2002-10-01 02:49:28 +00:00
John Baldwin
92ceafffd0 - Give legacy an identify routine that always adds 'legacy0' at an order
of 1 so that it is not probed until after acpi0 is probed and attached.
- In legacy_probe(), return ENXIO if acpi0 is around and alive.
- nexus_attach() is now much simpler and just lets its child drivers do
  all the work.
2002-09-30 18:47:11 +00:00
John Baldwin
31a51bf683 Trash the PnPBIOStable pointer later on when we know that the acpi probe
and attach routines have succeeded so that if they fail we can still use
the PnP BIOS to find ISA on-board devices.  The fact that we do this here
is gross but fixing it properly involves a lot more work.
2002-09-30 18:45:20 +00:00
David E. O'Brien
dbe57134ec Turn back on the "SMP: AP CPU #N Launched!" message on normal boots.
Peter's rev 1.189 should fix the lost console on SCSI-based systems due
to this message.
2002-09-30 15:39:57 +00:00
Poul-Henning Kamp
150b2bdfb2 If GEOM is in the kernel, take these three out. I have no way of
testing any modifications to them, they shouldn't even bother with
disklabels in the first place and they are just plain obsolete old
hardware which should be axed entirely before 5.0-R IMO.

Sponsored by:	DARPA & NAI Labs.
2002-09-30 13:49:20 +00:00
David E. O'Brien
469541bfde Only print out the "SMP: AP CPU #N Launched!" message on verbose boots.
The kernel printf() isn't race-free
2002-09-30 07:03:16 +00:00
David E. O'Brien
e4544528f6 Save the FP state in the PCB as that is compatable with releng4 binaries.
This is a band-aid until the KSE pthread committers get back on the ground
and have their machines setup.

Submitted by:	eischen
2002-09-30 07:02:22 +00:00
Peter Wemm
8eb8107b44 Deal with some SMP races by doing the entire copyin at once rather
than doing the checks piecemeal and then doing a second copyin later.

PR:		38021
Submitted by:	davidx (I've tweaked the patch a bit)
2002-09-28 22:44:45 +00:00
Peter Wemm
feea0ab05b There is no need for start/num to be signed in i386_ldt_args. 2002-09-28 20:42:04 +00:00
Peter Wemm
8b223ac209 Repair range checking for reading the ldt list.
PR:		38016
Submitted by:	davidx
2002-09-28 19:37:54 +00:00
Poul-Henning Kamp
cb8e433232 Don't call function in return() for a void function. 2002-09-28 17:36:29 +00:00
Poul-Henning Kamp
37c841831f Be consistent about "static" functions: if the function is marked
static in its prototype, mark it static at the definition too.

Inspired by:    FlexeLint warning #512
2002-09-28 17:15:38 +00:00
Søren Schmidt
4c2c25d405 Add the pst (Promise SX6000) driver to GENERIC. 2002-09-27 19:09:21 +00:00
Scott Long
89147260d5 Move the aac driver from MI to MD NOTES. It is a long way from being
64-bit clean.
2002-09-26 18:16:28 +00:00
Peter Wemm
bbe04fe2ca ISMEMSDP(), IS286GDP(), IS386GDP(), ISGDP(), ISSDP() and ISSYSSDP() are
not used anywhere anymore.
2002-09-26 05:07:41 +00:00
Mark Murray
82e5cdeb6e Fix a declaration that is actually supposed to be a macro definition.
Submitted by:	marius@alchemy.franken.de
2002-09-25 13:46:23 +00:00
Jonathan Mini
044af7c357 Back out last commit. Linux uses the old 4.3BSD sockaddr format. 2002-09-24 07:03:01 +00:00
Alfred Perlstein
4f492bfab5 use __packed. 2002-09-23 18:54:32 +00:00
John Baldwin
b8581e0d56 Now that we only probe host-PCI bridges once, we no longer have to check to
see if we have been probed before by checking for a pciX bus device.
2002-09-23 18:14:31 +00:00
John Baldwin
8ff25e9763 Put verbose printf's in the PCI BIOS interrupt routing code under
if (bootverbose).
2002-09-23 18:13:42 +00:00
John Baldwin
58eab4797a Update the nexus driver for the addition of the legacy driver:
- nexus no longer has PCI bridges as direct children, so the PCI bus
  ivar is no longer used and is removed.
- Don't attach default EISA, ISA, or MCA busses.  Instead, if we do not
  have an acpi0 device after bus_generic_probe(), add a legacy0 child
  device.
- Remove machine/nexusvar.h.
2002-09-23 16:03:00 +00:00
John Baldwin
ae829cae03 Hang apm off of the legacy device instead of the nexus. 2002-09-23 15:56:09 +00:00
John Baldwin
2ab55f4392 Change the nexus_pcib driver (eventually to be renamed to legacy_pcib) to
hang off of the legacy driver instead of the nexus.
2002-09-23 15:52:30 +00:00
John Baldwin
e8e951ce31 Add a new legacy(4) device driver for use on machines that do not have
ACPI or for when ACPI support is disabled or not present in the kernel.
Basically, the nexus device is now split into two with some parts
(such as adding default ISA, MCA, and EISA busses if they aren't found
as well as support for PCI bus device ivars) being moved to the legacy
driver.
2002-09-23 15:50:06 +00:00
Peter Wemm
1a8ec9c55a PIC_GOTOFF is OBE. 2002-09-23 07:27:45 +00:00
Peter Wemm
691cb905d6 use __packed, rather than __attribute__((packed)). 2002-09-23 06:50:07 +00:00
Jonathan Mini
d7f94a7a0e Don't use compatability syscall wrappers in emulation code.
This is needed for the COMPAT_FREEBSD3 option split.

Reviewed by:	alfred, jake
2002-09-23 06:17:54 +00:00
Peter Wemm
c692fbe091 At great personal risk, add a __packed and __aligned(x) define that
expand to __attribute__((packed)) and __attribute__((aligned(x)))
respectively.  Replace the handful of gcc-ism's that use
__attribute__((aligned(16))) etc around the kernel with __aligned(16).

There are over 400 __attribute__((packed)) to deal with, that can come
later.  I just want to use __packed in new code rather than add more
gcc-ism's.
2002-09-23 05:55:10 +00:00
Peter Wemm
79af999017 Delete a whole bunch of compatability defines that we dont use anymore. 2002-09-23 05:04:05 +00:00
Mike Barcroft
c0d4804d67 Be careful not to define GCC-specific optimizations in the non-GCC
case.
2002-09-23 04:32:17 +00:00
Peter Wemm
eb1443c8dd Create inlines for ltr(sel), lldt(sel), lidt(addr) rather than
functions that have one instruction.
2002-09-22 04:45:21 +00:00
Matthew N. Dodd
e58de9c6bc - Move the init of %gs and pcb_gs before user_ldt_free().
- Always call load_gs()
- Trim comments.

This addresses some of the issues raised by BDE.
2002-09-22 01:32:48 +00:00
Jake Burkholder
abc370fa85 Moved nfs_diskless setup code from autoconf.c to nfsclient/nfs_diskless.c
so that it is MI.  Allow nfs_mountroot to return an error if the nfs_diskless
struct is not valid, rather than panicing later on.  Call nfs_setup_diskless()
from nfs_mountroot if NFS_ROOT is defined, like bootpc_init().  Removed legacy
root mount support for sparc64, and enabled NFS_ROOT by default.
2002-09-22 00:59:02 +00:00
Jake Burkholder
05ba50f522 Use the fields in the sysentvec and in the vm map header in place of the
constants VM_MIN_ADDRESS, VM_MAXUSER_ADDRESS, USRSTACK and PS_STRINGS.
This is mainly so that they can be variable even for the native abi, based
on different machine types.  Get stack protections from the sysentvec too.
This makes it trivial to map the stack non-executable for certain abis, on
machines that support it.
2002-09-21 22:07:17 +00:00
Mark Murray
181cb2165a Use a function instead of a non-portable, GCC-specific asm() entry. 2002-09-21 19:03:42 +00:00
Mark Murray
e40ab3e98e A good dose of style.9. No functional change. 2002-09-21 19:02:17 +00:00
Mark Murray
38a4de7905 Code tidy-up. ISOfy, turn a macro into an inline for lint(1) (perhaps
this needs to go to cpufunc.h?), de-register.
2002-09-21 18:53:58 +00:00
Mark Murray
bebe1b92bd Use a function instead of embedding non-portable asm() constructs
in C code.
2002-09-21 18:51:19 +00:00
Mark Murray
39ae7d0dc4 Sort includes. 2002-09-21 18:30:12 +00:00
Mark Murray
d7ee442578 Provide in inline function for the (GNUC) assembler "hlt" instruction. 2002-09-21 18:26:53 +00:00
Mark Murray
c7c7312f2c Wrap GCC-specific asm() code in #ifdef __GNUC__ 2002-09-21 18:19:51 +00:00
Poul-Henning Kamp
bc8c3c3e37 Fix a 3 year old oversight: Remove the #ifdef/#endif pair now that there
is nothing between them anymore.

Spotted by:	peter.
2002-09-21 07:59:06 +00:00
John Baldwin
fe4663379e Axe unused include. 2002-09-20 19:16:41 +00:00
Poul-Henning Kamp
f00e97684b We need neither <sys/diskslice.h> nor <sys/disklabel.h> here.
Sponsored by:	DARPA & NAI Labs.
2002-09-20 17:59:09 +00:00
Poul-Henning Kamp
6fb3d70418 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.
2002-09-20 17:51:00 +00:00
John Baldwin
fc028b4e24 fork_trampoline() marks a trap frame.
Submitted by:	bde
2002-09-20 13:58:21 +00:00
John Baldwin
6beff25eed Use proper type for a variable used as a DDB symbol. 2002-09-20 13:56:11 +00:00
John Baldwin
f4684dbc23 Trim includes.
Submitted by:	bde
2002-09-20 13:54:45 +00:00
John Baldwin
9c89a3d5b5 Various style fixes, including moving db_print_backtrace() out of the
middle of the watchpoint code.

Submitted by:	bde
2002-09-20 13:53:33 +00:00
Matthew N. Dodd
12f20b19da This patch enables FreeBSD i686 MTRR support on Intel Pentium
4/XEON processors, which are not currently recognized.

Submitted by:	 Christian Zander <zander@minion.de>
2002-09-19 18:53:49 +00:00
John Baldwin
c79408a059 Implement db_print_backtrace() if DDB is compiled into the kernel. This
MD function is just a wrapper around db_stack_trace_cmd() that prints out
a backtrace of curthread.  Currently, this function is only implemented
on i386 and alpha (and the alpha version isn't quite tested yet, will do
that in a bit).  Other changes:

- For i386, fix a bug in the raw frame address case.  The eip we extract
  from the passed in frame address does not match the frame we received.
  Thus, instead of printing a bogus frame with the wrong eip, go ahead
  and advance frame down to the same frame as the eip we are using.
- For alpha, attempt to add a way of doing a raw trace for alpha.  Instead
  of passing a frame address in 'addr', pass in a pointer to a structure
  containing PC and KSP and use those to start the backtrace.  The alpha
  db_print_backtrace() uses asm to read in the current PC and KSP values
  into such a request.

Tested on:	i386
Requested by:	many
2002-09-19 18:46:29 +00:00
Matthew N. Dodd
37ee08bcab From Christian Zander:
This patch addresses a bug that can cause a GPF in the kernel - if a
process makes use of i386_set_ldt to install a LDT entry, then loads
a corresponding segment descriptor into %gs, forks, and if the child
execs.

In this scenario, setregs executes user_ldt_free and then determines
how to reset the %gs register:

    /* reset %gs as well */
    if (pcb == curpcb)
        load_gs(_udatasel);
    else
        pcb->pcb_gs = _udatasel;

This is insufficient in the fork/exec case, since pcb will be equal
to curpcb when the child execs; load_gs will reset %gs to _udatasel
but it doesn't reset pcb->pcb_gs; upon return from the system call,
cpu_switch_load_gs will thus attempt to restore %gs from pcb->pcb_gs
and trigger a GPF since all LDT entries have already been cleared.

The fix is to always reset pcb->pcb_gs to _udatasel.

Submitted by:	Christian Zander <zander@minion.de>
Reviewed by:	jake
2002-09-19 18:46:25 +00:00
Peter Wemm
ea5d4bd842 Repo copied to <sys/smbus/smb.h> 2002-09-19 04:13:43 +00:00
Peter Wemm
37e255de3f Repo copied to <sys/iicbus/iic.h> 2002-09-19 04:13:29 +00:00
Peter Wemm
db2cfa1f86 move wl (isa wavelan card, not "wi") to i386-only 2002-09-19 03:10:23 +00:00
Peter Wemm
6938800ee2 move "profile 2" to i386 2002-09-19 03:04:07 +00:00
Peter Wemm
b80ad83e76 move ncv, nsp, stg to i386-only section (there is no pc98-specific version) 2002-09-19 03:02:42 +00:00
Peter Wemm
2b412989fe Move dgb to the i386 section 2002-09-19 02:58:41 +00:00
Mitsuru IWASAKI
076ef4620b Restore status register A of RTC at resume time.
This should fix the 'too many RTC interrupts and statclock seems
broken after resume' problem.

MFC after:	1 week
2002-09-18 07:34:04 +00:00
Mike Barcroft
86954511d2 Implement C99's va_copy() macro. 2002-09-18 07:33:16 +00:00
Poul-Henning Kamp
1e77ed827e Add /dev/soekris-errled device to control the Error-LED on Soekris cards/boxes.
# turn LED off
    echo '0' > /dev/soekris-errled

    # turn LED on
    echo '1' > /dev/soekris-errled

    # flash LED (5 hz)
    echo 'f' > /dev/soekris-errled

    # flash LED (4/2 = 2 hz), syntax: "f[1-9]" -> .5 -> 4.5 Hz
    echo 'f4' > /dev/soekris-errled

    # flash digits 1,3 and 7, syntax: "d[1-9]*"
    echo 'd137' > /dev/soekris-errled

Characters not understood are ignored.
2002-09-17 11:47:38 +00:00
Maxim Sobolev
3ac0ac9ea8 Don't reference cpu_fxsr unless CPU_ENABLE_SSE is defined. This fixes kernel
in !CPU_ENABLE_SSE case.
2002-09-17 11:12:10 +00:00
Peter Wemm
66422f5b7a Initiate deorbit burn for the i386-only a.out related support. Moves are
under way to move the remnants of the a.out toolchain to ports.  As the
comment in src/Makefile said, this stuff is deprecated and one should not
expect this to remain beyond 4.0-REL.  It has already lasted WAY beyond
that.

Notable exceptions:
gcc - I have not touched the a.out generation stuff there.
ldd/ldconfig - still have some code to interface with a.out rtld.
old as/ld/etc - I have not removed these yet, pending their move to ports.
some includes - necessary for ldd/ldconfig for now.

Tested on: i386 (extensively), alpha
2002-09-17 01:49:00 +00:00
Jonathan Mini
30abe507c0 Add kernel support needed for the KSE-aware libpthread:
- Maintain fpu state across signals.
	- Save and restore FPU state properly in ucontext_t's.

Reviewed by:	bde, deischen, julian
Approved by:	-arch
2002-09-16 19:25:59 +00:00
Jonathan Mini
9ba1547929 Add kernel support needed for the KSE-aware libpthread:
- Maintain fpu state across signals.
	- Save and restore FPU state properly in ucontext_t's.

Reviewed by:	deischen, julian
Approved by:	-arch
2002-09-16 19:25:41 +00:00
Jonathan Mini
575525a000 Add kernel support needed for the KSE-aware libpthread:
- Maintain fpu state across signals.
	- Use ucontext_t's to store KSE thread state.
	- Synthesize state for the UTS upon each upcall, rather than
	  saving and copying a trapframe.
	- Save and restore FPU state properly in ucontext_t's.

Reviewed by:	deischen, julian
Approved by:	-arch
2002-09-16 19:25:08 +00:00
Julian Elischer
4f0db5e08c 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.
2002-09-15 23:52:25 +00:00
Mike Barcroft
ec541fb314 makeLINT.sed replaced makeLINT.sh about 4 months ago. 2002-09-15 19:04:23 +00:00
Bruce Evans
e9a6d3b44c Removed unused includes. Sorted includes. This is part of removing
includes of <sys/user.h> for its pollution only.  <sys/user.h> wasn't
even used for its pollution here.
2002-09-15 17:45:10 +00:00
David Malone
93f39ea88a Some BIOSs are using MTRR values that are only documented under NDA
to control the mapping of things like the ACPI and APM into memory.

The problem is that starting X changes these values, so if something
was using the bits of BIOS mapped into memory (say ACPI or APM),
then next time they access this memory the machine would hang.

This patch refuse to change MTRR values it doesn't understand,
unless a new "force" option is given. This means X doesn't change
them by accident but someone can override that if they really want
to.

PR:		28418
Tested by:	Christopher Masto <chris@netmonger.net>,
		David Bushong <david@bushong.net>,
		Santos <casd@myrealbox.com>
MFC after:	1 week
2002-09-15 15:07:55 +00:00
Robert Watson
a9739d989f Whitespace consistency fix from addition of IAHD_REG_PRETTY_PRINT: use
tabs not spaces.
2002-09-11 16:51:48 +00:00
Julian Elischer
71fad9fdee Completely redo thread states.
Reviewed by:	davidxu@freebsd.org
2002-09-11 08:13:56 +00:00
Nate Lawson
8579e9cfbd Fix LINT build on alpha by completing move of cy and apm_saver to
i386/conf/NOTES rather than the global conf/NOTES.

Suggested by: bde
2002-09-11 05:33:15 +00:00
Sam Leffler
f3a7208afa move some printfs under bootverbose
Reviewed by:	phk
2002-09-10 05:06:48 +00:00
John Baldwin
fefe985dc6 Make sure a $PIR table header has a valid length before accepting the table
as valid.

Submitted by:	Michal Mertl <mime@traveller.cz>
2002-09-09 18:24:35 +00:00
Robert Drehmel
4dfbdd7823 - Fix iBCS2 emulation of COFF files that have multiple libraries
in their library (STYP_LIB) section.
 - Attempt to make the code which calculates the next entry and
   string offsets look clearer.

PR:		kern/42580
Tested by:	Olaf Klein <ok@adimus.de> (on 4.7-PRERELEASE)
2002-09-09 15:51:10 +00:00
Poul-Henning Kamp
a0c422db00 #include "opt_bla.h" goes first says Bruce. 2002-09-09 08:44:52 +00:00
Jun Kuriyama
b37a9be231 Use "options " rather than "options<tab>". 2002-09-09 02:40:59 +00:00
Poul-Henning Kamp
9339569236 Fix style(9) bugs.
Brucified by:	bde
2002-09-08 15:16:49 +00:00
Peter Wemm
8c478ca930 Note that 'device gzip' *requires* COMPAT_AOUT. Maybe this "device"
should be renamed to COMPAT_GZIPAOUT or something like that.
2002-09-08 02:33:42 +00:00
Peter Wemm
a9f9df5daf Tidy up some loose ends that bde pointed out. caddr_t bad, ok?
Move fill_kinfo_proc to before we copy the results instead of after
the copy and too late.

There is still more to do here.
2002-09-07 22:31:44 +00:00
Peter Wemm
99a17113cd The true value of how the kernel was configured for KSTACK_PAGES was not
available at module compile time.  Do not #include the bogus
opt_kstack_pages.h at this point and instead refer to the variables that
are also exported via sysctl.
2002-09-07 22:15:47 +00:00
Juli Mallett
77c70ade18 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
2002-09-07 19:12:53 +00:00
Juli Mallett
9d05b77d4f 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.
2002-09-07 18:56:18 +00:00
Juli Mallett
d367157e25 Match the more modern ports and comment the filling of POSIX parts of siginfo
with 'Fill in POSIX parts'.  (Diff reduction.)
2002-09-07 18:55:15 +00:00
Bruce Evans
8a1a68fa84 Include <machine/pcb.h> instead of depending on namespace pollution in
<sys/user.h>.
2002-09-07 14:32:22 +00:00
Peter Wemm
f7749f924c 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.
2002-09-07 07:02:12 +00:00
Peter Wemm
7646aefc21 Supposedly linux has added a 6th syscall arg register (%ebp). I am not
100% sure if this is enough, but it will not harm anything.
2002-09-07 04:59:49 +00:00
Peter Wemm
6bf46c4c5f Add options COMPAT_AOUT to detect future bitrot. 2002-09-07 01:49:52 +00:00
Peter Wemm
a9148ab103 Give this a self contained a.out coredump routine.
XXX freebsd-aout coredumps for a linux-aout binary is a bit pointless.
2002-09-07 01:29:21 +00:00
Peter Wemm
1a50106e30 Zap the implementations of the i386-aout specific cpu_coredump function.
Most of the non-i386 platforms had rather broken implementations anyway.
2002-09-07 01:26:34 +00:00