Commit Graph

9019 Commits

Author SHA1 Message Date
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