Commit Graph

445 Commits

Author SHA1 Message Date
scw 2f54b52eac Print a trap/intr frame's SPC value. 2003-11-09 12:22:15 +00:00
scw 89a3825de9 In scif_rxsoft, bail early if the input buffers have not been initialised yet.
This can happen if we drop into ddb on the serial console before
scif_attach() has been called.
2003-11-09 12:19:54 +00:00
dsl 2ffbd2ab99 Remove p_nras from struct proc - use LIST_EMPTY(&p->p_raslist) instead.
Remove p_raslock and rename p_lwplock p_lock (one lock is enough).
Simplify window test when adding a ras and correct test on VM_MAXUSER_ADDRESS.
Avoid unpredictable branch in i386 locore.S
(pad fields left in struct proc to avoid kernel bump)
2003-11-04 10:33:15 +00:00
jdolecek 3abecdb88d avoid stong words in comments 2003-11-01 17:35:42 +00:00
cl ef56cc40ab Reduce code duplication by adding mi_userret() in sys/userret.h
containing signal posting, kernel-exit handling and sa_upcall processing.

XXX the pc532, sparc, sparc64 and vax ports should have their
XXX userret() code rearranged to use this.
2003-10-31 16:44:34 +00:00
simonb 6d85c5e0d5 Don't pass the (unused) return value args to the
trace_enter()/systrace_enter() functions.
2003-10-31 03:28:12 +00:00
kleink a3fabb9e7f Use <sys/ieee754.h> where applicable. 2003-10-26 20:55:30 +00:00
fvdl a08babb013 NULL -> 0 for preempt() argument. 2003-10-21 00:49:34 +00:00
briggs 11088af0ac Add SIGTRAMP_VALID(). 2003-10-18 18:29:53 +00:00
jdolecek ef5bb330f5 reassing majors for crypto and pf to use the newly defined MI major
range
2003-10-10 22:42:39 +00:00
jdolecek 4e915c9ccd update the comment - the space for machine-dependant majors
is reduced to 0-143
follows discussion on tech-kern
2003-10-10 21:21:25 +00:00
thorpej 901da40cf9 Add some accessor macros for the ucontext:
* _UC_MACHINE_PC() - access the program counter
* _UC_MACHINE_INTRV() - access the integer return value register
* _UC_MACHINE_SET_PC() - set the program counter (this requires
  special handling on some platforms).
2003-10-08 22:43:01 +00:00
lukem 1c33b4e6a4 Overhaul MBR handling (part 1):
<sys/bootblock.h>:
    *	Added definitions for the Master Boot Record (MBR) used by
	a variety of systems (primarily i386), including the format
	of the BIOS Parameter Block (BPB).
	This information was cribbed from a variety of sources
	including <sys/disklabel_mbr.h> which this is a superset of.

	As part of this, some data structure elements and #defines
	were renamed to be more "namespace friendly" and consistent
	with other bootblocks and MBR documentation.
	Update all uses of the old names to the new names.

<sys/disklabel_mbr.h>:
    *	Deprecated in favor of <sys/bootblock.h> (the latter is more
	"host tool" friendly).

amd64 & i386:
    *	Renamed /usr/mdec/bootxx_dosfs to /usr/mdec/bootxx_msdos, to
	be consistent with the naming convention of the msdosfs tools.

    *	Removed /usr/mdec/bootxx_ufs, as it's equivalent to bootxx_ffsv1
	and it's confusing to have two functionally equivalent bootblocks,
	especially given that "ufs" has multiple meanings (it could be
	a synonym for "ffs", or the group of ffs/lfs/ext2fs file systems).

    *	Rework pbr.S (the first sector of bootxx_*):
	    +	Ensure that BPB (bytes 11..89) and the partition table
		(bytes 446..509) do not contain code.
	    +	Add support for booting from FAT partitions if BOOT_FROM_FAT
		is defined.  (Only set for bootxx_msdos).
	    +	Remove "dummy" partition 3; if people want to installboot(8)
		these to the start of the disk they can use fdisk(8) to
		create a real MBR partition table...
	    +	Compile with TERSE_ERROR so it fits because of the above.
		Whilst this is less user friendly, I feel it's important
		to have a valid partition table and BPB in the MBR/PBR.

    *	Renamed /usr/mdec/biosboot to /usr/mdec/boot, to be consistent
	with other platforms.

    *	Enable SUPPORT_DOSFS in /usr/mdec/boot (stage2), so that
    	we can boot off FAT partitions.

    *	Crank version of /usr/mdec/boot to 3.1, and fix some of the other
	entries in the version file.

installboot(8) (i386):
    *	Read the existing MBR of the filesystem and retain the BIOS
    	Parameter Block (BPB) in bytes 11..89 and the MBR partition
	table in bytes 446..509.  (Previously installboot(8) would
	trash those two sections of the MBR.)

mbrlabel(8):
    *	Use sys/lib/libkern/xlat_mbr_fstype.c instead of homegrown code
	to map the MBR partition type to the NetBSD disklabel type.


Test built "make release" for i386, and new bootblocks verified to work
(even off FAT!).
2003-10-08 04:25:43 +00:00
thorpej 68723a995b * Shuffle some data structures so, and add a flags word to ksiginfo_t.
Right now the only flag is used to indicate if a ksiginfo_t is a
  result of a trap.  Add a predicate macro to test for this flag.
* Add initialization macros for ksiginfo_t's.
* Add accssor macro for ksi_trap.  Expands to 0 if the ksiginfo_t was
  not the result of a trap.  This matches the sigcontext trapcode semantics.
* In kpsendsig(), use KSI_TRAP_P() to select the lwp that gets the signal.
  Inspired by Matthias Drochner's fix to kpsendsig(), but correctly handles
  the case of non-trap-generated signals that have a > 0 si_code.

This patch fixes a signal delivery problem with threaded programs noted by
Matthias Drochner on tech-kern.

As discussed on tech-kern.  Reviewed and OK's by Christos.
2003-10-08 00:28:40 +00:00
scw 486ed93284 Kernel bits for siginfo on sh5. 2003-10-05 09:57:47 +00:00
jdolecek e6286b949a Add some framework for MI assignment of device majors - add sys/dev/majors
which is automatically included during kernel config, and add comments
to individual machine-dependant majors.* files to assign new MI majors
in MI file.

Range 0-191 is reserved for machine-specific assignments, range
192+ are MI assignments.

Follows recent discussion on tech-kern@
2003-10-05 08:04:24 +00:00
nathanw 4d59420344 Move __cpu_simple_lock_t and __SIMPLELOCK_{UN,}LOCKED to machine/types.h
so that they can be used in a namespace-friendly way.
2003-09-26 22:45:41 +00:00
simonb 550b4bef88 Fix "constify sendsig/trapsignal" fallout for non-siginfo'd archs. Test
compiled on most architectures.
2003-09-26 12:02:55 +00:00
cl 4fb604b287 add MD part of SA/pthread pagefault handling on sh5 2003-09-18 22:40:04 +00:00
scw 6e67b64a47 Add support for non-executable mappings. 2003-09-08 08:01:52 +00:00
itojun 4440262659 create /dev/crypto 2003-08-22 05:06:22 +00:00
scw 10e88b305a copy{in,out} and kcopy should return success if 'len' is zero. 2003-08-12 13:51:52 +00:00
scw 8d5dbf5382 An FPUEXC leaves the PC pointing to the FP instruction
which caused the exception. To avoid an endless loop if
the user is ignoring or catching SIGFPE, adjust the saved
PC to skip over the offending instruction.

XXX: It's not clear that this is the correct behaviour,
XXX: but it's the only way to make sh5 pass the IEEEFP
XXX: regression tests in regress/lib/libc/ieeefp/except.
2003-08-12 13:50:23 +00:00
scw 927c51ccaf Explicitly declare some symbols used by db_stack_trace_print()
as functions so they can be picked up as such.
2003-08-10 22:24:50 +00:00
scw 27479ae035 64-bit db_addr_t makes life much easier now that ddb uses ksyms. 2003-08-10 22:22:31 +00:00
scw 7f2011899c In PIC_GET_GOT, use a local numeric label which is very unlikely to
clash with other labels in code which uses it.
2003-08-10 22:18:12 +00:00
agc aad01611e7 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22364, verified by myself.
2003-08-07 16:26:28 +00:00
itojun 3f14c71f75 reserve cdev major # for PF. ok'ed by technical-exec 2003-07-27 14:17:57 +00:00
thorpej 063033a023 Since everyone uses clock_subr.c (or should, if they don't currently),
list it in conf/files instead of in every port's files.*.
2003-07-27 01:17:37 +00:00
thorpej 96ea5b9ac4 Rename clock_rtc_config() to todr_attach(). 2003-07-18 21:41:22 +00:00
thorpej 91b8f572a8 Move the prototype of clock_rtc_config() into <dev/clock_subr.h>. 2003-07-18 19:20:55 +00:00
lukem ed51729135 __KERNEL_RCSID() 2003-07-15 02:54:31 +00:00
fvdl d5aece61d6 Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
2003-06-29 22:28:00 +00:00
darrenr 960df3c8d1 Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records.  The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
2003-06-28 14:20:43 +00:00
martin d505b18964 Make sure to include opt_foo.h if a defflag option FOO is used. 2003-06-23 11:00:59 +00:00
fvdl 7dd7f8baa2 Handle 64bit DMA addresses on PCI for platforms that can (currently only
enabled on amd64). Add a dmat64 field to various PCI attach structures,
and pass it down where needed. Implement a simple new function called
pci_dma64_available(pa) to test if 64bit DMA addresses may be used.
This returns 1 iff _PCI_HAVE_DMA64 is defined in <machine/pci_machdep.h>,
and there is more than 4G of memory.
2003-06-15 23:08:53 +00:00
scw 31a6b2aa80 Mask off the lowest two bits of the disassembly start address. This avoids
misaligned references caused by the SHmedia bit.
2003-05-17 09:31:33 +00:00
kleink 776138ea69 Rename <sys/float_ieee.h> to <sys/float_ieee754.h>, following libc's
convention for these.
2003-05-12 15:22:53 +00:00
thorpej 36da248c07 Back out the following chagne:
http://mail-index.netbsd.org/source-changes/2003/05/08/0068.html

There were some side-effects that I didn't anticipate, and fixing them
is proving to be more difficult than I thought, do just eject for now.
Maybe one day we can look at this again.

Fixes PR kern/21517.
2003-05-10 21:10:23 +00:00
thorpej b77900c3c2 Simplify the way the bounds of the managed kernel virtual address
space is advertised to UVM by making virtual_avail and virtual_end
first-class exported variables by UVM.  Machine-dependent code is
responsible for initializing them before main() is called.  Anything
that steals KVA must adjust these variables accordingly.

This reduces the number of instances of this info from 3 to 1, and
simplifies the pmap(9) interface by removing the pmap_virtual_space()
function call, and removing two arguments from pmap_steal_memory().

This also eliminates some kludges such as having to burn kernel_map
entries on space used by the kernel and stolen KVA.

This also eliminates use of VM_{MIN,MAX}_KERNEL_ADDRESS from MI code,
this giving MD code greater flexibility over the bounds of the managed
kernel virtual address space if a given port's specific platforms can
vary in this regard (this is especially true of the evb* ports).
2003-05-08 18:13:12 +00:00
wiz 1ffa7b76c4 DMA, not dma nor Dma. 2003-05-03 18:10:37 +00:00
scw 44d097926f Delete an obsolete comment; ddb(9) is very definately functional on SH5. 2003-04-29 17:07:56 +00:00
scw 8c5c893bf7 Add a BKPT_ADDR() macro which gives MD code a chance to munge a
breakpoint address before it's used. Currently a no-op on all but sh5.

This is useful on sh5, for example, to mask off the instruction
type encoding in the bottom two address bits, and makes it possible
to do "db> break $rXX" instead of manually munging the address.
2003-04-29 17:06:03 +00:00
bjh21 4be7a2dcf3 Add a new feature-test macro, _NETBSD_SOURCE. If this is defined
by the application, all NetBSD interfaces are made visible, even
if some other feature-test macro (like _POSIX_C_SOURCE) is defined.
<sys/featuretest.h> defined _NETBSD_SOURCE if none of _ANSI_SOURCE,
_POSIX_C_SOURCE and _XOPEN_SOURCE is defined, so as to preserve
existing behaviour.

This has two major advantages:
+ Programs that require non-POSIX facilities but define _POSIX_C_SOURCE
  can trivially be overruled by putting -D_NETBSD_SOURCE in their CFLAGS.
+ It makes most of the #ifs simpler, in that they're all now ORs of the
  various macros, rather than having checks for (!defined(_ANSI_SOURCE) ||
  !defined(_POSIX_C_SOURCE) || !defined(_XOPEN_SOURCE)) all over the place.

I've tried not to change the semantics of the headers in any case where
_NETBSD_SOURCE wasn't defined, but there were some places where the
current semantics were clearly mad, and retaining them was harder than
correcting them.  In particular, I've mostly normalised things so that
_ANSI_SOURCE gets you the smallest set of stuff, then _POSIX_C_SOURCE,
_XOPEN_SOURCE and _NETBSD_SOURCE in that order.

Tested by building for vax, encouraged by thorpej, and uncontested in
tech-userlevel for a week.
2003-04-28 23:16:11 +00:00
ragge 766d04f56a Add ksyms device major. 2003-04-25 21:10:46 +00:00
scw 9143cf9a96 If the RTC time is > 50 days out, don't use it at all, on the assumption
that there is no battery backup (as is the case on the Cayman).
2003-04-20 21:26:46 +00:00
christos a2dfb1b570 PR/3012: Greg A. Woods: Write all float.h files [except the vax of course]
in terms of float_ieee.h
2003-04-19 23:05:28 +00:00
scw 63deb1bd73 Cast __greg_t to/from caddr_t via intptr_t. 2003-04-18 21:07:35 +00:00
scw 9957a9bbe4 Now that UBC no longer creates writable virtual aliases (for PMAP_VIVT),
we no longer need to track mappings added by pmap_kenter_pa() for the
purpose of cache-alias detection.
2003-04-18 20:02:34 +00:00
scw f97e7c222f Need to bump uvmexp.intrs when taking a h/w interrupt. 2003-04-18 19:57:11 +00:00
nathanw ff28c51cc0 Make cpu_getmcontext() run the PC through ras_lookup() so that kernel
getcontext() plus userlevel setcontext() (as used in libpthread) respects
the atomicity of RAS regions.
2003-04-11 22:02:28 +00:00
thorpej cc2c493bc4 Use PAGE_SIZE rather than NBPG. 2003-04-02 07:35:54 +00:00
thorpej 86f35f803c Use PAGE_SIZE rather than NBPG. 2003-04-02 02:45:36 +00:00
thorpej 3c0e6f55e1 We use 4k pages on the sh5; make PAGE_SIZE, PAGE_SHIFT, and PAGE_MASK
comptile-time constants.
2003-04-02 02:44:06 +00:00
scw e7e825f881 Remove some obsolete checks for __GNUC__ < 3. 2003-04-01 10:27:17 +00:00
scw 99e0368bfe Add PMAP_CACHE_VIVT, since the I$ is virtually indexed/tagged. 2003-04-01 10:25:09 +00:00
scw a7bc0a349e Some tweaks to reduce the effect of rounding errors in tmu_microtime()
and the calculation of the delay() constant.
2003-04-01 10:23:30 +00:00
scw ec17fb4b99 Fix bus_space_read_region_N() to work as advertised. 2003-03-29 22:07:14 +00:00
scw ea960960c0 We need to preserve SSR/SPC when switching ASIDs as we could be called
while handling a TLB miss (via the pmap_pte_spill() function), in which
case SSR/SPC are live.
2003-03-28 09:48:07 +00:00
scw 7fdeb41460 Fix for previous: frob SR, not SSR. 2003-03-27 20:21:27 +00:00
scw 00c69643a2 Make sure the FPU is enabled if we're about to drop to ddb due to
some catastrophic problem.
2003-03-27 17:29:17 +00:00
scw e6b13790fa SH5 needs __HAVE_FUNCTION_DESCRIPTORS defined in order for ld.elf_so
to resolve SHmedia function pointers correctly.
2003-03-26 14:46:32 +00:00
scw eefd7219fd Sign-extend the return value, as required by the ABI.
While I'm here, simplify the asm operands/constraints.
2003-03-26 12:00:41 +00:00
scw 955a468334 Add PIC support. 2003-03-24 14:26:16 +00:00
scw 2e5c2cd2ae Define just one mcount for both 32 and 64-bit ABIs; there's really no
advantage in having two slightly different versions.
Also save/restore FP register parameters.
2003-03-24 14:24:38 +00:00
scw 28db85d8f6 Relax the initial user stack alignment from 16 to 8 bytes.
Add a workaround for what appears to be a bug in binutils whereby
the entry point of an SHmedia binary can sometimes specify
SHcompact code (LSB is clear).
2003-03-24 14:21:27 +00:00
scw 5d74e4ddb2 Now that we can deal with debug exceptions, use a BRK instruction for
ddb breakpoints instead of TRAPA in order to simplify the trapa (syscall)
handler.
2003-03-19 11:37:57 +00:00
scw 2bce28091c Fix some comments.
Set up stack frames in copyin/copyout and friends (if DDB is defined) so
that ddb stack traces can trace through them.
2003-03-19 11:34:28 +00:00
scw 7c18481cf2 G/C an obsolete comment. 2003-03-19 11:31:55 +00:00
scw bfca0494bd Try to configure all children of cprc0, not just clock. 2003-03-13 14:37:36 +00:00
scw d4f824014d A bunch of things:
- Clean up the way cpu-specific tlb/cache functions are configured
    and used.
  - Add a workaround for a problem whereby cpu* at superhyway? fails
    to probe.
  - Print more info about the cpu/cache.
  - Move the RESVEC handlers back into generic sh5 code and ditch
    the panic stack hack.
  - Make the on-chip SCIF device the default console on Cayman.
  - Add experimental support for booting via a standalone bootstrap
    program (not yet committed) and using the boot parameters passed
    in by it.
  - Add a few more SH elf constants.
  - Tick a couple of items off the TODO list.
2003-03-13 13:44:16 +00:00
scw 31b3a7c37f In scif_getc(), check SCIF_SCFSR2_RDF in addition to SCIF_SCFSR2_DR to
detect waiting Rx data. This fixes an occasional console lockup when
when pasting text at the ddb prompt.
2003-03-13 13:19:01 +00:00
tshiozak 31e2cbf0b5 add some ISO C 1995 I18N functions and types:
btowc, wctrans, towctrans, wcscoll, wcsxfrm, wctype_t and wctrans_t.
2003-03-02 22:18:11 +00:00
kent cd7d9faeaf Introduce BUS_DMA_NOCACHE, and bus_dmamem_map() of i386 supports it. 2003-01-28 01:07:51 +00:00
scw e212eb9e09 Fix pasto in last commit. 2003-01-22 13:46:44 +00:00
scw a4b020d99e In cpu_upcall(), validate the address of the upcall handler so as to
avoid a kernel-mode exception if restoring an invalid SPC.
2003-01-22 13:40:57 +00:00
scw 3b0144945a Fix a cpu_switchto() botch. 2003-01-22 13:38:51 +00:00
scw fe8c97c2e1 In _MCONTEXT_TO_SIGCONTEXT(), set r24 to the magic number expected
by sh5's sys___sigreturn14().
2003-01-22 13:38:11 +00:00
scw 1ec8a7e381 Add _UC_UCONTEXT_ALIGN. 2003-01-22 13:35:55 +00:00
scw 2dd1c1657f Add sigcontext/mcontext conversion macros. 2003-01-21 11:28:01 +00:00
scw a57f525335 Define {,UN}LINK_BIG_FRAME() macros for dealing with stackframes
greater than 511 bytes in size.
2003-01-21 11:27:18 +00:00
scw c3be47693c Use 'int' instead of 'u_int32_t' in a couple of places to avoid
depending on sys/types.h.
2003-01-21 11:26:04 +00:00
scw 0767992461 If we don't explicitly recognise the trap type, only panic if it
came from kernel mode. Otherwise, print details of the exception
and send a SIGILL to the process.

The is necessary now that debug exceptions are handled here.
2003-01-20 22:32:26 +00:00
scw def0257e54 Split struct reg into integer and FP parts, to be more like every other port.
As a side benefit, advertise PT_[GS]ETFPREGS.
2003-01-20 20:07:52 +00:00
scw c64b785002 Add sh5 kernel support for SAs.
This gets the Cayman to multi-user with a non-SA aware userland.
2003-01-19 19:49:47 +00:00
scw 8b92aecb3f Use the full 'sh5le-unknown-netbsd-' prefixed toolchain names, and
set optimisation to -O2 now that gcc seems to generate decent sh5 code.
2003-01-19 19:46:57 +00:00
wiz 1035faff1d writable, not writeable. 2003-01-06 20:30:28 +00:00
wiz c6f1277bfa synchronous, not syncronous. 2003-01-06 13:10:25 +00:00
thorpej dca15fc8c2 Use aprint_normal() for cfprint routines. 2003-01-01 02:10:08 +00:00
manu 4a06119a9d Pass the system call table to trace_enter() and ktrsys() so that it is
possible to use alternate system call tables. This is usefull for
displaying correctly the arguments in Mach binaries traces.

If NULL is given, then the regular systam call table for the process is used.
2002-12-21 16:23:56 +00:00
thorpej e8cc3884de Rename __LDPGSZ to AOUT_LDPGSZ, to accurately reflect what it is. 2002-12-10 17:14:02 +00:00
thorpej 78ea2dd367 Use __LDPGSZ (which must be == USRTEXT) as the text address for a.out
executables, and eliminate the USRTEXT constant, which was only used
by the a.out exec code.
2002-12-10 05:14:24 +00:00
scw d4cfbd3754 Implement __cpu_simple_lock{,init,try}() for sh5. 2002-12-07 22:31:33 +00:00
scw 50247a2a3c Fix PRIiPTR. 2002-12-07 21:37:35 +00:00
scw 57c2c2b87f Add a hack at the end of setregs() which works around a bug which can,
under some circumstances, leave turds in the icache following vmspace
teardown.

It's not yet clear if this is a pmap bug or a toolchain problem since
the hack is unecessary when the kernel is compiled with -O0. Of course
that could just be masking the problem due to increased icache pressure...
2002-12-06 10:22:15 +00:00
scw f051850107 Avoid strict-alias warnings. 2002-12-06 10:14:10 +00:00
scw 41085b101b fsina.s, fsrra.s and fcosa.s take single-precision operands, not double. 2002-12-06 10:12:13 +00:00
scw 87897c05fe Qualify ptel and tlbcookie fields with volatile since they are
modified by the TLB miss handler.
2002-12-06 10:10:48 +00:00
lukem 0635de35a3 Remove KDIR=, since SYS_INCLUDE=symlinks and KDIR are not supported any more. 2002-11-26 23:30:07 +00:00
scw 918d34d917 Quell an uninitialised variable warning. 2002-11-24 12:07:52 +00:00
scw 2fcea657de Implemented #2: Improved TLB management 2002-11-23 09:27:03 +00:00
scw a3885e9bdd - Change VM_MIN_KERNEL_ADDRESS to start at KSEG1 instead of KSEG0.
- Overhaul the TLB management code such that we now keep track of
   the exact TLB slot at which a mapping was inserted, both for user-
   space and kernel mappings. This addresses #2 on the TODO list.
2002-11-23 09:25:54 +00:00
scw dbaff62d21 Make this compile again. 2002-11-23 09:14:14 +00:00
manu d584ed9598 Add a realcode argument to trace_enter and ktrsyscall. realcode is the
original system call number, which can be negative for a Mach trap.
We cannot just replace code by realcode, because ktrsyscall uses it as
an index in the system call table, thus crashing the kernel when the
value is negative.
2002-11-15 20:06:00 +00:00
scw bc159224ed Missing newline. 2002-10-31 14:52:54 +00:00
scw 78aeffb90b Add an explicit ULL suffix to a 64-bit constant to appease gcc-current. 2002-10-31 14:52:30 +00:00
scw 3795c4e6f4 Since we keep a list of all mappings for a given physical page (even
unmanaged mappings) so we can deal with cache aliases, make sure to
skip unmanaged/wired mappings (added via pmap_kenter_pa()) when doing
things like pmap_page_protect().
2002-10-31 14:34:17 +00:00
scw 6a3f09110b Catch NMIs when DDB is defined, instead of DEBUG.
Drop the interrupt level to zero when before handling ASTs in the
exit path of h/w interrupts.
2002-10-31 14:24:16 +00:00
scw 8bf915f645 When setting the SP for a process, copy the same value to the
process' FP for the sake of consistency.
2002-10-31 14:20:39 +00:00
jdolecek c82ab2eb79 now that mem_no is emitted by config(8), there is no reason to keep
copy of more or less identical iskmemdev() for every arch; move the function
to spec_vnop.c, and g/c machine-dependant copies
2002-10-26 13:50:17 +00:00
scw b67ad48827 Put bit definitions for the FP control/status register in <sh5/fpu.h> and
use them instead of "magic" numbers in the source.
2002-10-24 13:58:48 +00:00
scw 511275734b Format string fixes. 2002-10-24 13:48:44 +00:00
scw b28965836d Tick off another item. 2002-10-23 13:37:05 +00:00
scw c774ffbae4 MD glue for COMPAT_NETBSD32 on SH-5. 2002-10-23 13:26:35 +00:00
scw 31397fedc3 Make the compile if PMAP_DIAG is not defined. 2002-10-23 13:24:28 +00:00
jdolecek e0cc03a09b merge kqueue branch into -current
kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
2002-10-23 09:10:23 +00:00
scw 949919c48e Tick off another item. 2002-10-22 13:11:06 +00:00
scw 2a52019c1e As per TODO item #13, clear the Referenced bit in the PTE after purging
a mapping from the TLB/cache to prevent duplicate purges for pages
which were not touched since the last purge.
2002-10-22 13:10:28 +00:00
scw 8496cdaeb7 - Fix REDUCE16 to ignore the upper 32-bits of the input operand.
- Shift a leading misaligned quad to compensate for the implicit shift
  in the "ldlo.q" instruction. (And remove the "XXX:" comment which correctly
  hinted that this might be necessary).
- Clean up some comments.
2002-10-22 12:22:43 +00:00
scw 6a2132797e - Simplify early initialisation so we do most of it in C.
- Call allocsys() much earlier so we can use uvm_pageboot_alloc() to
  steal KSEG0 pages for system tables.
2002-10-22 09:30:26 +00:00
scw b7d8acc608 In switch_exit(), load the SP and FP from proc0's PCB instead of using
a "null" stack.
Also be sure to clear curproc, and update curpcb.
2002-10-21 15:37:20 +00:00
scw 87df298d3e Unroll the zero/copy page loops to do 128 bytes per loop instead of 32,
paying particular attention to cache-lines and sets.
2002-10-19 13:18:55 +00:00
scw 28cf032416 If the incoming buffer is already quad aligned, skip the initial
alignment code. (There was nothing wrong with the original code path
other than it was slightly slower if the buffer was already aligned).

Also, catch another corner case related to alignment/length of the
last 1-7 bytes.
2002-10-19 13:17:33 +00:00
scw 7feac76e17 Tick off a few more items, and add a new one. 2002-10-19 11:13:11 +00:00
scw 873eee59ff Add fast assembler versions of in_cksum() and in4_cksum().
(Well, as fast as can be expected on a cpu with no carry flag)
2002-10-19 09:01:44 +00:00
scw 80b7fbca17 Ditch the crude and slow bytewise copyin()/copyout()/kcopy() code in favour
of the asm memcpy() in libkern.
2002-10-19 08:56:45 +00:00
scw 1e0542ac19 Fix a spurious looping PC/FP message when we stop due to not finding
the caller's stack frame.
2002-10-19 08:50:30 +00:00
scw c01b319dcc There seem to be some stability problems with the scif serial port driver
at the moment, possibly as a side-effect of some yet-to-be-committed SH5
speed-ups.

Work-around it for now by using com0 as the console.
2002-10-19 08:43:32 +00:00
scw a7be530a95 Add code to support tracing back through a stackframe which was created
using a "movi imm, Rn / sub R15, RN, R15" pair. This is how the compiler
creates frames which are too big to fit in the immediate field of "addi";
something which happens a lot with -O0 ...

While I'm here, add a simple heuristic to detect infinite loops caused by
tracing back through some non-leaf asm routines which don't set up frames.
2002-10-18 09:16:14 +00:00
scw fd0556a4dc Interrupt handles are now allocated from KSEG0. 2002-10-14 14:22:44 +00:00
scw 89612efe30 Interrupt overhaul:
- Allocate interrupt handles dynamically from a pool(9) to reduce the
   number of TLB misses during interrupt dispatch.
 - Fully support evcnt(9) in all interrupt dispatchers.
2002-10-14 14:19:27 +00:00
scw 041aef4bee Preparation for compat_netbsd32. 2002-10-14 14:13:27 +00:00
scw bd8765b9da Add a couple more items. 2002-10-14 10:52:41 +00:00
scw e52022da42 Mark a couple of items as done. 2002-10-14 09:48:20 +00:00
scw 278e4d7886 Quell an uninitialised variable warning. 2002-10-14 09:46:31 +00:00
scw 48d75c2893 Work around yet another compiler optimisation bug.
I don't even want to think about where else in the kernel
this one could bite...
2002-10-12 12:02:16 +00:00
scw 2991c538da Add support for Restartable Atomic Sequences.
XXX: ptrace(2) does not currently work on SH5, so there are no checks for
tracing through a RAS at this time.
2002-10-12 11:39:53 +00:00
scw 7135f0329f Fixes for LP64. 2002-10-10 09:47:17 +00:00
scw 58c1858c31 More fixes/tweaks:
- Use the PVO_CACHEABLE flag in the pvo as the One True Indicator of
   the cacheable status of a mapping instead of peeking at the PTEH.
 - Don't inline some of the larger routines, in an effort to appease
   the somewhat buggy compiler.
 - Fix some comments.
 - Fix some casts.
 - Add a bunch more debugging instrumentation.
2002-10-10 08:57:52 +00:00
scw bbb7b848b6 Don't try to trace back through proc_trampoline. 2002-10-10 08:53:22 +00:00
scw a3d166c50b - Add kcr0 and kcr1 to db_regs.
- Move usr, sr, pc, and the branch-target registers to the top of
   the listing so that it is no longer necessary to scroll through
   64 integer registers to see them.
2002-10-10 08:52:31 +00:00
scw 4401a03fd4 Tweak the "ffs" code in cpu_switch so we can ditch __HAVE_MD_RUNQUEUE. 2002-10-09 20:27:35 +00:00
scw 1d99b44e36 Adjust the size of intrcnt members to match sizeof(u_long). 2002-10-09 18:52:36 +00:00
scw 16c5b1b5a8 - g/c an accidentally committed debug hack
- use sh5_trunc_page() instead of masking with SH5_PTEH_EPN mask
  where appropriate. The latter is not safe in 64-bit mode.
2002-10-08 16:01:07 +00:00
scw ae8f4bf362 Fix tyop. 2002-10-08 15:59:32 +00:00
scw 71de7dd5e6 - Tweak the kernel's start address for 64-bit kernels.
- Use a local hacked-up-for-sh64 dbsym(8).
2002-10-08 15:59:11 +00:00
scw f30b5f8e54 Cast to caddr_t via intptr_t. 2002-10-08 15:56:13 +00:00
scw 2729bcfb69 - Use intrnames[] instead of rolling our own.
- Update intrcnt[level] in sh5_intr_dispatch().
2002-10-08 15:55:07 +00:00
scw e0248b775a intrnames has moved to board-specific code. 2002-10-08 15:53:04 +00:00
scw a5719508fe Get DB_ELFSIZE for 64-bit kernels. 2002-10-08 15:49:26 +00:00