Commit Graph

1384 Commits

Author SHA1 Message Date
Peter Wemm
547a9e66fd vm_page_zero_idle() is no longer MD. 2001-08-25 04:54:25 +00:00
Peter Wemm
e220a92985 Remove a reference to MAP_INHERIT. 2001-08-25 04:27:40 +00:00
Matthew Dillon
219d632c15 Move most of the kernel submap initialization code, including the
timeout callwheel and buffer cache, out of the platform specific areas
and into the machine independant area.  i386 and alpha adjusted here.
Other cpus can be fixed piecemeal.

Reviewed by:    freebsd-smp, jake
2001-08-22 04:07:27 +00:00
Peter Wemm
95a6562598 Strip out some #if's for old implementations of global data pointers. 2001-08-21 22:14:13 +00:00
John Baldwin
a71c43dd2b Protect prototype of ptrace_clear_single_step() with #ifdef _KERNEL/#endif.
Requested by:	bde
2001-08-21 13:42:39 +00:00
Peter Wemm
e8ebc08f80 Make COMPAT_43 optional again. XXX we need COMPAT_FBSD3 etc for this
stuff.
2001-08-21 02:32:59 +00:00
John Baldwin
4583298b21 Turn off SMP on Alpha for the time being. There are some memory ordering
issues that can result in panics and probably data corruption on SMP
systems right now.  When they are fixed this can be turned back on.
2001-08-18 01:12:43 +00:00
John Baldwin
027e0eb15d Grab Giant around trapsignal() at the bottom of trap().
Reported by:	obrien
2001-08-18 01:08:45 +00:00
John Baldwin
be08df7290 Remove redundant declarations of functions that are declared in
sys/ptrace.h.
2001-08-18 00:57:32 +00:00
David E. O'Brien
7b1e8fbd77 Fix style nits. 2001-08-17 16:54:09 +00:00
David E. O'Brien
e113a479b2 Prototype the ptrace_*() 2001-08-16 19:57:36 +00:00
David E. O'Brien
9428157dbd Fix a dangling { 2001-08-16 10:32:42 +00:00
David E. O'Brien
589278dbae style(9) and make consistent across platforms 2001-08-16 09:29:35 +00:00
Andrey A. Chernov
2a54e09dff OFF_T -> OFF (more standard style) 2001-08-15 19:50:59 +00:00
Andrey A. Chernov
527b997c3d Add OFF_T_MAX/OFF_T_MIN 2001-08-15 19:12:46 +00:00
Bill Paul
3708f8da9c Teach bus_dmamem_free() about contigfree(). This is a bit of a hack,
but it's better than the buggy behavior we have now. If we contigmalloc()
buffers in bus_dmamem_alloc(), then we must configfree() them in
bus_dmamem_free(). Trying to free() them is wrong, and will cause
a panic (at least, it does on the alpha.)

I tripped over this when trying to kldunload my busdma-ified if_rl
driver.
2001-08-15 17:26:54 +00:00
Matt Jacob
cf1bca84b6 Old business: some SMP support. 2001-08-15 17:23:22 +00:00
Matt Jacob
c70f4417dc Old business: be able to disable processor configuration from resource. 2001-08-15 17:03:13 +00:00
David E. O'Brien
059d1e91d8 Style changes to commonize the various platforms. 2001-08-15 04:02:41 +00:00
Bill Paul
ee755665c2 Fix yet another "unconditionally free()ing memory without even checking
to see if it was malloc()ed first" bug. In bus_dmamap_create(), one of
two things can happen: either we need to allocate a special map due to
some manner of bounce buffering requirement, or we can DMA a buffer
in place. On the x86 platform, the "in place" case results in
bus_dmamap_create() returning a dmamap of NULL. The bus_dmamap_destroy()
routine later checks for NULL and won't bother free()ing the map if
it detects this condition.

But on the alpha, we don't use NULL, we use a statically allocated map
called nobounce_dmamap(). Unfortunately, bus_dmamap_destroy() does not
handle the condition where we attempt to destroy such a map: it tries
to free() the dmamap, which causes a panic.

Fix: test that map != &nobounce_dmamap before trying to free() it.

With this fix, my busdma-ified if_sis driver works on the alpha. I'm
a bit alarmed that I'm the first person ever to trip over this bug, since
we have been using busdma on the alpha for a while, and since it sort
of screams out "Hi! I'm a bug! Booga-booga!" when you look at it.

(Somewhere, somebody will say: "But Bill, why don't you just not bother
destroying the maps in this case." Because the API is supposed to be
a) symetrical and b) opaque to the caller. I can't know whether it's safe
to skip the bus_dmamap_destroy() step or not without sticking my fingers
into unsafe places, which is what I wanted to avoid in the first place.)
2001-08-14 21:56:53 +00:00
John Baldwin
4f99f11257 In prom_halt(), set the halt restart flags on the current CPU, not the
boot CPU.  This was the reason reboots on SMP systems could result in
weird hangs.  Unlike the x86, we do not need to switch back to the boot
CPU in order to reboot the machine.  See Section 3.4.5 of Part III
(Console Interface Architecture) from the Alpha Architecture Reference
Manual (aka the Brown Book) for more info.
2001-08-13 22:44:55 +00:00
John Baldwin
6937ca29dc Remove IPI_HALT to make way for a more correct fix for halts and restarts
on SMP alphas.
2001-08-13 22:41:15 +00:00
John Baldwin
1c94cee872 Minor style nits: cleanup and add some function prototypes. 2001-08-13 22:38:36 +00:00
John Baldwin
688ebe120c - Close races with signals and other AST's being triggered while we are in
the process of exiting the kernel.  The ast() function now loops as long
  as the PS_ASTPENDING or PS_NEEDRESCHED flags are set.  It returns with
  preemption disabled so that any further AST's that arrive via an
  interrupt will be delayed until the low-level MD code returns to user
  mode.
- Use u_int's to store the tick counts for profiling purposes so that we
  do not need sched_lock just to read p_sticks.  This also closes a
  problem where the call to addupc_task() could screw up the arithmetic
  due to non-atomic reads of p_sticks.
- Axe need_proftick(), aston(), astoff(), astpending(), need_resched(),
  clear_resched(), and resched_wanted() in favor of direct bit operations
  on p_sflag.
- Fix up locking with sched_lock some.  In addupc_intr(), use sched_lock
  to ensure pr_addr and pr_ticks are updated atomically with setting
  PS_OWEUPC.  In ast() we clear pr_ticks atomically with clearing
  PS_OWEUPC.  We also do not grab the lock just to test a flag.
- Simplify the handling of Giant in ast() slightly.

Reviewed by:	bde (mostly)
2001-08-10 22:53:32 +00:00
Peter Wemm
2aca0c28d3 Zap 'ptrace(PT_READ_U, ...)' and 'ptrace(PT_WRITE_U, ...)' since they
are a really nasty interface that should have been killed long ago
when 'ptrace(PT_[SG]ETREGS' etc came along.  The entity that they
operate on (struct user) will not be around much longer since it
is part-per-process and part-per-thread in a post-KSE world.

gdb does not actually use this except for the obscure 'info udot'
command which does a hexdump of as much of the child's 'struct user'
as it can get.  It carries its own #defines so it doesn't break
compiles.
2001-08-08 05:25:15 +00:00
Matt Jacob
d82784053e Revert part of previous- I misunderstood the use of 'ncpus'- I thought it'd
been hack to keep clocks from being reinitialized.
2001-08-01 20:35:42 +00:00
Matt Jacob
802f355a3f Don't initialize a clock twice (it's not a function of number of
cpus).
2001-08-01 19:40:11 +00:00
Jake Burkholder
7e5102989e Use a machine dependent type, Elf_Hashelt, for the elements of the elf
dynamic symbol table buckets and chains.  The sparc64 toolchain uses 32
bit .hash entries, unlike other 64 bits architectures (alpha), which use
64 bit entries.

Discussed with: dfr, jdp
2001-07-31 03:46:39 +00:00
Peter Wemm
0b27d7104f Make PMAP_SHPGPERPROC tunable. One shouldn't need to recompile a kernel
for this, since it is easy to run into with large systems with lots of
shared mmap space.

Obtained from:	yahoo
2001-07-27 01:08:59 +00:00
Peter Wemm
bd40659f85 Call the early tunable setup functions as soon as kern_envp is available.
Some things depend on hz being set not long after this.
2001-07-26 23:06:44 +00:00
Bosko Milekic
49f854f926 - Do not handle the per-CPU containers in mbuf code as though the cpuids
were indices in a dense array. The cpuids are a sparse set and treat
  them as such, setting up containers only for CPUs activated during
  mb_init().

- Fix netstat(1) and systat(1) to treat the per-CPU stats area as a sparse
  map, in accordance with the above.

This allows us to properly boot with certain CPUs disactivated. However, if
we later decide to re-activate said CPUs, we will barf until we decide to
implement CPU spinon/spinoff callback hooks to allow for said CPUs' per-CPU
containers to get configured on their activation.

Reported by: mjacob
Partially (sys/ diffs) Submitted by: mjacob
2001-07-26 18:47:46 +00:00
Doug Rabson
d4127edb9d Simplify the implementation of pmap_emulate_reference(). The new version
simply manipulates the pte which faulted instead of traversing the mapping
list for that page. This makes it possible to complete the trap without
needing locks and incidentally improves the accuracy of some statistics
used by the VM system.
2001-07-24 07:13:07 +00:00
Bill Paul
362c5c1e02 You were knocked senseless by the Boomerang, spun around by the Cyclone,
blown over by the Hurricane and had a house dropped on you by the Tornado.
Now it's time to have your parade rained on by... the Typhoon!

This commit adds driver support for 3Com 3cR990 10/100 ethernet
adapters based on the Typhoon I and Typhoon II chipsets. This is actually
a port of the OpenBSD driver with many hacks by me.

No Virginia, there isn't any support for the hardware crypto yet. However
there is support for TCP/IP checksum offload and VLANs.

Special thanks go to Jason Wright, Aaron Campbell and Theo de Raadt for
squeezing enough info out of 3Com to get this written, and for doing
most of the hard work.

Manual page is included. Compiled as a module and included in GENERIC.
2001-07-23 20:44:54 +00:00
David E. O'Brien
59177a15cc Now that config(8) has stopped breaking POLA (mkmakefile.c rev 1.69) by
always including <KERNEL>.hints if its exist reguardless of the lack of a
"hints" directive in the <KERNEL> file; we can have a real hints file again.
2001-07-15 17:56:53 +00:00
David E. O'Brien
2a57c11a3a Turn off preemption on the Alpha for the time being. Peter and JHB aren't
sure when things got so bad (JHB says preemption worked just fine for months
before the AlbertVM commit).  Even post DillionVM locking commit, Miatas
(DEC Personal Workstations) are very fragile -- not making it thru a world
build.  With this patch it does.

Those hacking on SMPng will want to locally back out this commit.  The rest
of us will want to run with it until the SMPng guys figure out the problem(s).

Submitted by:	peter
2001-07-15 00:03:01 +00:00
Matt Jacob
8f01c08a34 Fix reboot hangs that have happened with multiple processors
on Alpha 4100s.

Basically, if you're halting or you're rebooting, you should
tell all other processors to halt first. Define IPI_HALT- IPI_STOP
is not what we want for this purpose, which will call prom_halt(0)
on receipt.

The processor running the halt or reboot wil send an IPI_HALT to all
other processors, delay a bit, then continue to do what what it was
planning on doing (prom_halt({0|1})).
2001-07-14 21:37:57 +00:00
Dima Dorfman
a7a1b07e25 Move fxp to the miibus section where it belongs. 2001-07-14 06:35:54 +00:00
David E. O'Brien
6036d427b7 I really should have just commented out this intire file vs. removing all
the contents.  One may still want the contents as reference for creating
/boot/device.hints.
2001-07-13 18:45:06 +00:00
David E. O'Brien
5f662f42d6 Hints processing is FUBAR'ed right now.
By default, we will end up with a duplicate set of hints if people have
a properly populated /boot/device.hints.  So for now, remove the hints
here until Peter revisits the new hints processing from mid-June that
broke Alpha booting.
2001-07-13 17:43:38 +00:00
Dima Dorfman
2e1b1231fc `pcn' supports AMD Am79C97x cards, not Am79C79x cards.
PR:		28946
Submitted by:	Ryuichiro Imura <imura@ryu16.org>
2001-07-13 13:34:08 +00:00
Brian S. Dean
17bbfb5897 Add 'hwatch' and 'dhwatch' ddb commands analogous to 'watch' and
'dwatch'.  The new commands install hardware watchpoints if supported
by the architecture and if there are enough registers to cover the
desired memory area.

No objection by: audit@, hackers@

MFC after: 2 weeks
2001-07-11 03:15:25 +00:00
Matt Jacob
cd7c95e0bd Sanity guard- return ENODEV if we don't have a good IRQ resource. 2001-07-11 02:24:28 +00:00
Matt Jacob
71cfb39eb9 Slight cleanliness- add an unlock of Giant in one dopanic case. Do
some very minor formatting changes.
2001-07-11 02:23:31 +00:00
Julian Elischer
0b1ae8097d A set of changes to reduce the number of include files the kernel
takes from /usr/include. I cannot check them on alpha.. (will try beast)

Briefly looked at by: Warner Losh <imp@harmony.village.org>
2001-07-08 04:56:07 +00:00
Matt Jacob
48bd6f600e Bracket call to vm_page_flag_set with required Giant lock/unlock. 2001-07-05 17:27:50 +00:00
Matt Jacob
0b848380bb You cannot require Giant to be locked when you haven't acquired it yet. 2001-07-05 16:55:50 +00:00
Matthew Dillon
7197571105 Move vm_page_zero_idle() from machine-dependant sections to a
machine-independant source file, vm/vm_zeroidle.c.  It was exactly the
same for all platforms and updating them all was getting annoying.
2001-07-05 01:32:42 +00:00
Matthew Dillon
6d03d577a5 Reorg vm_page.c into vm_page.c, vm_pageq.c, and vm_contig.c (for contigmalloc).
Also removed some spl's and added some VM mutexes, but they are not actually
used yet, so this commit does not really make any operational changes
to the system.

vm_page.c relates to vm_page_t manipulation, including high level deactivation,
activation, etc...  vm_pageq.c relates to finding free pages and aquiring
exclusive access to a page queue (exclusivity part not yet implemented).
And the world still builds... :-)
2001-07-04 23:27:09 +00:00
Matthew Dillon
0cddd8f023 With Alfred's permission, remove vm_mtx in favor of a fine-grained approach
(this commit is just the first stage).  Also add various GIANT_ macros to
formalize the removal of Giant, making it easy to test in a more piecemeal
fashion. These macros will allow us to test fine-grained locks to a degree
before removing Giant, and also after, and to remove Giant in a piecemeal
fashion via sysctl's on those subsystems which the authors believe can
operate without Giant.
2001-07-04 16:20:28 +00:00
Matt Jacob
d99b6ac2d7 Follow Bruce's suggestions. They're probably wrong, but better than before. 2001-07-04 05:16:56 +00:00