Commit Graph

4032 Commits

Author SHA1 Message Date
Peter Wemm
bfe14b3edc MFi386: remove debug printf 2004-06-03 20:22:48 +00:00
Peter Wemm
b5eb4e5196 Move module.h include to the same place as on i386 for diff reduction. 2004-06-03 20:21:30 +00:00
Peter Wemm
9248fc7bc0 MFi386: move cpu_nameclass struct next to its only consumer 2004-06-03 20:18:15 +00:00
Tim J. Robbins
cc05397ffc Remove checks for curthread == NULL - it can't happen. 2004-06-03 10:22:47 +00:00
Poul-Henning Kamp
fd360128ff Add missing <sys/module.h> instances which were shadowed by the nested
include in <sys/kernel.h>
2004-06-03 05:58:30 +00:00
Tim J. Robbins
fa2a4d0595 Move TDF_DEADLKTREAT into td_pflags (and rename it accordingly) to avoid
having to acquire sched_lock when manipulating it in lockmgr(), uiomove(),
and uiomove_fromphys().

Reviewed by:	jhb
2004-06-03 01:47:37 +00:00
Tim J. Robbins
aa0aa7a113 Move TDF_SA from td_flags to td_pflags (and rename it accordingly)
so that it is no longer necessary to hold sched_lock while
manipulating it.

Reviewed by:	davidxu
2004-06-02 07:52:36 +00:00
Poul-Henning Kamp
41ee9f1c69 Add some missing <sys/module.h> includes which are masked by the
one on death-row in <sys/kernel.h>
2004-05-30 17:57:46 +00:00
Alan Cox
b59f545aa2 MFi386 revision 1.6
Reenable ithread preemption for interrupts that occur while executing in
 the kernel.
2004-05-30 04:49:39 +00:00
Tim J. Robbins
402705521a Implement __bb_init_func. This is a fairly straightforward conversion
of the i386 version.
2004-05-29 01:13:28 +00:00
Alan Cox
662d471da6 Remove a broken micro-optimization from pmap_enter(). The ill effect
of this micro-optimization occurs when we call pmap_enter() to wire an
already mapped page.  Because of the micro-optimization, we fail to
mark the PTE as wired.  Later, on teardown of the address space,
pmap_remove_pages() destroys the PTE before vm_fault_unwire() has
unwired the page.  (pmap_remove_pages() is not supposed to destroy
wired PTEs.  They are destroyed by a later call to pmap_remove().)
Thus, the page becomes lost.

Note: The page is not lost if the application called munlock(2), only
if it relies on teardown of the address space to unwire its pages.

For the historically inclined, this bug was introduced by a
megacommit, revision 1.182, roughly six years ago.

Leak observed by: green@ and dillon independently
Patch submitted by: dillon at backplane dot com
Reviewed by: tegge@
MFC after: 1 week
2004-05-28 19:42:02 +00:00
Thomas Moestl
65e29c4822 Retire cpu_sched_exit(); it is not used any more. 2004-05-26 12:09:39 +00:00
Bruce Evans
026afdcc05 Quick fix for overflow when tsc_freq >= 2^31. "int profrate" in struct
gmon and struct gmonhdr was originally just to represent the kernel
(profiling) clock frequency and it remains poorly suited to representing
the frequencies of fast counters like the TSC.  It broke a year or two
ago.  This quick fix keeps it working for another year or month or two
until TSC frequencies can exceed 2^32, by dividing the frequency by 2.
Dividing the frequency by 4 would work for a little longer but would
lose a little too much precision.
2004-05-26 09:43:38 +00:00
Bruce Evans
d7d197e0f9 Oops, ".align 4" for the data section in the previous commit should
have been ".p2align 4".  This bug is cosmetic since the data section
happens to be empty.
2004-05-24 12:42:16 +00:00
Bruce Evans
003d5d66b1 Fixed profiling of trap, syscall and interrupt handlers and some
ordinary functions, essentially by backing out half of rev.1.115 of
amd64/exception.S.  The handlers must be between certain labels for
the purposes of profiling, and this was broken by scattering them in
separately compiled .S files, especially for ordinary functions that
ended up between the labels.  Merge the files by #including them as
before, except with different pathnames and better comments and
organization.  Changes to the scattered files are minimal -- just
move the labels to the file that does the #includes.

This also partly fixes profiling of IPIs -- all IPI handlers are now
correctly classified as interrupt handlers, but many are still missing
mcount calls.
2004-05-24 12:08:56 +00:00
Bruce Evans
909ca1671d Don't repeat the definition of IDTVEC(). It is in asmacros.h. 2004-05-24 11:28:11 +00:00
Bruce Evans
7a9e253666 Added profiling support for Xint0x80_syscall. 2004-05-23 19:06:15 +00:00
Bruce Evans
5eb1e23a45 Adjusted for amd64 after repo-copy. The adjustments are routine, except:
- perfmon headers must be avoided until perfmon is supported.
- all call-used registers including return registers must be preserved
  by .mcount(), etc., not quite as in profile.h.  __cyg_profile_func_*()
  don't require this, but they are (mis)implemented as aliases for
  .mcount(), etc. so they preserve the registers.
- i386 ifdefs related to perfmon have not been adjusted yet.
2004-05-23 18:27:14 +00:00
Bruce Evans
03d5ca33db Restored FAKE_MCOUNT() and MEXITCOUNT invocations and adjusted them for
amd64 as necessary.  This is routine, except:
- the FAKE_MCOUNT($bintr) in doreti was missing the '$'.  This gave a
  a garbage address made up of padding bytes (with the nop byte 0x90 as
  the MSB) instead of the intended address of bintr.  This accidentally
  worked on i386's because (0x90 << 24) is close enough to bintr, but
  it doesn't work on amd64's because (0x90 << 56) is much further away
  from bintr.
- the FAKE_MCOUNT($btrap) in calltrap was similarly broken.  It hasn't
  been needed since FreeBSD-1, so just delete it.
2004-05-23 17:18:48 +00:00
Bruce Evans
5423714950 Adjusted FAKE_MCOUNT()s for amd64. This is needed for both ordinary
and high resolution profiling of interrupt handlers.  The adjustments
are routine once the magic stack offset 13*4 is decoded to be TF_RIP
(there were originally more types of stack frames so using TF_EIP for
one of them wouldn't have been much simpler).

Removed garbage comments attached to some of the FAKE_MCOUNT()s.
2004-05-23 16:23:29 +00:00
Bruce Evans
e2960917e1 Spell "retq" as "ret" in pagezero() like it is everywhere, else so
that the usual macro for "ret" hides the detail of calling .mexitcount
before returning.

Fixed missing call to .mexitcount in lgdt().  This was missing on
i386's, mainly because lgdt() uses lret[q] insted of ret.  This is
very unimportant since lgdt() is not (normally?) called until after
profiling is initialized.
2004-05-23 14:56:02 +00:00
Bruce Evans
69820c2a56 MFi386 (1.103 and 1.104: fixed some problems in high resolution profiling
and improved some comments).  Also, made the documented {f,s}uword()
functions the standard entry points and the undocumented {f,s}uword64()
functions alternative entry points, like {f,s}uword32() for i386's.  The
bitrot in the comments was a little larger here -- there are new undocumented
32-bit sub-word functions, not just renaming of 16-bit functions from
documented ones to undocumented ones.
2004-05-21 16:50:57 +00:00
Bruce Evans
5a8f125ad9 MFi386 (1.37: GUPROF calibration macros; only routine adjustments needed). 2004-05-20 16:22:57 +00:00
Peter Wemm
8dd1279c31 Like on i386, clear the last three entries in the pml4 page when doing a
pmap_release(), and put it the free queue marked as already zeroed.
2004-05-19 21:55:37 +00:00
Bruce Evans
8693960479 Fixed the type of fptrdiff_t. It needs to be 64 bits in theory, and in
practice too since kernel addresses are almost 2^64 higher than most
user addresses.
2004-05-19 16:19:11 +00:00
Bruce Evans
19b5915afa Fixed some style bugs (mainly misalignment of backslashes). 2004-05-19 16:04:26 +00:00
Bruce Evans
b2321e7cdb Moved most of the "MI" definitions and declarations from <machine/profile.h>
to <sys/gmon.h>.  Cleaned them up a little by not attempting to ifdef
for incomplete and out of date support for GUPROF in userland, as in
the sparc64 version.
2004-05-19 15:41:26 +00:00
Peter Wemm
eba9b48b10 Unbreak builds without DDB. Bad Bruce! No cookie! :-) 2004-05-19 01:23:48 +00:00
Peter Wemm
2079cde964 The 'call mcount' hooks that gcc inserts when profiling are in a place that
cannot handle the scratch registers being trashed.  So we have to preserve
them ourselves.
2004-05-18 22:52:32 +00:00
Stefan Farfeleder
b1aa0ba527 <stdint.h> should define WINT_M{AX,IN} independent from whether WCHAR_MIN is
defined.  Otherwise first including <wchar.h> and then <stdint.h> leads to no
WINT_M{AX,IN} at all.

PR:		64956
Approved by:	das (mentor)
2004-05-18 16:04:57 +00:00
Bruce Evans
130ff9c31a Fixed DDB_NOKLDSYM on amd64's:
machdep.c:
Initialize the symbol table pointers, not quite like for other arches.

db_elf.c:
Don't claim to be an i486 in the fake ELF header.
2004-05-18 05:30:06 +00:00
Peter Wemm
922013a665 Turn on modules for amd64. Fear. 2004-05-17 22:13:14 +00:00
Peter Wemm
910bb7dbe9 Deal with REL records that have the addend embedded variable sized targets
rather than the RELA table.  I dont know if bintutils will ever generate
REL records, but just in case.....
2004-05-17 21:16:49 +00:00
Peter Wemm
df4fd27737 Checkpoint some of what I was starting to tinker with for having some
different context support for 32 vs 64 bit processes.  This simply omits
the save/restore of the segment selector registers for non 32 bit
processes.  This avoids the rdmsr/rwmsr juggling when restoring %gs
clobbers the kernel msr that holds the gsbase.

However, I suspect it might be better to conditionally do this at
user<->kernel transition where we wouldn't need to do the juggling in the
first place.  Or have per-thread extended context save/restore hooks.
2004-05-16 22:43:57 +00:00
Peter Wemm
12c1418ccf Kill the LAZYPMAP ifdefs. While they worked, they didn't do anything
to help the AMD cpus (which have a hardware tlb flush filter).  I held
off to see what the 64 bit Intel cpus did, but it doesn't seem to help
much there either.  Oh well, store it in the Attic.
2004-05-16 22:11:50 +00:00
Peter Wemm
7be2e3e26d Converge some more with i386. 2004-05-16 21:27:29 +00:00
Peter Wemm
2a779082bb MFi386: add rue and twa 2004-05-16 20:57:01 +00:00
Peter Wemm
5119532b56 MFi386: avoid partial register references, for what its worth. 2004-05-16 20:46:13 +00:00
Peter Wemm
792e29ba26 For consistency with i386, have pmap_kenter_temporary() take a vm_paddr_t
argument.  It is actually the same type on amd64 (vm_paddr_t = vm_offset_t)
but this reduces the i386<->amd64 diffs a little.
2004-05-16 20:44:41 +00:00
Peter Wemm
463e5aa66e MFi386: numerous interrupt and acpi updates 2004-05-16 20:30:47 +00:00
Peter Wemm
e8855d4f97 Make a small revision to the api between the elf linker core and the
elf_reloc() backends for two reasons.  First, to support the possibility
of there being two elf linkers in the kernel (eg: amd64), and second, to
pass the relocbase explicitly (for relocating .o format kld files).
2004-05-16 20:00:28 +00:00
Nate Lawson
869ec176fc Make unnecessary globals static and remove unused includes.
Pointed out by:	cscout
2004-05-06 02:18:58 +00:00
Nate Lawson
65a7c90189 Add an MI implementation of the ACPI global lock routines and retire the
individual asm versions.  The global lock is shared between the BIOS and
OS and thus cannot use our mutexes.  It is defined in section 5.2.9.1 of
the ACPI specification.

Reviewed by:	marcel, bde, jhb
2004-05-05 20:04:14 +00:00
John Baldwin
030b156bf0 Add a simple mini-driver for the ELCR register. Originally, the ELCR
register controlled the trigger mode and polarity of EISA interrupts.
However, it appears that most (all?) PCI systems use the ELCR to manage
the trigger mode and polarity of ISA interrupts as well since ISA IRQs used
to route PCI interrupts need to be level triggered with active low
polarity.  We check to see if the ELCR exists by sanity checking the value
we get back ensuring that IRQS 0 (8254), 1 (atkbd), 2 (the link from the
slave PIC), and 8 (RTC) are all clear indicating edge trigger and active
high polarity.

This mini-driver will be used by the atpic driver to manage the trigger and
polarity of ISA IRQs.  Also, the mptable parsing code will use this mini
driver rather than examining the ELCR directly.
2004-05-04 20:07:46 +00:00
Marcel Moolenaar
d1d9feac7c Add option GEOM_GPT. This brings the ability to have a large number of
partitions on a single disk.
2004-05-02 20:40:19 +00:00
David E. O'Brien
4e744b5e7f Spell Ethernet correctly. 2004-05-02 18:57:29 +00:00
David Schultz
be3930682a Hide FLT_EVAL_METHOD and DECIMAL_DIG in pre-C99 compilation
environments.

PR:		63935
Submitted by:	Stefan Farfeleder <stefan@fafoe.narf.at>
2004-04-25 02:36:29 +00:00
Nate Lawson
8ec94874b2 Don't check for NULL, device_get_softc() always succeeds. 2004-04-21 02:10:58 +00:00
Alan Cox
ec8544f744 Simplify the sf_buf implementation. In short, make it a trivial veneer
over the direct virtual-to-physical mapping.
2004-04-18 05:36:37 +00:00
Alan Cox
ace2c466dc Set the "global" attribute on the page table entries for the kernel and
direct mappings.  This shaves a few seconds off of my buildworld times.

Discussed with:	peter@
2004-04-16 03:45:28 +00:00