Commit Graph

415 Commits

Author SHA1 Message Date
uch 57918e656a add kernel stack debug option. 2002-03-17 14:05:47 +00:00
uch 02add6730a reserve wired entries for kernel stack. 2002-03-17 14:04:18 +00:00
uch 3900e66164 add kernel stack and trapframe debug command. 2002-03-17 14:03:55 +00:00
uch 9e6153d985 remove obsoleted functions. 2002-03-17 14:03:34 +00:00
uch b4b9d38675 zero clear all TLB entry to avoid unexpected VPN match. 2002-03-17 14:03:09 +00:00
uch 1e6e3f896d write-through mode for now. since SH4 kernel access page table via P2. XXX 2002-03-17 14:02:43 +00:00
uch 4c6260b9de kernel stack fix. old code simply P3 address converted to P1, it
caused memory destruction when kernel stack grow over 1 page.  new
code use P3 address for kernel stack. but for the sake of debug, P1
kernel stack mode remain.
2002-03-17 14:02:03 +00:00
christos 640a59b952 catch-up with stackgap change. 2002-03-16 20:45:43 +00:00
chs 9fe7f9402f only comments may follow #endif on a line. 2002-03-16 05:27:53 +00:00
uch 9a0d81c6cc use IOM_RAM_BEGIN macro instead of ram_start. 2002-03-10 07:46:51 +00:00
uch 672baca18b proc0 and page table intialize routines are moved to sh3_machdep.c 2002-03-10 07:46:12 +00:00
uch f9201a1606 common part are moved to sh3/include/param.h 2002-03-10 07:45:31 +00:00
thorpej a180cee23b Pool deals fairly well with physical memory shortage, but it doesn't
deal with shortages of the VM maps where the backing pages are mapped
(usually kmem_map).  Try to deal with this:

* Group all information about the backend allocator for a pool in a
  separate structure.  The pool references this structure, rather than
  the individual fields.
* Change the pool_init() API accordingly, and adjust all callers.
* Link all pools using the same backend allocator on a list.
* The backend allocator is responsible for waiting for physical memory
  to become available, but will still fail if it cannot callocate KVA
  space for the pages.  If this happens, carefully drain all pools using
  the same backend allocator, so that some KVA space can be freed.
* Change pool_reclaim() to indicate if it actually succeeded in freeing
  some pages, and use that information to make draining easier and more
  efficient.
* Get rid of PR_URGENT.  There was only one use of it, and it could be
  dealt with by the caller.

From art@openbsd.org.
2002-03-08 20:48:27 +00:00
uch dc55dc2c73 remove unneeded code and files. 2002-03-08 13:22:11 +00:00
uch babf2e5892 cpu_swapout() moved to cpu.h 2002-03-08 13:12:10 +00:00
thorpej 069a559c65 Remove some files that no longer exist. 2002-03-07 19:34:37 +00:00
tsutsui 3c8b0446fe Change type of dumpmag to u_int32_t since it is actually
a 32bit unsigned magic number.
As per discussion on tech-kern, and fixes port-sparc64/11949.
2002-03-06 13:10:18 +00:00
uch 2f603eaa17 CTL_MACHDEP definitions are integrated into sh3/include/cpu.h again. 2002-03-04 14:36:13 +00:00
simonb 6f0fb25121 Don't need to declare phys_map - it is declared in <uvm/uvm_extern.h>. 2002-03-04 02:43:22 +00:00
uch 08aefbe07d remove temporal debug code. 2002-03-03 14:32:21 +00:00
uch 90baa8b206 SR related parts moved to psl.h. cpufunc.h segments.h are removed.
kernel mode checking is only SR.MD. no check stack pointer.
2002-03-03 14:31:24 +00:00
uch 17fbf85dc3 machine dependent sysctl are moved to machine/cpu.h
dreamcast, hpcsh ... CPU_CONSDEV
	mmeye, evbsh3	 ... CPU_CONSDEV, CPU_LOADANDRESET
2002-03-03 14:28:48 +00:00
uch 6042c0a3fc Initial support for KGDB on the sh3. 2002-03-02 22:26:25 +00:00
uch 65af267aeb Add SH7709A INTEVT2 register define. 2002-03-02 22:25:19 +00:00
uch b94c8137ab cpu_reset:
Set EXPEVT to 0x20(manual reset) before jump to reset vector.
2002-02-28 18:18:51 +00:00
uch 9c21656766 cpu_dumpconf, reserve_dumppages, dumpsys, cpu_reset are moved to sh3/sh3_machdep.c 2002-02-28 16:54:28 +00:00
simonb 4324f37586 Use "#define<tab>". 2002-02-28 03:17:23 +00:00
uch 6ece4e10f0 Remove #if 0 #endif 2002-02-28 01:58:53 +00:00
uch bbc655c4fb Cleanup register definition 2002-02-28 01:56:57 +00:00
uch 40382c6556 Change foo_r0_r1 macro in sh3/locore.h to foo(Rn, Rm) 2002-02-28 01:53:42 +00:00
uch 06fbd079f5 Remove unneeded header. 2002-02-28 01:52:28 +00:00
christos e8116a8f5b - Use DEV_ constants, instead of documenting the numbers!
- Delete cdev_decl(mm); where appropriate, and other hand-crufting [hi powerpc!]
2002-02-27 01:20:51 +00:00
simonb d9ab16ba2f Purge CLSIZE, CLSIZELOG2 and MCLOFSET.
Be consistant in the way that MSIZE, MCLSHIFT, MCLBYTES and NMBCLUSTERS
  are defined.
Remove old VM constants from cesfic port.
Bump MSIZE to 256 on mipsco (the only one that wasn't already 256).
2002-02-26 15:13:19 +00:00
uch 31ae0ac1e9 clean up Makefiles 2002-02-24 20:10:53 +00:00
uch 6bda0e36c3 use sh_clock_get_pclock() instead of PCLOCK. 2002-02-24 19:35:42 +00:00
uch 3c3da7bf57 _start -> start. 2002-02-24 18:24:15 +00:00
uch 693be1956c Move common exception vector and scheduler code to
sh3/sh3/exception_vector.S and sh3/sh3/locore_subr.S. exception
vectors are installed by sh_cpu_init().  machine/locore.S contains
kernel entry, interrupt handler, and some MD code.
2002-02-24 18:19:40 +00:00
uch 72589177e0 remove obsolete file. 2002-02-24 18:13:06 +00:00
uch b1b1f1117b NetBSD/sh3 common part of clock routine. 2002-02-22 19:55:33 +00:00
uch f3b1882035 print MMU infomation. 2002-02-22 19:46:34 +00:00
uch f694c9fdd7 New NetBSD/sh3 clock framework.
+ hardclock source is moved from TMU1 to TMU0.
 + SH3/SH4 common kernel support.
 + PCLOCK estimation.
 + remove duplicated code.
2002-02-22 19:43:58 +00:00
uch 5f5cce9adc Clean up function declaration. 2002-02-19 17:22:34 +00:00
uch 1bdc7cc5ca Clean up functions
disable_intr, enable_intr, disable_interrupt, enable_interrupt,
disable_ext_intr, enable_ext_intr.
New functions:
for external interrupt:
_cpu_intr_suspend and _cpu_intr_resume.
for exception:
_cpu_exception_suspend and _cpu_exception_resume.
2002-02-19 17:21:18 +00:00
wiz 37e458fa45 strategy should have an 'r'. Inspired by similar change in OpenBSD. 2002-02-19 17:09:40 +00:00
simonb 2d8577fb83 Clean up some rampant code duplication wrt ieee number handling:
- Add alignment-safe double and float unions.
 - Use the above for the __infinity and __nan constants on all
   architectures that use the standard ieee754 representation of
   those constants.
 - Add a single copy of various ieee754 math functions (frexp, isinf,
   isnan, ldexp and modf) that had numerous duplicates among the
   arch-specific directories.
 - Use the above functions on all architectures where the generic C
   versions where used.  Architectures that had local assembly
   routines are untouched (for those functions only).
2002-02-19 13:08:12 +00:00
uch 6e0794b560 To determine CPU architecture and product, add cpu_arch and cpu_prduct variables.
these are initialized by sh_cpu_init()@sh3/sh3_machdep.c
(see sh3/include/cputypes.h for detail.)
add "options SH3" for SH3 kernel config file.
2002-02-17 20:59:33 +00:00
uch 14bcf8c92a add cache dump 2002-02-17 20:58:35 +00:00
uch a96c1d0e8f change register naming. 2002-02-17 20:58:02 +00:00
uch 70826aa2cd sh_cpu_init() is added. its initialize cache, MMU ops appropriately.
machine locore code call this at first.
2002-02-17 20:57:09 +00:00
uch 780de330ba Add new MMU API. for detail, see sh3/mmu.h's comment. 2002-02-17 20:55:50 +00:00
uch 779bf563f4 ANSIfy. remove #if 0 ... #endif. 2002-02-17 20:53:40 +00:00
chs b744097a5f allow writing to write-only mappings. fixes PR 3493. 2002-02-14 07:08:02 +00:00
uch b3f7b11fe7 ANSIfy KNF. 2002-02-12 15:26:45 +00:00
uch 7f6769e315 wrap #ifdef SH4 2002-02-11 18:55:16 +00:00
uch 9487e1d731 change PTE PG_* bit define to support SH4 PCMCIA space attribute fully.
for detail, see pte.h.
2002-02-11 18:06:06 +00:00
uch 32f2c6e61f clean up redundant PTE PG_* defines.
PG_RO     -> PG_KR
PG_RW     -> PG_KW
PG_u      -> PG_URKR
PG_PROT   -> PG_UW
PG_AVAIL1 -> PG_PVLIST
2002-02-11 18:05:17 +00:00
uch 6a86080d84 add useful macro for running P2, P1 area. 2002-02-11 18:04:24 +00:00
uch de4d07e475 add defines 2002-02-11 18:03:48 +00:00
uch e63a9777b2 add new cache routine. 2002-02-11 18:03:05 +00:00
uch 03487ed5cb machine tlb command print PFN with AREA number. 2002-02-11 17:50:17 +00:00
uch b3308f4d3d TLB dump command added to DDB 2002-02-08 06:12:00 +00:00
uch da20ab3589 add SH3/SH4 namespace free defines. 2002-02-08 06:11:38 +00:00
uch 66510b76a9 add SH-internal memory mapped register access method. 2002-02-08 06:11:16 +00:00
thorpej 462fa41153 * Make this lint'able.
* Reduce some code duplication.
2002-02-04 08:34:27 +00:00
thorpej 87c05210dd Fix for ELF + __NO_LEADING_UNDERSCORES__. 2002-02-04 08:33:34 +00:00
thorpej 74cd9f1058 In setregs(), pass PS_STRINGS in r9. 2002-02-03 22:28:09 +00:00
uch 4202622d3c if PCLOCK isn't setted, use estimated value calculated by kernel. 2002-02-01 17:52:54 +00:00
thorpej ed0b3a0857 Add SuperH ELF header flags. 2002-01-29 01:42:57 +00:00
thorpej e46bcf64ee Add SuperH relocation types. 2002-01-29 01:35:36 +00:00
chs 9451559ef4 pmap_page_protect(VM_PROT_NONE) must remove all mappings in the PV list,
even if they are wired.  we need to be able to remove all mappings to
pages that are being freed due to (eg.) file truncation.
2002-01-02 00:51:33 +00:00
thorpej 3bce84cf10 Consider __NO_LEADING_UNDERSCORES__ provided by the new ELF toolchain. 2001-12-16 18:11:12 +00:00
soren 875bff0962 To make dev/pcmcia work on platforms with 64-bit bus_addr_t and
32-bit bus_size_t (sparc), change the pcmcia_mem_map(9) offsetp
argument to bus_size_t as it is used as a bus_space offset.
2001-12-15 13:23:20 +00:00
thorpej f77397d481 Use __sh__ instead of __sh3__. 2001-12-14 23:30:02 +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
lukem 0fa231134c - replace "defopt" with "defparam" for options which must take a value,
as config(8) will warn for value-less defparam options
- minor whitespace/formatting cleanup
- consolidate opt_tcp_recvspace.h and opt_tcp_sendspace.h into opt_tcp_space.h
2001-11-20 14:34:18 +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
soren 662f877587 MAXSLP is defined to be a machine-independent scheduling parameter,
so move it into sys/param.h.
2001-11-15 18:06:11 +00:00
chs a69c43b997 fix pmap_extract() to handle addresses with a PTP but an invalid PTE. 2001-11-15 05:16:41 +00:00
thorpej e8ee04475d - Add a new vnode flag VEXECMAP, which indicates that a vnode has
executable mappings.  Stop overloading VTEXT for this purpose (VTEXT
  also has another meaning).
- Rename vn_marktext() to vn_markexec(), and use it when executable
  mappings of a vnode are established.
- In places where we want to set VTEXT, set it in v_flag directly, rather
  than making a function call to do this (it no longer makes sense to
  use a function call, since we no longer overload VTEXT with VEXECMAP's
  meaning).

VEXECMAP suggested by Chuq Silvers.
2001-10-30 15:32:01 +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
msaitoh 61b54edfd4 s/BYTE_ORDER/_BYTE_ORDER/g 2001-10-16 02:07:46 +00:00
chs 80373b7e54 don't depend on other headers to include sys/proc.h for us. 2001-09-28 11:59:51 +00:00
chs 1dcb706816 fix type-o. 2001-09-21 02:36:47 +00:00
chs b1ac97973c Fix kern/13049: missing unlock on failure exit from pmap_enter() 2001-09-19 07:54:48 +00:00
wiz 55fbb5ff57 Grammar improvements in comments. 2001-09-16 16:40:44 +00:00
wiz 456dff6cb8 Spell 'occurred' with two 'r's. 2001-09-16 16:34:23 +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
msaitoh 9cd1fceecc remove obsolete file 2001-09-14 11:39:39 +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
msaitoh 78db8b9715 add missing check for framing error 2001-09-10 08:50:33 +00:00
msaitoh d3e7333a60 s/cpu_startup/sh3_startup/g in panic messages 2001-09-01 03:02:31 +00:00
chs 9e8e4c5bdc I was wrong, sh4 does have a VAC.
change vmapbuf()/vmunmapbuf() back to using pmap_enter()/pmap_remove().
2001-08-19 20:44:41 +00:00
chs dd3f84513a typo in previous. 2001-08-19 17:45:15 +00:00
chs 17d06a7ad7 use pmap_k* in vmapbuf() and vunmapbuf() since there's no VAC on this platform.
in vunmapbuf(), call pmap_*remove() explicitly since uvm_km_free_wakeup()
will soon no longer do it for us.
2001-08-19 17:37:35 +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
msaitoh dfc4520de8 G.C. 2001-08-10 18:57:25 +00:00
msaitoh 6096cc20fb byebye 2001-08-10 18:55:08 +00:00