Commit Graph

244 Commits

Author SHA1 Message Date
yamt
ab51be8e72 define SPINLOCK_SPIN_HOOK to let LK_SPIN lockmgr locks call x86_pause. 2003-10-26 11:15:16 +00:00
kleink
a1fdc1db7a Reflect the explicit integer bit here as well. 2003-10-25 21:31:25 +00:00
christos
e5d9888ff1 Fix uninitialized variable warning 2003-10-25 18:39:40 +00:00
kleink
56062be225 Make ieee_ext match reality, and add a note about its ABI-specific
tail padding.
2003-10-23 23:28:29 +00:00
kleink
422697679e * Move the definitions for types other than single-precision and double-
precision back to machine-dependent headers.  C99 has no strict
  requirement which, if any, extended-precision type `long double' must
  match, and even between 80-bit formats there are differences in
  implementation (m68k vs. x86).
* On arm, consider __VFP_FP__.
2003-10-23 23:26:06 +00:00
kleink
5d1a2f48d2 Use a common <machine/math.h> for amd64 and i386. 2003-10-22 11:54:23 +00:00
fvdl
eee926f0a9 Only declare intr_scan_bus if NIOAPIC > 0. 2003-10-22 01:53:49 +00:00
fvdl
e74e8c0c71 Correctly walk up the PCI bus tree to find an interrupt match with
a swizzled pin.
2003-10-21 23:25:48 +00:00
fvdl
80cec054e5 If a bus has not been configured by MPBIOS/ACPI, and the attach hook
for it is called, mark it as configured.
2003-10-21 23:22:52 +00:00
fvdl
6a6db3cbd9 Add hooks and structures to allow the MP table intr mapping code a
better shot at finding a mapping. For PCI interrupts, if a bus
has no mappings, try its parent, with the swizzled pin, and the
bridge's device number.
2003-10-16 22:56:29 +00:00
tron
676596e33a Fix build problem when MPACPI is used without ioapic as proposed by
Quentin Garnier on current-users@NetBSD.org.
2003-10-10 20:16:54 +00:00
fvdl
0a79ef3086 Allow probing of CPUs only by ACPI, so that MPBIOS can still do interrupt
mapping should ACPI have a quirk. From Christos. One change by me: make
sure that lapic_boot_init doesn't get called twice, otherwise the
cpu_info entry for the CPU with id 0 gets zapped.
2003-10-09 16:25:16 +00:00
bouyer
83af294c93 pciide_machdep.c depends on pciide_common, not pciide.
Pointed out and fix tested by Marc Recht.
2003-10-08 17:29:59 +00:00
lukem
1c33b4e6a4 Overhaul MBR handling (part 1):
<sys/bootblock.h>:
    *	Added definitions for the Master Boot Record (MBR) used by
	a variety of systems (primarily i386), including the format
	of the BIOS Parameter Block (BPB).
	This information was cribbed from a variety of sources
	including <sys/disklabel_mbr.h> which this is a superset of.

	As part of this, some data structure elements and #defines
	were renamed to be more "namespace friendly" and consistent
	with other bootblocks and MBR documentation.
	Update all uses of the old names to the new names.

<sys/disklabel_mbr.h>:
    *	Deprecated in favor of <sys/bootblock.h> (the latter is more
	"host tool" friendly).

amd64 & i386:
    *	Renamed /usr/mdec/bootxx_dosfs to /usr/mdec/bootxx_msdos, to
	be consistent with the naming convention of the msdosfs tools.

    *	Removed /usr/mdec/bootxx_ufs, as it's equivalent to bootxx_ffsv1
	and it's confusing to have two functionally equivalent bootblocks,
	especially given that "ufs" has multiple meanings (it could be
	a synonym for "ffs", or the group of ffs/lfs/ext2fs file systems).

    *	Rework pbr.S (the first sector of bootxx_*):
	    +	Ensure that BPB (bytes 11..89) and the partition table
		(bytes 446..509) do not contain code.
	    +	Add support for booting from FAT partitions if BOOT_FROM_FAT
		is defined.  (Only set for bootxx_msdos).
	    +	Remove "dummy" partition 3; if people want to installboot(8)
		these to the start of the disk they can use fdisk(8) to
		create a real MBR partition table...
	    +	Compile with TERSE_ERROR so it fits because of the above.
		Whilst this is less user friendly, I feel it's important
		to have a valid partition table and BPB in the MBR/PBR.

    *	Renamed /usr/mdec/biosboot to /usr/mdec/boot, to be consistent
	with other platforms.

    *	Enable SUPPORT_DOSFS in /usr/mdec/boot (stage2), so that
    	we can boot off FAT partitions.

    *	Crank version of /usr/mdec/boot to 3.1, and fix some of the other
	entries in the version file.

installboot(8) (i386):
    *	Read the existing MBR of the filesystem and retain the BIOS
    	Parameter Block (BPB) in bytes 11..89 and the MBR partition
	table in bytes 446..509.  (Previously installboot(8) would
	trash those two sections of the MBR.)

mbrlabel(8):
    *	Use sys/lib/libkern/xlat_mbr_fstype.c instead of homegrown code
	to map the MBR partition type to the NetBSD disklabel type.


Test built "make release" for i386, and new bootblocks verified to work
(even off FAT!).
2003-10-08 04:25:43 +00:00
fvdl
a7a118bf66 Backout previous for now, it breaks second CPU spinup. It'll be back later. 2003-10-07 21:47:57 +00:00
fvdl
9771ccbb32 Changes from Christos to fall back to MPBIOS for interrupt probing
if MPACPI fails, so that MPACPI can be used to only probe CPUs
if needed.
2003-10-07 18:10:36 +00:00
nathanw
4d59420344 Move __cpu_simple_lock_t and __SIMPLELOCK_{UN,}LOCKED to machine/types.h
so that they can be used in a namespace-friendly way.
2003-09-26 22:45:41 +00:00
skd
3736d609a5 Fix for ioapic irq routing. This fixes kern/22728.
Approved by fvdl.
2003-09-18 19:31:19 +00:00
fvdl
5a759ef06c Move the bulk of pci_intr_string into a seperate intr_string function. Use
that new function to print the pciide compat interrupt in pciide_machdep.c.
Share pciide_machdep.c between amd64 and i386.
2003-09-06 17:44:36 +00:00
fvdl
40b81ea5a1 If possible, put the device name of the APIC used into the interrupt string,
not "apic N". This makes it easier to match vmstat output with dmesg output.
2003-09-06 14:55:50 +00:00
fvdl
631d339e09 When establishing the ACPI SCI, make sure it's always active low (as well
as level-triggered). Do this by changing the MP config entry that was
set up for the interrupt. Do not change anything if there was an ACPI
interrupt source override, assume that this contains the correct
information already.
2003-09-06 14:38:41 +00:00
fvdl
ce2fedd6fb Compile in the !MPACPI && NIOAPIC case. 2003-09-02 20:10:30 +00:00
itojun
ffb2df7cd0 variable 'sc' needed in MPACPI case (what should we do about NIOAPIC?) 2003-08-27 11:38:54 +00:00
fvdl
c43b35423e Pass pointers to frames from assembly, do not use the 'frame on stack
as argument passed by value' trick, as gcc 3.3.x makes (valid) assumptions
about the stack that will not be true. Costs 2 instructions per trap/syscall
on i386, 4 per interrupt for MP. One instruction per trap/syscall on amd64,
2 per interrupt for MP. I expect gcc 3.3.1 to make up for this by better
optimization (it'd better..)

While here, make amd64 compile again by using subr_mbr_disk.c
2003-08-20 21:48:35 +00:00
agc
aad01611e7 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22364, verified by myself.
2003-08-07 16:26:28 +00:00
mrg
5d4f9678cd give >32 bit constants an "LL" prefix to appease gcc3.3 2003-07-28 10:29:00 +00:00
simonb
ea8d25e941 Use local APIC id to determine boot CPU.
Fixes PR kern/20690 from Jaromir Dolecek.  Fix from fvdl.
2003-07-22 12:10:20 +00:00
lukem
457546793c change multiple include protection #define to match filename 2003-07-19 04:52:18 +00:00
lukem
52c38f7f74 add __KERNEL_RCSID() 2003-07-14 22:32:39 +00:00
fvdl
d5aece61d6 Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
2003-06-29 22:28:00 +00:00
darrenr
960df3c8d1 Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records.  The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
2003-06-28 14:20:43 +00:00
martin
864f19482a #ifdef _KERNEL_OPT police 2003-06-23 14:59:21 +00:00
martin
d505b18964 Make sure to include opt_foo.h if a defflag option FOO is used. 2003-06-23 11:00:59 +00:00
thorpej
452a8fdae2 Rename IPL_IMP -> IPL_VM. 2003-06-16 20:00:56 +00:00
fvdl
7dd7f8baa2 Handle 64bit DMA addresses on PCI for platforms that can (currently only
enabled on amd64). Add a dmat64 field to various PCI attach structures,
and pass it down where needed. Implement a simple new function called
pci_dma64_available(pa) to test if 64bit DMA addresses may be used.
This returns 1 iff _PCI_HAVE_DMA64 is defined in <machine/pci_machdep.h>,
and there is more than 4G of memory.
2003-06-15 23:08:53 +00:00
thorpej
0eff671820 Also pass a type argument to comcnattach() and com_kgdb_attach().
comspeed() (and thus cominit()) may need this information.
2003-06-14 17:01:06 +00:00
fvdl
4812bbf71f Avoid bad free() calls for failed allocations. From enami. 2003-06-11 21:36:49 +00:00
fvdl
80dd75c603 mpb_name may not be set for a bus, since it's possible a PCI bus
doesn't show up when looking at ACPI, but is found on a ppb. So
check if it's NULL before doing a strcmp on it.

From Takayoshi Kochi.
2003-06-01 19:14:20 +00:00
fvdl
afff857edc Add the options MPBIOS_SCANPCI and MPACPI_SCANPCI to configure PCI roots
with the MPBIOS/ACPI bus information, by walking through the buses, and
descending down every bus that hasn't been marked configured yet.
2003-05-29 20:22:28 +00:00
fvdl
3ce3540177 Don't start the process of scanning CPUs and I/O APICs (with interrupt
routing to follow later) if the ACPI implementation is marked as
having a quirky PCI bus/interrupt configuration. If MPBIOS is also
defined, it'll do the job instead.
2003-05-15 21:31:59 +00:00
fvdl
c9c95208a9 Postpone the ioapic_ih assignment a bit, since the pin number may have
been corrected in a workaround in the meantime.
2003-05-15 16:32:50 +00:00
fvdl
74793a8cdd Try a little harder to find PCI buses in the MPACPI code, in a (probably
futile) attempt to get quirky ACPI implementations going.

Work around a problem with quirky MP tables for ioapic interrupt routing.
2003-05-15 13:30:31 +00:00
fvdl
f8a204c941 Add RCS Id and/or copyright notice. 2003-05-14 12:22:34 +00:00
kleink
776138ea69 Rename <sys/float_ieee.h> to <sys/float_ieee754.h>, following libc's
convention for these.
2003-05-12 15:22:53 +00:00
fvdl
908e4bef54 Remove machine/cputypes include. 2003-05-11 21:51:32 +00:00
fvdl
28644fa06f Make this include file shareable (moved here from sys/arch/i386/include) 2003-05-11 18:48:13 +00:00
fvdl
2e91dc8e00 Update for acpi file move to sys/arch/x86/x86. 2003-05-11 18:24:12 +00:00
fvdl
a03460e886 Moved here from sys/arch/i386/i386 2003-05-11 18:21:16 +00:00
fvdl
def0e7acaa Moved here from sys/arch/i386/include. 2003-05-11 18:20:38 +00:00
fvdl
36e72df35b Add a function that dumps ioapic redir state, for our debugging pleasure. 2003-05-11 13:49:02 +00:00
fvdl
4fb355a1be Initialize the global int number to -1 (the MPBIOS code doesn't set it
anywhere else; MPACPI does use it).
2003-05-11 00:06:31 +00:00
fvdl
f42f32cacc Add a global_int field to the mp_intr_map structure, for use with ACPI.
XXX should probably just use an array directly indexed by global interrupt
numbers in that case.
2003-05-11 00:05:52 +00:00
fvdl
d88cf589cb A few ISA sound drivers like to share dma channels, and hence deferred
isa_dmamap_create() calls to their open/close entrypoints. This worked
with some luck, but broke on i386 when _bus_dmamap_create started
to allocate bounce buffers upfront, since memory below 16M may well
not be available when the sound devices is opened for the Nth time.

To fix this, create a new simple interface, isa_drq_alloc/isa_drq_free,
wrappers around already existing bitmask macros. These are expected
to be used before an isa_dmamap_create call, and after an
isa_dmamap_destroy call, respectively. For the sb and ad1848 drivers,
they're deferred until open/close.

All isa_dmamap_create calls can now use BUS_DMA_ALLOCNOW and be done
at attach time.
2003-05-09 23:51:25 +00:00
fvdl
8aca0c88d2 Add x86_pause() inline function, containing the "pause" instruction
for i386, and nothing for amd64. Sprinkle it in various spinloops,
as recommended by Intel.
2003-05-08 01:04:34 +00:00
fvdl
799347472e Generalize bounce buffers, and use them for 32 bit PCI if needed.
Make ALLOCNOW the default iff bouncing might be needed (this has
no effect on i386 because ISA DMA devices already had to use
ALLOCNOW, and PCI isn't bounced (yet), since we don't do > 4G
at this point for i386.
2003-05-07 21:33:57 +00:00
fvdl
6bd0c9f44d Move definition of ISA_DMA_BOUNCE_THRESHOLD to dev/isa/isareg.h. 2003-05-05 12:55:41 +00:00
fvdl
2cd70f0da1 Block level-triggered interrupts at the ioapic if they are deferred.
Avoids interrupt storms seen on some systems. Many thanks to
Stoned Elipot for testing.
2003-05-04 22:01:56 +00:00
wiz
1ffa7b76c4 DMA, not dma nor Dma. 2003-05-03 18:10:37 +00:00
fvdl
4fc5083af1 Include "eisa.h" in order to get the NEISA value; without it EISA-only
MP intr routing tables wouldn't be searched.
2003-04-28 20:26:18 +00:00
fvdl
df51b177d8 Install cacheinfo.h 2003-04-26 10:49:54 +00:00
fvdl
4b293b5851 Share some common cache info cpuid code between i386 and x86_64. 2003-04-25 21:54:29 +00:00
christos
f1726c271b Override LDBL_MIN 2003-04-21 00:08:24 +00:00
christos
a2dfb1b570 PR/3012: Greg A. Woods: Write all float.h files [except the vax of course]
in terms of float_ieee.h
2003-04-19 23:05:28 +00:00
dsl
ab1f41a716 Add definitions (#defined out) to pass the result of the v3.x bios
extended disk information request to the kernel.
Binary compatible with the existing code, disabled because I don't
have a system with a bios that supports the request.
2003-04-16 19:16:42 +00:00
thorpej
bcea7d5f28 Use cached physical addresses for mbufs and clusters to save having
to extract the physical address from the virtual.

On the ARM, also use the "read-only at MMU" indication to avoid a
redundant cache clean operation.

Other platforms should use these two as examples of how to use these
new pool/mbuf features to improve network performance.  Note this requires
a platform to provide a working POOL_VTOPHYS().

Part 3 in a series of simple patches contributed by Wasabi Systems
to improve network performance.
2003-04-09 18:51:35 +00:00
thorpej
ffc984aa7c Use PAGE_SIZE rather than NBPG. 2003-04-02 07:53:56 +00:00
thorpej
d071d9a8d0 Use PAGE_SIZE rather than NBPG. 2003-04-01 15:02:05 +00:00
christos
866b37e61b pmap_kremove the pages before uvm_km_free'ing them. Thanks jason! 2003-03-14 18:47:53 +00:00
thorpej
7d8f167f16 Split bus_space and bus_dma into separate files. 2003-03-12 00:09:51 +00:00
fvdl
91ef1f21bf Make the apic address unsigned, as it should be. 2003-03-04 23:27:32 +00:00
fvdl
c89161c65f ioapic address is not actually a pointer, initialize it as uint32_t 2003-03-04 23:21:25 +00:00
fvdl
e575c4bc69 Fix some fields that did not have explicit types yet. 2003-03-04 23:20:29 +00:00
fvdl
48aa516ffe Use read_psl and write_psl. 2003-03-04 22:43:36 +00:00
fvdl
d9bd125d50 Make EISA support conditional (on by default on i386). 2003-03-04 22:19:04 +00:00
fvdl
a345044000 s/i386_isa_chipset/x86_isa_chipset/ 2003-03-04 01:07:36 +00:00
fvdl
7b925fa8cf Use unsigned long long to print msr values. 2003-03-03 22:23:22 +00:00
fvdl
2934facefc use CVAROFF. 2003-03-03 22:17:15 +00:00
fvdl
60ff7764b1 Use pmap_cpu_has_pg_n() 2003-03-03 22:16:54 +00:00
fvdl
22c3c5973b The IDT is an array of struct gate_descriptor. 2003-03-03 22:16:20 +00:00
fvdl
cf1495e079 Install cpuvar.h 2003-03-03 20:26:18 +00:00
fvdl
7f72a2bff2 Clean up some unneeded "mca.h" and "eisa.h" includes, make one that is
needed dependent on !__x86_64__. To be revisited later.
2003-03-02 18:27:14 +00:00
fvdl
636c7ca859 x86_64 has no mca.h and eisa.h (should perhaps just generate empty ones) 2003-03-02 18:11:03 +00:00
fvdl
0cb6724bc7 lock_machdep.c moved here from arch/i386/i386. 2003-03-01 22:55:02 +00:00
fvdl
9ad868eb65 Moved here from i386/include 2003-03-01 18:29:28 +00:00
fvdl
d2315fd2b7 Remove accidentally enabled debug printf.
From Enami.
2003-03-01 13:05:37 +00:00
fvdl
f8b0474185 Reinstate some const qualifiers I accidentally removed when moving this
file.
2003-02-27 11:22:46 +00:00
fvdl
dd22310ae1 Add consinit.c 2003-02-27 01:50:40 +00:00
fvdl
b5a7ec69dd Moved here from arch/i386/i386. 2003-02-27 01:49:05 +00:00
fvdl
d89d6b98f7 Catch up with isa_machdep.c and pci_machdep.c move. 2003-02-27 00:39:40 +00:00
fvdl
e397aa2f84 Moved here from i386/pci. 2003-02-27 00:30:31 +00:00
fvdl
8556a55a8d Moved here from i386/isa 2003-02-27 00:28:08 +00:00
fvdl
20e439b5cb Move a few more files to x86/include. Trim the list of files to install
in /usr/include a bit.
2003-02-27 00:10:56 +00:00
fvdl
2b14e212b1 Install header files. 2003-02-26 22:27:00 +00:00
fvdl
8375b2d985 Move some files out of i386 into x86, so that they can be shared with
other ports.
2003-02-26 21:26:09 +00:00