Commit Graph

521 Commits

Author SHA1 Message Date
skrll e25a471c87 Fix typo in comment. 2002-01-01 16:24:33 +00:00
thorpej d2453f69b1 Remove the call to abort(). We don't pull in a prototype for it,
and there's no sane way to do so.
2002-01-01 01:58:01 +00:00
bjh21 00bd2cbdac Merge ast() and userret() between arm32 and arm26. The implementation used
is the arm32 one.
2001-12-21 22:56:16 +00:00
thorpej a6a5d9fa2b Use the correct version of va_arg() for _STANDALONE. 2001-12-20 20:29:09 +00:00
bjh21 a938f3a7ee Remove some outdated comments: arm26 kernels use APCS-32 now, which
means they don't do silly things like restoring IRQ/FIQ disable bits
on function return.
2001-12-20 16:12:10 +00:00
thorpej 014157862c * Share a common vector page between arm26 and arm32.
* Use a common set of exception handlers for all arm32 platforms.
* New FIQ framework based on discussions with Ben Harris, shared
  between arm26 and arm32.
2001-12-20 01:20:21 +00:00
thorpej 631447bb4a Change some #if 0 to #ifdef VERBOSE_INIT_ARM. 2001-12-18 02:52:00 +00:00
bjh21 f2ebadcc6f Ensure that vidc.h gets installed somewhere -- Xarm32vidc needs it to compile. 2001-12-17 15:07:37 +00:00
bjh21 7bc474a92b mod() was unused. g/c it. New code should use abs() anyway. 2001-12-15 22:41:44 +00:00
bjh21 eefdf030c9 Simplify the pixel-clock-rate-setting code, so it always works out the
parameters from first principles rather than using a static table for some
rates.  This makes it work correctly on ARM7500, for which the table was
bogus (ARM7500 has a different refclk from VIDC20).
2001-12-15 22:21:46 +00:00
chris 80e667c6ab Add clockctl device.
Note that someone needs to tidy this up, we've got 92 block devices, which just ain't true.  Also appears we're actually missing some, eg the ld block device.
2001-12-11 00:34:50 +00:00
thorpej 51535d4bf5 Add support for dumping ELF-cormat core files. 2001-12-09 23:05:56 +00:00
atatat b45c51b1fc Roll the rest of the ports over to the new MI kernel build machinery.
Any problems reported by testers have been fixed, and massive
cross-compiling of kernels has shown that any problems that remain
with actually building kernels are not related to this.
2001-12-09 05:00:40 +00:00
chris 3831bfec98 Improve comment on the clockswitching asm code, it doesn't use r0 at all, it just needs it to make valid asm. 2001-12-08 21:30:04 +00:00
chris ce689bde4d Fix the asm macros
The tmpx registers are now outputs, this makes them all unique.
Add the fact that cc is changed by the asm (not believed to be used but rather be correct)
Correctly specify w as an input and output register, I think this was hiding the bug below!
Allow sum to be in a different input and output register.

Correct bug in psuedo header handling for in4_cksum.  Seems that the new macros turned up a latent bug in the psuedo header handling, the code was moving a pointer forward 16 bytes twice, not found before as the ADD16 macro wasn't 100% accurate, as it didn't output w, even though it modified it.
2001-12-08 21:18:50 +00:00
thorpej 72dee19a8c Reset the i80200 ICU and PMU to a pristine state very early. 2001-12-01 23:06:45 +00:00
bjh21 e4dac015cd Don't define get_cachetype() unless it's going to be used. 2001-12-01 14:21:18 +00:00
thorpej 3fd0a58e9d On the i80200, disable ECC in the Bus Controller Unit early on; we
don't really have code to deal with ECC errors yet.
2001-12-01 06:33:40 +00:00
thorpej 5936a89bf5 Add register definitions for the i80200 Interrupt Controller Unit,
Bus Controller Unit, and Performance Monitoring Unit.
2001-12-01 05:46:19 +00:00
thorpej 2b08dcc43b Clarify a comment to state that it is intentional that we attach
only the Secondary PCI bus (it's the only bus which can have a
device space hidden from any PCI host on the Primary bus).

Also, use the bus number from the PPB businfo register seecondary bus
field rather than hard-coding "1".
2001-11-30 19:29:44 +00:00
thorpej e90eccc52c Clarify a comment. 2001-11-30 19:26:03 +00:00
thorpej a2c8fc94fe Provide a way for platforms to move away from the old RiscPC-centric
interrupt code.  Garbage-collect some unused stuff.
2001-11-29 17:14:02 +00:00
thorpej a93f7ef419 Provide a hook for platform-specific interrupt code to specify
the "spl" cookie in the switch frame.
2001-11-29 17:12:22 +00:00
thorpej b0f775a467 Remove some overly-paranoid debug code that grovels too much
platform-specific internals.
2001-11-29 17:10:31 +00:00
thorpej 8ae5055ed9 Add routines for accessing the general purpose I/O facility of
the i80312 Companion I/O chip.
2001-11-29 08:27:11 +00:00
thorpej 574dba96b1 Update copyright. 2001-11-29 08:26:18 +00:00
thorpej c5ecb8d8c5 Use the new arm_dcache_align variable to set the PCI device BHLC
register.
2001-11-29 02:26:50 +00:00
thorpej 959181a8b2 Fetch cache info from the Cache Type register on ARM7TDMI and "greater"
processors.  Report this when the processor is attached.
2001-11-29 02:24:58 +00:00
thorpej 636e9cd08b Add a "cacheline_size" argument to pci_configure_bus(). It is used
to set the cacheline size in the BHLC register.  This should be the
size of the largest D-cache line on a system.
2001-11-28 23:48:34 +00:00
thorpej 85a1db0fda Disable MRL, MRM, and MWI for now. 2001-11-28 22:39:09 +00:00
thorpej bd3e75a9df Oops, make sure to add in the physical base of the PCI memory
window when mapping PCI mem space.  (Whee, I can take out my
local hack, now).
2001-11-28 21:08:47 +00:00
lukem ecb81c3f6d - convert usage of "defopt" to "defflag" where the relevant option does
not support a value (e.g., it's to be used as "options FOO" instead of
  "options FOO=xxx"). options that take a value were converted to
  defparam recently.
- minor whitespace & formatting cleanups
2001-11-28 10:21:10 +00:00
thorpej 379948c31f - Garbage-collect some unused cruft.
- When processing ASTs, restore interrupts *after* clearing astpending.
2001-11-28 01:06:19 +00:00
thorpej b9caa4cbc7 Don't grovel interrupt-related info here; if a platform wants to
do that, let it do that in a way it can control.
2001-11-28 00:19:53 +00:00
thorpej a2fa0b1029 Add prototypes for new XScale write-through cache routines. 2001-11-28 00:18:46 +00:00
thorpej 8e96318c12 Don't define interrupt handler-related offsets here. 2001-11-28 00:18:13 +00:00
thorpej 28466919a2 Use <machine/intr.h> rather than <machine/irqhandler.h> 2001-11-27 01:03:52 +00:00
thorpej 8cd82ab7b7 Move interrupt-related stuff out of the generic 32-bit ARM genassym.cf
and into platform-specific genassym.cf files.
2001-11-27 00:15:58 +00:00
thorpej ed112809c9 Allow port-specific Makefile fragments to specify a list of additional
genassym.cf fragments, if desired.
2001-11-26 23:44:58 +00:00
thorpej 2d89f9075b Move interrupt-related stuff out of stubs.c into intr.c. 2001-11-26 23:19:04 +00:00
thorpej bb706190b3 Add code to run the XScale cache in write-though mode, and do so
for now...
2001-11-26 22:26:44 +00:00
thorpej 0ca43a5fde Use <arm/arm32/psl.h>, not <machine/psl.h>. 2001-11-26 20:51:57 +00:00
thorpej c8c624e4aa Don't include <machine/psl.h> directly. 2001-11-26 20:49:04 +00:00
thorpej 534b950d29 Move the interrupt-related file declarations into port-specific
config descriptions so that each port choose whether or not to
use it.
2001-11-26 20:33:43 +00:00
thorpej 8ec81cf263 Sprinkle CPWAIT around to enforce some barriers. Also deal with some
pre-B-step errata: must clean-dcache-line to an address before
invalidate-dcache-line to that address, or the dirty bits will not
get cleanred in the dcache array for that line.
2001-11-26 18:09:08 +00:00
thorpej 3b97bd4996 Remove dummy includes. 2001-11-26 01:03:58 +00:00
thorpej da03707c2f Moved to <sys/disklabel_acorn.h> 2001-11-26 01:03:23 +00:00
thorpej e4b45721eb Remove Shark-specific header file. 2001-11-26 01:03:00 +00:00
thorpej dc19fe137e Don't install includes which userland doesn't need. 2001-11-26 01:02:28 +00:00
thorpej 013b705fdc G/c the unused (and #if 0'd) bits of cpu_disklabel. Fetch disklabel_acorn.h
from the correct place.
2001-11-25 19:02:03 +00:00
thorpej 2b74082b7b End the "new ARM includes strategy" experiment. The new strategy
broke too many assumptions makde by other parts of the source tree,
and the strategy and how it was supposed to work was never discussed
on tech-userlevel, nor was it applied consistently (to all ARM ports
and to other ports which have common MACHINE_ARCH code, such as MIPS,
m68k, powerpc).

Verified to complete a full "make build" on cats, dnard, evbarm,
and netwinder.
2001-11-25 15:55:53 +00:00
thorpej c5269c1608 Make the ARM, Ltd. floating point emulator work w/ ELF. 2001-11-24 03:39:17 +00:00
thorpej 87fe867c21 Move the ARM, Ltd. floating point emulator to arch/arm. 2001-11-24 01:26:23 +00:00
thorpej fc019be5fd Use <arm/undefined.h> instead of <machine/undefined.h>. 2001-11-23 21:18:29 +00:00
thorpej 0c57d87232 Use <arm/cpufunc.h>, not <machine/cpufunc.h>. 2001-11-23 19:21:47 +00:00
thorpej d60ef922be Disable the BTB by default on the XScale again; there's some early
stepping errata to deal with before we can safely do this.
2001-11-23 19:17:04 +00:00
thorpej 5101f01dff Move even more constants into the shared 32-bit vmparam.h header.
Cleanup elsewhere will have to be done before we can sanitize this
header any further.
2001-11-23 18:16:10 +00:00
thorpej 15c76e3c84 - Move more contents of various <machine/vmparam.h> files into
<arm/arm32/vmparam.h> (mostly the stuff that's tied to the pmap
  implementation).
- Since the MMU definitions in pte.h are specific to ARM processors
  that support 32-bit mode, move pte.h to <arm/arm32/pte.h>.
- Make the Netwinder startup file build again (use PT_B|PT_C, rather
  than PT_CACHEABLE, since the latter expands to a variable these days).
2001-11-23 17:39:03 +00:00
thorpej fec02f1259 No need to pull in <machine/pte.h> directly. 2001-11-23 17:23:40 +00:00
thorpej 299362f0ff Pull in assym.h for __PROG32 (needed for IRQenable/IRQdisable macros,
which should probably be pulled out of cpu.h anyway...)
2001-11-23 16:53:07 +00:00
thorpej 926df47ec4 Provide __PROG32 to assembly code. 2001-11-23 16:50:48 +00:00
thorpej b393d0d3f7 Kill <machine/katelib.h>. Any place that still uses it should just
reference <arm/arm32/katelib.h> until such time as all use of this
file has been purged from the face of the earth.
2001-11-22 18:34:30 +00:00
thorpej 88bba2e5a4 Add cpu_cpwait() calls after TLB updates that are not expected to
be followed up by a pmap_update().
2001-11-22 18:24:43 +00:00
thorpej 67fd41ddbf Add 26-bit and 32-bit types.h files, which indicate the programming
model in use for a given platform (__PROG26 vs __PROG32), then pulls
in <arm/types.h>.  Change each ARM port to pull in <arm/arm26/types.h>
or <arm/arm32/types.h> as appropriate.  Change all references to PROG26
and PROG32 to __PROG26 and __PROG32.  Eliminate the opt_progmode.h
header file.
2001-11-22 17:59:57 +00:00
lukem 03aef4723c cleanup:
options SPACE TAB
	makeoptions TAB
	psuedo-device TAB
	remove trailing whitespace
	replace multiple spaces -> tabs
	options "FOO" -> options FOO
	options "FOO=bar" -> options FOO=bar
	options "FOO=\"bar\"" -> options FOO="\"bar\""
2001-11-20 12:56:17 +00:00
lukem 99bccc3cab - pull in opt_kgdb.h where necessary
- replace opt_kgdb_machdep.h with opt_kgdb.h
- defparam opt_kgdb.h:
	KGDB_DEV KGDB_DEVNAME KGDB_DEVADDR KGDB_DEVRATE KGDB_DEVMODE
- move from opt_ddbparam.h to opt_ddb.h:
	DDB_FROMCONSOLE DDB_ONPANIC DDB_HISTORY_SIZE DDB_BREAK_CHAR SYMTAB_SPACE
- replace KGDBDEV with KGDB_DEV
- replace KGDBADDR with KGDB_DEVADDR
- replace KGDBMODE with KGDB_DEVMODE
- replace KGDBRATE with KGDB_DEVRATE
- use `9600' instead of `0x2580' for 9600 baud rate
- use correct quotes for  options KGDB_DEVNAME="\"com\""
- use correct quotes for  options KGDB_DEV="17*256+0"
- remove unnecessary dependancy on Makefile for kgdb_stub.o
- minor whitespace cleanup
2001-11-20 08:43:19 +00:00
chris 04d6054972 Correct comment to avoid confusion, it really means 32 bits not 32 bites. 2001-11-20 00:22:33 +00:00
chris 165b023373 Give the idle loop a non-profiled entry, means it appears in profile info correctly (rather than all it's time being under remrunqueue)
switch_exit only needs to take 1 parameter, it loads the value of proc0 into R1 itself
Fixup some comments to reflect the real state of things.
Tweak a couple of bits of asm to avoid a load delay.
remove excess code for setting curpcb and curproc.
2001-11-19 20:38:58 +00:00
thorpej 2d7fd0a8b8 Implement pmap_update(). Currently it just calls cpu_cpwait(),
which ensures that TLB/cache operations have completed.
2001-11-19 18:41:32 +00:00
thorpej 887bcc078e Add a "cpwait" cpufunc, currently a nullop on all but XScale.
"cpwait" ensures that all coprocessor operations have completed
before returning.
2001-11-19 18:40:15 +00:00
bjh21 6b12ec55b2 Add prototypes for undefinedinstruction() and resethandler(). 2001-11-16 13:12:06 +00:00
thorpej 0b6370bfee Implement __cpu_simple_lock*() primitives using the SWP insn. Note
this insn is available only on ARM arch v3 and later (and 2a).  We
don't expect to be using these ops in the kernel on processors too
old to have SWP, and for userland uses (in e.g. a pthread library),
the kernel will simply have to trap and emulate the insn (it needs
to be "atomic", so a kernel trap of some sort will be necessary on
such platforms anyway).
2001-11-15 19:22:32 +00:00
thorpej be13b85887 * Give the XScale its own cpu_control() entry point; we have to flush
the Branch Target Buffer of the BPRD bit changes.
* Enable Branch Prediction on the XScale by default.
* Don't invalidate the Branch Target Buffer explicitly. the i80200
  manual (section 5.1, Branch Target Buffer Operation) notes that
  manual software management of the BTB is unnecessary; it is flushed
  implicitly when:
     * processor resets
     * FCSE process ID is written
     * I-cache is invalidated
2001-11-14 01:00:05 +00:00
thorpej 91f49d269d Eliminate some duplicated code here (similar to XScale code):
* sa110_cache_purgeD() is the same as sa110_cache_cleanD() on the
  SA-1 -- make it an alias.
* sa110_cache_syncI() and sa110_cache_purgeID() are identical to
  sa110_cache_cleanD() on the SA-1, with the exception that the
  I-cache must also be flushed.  Save code duplication by moving
  the I-cache flush before the D-cache clean and letting it fall
  through.
2001-11-14 00:08:05 +00:00
chris 8298c55eab Correct comments for ffs algoritm (it isn't using register r0) 2001-11-11 22:07:41 +00:00
thorpej b75edaf367 Some fixes/cleanup to the XScale cache clean code:
* Define a CPWAIT macro as described in the i80200 manual and use it,
  rather than replicating the code in a few places.
* The i80200 manual notes that the line-allocate operation used to
  do global D$ clean does not actually perform a load/fill request
  from external memory, and thus does not actually place valid data
  in the cache lines allocated.  Require that machine-dependent code
  allocate an appropriately-sized chunk of unmapped VA space for the
  global clean operation in order to avoid unpredictable results.
* The i80200 manual notes that the VA range for the Mini-Data global
  clean (which *must* be mapped to physical memory) must be reserved
  exclusively for cleaning the Mini-Data cache.  Require that machine-
  dependent code allocate an appropriately-sized chunk of memory for
  this purpose.
2001-11-11 17:18:27 +00:00
thorpej c653a0ee51 Even though the ARM architecture defines large, standard, and small
pages, we use the standard (4K) page size as PAGE_SIZE.  Make the
PAGE_SIZE related variables compile-time constants that reflect this.

Results in a bit over 2K worth of .text savings, and visibly better
code in the places that use PAGE_SIZE, etc.
2001-11-11 16:40:36 +00:00
thorpej 2ea8a793d0 * Define prologue/epilogue macros for the cache clean functions,
and use them, like we do in the SA-1 code.
* Use numbered labels for loops.
2001-11-11 01:05:11 +00:00
thorpej 3492e0ce0b Fix a missing-whitespace typo. 2001-11-11 01:02:58 +00:00
thorpej eb8206f223 Use numeric labels for loops. 2001-11-11 00:47:49 +00:00
thorpej de8e924e4c * Define prologue/epilogue macros for the cache clean functions,
and use them, rather than replicating the code several times.
* Use numbered labels for loops.
2001-11-11 00:41:48 +00:00
thorpej fe9e809208 Add a comment explaining that we expect the memory controller
registers to already be subregion'd off, and actually init
the PCI DMA tag.
2001-11-10 23:14:51 +00:00
thorpej 9e1b785626 Split all the model/version-specific cpufuncs into separate files
corresponding to the model/version.
2001-11-10 23:14:08 +00:00
thorpej a27687fb2f Fix some whitespace. 2001-11-10 23:12:41 +00:00
thorpej fa6ae96384 This file is not used. 2001-11-10 00:13:58 +00:00
thorpej d1f4bf74ca Add support for PCI DMA on the i80312. We currently just do
DMA via the Secondary Inbound window, for now.  Will probably
need to revisit this at some point.

Require that the board-specific i80312 front-end slice off a
subregion for the memory controller before calling i80312_attach(),
and fix a bug in the IQ80310 front-end that caused the Secondary
Inbound window to be configured incorrectly.
2001-11-09 23:15:52 +00:00
thorpej d32191e3da Add support for configuring the PCI bus (starting with the Secondary
bus only, for now).

XXX Some cleanup wrt. pci_conf_interrupt() needs to happen.
2001-11-09 19:48:35 +00:00
thorpej 671a1b111f Print the fault PC for non-USR Prefetch Aborts. 2001-11-09 19:04:23 +00:00
thorpej 82c11eec1c Clear the Master Abort after reading config space for a non-existent
PCI device.  Disable debugging messages, as PCI config space works now.
2001-11-09 18:04:10 +00:00
thorpej 42a10f6cd4 Implement a badaddr_read() routine which performs a load of the
specified size for the caller, and returns true or false indicating
whether or not a Data Abort occurred (i.e. the address was "bad").
2001-11-09 17:58:00 +00:00
thorpej d16c00cfb2 Disable the ATU interrupt sources (i.e. interrupts that occur when
we get Master or Target aborts).
2001-11-09 17:44:43 +00:00
thorpej 10392361f8 Make the DDB trace output a lot easier to look at. 2001-11-09 16:49:29 +00:00
thorpej 147b1bdc1c Add some rudimentary support for ELF symbols in DDB on the ARM ports.
On platforms which load the kernel sans symbols directly from firmware
(possibly in e.g. S-Record format), call ddb_init() with empty arguments,
so that it will search any compiled in SYMTAB_SPACE.  On all other platforms,
if __ELF__, also call ddb_init() with empty arguments until ELF bootloaders
which pass symbol information are ready.
2001-11-09 07:21:37 +00:00
thorpej 660b98b7dc Snapshot of work-in-progress for Intel i80312 Companion I/O chip;
just basic Inbound and Outbound window setup is done, PCI configuration
space access (not quite working yet), and I/O and Memory space routines
so far.
2001-11-09 03:27:51 +00:00
thorpej 64f23a2423 Adjust the way the PMMRs are defined -- offsets from a base, not
absolutes.  Also, add PPB and more ATU registers.
2001-11-08 03:20:36 +00:00
thorpej b9364bb468 First cut at XScale setup code. Needs more work. 2001-11-07 00:17:36 +00:00
thorpej 46309d6bc6 Const poisoning of cpu/class names. 2001-11-06 20:39:13 +00:00
thorpej 5b3f78d953 "i80200", not "80200". 2001-11-06 20:02:13 +00:00
thorpej f12c8ee306 "XScale", not "Xscale". 2001-11-06 19:59:43 +00:00
thorpej e8982cb969 Make it possible for Makefile.${MACHINE}.inc to provide extra
stuff at the end of SYSTEM_LD_TAIL.
2001-11-06 19:52:21 +00:00
thorpej af0d2bf570 Config info for the i80312 XScale companion I/O chip. 2001-11-05 23:38:55 +00:00
thorpej 20b742fd48 RCS ID. 2001-11-05 23:38:05 +00:00
thorpej 49951f6d12 Prototypes for i80312 routines. 2001-11-05 23:37:41 +00:00
thorpej 22514e4c7d Routines for handling the i80312 memory controller for XScale.
Currently includes a routine to determine memory size from the
SDRAM configuration registers.
2001-11-05 23:37:01 +00:00
thorpej fe988b60bb Add PCI window addresses. 2001-11-04 19:32:32 +00:00
thorpej 95a9886f49 Add a comment describing what this file is. 2001-11-04 01:23:49 +00:00
thorpej 8f626436b6 Add missing RCS ID, add missing name. 2001-11-04 01:16:01 +00:00
rearnsha e4fff4a560 Replace most uses of pmap_pde_p with pmap_pde_page, since that is what
we need later in the code.  This fixes a fatal kernel fault in
pmap_modified_emulation if a user application tries to access a kernel
address that is section-mapped.

Add a diagnostic that detects attempts to call pmap_kenter_pa with a
va that is section-mapped.
2001-11-03 00:06:02 +00:00
rearnsha 64c191c269 Define boolean predicates pmap_pde_page, pmap_pde_section & pmap_pde_fpage,
which return true if their pde argument is a coarse page, section or
fine page respectively.
2001-11-03 00:01:23 +00:00
rearnsha 6dcc9636dc Define L1_FPAGE for fine page entries in L1 page table. 2001-11-02 23:58:46 +00:00
rearnsha 87cb8af648 When clearing the modified bit for modified emulation, don't turn
caching on for a page just because we are clearing the writable bit in
the PTE: this is incompatible with the way pmap_vac_me_harder works,
and the code in the modified emulation handler doesn't know about
recalculating the cachable attributes (nor should it, IMO).

Also, if we are invalidating a page, flush its TLB entry; for some
reason we were only doing this when clearing the Write or modified
bits.

These patches together seem to solve the random seg-faults that were
still occuring occasionally under heavy paging.
2001-11-01 15:49:16 +00:00
rearnsha 839525d027 When creating section maps, use pte_cache_mode for setting the
page attributes of cacheable pages.
2001-10-27 16:51:44 +00:00
rearnsha b044d8f60c Add a couple more diagnostics. 2001-10-27 16:48:50 +00:00
rearnsha e185c586c3 Export pte_cache_mode. Define PT_CACHEABLE in terms of it. 2001-10-27 16:45:35 +00:00
rearnsha 3fd2995a76 Declare the plcom device. 2001-10-27 16:42:37 +00:00
rearnsha 9a322ae54f Set initial spl level to SPL_SERIAL, which for some strange reason
is higher than SPL_HIGH (maybe we should be fixing SPL_HIGH).

If IPL_STATCLOCK is defined, initialize spl_masks[_SPL_STATCLOCK] from
it; otherwise initialize use IPL_CLOCK.
2001-10-27 16:41:00 +00:00
rearnsha 85123cf6bf Add new spl level -- _SPL_STATCLOCK. 2001-10-27 16:37:24 +00:00
rearnsha 8a92dcdaa8 Pull in machine/conf.h to find out if we have the plcom serial driver.
If so, then call plcomsoft when appropriate.
2001-10-27 16:34:12 +00:00
rearnsha 4487810503 Add the IFPGA console device. 2001-10-27 16:29:23 +00:00
jmc 6d536163de Change defaults for kernel compiles. Default all to USETOOLS?=no and have
the etc Makefile override that by putting USETOOLS into $.MAKEOVERRIDES
This way the default for kernel compiles is still to use the installed
toolchain instead of depending on $TOOLDIR. $TOOLDIR can be used by
simply adding USETOOLS=yes to the command line as usual.

Adjust each ports template to set the default no setting and also pull in
bsd.own.mk if they weren't already to ensure they'll build correctly
with the new toolchain setup.
2001-10-26 06:45:33 +00:00
thorpej 2c5ebcddfb Use MACHINE, not TARGET_MACHINE. 2001-10-23 18:57:32 +00:00
thorpej a2bf3bc31b Pull in <bsd.own.mk> to get the correct toolchain definitions for
the USE_NEW_TOOLCHAIN case.
2001-10-23 17:32:35 +00:00
bjh21 3506931511 Make sure that PT_STEP is defined for userland, even though we don't
support it in the kernel yet.  If we don't do this, GDB arbitrarily
assumes we wanted it to be 9, which is silly.

In the kernel, leave it undefined so that sys_process.c doesn't
generate code for it.
2001-10-19 00:18:20 +00:00
bjh21 d3d2d8bdd7 Recognize GDB's default breakpoint instruction (as of GDB 5.0), in addition to
the instruction we used with GDB 4.x.  The new instruction has the advantage
of fitting the pattern that ARM recommend using for instructions that need to
stay undefined.
2001-10-18 21:26:21 +00:00
rearnsha 81fc80144a Add a comment describing the logic implemented by pmap_vac_me_harder. 2001-10-18 18:15:56 +00:00
rearnsha b5a8c6922a On processors that support both write-through and write-back cacheing
(eg ARM920), the mode in which the processor operates is governed by
the use of both the PT_C and PT_B bits:

	PT_C=1,PT_B=1 -> Write-back
	PT_C=1,PT_B=0 -> Write-through

To support this define pte_cache_mode (initialized to PT_C|PT_B) and
use that when enabling cacheing for a page.
2001-10-18 17:06:14 +00:00
rearnsha 7de86d9ccd With a diagnostic kernel, printing out a message each time we fail
to allocate a L1 pt is often enough to bring the system to its knees:
so make the messages PDEBUG(0,...).

However, even with this step having more than a small number of
processes searching for a L1 pt can still be enough to bring the system
down, since they all run at high priority and sleep for very little time,
thus blocking out user code from completing.  So implement an exponential
backoff when waiting for a page table, so that we don't hog the CPU when
memory is scarce.

Tested by running a make of the C compiler with "gnumake -j30" (and plenty
of swap space).
2001-10-18 16:50:30 +00:00
rearnsha d447073383 Fix pmap_vac_me_harder to take into account pages that are mapped
into both kernel and user space.

Fixes port-arm32/13998.
2001-10-18 16:32:40 +00:00
rearnsha bc8cd3375d Support for ARM9. 2001-10-18 15:19:58 +00:00
rearnsha c14090e8fa Add support calls for ARM9.
Where ARM9, StrongARM and XScale share the same function, rename it
as armv4_XXX.
2001-10-18 14:10:07 +00:00
rearnsha 0dbc5bbfab Add CPU_ARM9 to opt_cputypes.h 2001-10-18 14:03:43 +00:00
rearnsha 520fd8e5d8 Use 'p15' consistently in all mcr and mrc instructions.
Fix warnings in stm/ldm instructions of get_pc_str_offset.
2001-10-18 10:30:34 +00:00
rearnsha 2c48187673 Don't unmap page 0 when preparing to swap out a process. If the pmap
is shared with another process (as can happen if vfork is being used),
then that other process will end up not having a page 0, which is bad
news indeed, since then there is no way back into the kernel.

Found this using a multi-ice box, so they are useful after all!

This seems to fix pr port-arm32/11921 and (possibly) kern/9859.
2001-10-18 09:26:08 +00:00
reinoud be3168ab71 Sad point .... remove RC7500 support from the iomd directory in the
arch/arm/iomd/* .... the RC7500 isnt really an iomd/vidc machine but has
different video/audio chip and was kind of hardwired/hacked into the other
chip drivers.
2001-10-17 23:28:19 +00:00
matt 747d79ef47 Workaround "../../../.." 2001-10-17 23:21:44 +00:00
bjh21 07b63ac97a On ELF systems, make intptr_t and uintptr_t long, because Matt says so.
This makes regress/lib/libc/int_fmtio compile.
2001-10-16 20:40:45 +00:00
bjh21 83d5fd8043 Make the declaration of get_pc_str_offset() into a prototype. 2001-10-14 00:17:26 +00:00
reinoud 7d4a1addde Initial commit of the splitting off of arch/acorn32 from arch/arm32.
The IOMD/VIDC combination is now moved to arch/arm/iomd together. These
files still need a lot of cleaning up :( .... esp. the RC7500 support that
is still dormant in it; this needs either to be removed or split out for
RC7500's ``VIDC'' video/audio variant.

Apart from the RC7500 support wich is still in arch/arm32 the
iomd,vidc,riscpc and podulebus subdirectories of arch/arm32 can be removed.

This split still uses some small parts of arch/arm32 .... those are the MI
parts that haven't been moved yet.

RiscPC/A7000 have been tested and confirmed to build as should NC.
2001-10-05 22:27:40 +00:00
chris 5f0c745782 Add a couple of simplelocks to make sure we call pagealloc with the uvm_object locked. Found while running a LOCKDEBUG kernel on cats. 2001-09-29 09:39:12 +00:00
chris fa742cde19 Tweak spl functions a little, try to do something between an ldr and it's use. Not the greatest of gains but spl is called a lot it might add up.
Also add comments stating alignment of stack.
2001-09-28 10:01:02 +00:00
chris 38f962d504 Note the alignment state of the stack. This is part of the work to get the stack 8byte aligned for ELF 2001-09-28 09:56:03 +00:00
chris 79f5d977e0 Add extra arg to fpa_test as it should have 4 args. Also add prototypes for fpa_test and fpa_handler. 2001-09-28 09:53:41 +00:00
takemura ca59965026 Renamed platid_search() to platid_search_data() and added new platid_search().
Platid_name() was re-implemented using platid_search().
2001-09-24 14:29:30 +00:00
chris 8fd1ceb7bf Fix bug in vmapbuf, was using len before it had been adjusted. Found by Frank while Luke was tracking down a bug. 2001-09-20 23:32:23 +00:00
matt 544880621b Add cdev_decl for new devices in conf.c 2001-09-16 17:41:28 +00:00
matt ec78dd0fce Add missing devices (IOP,MLX,MLY,LD), PCI, stub AGP, ... 2001-09-16 17:40:40 +00:00
matt d75fe4fc1e Fix .type which uses wrong symbol name. 2001-09-16 17:38:08 +00:00
chris 244c9d9d95 Add the first tweak from PR 12364. Don't switch the flush block on an SA, as it makes second and subsequent flushes less efficient. The other tweaks are already committed. 2001-09-16 08:51:17 +00:00
chs 64c6d1d2dc a whole bunch of changes to improve performance and robustness under load:
- remove special treatment of pager_map mappings in pmaps.  this is
   required now, since I've removed the globals that expose the address range.
   pager_map now uses pmap_kenter_pa() instead of pmap_enter(), so there's
   no longer any need to special-case it.
 - eliminate struct uvm_vnode by moving its fields into struct vnode.
 - rewrite the pageout path.  the pager is now responsible for handling the
   high-level requests instead of only getting control after a bunch of work
   has already been done on its behalf.  this will allow us to UBCify LFS,
   which needs tighter control over its pages than other filesystems do.
   writing a page to disk no longer requires making it read-only, which
   allows us to write wired pages without causing all kinds of havoc.
 - use a new PG_PAGEOUT flag to indicate that a page should be freed
   on behalf of the pagedaemon when it's unlocked.  this flag is very similar
   to PG_RELEASED, but unlike PG_RELEASED, PG_PAGEOUT can be cleared if the
   pageout fails due to eg. an indirect-block buffer being locked.
   this allows us to remove the "version" field from struct vm_page,
   and together with shrinking "loan_count" from 32 bits to 16,
   struct vm_page is now 4 bytes smaller.
 - no longer use PG_RELEASED for swap-backed pages.  if the page is busy
   because it's being paged out, we can't release the swap slot to be
   reallocated until that write is complete, but unlike with vnodes we
   don't keep a count of in-progress writes so there's no good way to
   know when the write is done.  instead, when we need to free a busy
   swap-backed page, just sleep until we can get it busy ourselves.
 - implement a fast-path for extending writes which allows us to avoid
   zeroing new pages.  this substantially reduces cpu usage.
 - encapsulate the data used by the genfs code in a struct genfs_node,
   which must be the first element of the filesystem-specific vnode data
   for filesystems which use genfs_{get,put}pages().
 - eliminate many of the UVM pagerops, since they aren't needed anymore
   now that the pager "put" operation is a higher-level operation.
 - enhance the genfs code to allow NFS to use the genfs_{get,put}pages
   instead of a modified copy.
 - clean up struct vnode by removing all the fields that used to be used by
   the vfs_cluster.c code (which we don't use anymore with UBC).
 - remove kmem_object and mb_object since they were useless.
   instead of allocating pages to these objects, we now just allocate
   pages with no object.  such pages are mapped in the kernel until they
   are freed, so we can use the mapping to find the page to free it.
   this allows us to remove splvm() protection in several places.

The sum of all these changes improves write throughput on my
decstation 5000/200 to within 1% of the rate of NetBSD 1.5
and reduces the elapsed time for "make release" of a NetBSD 1.5
source tree on my 128MB pc to 10% less than a 1.5 kernel took.
2001-09-15 20:36:31 +00:00
chris 5cb5484ce3 Sprinkle some static and inline into a couple of functions. Remove dead entries from pmap.h. 2001-09-13 23:56:01 +00:00