Commit Graph

718 Commits

Author SHA1 Message Date
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
chris 5695ad388d Update pmap_clearbit to flush the cache if the area is being made readonly. Also only do this and the tlb flush if the pmap is the current pmap. 2001-09-13 22:45:23 +00:00
rjs fcd39c5f2e Add bs_notimpl_bs_mmap to bus space struct. 2001-09-12 12:32:16 +00:00
rearnsha 9358e3ecc3 Fix warning errors for printing size_t types when compiling with
DEBUG_DMA (uses casts due to a.out and ELF having different base
types for size_t).
2001-09-12 09:41:50 +00:00
chris bd81d66bb5 Update the pmap following some comments from Chuck Silvers:
Remove some overzealous locking of HEAD_TO_MAP
Remove a potential deadlock in pmap_copy_page
Change alloc and free l1pt to use kenter/kremove.
Update pmap_map to use kenter (only actually used by dumpsys, so no matching kremove)
2001-09-10 23:40:02 +00:00
chris 70907ad742 Add stubs for mmap to footbridge, must implement proper mmap real soon. 2001-09-10 23:05:19 +00:00
chris 0e7661f023 Update pmap_update to now take the updated pmap as an argument.
This will allow improvements to the pmaps so that they can more easily defer expensive operations, eg tlb/cache flush, til the last possible moment.

Currently this is a no-op on most platforms, so they should see no difference.

Reviewed by Jason.
2001-09-10 21:19:08 +00:00
reinoud 7bace466ad Initial commitment of the bus_space_mmap() functions as proposed by Jason R
Thorpe as an extension to the bus_space(9) API.

Only the mainbus has a working mmap... iomd, podulebus and isa dont have
one yet. Its trivial to add the iomd and isa's memory part but am a bit
hessistant to add it without knowing its implications by heart.

Podulebus might be implemented in 32 bits EASI but otherwise its not really
transparent since there is AFAIK no function to explicitly read one byte or
so .. or is this implemented in a higher level ?

ARM26 and arch/arm32/dnard (Shark) kernels compile and RiscPC and Shark
kernels are tested and function OK.

Implications of other ARM systems like hpcarm and ebarm are propably
minimal or solved trivially.
2001-09-10 02:20:19 +00:00
toshii 7c9e82d6e3 Don't define pcb_* register macros.
pcb_sp macro conflicts with sys/netinet6/ipsec.c.
2001-09-09 10:33:42 +00:00
toshii b45ffd445a Readd sacom to cdevsw. 2001-09-09 09:54:13 +00:00
matt ff5f5ea027 Don't compile SPL/INTR stuff if NEWINTR is defined. 2001-09-05 17:08:41 +00:00
matt 779b9b4649 Fix some register definitions. 2001-09-05 17:05:36 +00:00
matt 0b5b9ca90e Change <machine/irqhandler.h> to <machine/intr.h>. Change
{irq,fiq}handler_t to struct XXXhandler
2001-09-05 16:23:10 +00:00
matt 792b7ebd13 Change <machine/irqhandler.h> to <machine/intr.h> since the latter always
includes the former and is a standard include file.
2001-09-05 16:17:35 +00:00
matt c9fd88afcf Don't clean the minidata cache by default on XScale. 2001-09-05 16:14:49 +00:00
matt 4370f884b2 Flesh XSCALE support. 2001-09-05 16:13:18 +00:00
matt 78944c67e3 Add an obio bus. 2001-09-05 16:12:36 +00:00
wiz b940fa8a83 Fix typos (CONS instead of CONF, and specifc instead of specific). 2001-09-04 21:45:19 +00:00
matt 7ce6450eac Add a merged <pcb.h> for arm26/arm32. 2001-09-03 19:20:27 +00:00
matt d7c7a3ea02 Add __ELF__ stuff for resized types under ELF. 2001-09-03 01:51:39 +00:00
matt b0f89169ee Switch netwinder to use a common conf.c for the arm ports. 2001-09-03 01:50:00 +00:00
simonb 023bdd2bf2 Use comments around the token after a #endif. 2001-08-31 04:44:54 +00:00
matt e4892d7157 When invaliding single icache line on XScale, the branch target buffer
also needs to be invalidated.  Also, but in the right sequence to empty
the pipeline on XScale.
2001-08-30 01:15:39 +00:00
chris 37fb92dcab Remove unused entries from the pcb. This is with a long term view of merging the arm26 and arm32 pcb's. 2001-08-27 11:39:43 +00:00
matt edc83ba7f4 Add xscale cpufuncs (using the sa110 ones when they are identical). 2001-08-27 00:00:27 +00:00
matt e8f317bba8 Add xscale cpu functions 2001-08-26 19:41:57 +00:00
matt 4e642cc5fd Add i80312 register definitions (just registers for now). 2001-08-26 19:25:47 +00:00
matt 08f4bcddf3 files file for xscale (i80312 aka iopxs) 2001-08-26 19:19:09 +00:00
bjh21 ed5e27cc44 Increase the size of a jmp_buf when using ELF, since this will be our last
chance to do so for a while.  We don't use the extra space yet, but VFP
support is likely to need it.
2001-08-25 14:45:59 +00:00
chris 140252be2b Arm has a vac, so we must use pmap_enter/remove for vmapbuf rather than k* versions, otherwise we may not be doing the right caching thing. 2001-08-20 21:52:09 +00:00
wiz d375535396 Fix typo in comment (suceed). 2001-08-20 11:49:11 +00:00
matt 4bc8190b62 Change local offset/label for irqhandlers to Lirqhandlers. Because in
ELF _C_LABEL(irqhandlers) == irqhandlers so we were getting self-referential
pointer which causes the IRQ to fall on itself.  [With this change the
netwinder kernel can now be *ELF* and boots to multiuser]
2001-08-19 07:29:26 +00:00
jdolecek c495131fe3 Move _insque()/_remque() to libkern. Once remaining uses would
be converted to <sys/queue.h> macros, _insque()/_remque() would be eliminated
altogether.
2001-08-12 08:35:31 +00:00
chris 0b0518e0dd Fix compile without DIAGNOSTICs enabled 2001-08-11 14:47:56 +00:00
chris 191de4d242 Checking a whole host of pmap changes:
Improved locking (not that we actually use it on a uniprocessor, but one day :)
Removed unneeded splvm's
tweaked pmap_clean_page code to only flush the cache if the page is mapped in the current pmap  (based on diff from richard E)
Adopted pv entry allocation mechanism from i386.
Laid framework for returning ptp's when we've finished with them rather than holding onto them till the process exits.
ptp's are now allocated with a uvm object for the pmap, means that we can walk a list to free them off in pmap_release, until they get freed off by pmap_remove.

Also implemented a page zeroing function when the processor is idling.  Note that hpcarm may wish to disable this.

I believe this code to be stable, if anyone has any problems please shout up.
2001-08-11 13:20:19 +00:00
chris c5de587666 Make use of pmap_kenter instead of pmap_enter for kernel buffers. 2001-08-11 13:00:48 +00:00
chris 163b9983d7 Add arm_trunc_page, similair to trunc_page but using a hardcoded PGOFSET. 2001-08-11 12:59:45 +00:00
chris 6cca1c3f58 Update to make use of a proper kenter implementation for vmapbuf and vunmapbuf. 2001-08-11 12:57:25 +00:00
chris 6e43d02452 Patch in Richard E's changes to bcopy page, the loop doesn't need unrolling as much as it currently is due to the overhead of the load/stores taking most of the time. (profiling shows minimal time difference) 2001-08-11 12:44:42 +00:00
bjh21 4dd0161267 Use STACKALIGN rather than &=~7. 2001-08-07 22:56:09 +00:00
bjh21 8fa03d16ac Add macros to hide the details of stack-pointer alignment. 2001-08-07 22:54:00 +00:00
bjh21 bd6d4d6b77 Use <arm/param.h> to get shared definitions. 2001-08-07 22:26:56 +00:00
bjh21 f37b49755f When delivering a signal, ensure that the stack is 8-byte-aligned. 2001-08-06 22:32:23 +00:00
chris 9522cf08d4 Share procfs_machdep.c across arm. 2001-08-05 13:09:45 +00:00
matt 9509e734a3 Force size_t formats/arge to be (u_long). I'd use 'z' for this but gcc
2.95.3
2001-08-05 05:07:27 +00:00
rjs faf8b4c913 Update from hpcarm with changes to probe routine and test for chip ID. 2001-08-01 14:02:58 +00:00
matt 03b77c0534 Add a CPU_XSCALE defopt (for eventual support). 2001-07-31 17:00:24 +00:00
rjs 6b65fea380 Remove unused hpc includes. 2001-07-30 16:23:09 +00:00
rjs 9013c85405 Update from hpcarm to remove iPAQ egpio code. 2001-07-30 16:20:06 +00:00
rjs 51bc7258f8 Update from hpcarm with MCP base definition. 2001-07-30 16:08:42 +00:00
rjs c79059dd3f Update from hpcarm to remove iPAQ and Jornada specific #defines. 2001-07-30 15:58:56 +00:00
rjs b85ae98e65 Update from hpcarm with MCP register definition. 2001-07-30 12:19:04 +00:00
rjs 495d108bd3 Update from hpcarm with cookie change. 2001-07-30 10:55:49 +00:00
rjs 9b65c24aa5 Remove unused LCD definitions. 2001-07-30 10:50:59 +00:00
rjs 1304d2220e Mirror removal from hpcarm. 2001-07-30 10:48:31 +00:00
rjs 499d1068e8 Update from hpcarm. 2001-07-30 10:46:08 +00:00
rjs e35b542831 Mirror removal from hpcarm. 2001-07-30 10:33:59 +00:00
rjs 730b1a57ac Copy from hpcarm. 2001-07-30 10:17:21 +00:00
chris fa4e4d9668 Rework the pmap_release code to not have to walk the ptpt, it now uses a uvm_object to track the allocated vm_pages, this means it can free off the entries in the uvm_object.
Testing shows that it's about 5% faster on the make configure step for gmake.
2001-07-29 12:45:27 +00:00
chris 89415a32e2 PR 13581
Add empty pmap.h and vmparam.h to make userland happier.
2001-07-29 09:50:07 +00:00
chris af16732a3a Fix for PR 13580.
Make sysarch include sys/stdint.h so it picks up the a definition of uintptr_t.
2001-07-29 08:37:56 +00:00
chris 9f04d8d670 A couple of tidy ups to pmap:
pmap_t -> struct pmap * in pmap.c and pmap.h
kernel_pmap -> pmap_kernel() everywhere.

Compiled and booted on riscpc and cats.
2001-07-28 18:12:43 +00:00
chris 4a126d9937 finish moving common arm32 bits out into arm/arm32. 2001-07-28 15:08:10 +00:00
chris 27f96e8440 Move the generic arm32 files into arm/arm32 from arm32/arm32, tested kernel builds on cats and riscpc. 2001-07-28 13:28:03 +00:00
chris 9c823196e0 Change -x into -X for linking, it makes traces more meaningful. 2001-07-28 13:24:24 +00:00
chris 37dc65af43 bzero->memset 2001-07-28 12:29:58 +00:00
matt 36dc943f75 Change ARM-ELF to LP64 friendly types. 2001-07-28 07:42:28 +00:00
matt 384a403ca5 Make sync_icache_args use more standard types. 2001-07-23 17:04:27 +00:00
takemura 64b6b76a21 You must set 'HPCFB_SWAP_*' if bytes are stored in reverse order, i.e.
little endian like order, however, usage of 'HPCFB_SWAP_*' was widely
misunderstood because it reminded you of 'RI_BSWAP' in raster operation.
Please note that 'RI_BSWAP' indicate that frame buffer byte order is different
from natural order of system while 'HPCFB_REVORDER_*' is independent of
system byte order.
2001-07-22 09:56:39 +00:00
thorpej babefc5331 Add BUS_DMA_READ and BUS_DMA_WRITE flags, that hint the back-end
at dmamap load time that the mapping will be used for a unidirectional
transfer of the specified direction.
2001-07-19 15:32:10 +00:00
rjs c1539a6ba2 Add Jazelle mode flag. 2001-07-18 16:31:17 +00:00
matt bb9bd28fa8 Change way PIC stuff is emitted for ELF to be more flexible. 2001-07-16 05:43:32 +00:00
matt 59ce75e3e7 Need to emit PLT magic for PIC ELF files. 2001-07-16 05:42:50 +00:00
matt 7a4fca28c6 Add a GOTSYM which emits the right stuff to GOT symbols under ELF and/or
a.out.
2001-07-14 18:24:41 +00:00
matt 497b990687 Clarify when/where MACHINE & MACHINE_ARCH are defined. Add default
user-visible definitions.
2001-07-14 07:31:31 +00:00
matt 24a2b394aa Make <sysarch.h> valid for all arm platforms. Adjust/remove port-specific
includes as required.
2001-07-14 00:23:09 +00:00
matt c5e61ec6d5 Move user-visible MBUF constant here. Define MAXPHYS. Include DEV_BSIZE 2001-07-13 19:43:15 +00:00
matt d09cef0906 Gah!. Use the variable name (LINKENTRY). 2001-07-12 07:02:00 +00:00
matt 2d9f71a0d9 Fix a few things for NetWinder. NetWinder needs to override the
std entry point so add a hook for that.  Also pick up the port
specific .inc file from the right directory.
2001-07-12 06:25:07 +00:00
bjh21 ea353a48e1 Purge CPU_ARM7500. Thanks to Reinoud's work, it's no longer needed. 2001-07-10 20:43:57 +00:00
reinoud 8ca7d6ec9c Initial commit for merging A7000/NC with the RISCPC in order to get _one_
bootable GENERAL kernel for the 3 machines.

This is done by integrating the ARM7500 in a better way. In various places
the IOMD ID is checked and action is taken at runtime compared to
compiletime.

The small piece of assembler that is changed now uses the flag
`arm7500_ioc_found' that is set up by iomd.c at startup. When this chip
isnt found at startup it will skip reading the ARM7500 extended IRQ
registers and wont clear them either.

The next step will be getting the mode-definition files to the bootloader.
Currently they are compiled in.
2001-07-09 21:46:19 +00:00
reinoud 1f5b07de6a Changed the variable within the ARM6 late abort section from cpu_ctrl to
cpuctrl ...
2001-07-09 19:51:14 +00:00
rjs 72c860d841 Initial copy of SA11x0 support from hpcarm. 2001-07-08 23:37:52 +00:00
rjs 35dc2ba462 Initial copy of SA11x0 support from hpcarm. 2001-07-08 23:20:04 +00:00
chs b86053cc53 clean up pmap_k{enter_pa,remove}():
a page is allowed to be mapped normally when k-mapped.
use UVM_PGA_ZERO to get zeroed pages rather than zeroing here.
2001-07-08 19:44:43 +00:00
chris 4c32798eb8 Implement proper versions of kenter_pa and kremove, I've based them on versions provided by Richard E. 2001-07-06 20:15:13 +00:00
chris b8ceed365f Improve the vac_me_harder function, it is now slightly faster, however pmap_enter_pv is also now slightly slower, so they appear to balance out.
Note that I've some ideas in the works on how to improve the pv handling, so the slow down is short term only.

Also added non-advertising licence and copyright to myself and richard.
2001-06-25 23:22:38 +00:00
chris 407440a6b3 Add a pmap_map_ptes function to map another process page table entries into the current pmap (similair to pmap_pte) but this allows multiple use of it, rather than repeated calls of pmap_pte for pte, map_ptes returns a pointer to the va where the entries were mapped so it can be reused ptes can be found by indexing into it.
Update some of the functions that use pmap_pte to pmap_map_ptes.

Note that there's a dummy macro for pmap_unmap_ptes, this is because at some point locking will be needed, so we need to be able to unlock them.

Performance gain seems to be minimal, however long term it should help improve things.

This is similair to the i386 pmap_map_ptes, however it's based on a version from Richard Earnshaw.
2001-06-24 23:21:04 +00:00
chs 908aa6ff3d remove "machine vmstat" command, since "show uvmexp" does the same thing. 2001-06-24 07:32:20 +00:00
bjh21 690f56e57a Add a common <arm/param.h>, containing those few things that are obviously
common across all ARM systems.
2001-06-23 13:25:19 +00:00
bjh21 3622d4e282 Add <arm/endian.h> and remove the cats, dnard and netwinder versions, since
they're all the same (a redirect to <sys/endian.h>).
2001-06-23 12:20:27 +00:00
chris c3b7efe5d3 GC a couple of unused entries in the pmap struct 2001-06-22 09:12:11 +00:00
chris cca2bd293b Use a pool to store pmap structs. 2001-06-22 09:09:42 +00:00
chris 7383fda9e0 Remove defopt EBSA285.
Move the files from footbridge that are cats specific.
Remove EBSA285 kernel as people should be able to use the generic cats kernel for EBSA285 systems.
2001-06-20 22:14:32 +00:00
wiz ac951736bc `response', not `responce' 2001-06-19 13:45:52 +00:00
wiz f3f6c5b675 `accessible' only has one `a'. 2001-06-19 12:52:20 +00:00
bjh21 cb36bacea5 Merge arm32/dev/bus_space_notimpl.S and hpcarm/hpcarm/bus_space_notimpl.S
into arm/arm/bus_space_notimpl.S.  They were identical anyway.

This file has no excuse for being in assembler, but I'll leave that for another
day.
2001-06-18 22:26:15 +00:00
bjh21 80c5d7ab99 Move <arm/arm32/bus.h> to <arm/bus.h>, since it looks like it's going to be
necessary on arm26 as well.
2001-06-18 21:37:32 +00:00
thorpej 8eb3b954f1 Don't need to prototype child_return() here, it's in <sys/proc.h>. 2001-06-14 22:56:55 +00:00
nathanw 0adcac34e5 That's supposed to be <machine/io.h> in the XXX'd #ifdef, not a repeat
of <machine/bus.h>.
2001-06-13 17:52:43 +00:00
matt fa3621e3be Move netwinder_machdep.c to files.netwinder. Eliminate opt_netwinder.h and
use #ifdef netwinder insead.  XXX ebsa285_machdep.c should move to the cats
directory and files.cats
2001-06-12 17:10:25 +00:00
chris 1825c7b68a Move defopt FOOTBRIDGE to where it really should be in files.footbridge, which is where I should have left it. 2001-06-11 22:25:09 +00:00
matt 95be56d2e1 Only include dependency on include-dirs if the include directory doesn't
exist.
2001-06-11 17:50:34 +00:00
matt d87a9f23c3 Add common Makefile for arm ports. Only include (for now) machine/io.h
if arm32 is defined.  io.h is RISCPC specific and isn't needed for other
ports.
2001-06-11 17:44:38 +00:00
chris b0a79f686c Typo police: 28285 -> 21285
Also garbage collect the old kernel VM map defines for footbridge.
2001-06-09 10:44:10 +00:00
chris af8ce95972 Move the footbridge dir out of arm32 into arm. 2001-06-09 10:29:11 +00:00
chris 75d8b9d463 Checkin fix to ARM7TDMI support. As per patch from John Fremlin to
port-arm32.
2001-06-07 21:07:22 +00:00
bjh21 95fe4db7e3 Replace arm/arm32/db_trace.c and arm26/arm26/db_trace.c with a unified version
in arm/arm.  This version is based on the arm26 version, and includes dumping
the contents of stack frames, with automatic determination of the save code
pointer offset.
2001-06-05 09:25:05 +00:00
bjh21 261bd8f8ac Add get_pc_str_offset(), which returns the offset between the address of an
instruction that stores the program counter and the value of PC that's stored.
This can vary between ARM implementations, but is guaranteed to be constant on
a given one.
2001-06-05 09:19:32 +00:00
chris 878db7cfb8 Add support for ARM7TDMI, as provided in a patch from John Fremlin to port-arm32.
Shouldn't effect any currently in tree ports.
2001-06-03 18:32:33 +00:00
bjh21 e1fdb3abbf Rather than duplicating the LDM/STM/LDC/STC fixup code between
early_abort_fixup() and late_abort_fixup(), have the latter tail-call the
former.  This saves another 200 bytes, and I've found my ARM710a card now, so
I've even tested it.
2001-06-03 13:38:14 +00:00
bjh21 3c88c46567 In {early,late}_abort_fixup(), return ABORT_FIXUP_FAILED, rather than
panic'ing, if we hit an instruction we can't fix up.  This saves 250-odd bytes
of code, and should allow the caller to print a more useful message.
2001-06-02 22:30:07 +00:00
bjh21 f594a52dae late_abort_fixup: Get the indentation right! 2001-06-02 22:08:11 +00:00
bjh21 54a986d7fc Replace arm6_dataabt_fixup() and arm7_dataabt_fixup() with early_abort_fixup()
and late_abort_fixup(), based on the abort model in use, rather than the CPU
type.  This cleans up the code and makes it smaller.  Only tested on an
ARM6 -- I can't find my ARM710a card right now.
2001-06-02 21:03:32 +00:00
bjh21 7089595665 Initial cpufunc operations for ARM3. Not actually used yet. 2001-06-02 19:01:03 +00:00
bjh21 c81d426dcf Save R14 (in a proper stack frame) around {read,write}_multi_1, since page
faults can corrupt it on arm26.
2001-06-02 11:15:56 +00:00
bjh21 ac0d39dfe8 Add write_multi_1(). 2001-06-02 10:44:56 +00:00
mrg 67afbd6270 use _KERNEL_OPT 2001-05-30 11:57:16 +00:00
bjh21 f15491e9d3 Move the declarations of blockio.S functions from katelib.h to a new, exciting
<arm/blockio.h>.  katelib.h includes it for compatibility.
2001-05-30 00:16:36 +00:00
bjh21 d51c27dfa8 Add read_multi_1() which does what it says fairly fast. 2001-05-30 00:14:09 +00:00
bjh21 7d9a4dbad7 Move blockio.S from sys/arch/arm32/arm32 to sys/arch/arm/arm, since I want to
start using it on arm26.

hpcarm gets to keep its own version, since it's not identical and I haven't
got an hpcarm box to test.
2001-05-29 23:03:20 +00:00
chs e44e9dec8a replace vm_page_t with struct vm_page *. 2001-05-26 21:27:02 +00:00
chs 118ddca24a replace {simple_,}lock{_data,}_t with struct {simple,}lock {,*}. 2001-05-26 16:32:40 +00:00
chris cbf8e0eb95 Add a files.footbridge for inclusion by cats and netwinder. This is to make moving of the footbridge dir easier (when it eventually moves from arm32)
Also remove EBSA285 defopt from the netwinder file as the netwinder isn't an eval board.
2001-05-23 21:21:42 +00:00
chris 8901caf8ff Create an asm based version of in4_cksum based on the sparc version.
Also don't compute psuedo header for nxt == 0
2001-05-23 19:33:48 +00:00
bjh21 330163a77f Include opt_cputypes.h, since we use CPU_*. 2001-05-13 14:41:56 +00:00
bjh21 b9ded015f4 strstr() is no longer used in the kernel. G/C it. 2001-05-13 14:17:36 +00:00
bjh21 e2b24925d1 Use get_bootconf_option() to find boot options, rather than home-grown
strstr()-based hacks.
2001-05-13 13:53:08 +00:00
bjh21 0ea71ec5ea Make use of a.out or ELF symbols dependent on the compile-time definition of
__ELF__.
2001-05-13 13:51:08 +00:00
bjh21 e8fd2642a9 Don't include parse_cpu_options() unless we're going to use it. This fixes
a warning on arm26.
2001-05-13 13:50:01 +00:00
bjh21 2af5062ab7 Add <machine/bootconfig.h> on arm26, and add an <arm/bootconfig.h> for it to
include (since all the contents are MI).
2001-05-13 13:46:23 +00:00
bjh21 61044be691 Move get_bootconf_option() into a new file, sys/arch/arm/arm/bootconfig.c,
since it's in no way machine-dependent.  It's not really ARM-specific either,
but I don't think it's useful enough to be made part of the MI kernel.
2001-05-13 13:44:33 +00:00
bjh21 6d4648fa03 Move "defopt PMAP_DEBUG" into files.arm, since it's used by code in arch/arm. 2001-05-06 18:31:14 +00:00
bjh21 f9087c439b Move cpufunc stuff from arm32/arm32 to arm/arm. The only change involved is
to add recognition of the SA-1100 and SA-1110 for compatibility with hpcarm
(which is now using this code as well).
2001-05-06 18:01:42 +00:00
simonb 6a511e05e2 Be consistent with limit constants:
- use "U" suffix for unsigned constants
 - use "L" suffix for long constants
 - use "UL" suffix for unsigned long constants
 - use hexadecimal instead of decimal

Fixes build problems with vi (now that warnings/errors are enabled) on
mips, powerpc and arm platforms.
2001-05-04 15:12:32 +00:00
bjh21 8afb876f73 Make the common <arm/profile.h> work on arm26 and arm32, choosing whether
to munge R15 or not at runtime.  Also make it work with both ELF and a.out.
2001-05-04 00:11:15 +00:00
bjh21 262c7835b0 In an ELF kernel, don't try to find an a.out symbol table. 2001-05-02 19:10:29 +00:00
kleink fe3c9ceaf7 * Move definitions of exact-width integer types from <machine/types.h>
to <sys/types.h> and <sys/stdint.h>.
* Add a new C99 <stdint.h> header, which provides integer types of
  explicit width, related limits and integer constant macros.
* Extend <inttypes.h> to provide <stdint.h> definitions and format
  macros for printf() and scanf().
* Add C99 strtoimax() and strtoumax() functions.
* Use the latter within scanf().
* Add C99 %j, %t and %z printf()/scanf() conversions for
  intmax_t, pointer-type and size_t arguments.
2001-04-28 15:41:28 +00:00
bjh21 3a7710b605 Add ELF version of _PROF_PROLOGUE. 2001-04-26 23:20:02 +00:00
kleink 99054d7a6c Add definitions for C99 fastest minimum-width integer types. 2001-04-26 16:25:19 +00:00
thorpej fe664428c8 Garbage-collect pmap_page_index(). 2001-04-25 17:35:00 +00:00
bjh21 63692f5771 Rather large overhaul. Mostly cosmetic, but also:
Provide PROC_PC on arm26.
Provide working CLKF_INTR on arm26.
Make setsoftast a macro everywhere.
2001-04-24 18:20:21 +00:00
thorpej 1c3a62e066 Sprinkle pmap_update() calls after calls to:
- pmap_enter()
- pmap_remove()
- pmap_protect()
- pmap_kenter_pa()
- pmap_kremove()
as described in pmap(9).

These calls are relatively conservative.  It may be possible to
optimize these a little more.
2001-04-24 04:30:50 +00:00
thorpej 55044638aa Remove pmap_kenter_pgs(). It was never really adopted by
anything, and the interface itself wasn't as flexible as
callers would have probably liked.
2001-04-22 23:42:11 +00:00
thorpej 69abdbf60c Undo a misguided previous change to the pmap_update() API. 2001-04-22 23:19:26 +00:00
thorpej 4738622712 Give pmap_update() an argument (a pmap_t) so that it knows which
pmap it should be updating.
2001-04-22 00:33:59 +00:00
thorpej 82065e8a0b Update the comment for pmap_update(). 2001-04-21 17:13:12 +00:00
bjh21 630f137a5e Multiple-inclusion protection. 2001-04-21 15:47:32 +00:00
toshii 61ff48a82e In pmap_allocpagedir(), check if uvm_km_zalloc of ptpt is successful,
and handle alloc failure case.
2001-04-20 18:11:53 +00:00
matt 1a5fe5b583 Split cpu from mainbus so that cpu can attached to other buses (like ofbus). 2001-04-20 18:08:48 +00:00
rearnsha 50e1e30747 Put back that old (not) unused include file. But only include it
when ARMFPE is defined.  Since that is the only time we use it.
2001-04-18 20:27:33 +00:00
kleink f06533a1ee Add definitions of C99 integer format conversion macros.
XXX Fastest minimum-width integer types haven't been decided upon yet.
2001-04-15 17:13:04 +00:00
kleink 739cb75837 Add definitions of C99 specified-width integer type limits.
XXX Fastest minimum-width integer types haven't been decided upon yet.
2001-04-15 15:29:02 +00:00
kleink cdcf9f46c5 Add definitions of C99 integer constant macros.
Tidy Makefiles up a little.
2001-04-14 22:46:19 +00:00
kleink a7c20e5788 Add definitions of C99 integer constant macros. 2001-04-14 22:38:33 +00:00
kleink 7affdab52e Add definitions of C99 minimum-width and greatest-width integer types.
XXX Fastest minimum-width integer types haven't been decided upon yet.
2001-04-14 12:19:49 +00:00
thorpej bf2dcec4f5 Remove the use of splimp() from the NetBSD kernel. splnet()
and only splnet() is allowed for the protection of data structures
used by network devices.
2001-04-13 23:29:55 +00:00
kleink 9133b51cd8 Replace the 'unsigned __COMPILER_INT64__' construct with a new name,
__COMPILER_UINT64__, to be supplied - if such a case is made, it shouldn't
be assumed that the unsigned type-specifier may be applied to it.
2001-04-12 22:01:18 +00:00
reinoud d2b84b36d2 Removing an old unused include 2001-04-04 21:40:20 +00:00
toshii dfddb1e107 Increase spl_masks[] size by one and set the extra element to 0.
irq_entry accesses here.
2001-03-31 12:22:37 +00:00
bjh21 bfc2063e69 Create an ARM2-specific undefined-instruction handler which deals with the
undef/SWI bug and handles emulating SWP.

Untested bacuse my ARM2 machine isn't currently set up.
2001-03-17 18:12:09 +00:00
chs ac3bc537bd eliminate the KERN_* error codes in favor of the traditional E* codes.
the mapping is:

KERN_SUCCESS			0
KERN_INVALID_ADDRESS		EFAULT
KERN_PROTECTION_FAILURE		EACCES
KERN_NO_SPACE			ENOMEM
KERN_INVALID_ARGUMENT		EINVAL
KERN_FAILURE			various, mostly turn into KASSERTs
KERN_RESOURCE_SHORTAGE		ENOMEM
KERN_NOT_RECEIVER		<unused>
KERN_NO_ACCESS			<unused>
KERN_PAGES_LOCKED		<unused>
2001-03-15 06:10:32 +00:00
toshii 300d398485 Move references to arm/arm/disksubr*.c from files.arm to
files.{arm26,arm32,dnard}.
2001-03-14 14:39:45 +00:00
bjh21 c3c5158d00 Change the value of tf_pc in undefined-instruction handlers on arm32. It now
always points to the undefined instruction in question.  It's up to the
handler to advance it to the next instruction if it wants execution to
continue there.  This is how things have always worked on arm26.
2001-03-13 23:56:48 +00:00
bjh21 ce3ad2275b Update FPU detection to use remove_coproc_handler(). 2001-03-13 23:51:48 +00:00
bjh21 c72a18bddc Separate out the SIGTRAP (gdb breakpoint) generator from undefinedinstruction()
so it's no longer a special case.
2001-03-13 20:22:02 +00:00
bjh21 ce5529eabf Change undefined instruction handler to use a linked list for each
co-processor.  This is necessary so we can have several handlers for
CP0 (used as a catch-all for non-CP instructions).

Handlers are now removed using remove_coproc_handler(), rather than by calling
install_coproc_handler() with a NULL handler.

Because install_coproc_handler() can now allocate memory, there's a version
for use at boot time that doesn't.
2001-03-11 16:18:39 +00:00
bjh21 4624a1247e Make this suitable for use on arm26 as well. 2001-03-11 16:02:21 +00:00
bjh21 5f8b55f7c3 Pass a softc pointer around everywhere, and use it when we need the name of
the device.

Don't pretend that fpe0 and fpu0 exist as devices (they don't).

G/C a few items related to /dev/cpu* support.
2001-03-11 15:05:43 +00:00
bjh21 f61ad8fa80 G/C more unused elements of struct _cpu. 2001-03-11 00:14:56 +00:00
bjh21 d005972168 "needs-flag" for cpu is no longer needed. 2001-03-11 00:11:05 +00:00
bjh21 ca5024c3a1 Add code to point out to the user if their CPU isn't supported, and to
suggest what kernel options to use to get it to work.
2001-03-10 21:27:06 +00:00
bjh21 b362a4bef3 Change the meaning of cpu_class. It now has one value for each core we
support, which corresponds to one for each CPU_* option, or one for each
cpufunc structure.

Also remove some more residual code for the support of multiple and non-ARM
CPUs.
2001-03-10 20:15:46 +00:00
bjh21 c24be229f5 Don't allow the I and F (IRQ and FIQ disable) flags to be set in the PSR
by sigreturn.  This prevents user processes disabling interrupts by messing
with their signal context.
2001-03-10 20:08:55 +00:00
rearnsha bf5e18af99 Add param.h to INCS. 2001-03-10 18:32:25 +00:00
bjh21 0bcb071684 Correct CPU_ID_ISOLD() and CPU_ID_IS7(). 2001-03-10 16:19:59 +00:00
bjh21 f6c36838ae Use the same undefined-instuction handler on both arm26 and arm32. The handler
is derived mostly from the arm32 version, but with a check for an obscure ARM2
bug thrown in.

arm26 fpu and cpu drivers use the new interface for catching undefined
instructions.
2001-03-08 21:30:35 +00:00
thorpej 2c4c690f14 Add the BUS_DMA_STREAMING flag. 2001-03-07 22:42:16 +00:00
bjh21 4ada0ac792 Create cpufunc_null_fixup() to replace all the CPU-specific abort-fixup
routines that did nothing.
2001-03-06 22:29:13 +00:00
matt b7cd0eeaac Move arm32/arm32/ast.c to arm/arm32/ast.c 2001-03-06 07:52:35 +00:00
bjh21 3ec18a1616 General prettification (mostly comments). 2001-03-05 23:29:32 +00:00
bjh21 78eae7d026 ANSIfy. 2001-03-05 23:14:22 +00:00
bjh21 83b8de43dd Move undefined.c from sys/arch/{arm32/arm32,hpcarm/hpcarm} to sys/arch/arm/arm
in preparation for making it usable on arm26 as well.
2001-03-05 23:06:14 +00:00
bjh21 25ec015449 Merge setregs() from sys/arch/arm32/arm32/machdep.c,
sys/arch/hpcarm/hpcarm/machdep.c and sys/arch/arm26/arm26/vm_machdep.c
into sys/arch/arm/arm/arm_machdep.c.
2001-03-04 23:25:00 +00:00
matt d6fc837c17 more vm_offset_t/vm_size_t -> {p,v}{addr,size}_t changes
move pmap_* declarations to pmap.h.  fix conflicts this
exposed (e.g different definitions for pmap_bootstrap).
2001-03-04 19:05:55 +00:00
bjh21 0618726202 ANSIfy while I'm here. 2001-03-04 15:40:17 +00:00
bjh21 496829a88b Make compat_13_sys_sigreturn() work on arm26, and move it from
arch/arm/arm32/compat_13_machdep.c to arch/arm/arm/compat_13_machdep.c.
2001-03-04 15:27:03 +00:00
bjh21 aa34be4532 Make "options ARMFPE" work again.
Mostly due to Richard Earnshaw.
2001-03-04 14:32:12 +00:00
bjh21 ab8e9aaefd Add CPU ID for ARM7500FE (determined empirically from two I've got here). 2001-03-04 14:26:26 +00:00
matt 93c0e77b0f Only define MACHINE & MACHINE_ARCH in port-dependent param.h.
Everything else (since it's common) is from <arm/arm32/param.h>
2001-03-04 08:28:51 +00:00
matt 58438fb425 Move compat_13_machdep.c, strstr.c, copystr.S, bcopyinout.S, and
bcopy_page.S to arm/arm32 and remove port-local copies.
2001-03-04 08:25:38 +00:00
matt 4679f9115c Convert some vm_size_t to vsize_t/psize_t. Change vaddr_t to paddr_t
where appropriate.
2001-03-04 07:30:19 +00:00
matt f97f725bc9 Remove OFW hooks. Allow ports to add there own hooks via
ARM_EXTRA_DB_COMMANDS.
2001-03-04 05:40:03 +00:00
matt 4a5fdbf390 disksubr*.c are now shared. Start moving files from ../../arm32/arm32 2001-03-04 05:17:41 +00:00
matt 8655276e9a Move these from arm32/arm32 2001-03-04 05:11:41 +00:00
matt 4e6f220e99 Move these from arm32/arm32 2001-03-04 05:08:43 +00:00
matt 7d33ba27bf Move from arm32/arm32. s/vm_offset_t/vaddr_t/g 2001-03-04 05:08:09 +00:00
matt 79efd2285e These are same between arm32 & arm26. 2001-03-04 05:06:51 +00:00
matt 6755bfc8c1 s/vm_offset_t/vaddr_t/g 2001-03-04 04:15:58 +00:00
matt 7af4578cfc s/vm_offset_t/vaddr_t/g 2001-03-04 03:40:58 +00:00
bjh21 40333cf8fd Kill cpu_host and cpu_flags: they weren't having any practical effect. 2001-03-03 21:34:00 +00:00
bjh21 c32dba2092 Remove support for /dev/cpu*. This code has never done anything useful anyway. 2001-03-03 18:04:34 +00:00
bjh21 2a91058dd3 Remove spurious declaration of initialise_fpe(). 2001-03-03 17:49:58 +00:00
bjh21 2029721f3f NCPU will always be 1 if this file is being compiled at all, so don't bother
checking it.
2001-03-03 17:46:31 +00:00