Commit Graph

3317 Commits

Author SHA1 Message Date
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
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
Archie Cobbs
36a8dac10d Let kse_wakeup() take a KSE mailbox pointer argument.
Reviewed by:	julian
2002-10-02 16:48:16 +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
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
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
7e9bac35e2 A more lint friendly #ifdef lint section. 2002-10-01 14:01:58 +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
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
Peter Wemm
bbe04fe2ca ISMEMSDP(), IS286GDP(), IS386GDP(), ISGDP(), ISSDP() and ISSYSSDP() are
not used anywhere anymore.
2002-09-26 05:07:41 +00:00
Archie Cobbs
89def71cbd Make the following name changes to KSE related functions, etc., to better
represent their purpose and minimize namespace conflicts:

	kse_fn_t		-> kse_func_t
	struct thread_mailbox	-> struct kse_thr_mailbox
	thread_interrupt()	-> kse_thr_interrupt()
	kse_yield()		-> kse_release()
	kse_new()		-> kse_create()

Add missing declaration of kse_thr_interrupt() to <sys/kse.h>.
Regenerate the various generated syscall files. Minor style fixes.

Reviewed by:	julian
2002-09-25 18:10:42 +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
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
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
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
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
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