Commit Graph

434 Commits

Author SHA1 Message Date
uch
95f0d5c680 add RTC control register 1 defines. 2001-04-22 16:50:17 +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
15f731ee94 pmap_update() should not be equated with "flush entire TLB", it is
used to process deferred pmap operations.  Since these pmaps don't
defer anything, pmap_update() is a noop.
2001-04-21 17:25:01 +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
marcus
b6c1c5d49a Altentries should also be marked as functions, to keep linker happy. 2001-04-09 20:31:20 +00:00
marcus
e0d02d24d5 Mark syscalls as functions. 2001-04-09 15:52:59 +00:00
marcus
0640ad6ace When the endians are little, they are little. 2001-03-29 03:23:33 +00:00
matt
f283c0a504 Use ${THISSH3} instead of ../.. ; not everyone builds in ../compile/FOO 2001-03-24 18:26:11 +00:00
chs
e47583af2c missed some KERN_FAILUREs. 2001-03-18 23:43:53 +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
itohy
7ffa2a0375 Add RTC_OFFSET support to inittodr() on dreamcast.
No changes to other sh ports.
2001-03-07 00:47:22 +00:00
thorpej
51aeeceeaf Clean up TLB trap handling a little.
- When printing a user trap, include p->p_comm in the message.
- In the TLB fault handler, don't just go charging along if
  the fault can't be handled.  If we get a fatal kernel TLB
  fault, we need to panic!  Or, if DDB is enabled, call the
  Debugger().
2001-03-06 21:58:23 +00:00
msaitoh
0aa1f3d01e modify target name because we can't recommend to use pkgsrc/cross
(though I'm not the person who did such BAD modification)
2001-02-27 14:05:53 +00:00
msaitoh
bba3f2423b add comment about $CPP
From source:

# XXX following definition is absolutely incorrect.
# Our cpp is not /usr/libexec/cpp but /usr/bin/cpp.
# True solution is:
#	1) copy /usr/bin/cpp into /usr/local/bin/sh-*-*-cpp
#	2) Edit CPP in sh-*-*-cpp correctly
#		(e.g. "CPP=`$CC -print-prog-name=cpp`").
#	3) Edit STDINCDIR in sh-*-*-cpp correctly
#		(e.g. STDINCDIR=/usr/local/sh-unknown-netbsdcoff/include)

# BROKEN
CPP=`$TARGET-gcc -print-prog-name=cpp`

# EXAMPLE
#CPP=/usr/local/bin/sh-unknown-netbsdcoff-cpp
#CPP=/usr/local/bin/sh-unknown-netbsdelf-cpp
2001-02-26 08:46:15 +00:00
msaitoh
6c4c53a461 add "MACHINE_CPU=sh3" 2001-02-26 08:24:20 +00:00
msaitoh
bc759e0d8d check __LEADING_UNDERSCORE 2001-02-25 19:15:04 +00:00
msaitoh
526ce203e7 check __LEADING_UNDERSCORE instead of __sh3__ 2001-02-25 15:49:58 +00:00
uch
e0a4623854 move disksubr.c define to machine-port. 2001-02-21 16:42:04 +00:00
uch
8ce0133cc8 add SH7709/SH7709A I/O port register define 2001-02-21 14:49:53 +00:00
msaitoh
c090c1cfe5 temporary fix a serious pmap problem with dummy PMAP_{MAP,UNMAP}_POOLPAGE().
To fix correctly, set IOM_RAM_BEGIN with P0 addr instead of P1 addr and
fix machdep.c and pmap.c.
2001-02-19 17:51:22 +00:00
msaitoh
2633a5dcb5 _C_LABEL() 2001-02-14 17:57:31 +00:00
uch
78af56fcfd move VM_PHYSSEG_MAX, VM_NFREELIST, VM_FREELIST_DEFAULT defines to
machine/vmparam.h
2001-02-07 14:53:09 +00:00
uch
6a7b420b7e move machine-port specific file to machine directory.
for evbsh3, mmeye and dreamcast, use MI md_root.c
2001-02-06 16:45:19 +00:00
thorpej
c8cdb12913 Add some comments about P/USEG 2001-02-02 18:25:04 +00:00
thorpej
ef2315d256 Rewrite how mod/ref emulation is done. In particular, make
modified attribute checking actually work.  Previously, a
page could be reported as modified even if it wasn't!  This
is very bad, and e.g. caused the VM system to attempt to
"clean" pages of read-only files.

Only lip-services is paid to referenced attribute emulation.
This could be improved.
2001-02-02 02:28:18 +00:00
msaitoh
61831529f2 add some macros for 8bit PCMCIA access 2001-01-30 04:15:10 +00:00
tsubai
9b4793fd1b #ifdef DREAMCAST --> #ifdef dreamcast. 2001-01-22 08:23:58 +00:00
tsubai
4791d269ec -Dsh3 --> -D${TARGET_MACHINE}. 2001-01-22 08:22:15 +00:00
tsubai
ffb8bbbb30 #ifdef sh3 --> #ifdef __sh3__. 2001-01-22 08:18:06 +00:00
itojun
f92ee7af5c sync indent. 2001-01-22 07:04:10 +00:00
marcus
aa94cdc6ad Oops. Left a debug printout in there... 2001-01-21 23:53:09 +00:00
jdolecek
d5d431e8ae make db_[e]regs[] const 2001-01-18 10:54:27 +00:00
itojun
f79137a3f1 it looks that gas configured for little endian output runs as
big endian assembler, sometimes.  explicitly have -little to specify
little endian output.
2001-01-17 06:03:54 +00:00
itojun
ef1a3ce53b the kernel for SH3-based WinCE machines (little endian), by uch.
MACHINE=hpcsh, MACHINE_CPU=sh3el.

bootloader: ftp://f77.nop.or.jp/users/uch/hpcboot/
original patch: ftp://f77.nop.or.jp/users/uch/hpcsh/

sys/sh3/sh3/md_root.c: add #ifdef MEMORY_DISK_DYNAMIC
2001-01-17 05:21:47 +00:00
itojun
d8ba6d06be procfs_machdep is per port (not per CPU). 2001-01-17 00:44:33 +00:00
fvdl
c7f1462f3e Add machdep file for procfs. Currently only used for linux-style
/proc/cpuinfo (only active when procfs is mounted with -o linux).
For ports other than the i386 this currently produces an empty
string.
2001-01-17 00:07:18 +00:00
marcus
bc9ea0aebd Dreamcast uses a different realtime clock than the builtin RTC. 2001-01-16 00:34:44 +00:00
thorpej
45de366b2e Rename __GENERIC_SOFT_INTERRUPTS to __HAVE_GENERIC_SOFT_INTERRUPTS,
and place the definition in <machine/types.h>.  This can now be used
as a flag to indicate whether or not <machine/intr.h> can be included
to get the generic soft interrupt API.
2001-01-14 23:50:28 +00:00
thorpej
a3ec356d52 splimp() -> splvm() 2001-01-14 03:22:04 +00:00
thorpej
d85a75f583 Make sure everybody has an splvm() and equate it with splimp() (splimp()
is the historical name for this interrupt level, and the historical name
is going to go away in the near future).
2001-01-14 02:00:37 +00:00
itojun
6378ac40ee pass the right $CPP 2001-01-09 02:31:37 +00:00
itojun
828bec041b committed local change by mistake :-) 2001-01-04 09:49:29 +00:00
itojun
a8507fa1e7 pkgsrc/cross/sh-* do not supply cpp 2001-01-04 08:55:08 +00:00
itojun
26b1bcce00 cc -v is too verbose 2001-01-04 08:39:53 +00:00
itojun
a629edfcca use -O1 for now, -O2 dies 2001-01-04 07:55:32 +00:00
itojun
da0e17f08c fix pathname to meet pkgsrc/cross/sh* 2001-01-04 07:51:50 +00:00
itojun
8a58f991f6 content were mixed up 2001-01-04 07:50:23 +00:00
itojun
156bea1018 nuke obsolete Makefile templates.
split build-sh3 into two, for sh3e[bl].
2001-01-04 07:09:47 +00:00
itojun
1e7e3274f4 split MACHINE_ARCH sh3e[lb]. userland build still needs checking. 2001-01-04 07:03:21 +00:00
itojun
10e1d3091a share sys/arch/sh3/conf/Makefile.sh3 across sh3-based architectures.
cleanup param.h a bit.
2001-01-03 18:14:44 +00:00
takemura
c5fd828440 replace 'long long' with int64_t to compile stand alone program with
compiler other than GCC.
2001-01-03 10:08:55 +00:00
itojun
efa2b7073c make mbstate_t bigger (32 -> 128 bytes).
XXX if you have libc after citrus locale import, please recompile libc,
and your applications that use mbstate_t (rather rare).  really sorry
for the mess.
2000-12-26 10:35:28 +00:00
jdolecek
e9e91a0fb5 split off thread specific stuff from struct sigacts to struct sigctx, leaving
only signal handler array sharable between threads
move other random signal stuff from struct proc to struct sigctx

This addresses kern/10981 by Matthew Orgass.
2000-12-22 22:58:52 +00:00
itojun
823498203f populate _BSD_MBSTATE_T_. add warning regarding to rune_t. 2000-12-21 06:03:47 +00:00
jdolecek
cacec11253 delete obsolete comment 2000-12-17 15:52:39 +00:00
tsubai
0763c14571 Make this compile again. 2000-12-15 01:16:48 +00:00
marcus
724713366e Made weak_alias create correct labels on sh-elf. 2000-12-14 18:47:30 +00:00
msaitoh
007d059977 - fix \n conversion from \n\r to \r\n
- cleanup
2000-11-22 21:14:25 +00:00
msaitoh
d077acc4e9 const struct sysent 2000-11-22 21:12:28 +00:00
chs
c62d17a551 rationalize the use of b_flags for geteblk() buffers.
rather than assigning to the whole field, set or clear individual flags,
which implies that the B_BUSY and B_INVAL flags will remain set.
this allows us to make the assertion in brelse() that B_BUSY is set,
which is the purpose of all this.
2000-11-20 08:24:08 +00:00
msaitoh
3ba9161ab2 check whether SH4_PCMCIA is defined or not.
fixes PR. 11441.
2000-11-08 01:03:03 +00:00
msaitoh
d254039699 Add support stacktrace when a function contains "mov #n,r3; sub r3,r15" 2000-11-02 13:08:25 +00:00
eeh
8c3f6a0d10 Adapt to new line discipline scheme. 2000-11-02 00:37:56 +00:00
msaitoh
d191cbf210 add interrupt mode into wdog
To use:

	ioctl(fd, SIOWDOGSETMODE, &val)

	val:	WDOGM_RESET	-> reset when counter expired
		WDOGM_INTR	-> print PC when counter expired (new!)

This interface is still under experimental.
2000-10-31 02:04:12 +00:00
msaitoh
13bed0a344 - fix error handing in getc.
Now we can handle BREAK signal and framing error correctly.

- cleanup.
2000-10-31 01:08:41 +00:00
is
126ba78048 We do wired page accounting. Tell UVM about this. 2000-09-28 14:03:38 +00:00
thorpej
72a24b4eae Add an align argument to uvm_map() and some callers of that
routine.  Works similarly fto pmap_prefer(), but allows callers
to specify a minimum power-of-two alignment of the region.
How we ever got along without this for so long is beyond me.
2000-09-13 15:00:15 +00:00
msaitoh
2b1674cc62 remove extra #endif 2000-09-08 19:52:13 +00:00
msaitoh
2cb1f4181a sync with i386's revision 1.133:
It's legal to mmap pages in the lower part of the stack (<limit),
	and use them, so allow this by relaxing the check for it.
2000-09-08 19:48:12 +00:00
msaitoh
772c846544 delete an obsolete comment. 2000-09-08 18:46:39 +00:00
tsubai
9fdd44d404 DDB single step and stack trace support. 2000-09-08 10:15:23 +00:00
tsubai
d0078c839c Add breakpoint(). 2000-09-06 11:25:13 +00:00
tsubai
96f1451685 Downcase mnemonics. 2000-09-04 23:18:36 +00:00
tsubai
600169a9a3 Make this (at least) compile on sh3. 2000-09-04 23:11:42 +00:00
tsubai
bf4246e37a Disassembly support in DDB. 2000-09-04 23:02:42 +00:00
tsubai
cdbe0b9ec9 Add DDB hook. 2000-09-04 22:44:18 +00:00
tsubai
5f39c378a3 Correct label_t size. 2000-09-04 22:18:43 +00:00
msaitoh
8d1b1036ff - move MMUCR_VALIDBITS definition into mmureg.h.
- access correct address in cacheflush().
2000-09-04 05:48:35 +00:00
msaitoh
e44c80532c sh3 disassembler written by Akinori Koketsu. 2000-09-01 22:25:36 +00:00
tsubai
a964ecd1a9 Correct iosize. 2000-09-01 10:43:33 +00:00
tsubai
c6615ed380 Initialize pv_head locks. 2000-08-30 09:55:28 +00:00
thorpej
4db6fc7542 Make need_resched() take a "struct cpu_info *" argument. This
causes gives a primitive form of processor affinity.  Its use in
roundrobin() still needs some work.
2000-08-25 01:04:06 +00:00
thorpej
58e7a6954b Add spllock(). See spl(9) for details. 2000-08-22 19:46:26 +00:00
tsubai
f406aae2d2 MD part of mcount. 2000-08-22 11:25:49 +00:00
thorpej
23a7f255d4 Make sure we provide splsched() as described in spl(9). 2000-08-21 02:06:31 +00:00
msaitoh
7369c6d979 add an INTEVT code for WDT 2000-08-17 00:01:53 +00:00
msaitoh
90f4e30815 2nd argument of SYS___syscall(code, ...) is quad alignmented.
On little endian mode, 1st argument is not r5 but r4.
2000-08-09 22:11:17 +00:00
tv
8df356a34f %r, %n -> db_format_radix() 2000-08-09 20:09:25 +00:00
tshiozak
51a53de0d5 Preparation for the future introduction of multibyte locale.
- MB_LEN_MAX is increased to 32.
 - To ensure binary compatibility for old executables
   under multibyte locale, versioned setlocale is added.
 - __mb_len_cur definision is added in setlocale.c
   and enable it in stdlib.h .
   It is also important for multibyte locale stuffs,
   but I just forgot.
2000-08-08 22:31:13 +00:00
msaitoh
e049977033 check _BYTE_ORDER instead of BYTE_ORDER 2000-08-02 11:32:41 +00:00
msaitoh
dafe13f724 callout()->callout_reset() 2000-07-11 18:46:22 +00:00
msaitoh
7f0eba7ad8 make spllower() return void. 2000-07-06 04:31:04 +00:00
itojun
d738f90fd7 raise MSIZE from 128 to 256.
- for sizeof(void *) == 8 arch, this is mandatory.  MHLEN is too small
  already (less than 80) and there are chances for unwanted packet loss due
  to m_pullup restriction.
- for other cases, the change should avoid allocating clusters in most cases
  (even when you have IPv4 IPsec tunnel, or IPv6 with moderate amount of
  extension header)

portmasters: if your arch chokes with the change (high memory usage or
whatever), please backout the change for your arch.
2000-06-30 17:55:11 +00:00
mrg
fa00dc597a remove include of <vm/vm.h>. <vm/vm.h> -> <uvm/uvm_extern.h> 2000-06-29 07:44:02 +00:00
kleink
bb2ed0f487 G/c _BSD_INTPTR_T_ and _BSD_UINTPTR_T_. 2000-06-27 05:53:22 +00:00
kleink
47b5c5e3b1 Resolve some formatting nits; add __intptr_t and __uintptr_t. 2000-06-27 04:58:51 +00:00
kleink
e695f72a2e Add <machine/int_types.h>, which provides namespace-pure definitions
of exact-width integer types.
2000-06-26 15:42:16 +00:00
mrg
2f159a1bac remove/move more mach vm header files:
<vm/pglist.h> -> <uvm/uvm_pglist.h>
	<vm/vm_inherit.h> -> <uvm/uvm_inherit.h>
	<vm/vm_kern.h> -> into <uvm/uvm_extern.h>
	<vm/vm_object.h> -> nothing
	<vm/vm_pager.h> -> into <uvm/uvm_pager.h>

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.
2000-06-26 14:20:25 +00:00
simonb
889c658b5b Change the kernel mmap interface so that the offset to map is an
"off_t" and the return value is a "paddr_t" to allow mappings
at offsets past 2^31 bytes.  Somewhat inspired by FreeBSD, which
only changed the offset to a "vm_offset_t".

Includes updates for the i386, pc532 and sh3 mmmmap from Jason Thorpe.
2000-06-26 04:55:19 +00:00
kleink
133ea38323 Add a WEAK_ALIAS() macro. 2000-06-23 12:18:45 +00:00
fvdl
1ee7d22c0b Remove prefix construction for softdeps. Add SOFTDEP option to GENERIC. 2000-06-22 20:27:49 +00:00
msaitoh
03cf0ea64a clear ORER, FER and PER bit of the SCSSR reg.
(This bits aren't cleared automatically)
2000-06-19 09:32:00 +00:00
msaitoh
4d2677e3a0 clear the ER bit of the SCSSR2 reg.
(This bit isn't cleared automatically)
2000-06-19 09:30:35 +00:00
tsubai
5afb55f9cd child_return() should take void *arg. 2000-06-07 11:34:17 +00:00
tsubai
bebb7b9aee Remove child_return prototype; it is now in sys/proc.h. 2000-06-07 11:23:17 +00:00
soren
a9aa2abf94 defopt SYSCALL_DEBUG. 2000-06-06 18:52:30 +00:00
mycroft
e9deffe0bf Move a bunch of the COFF definitions into exec_coff.h, so they can be used by
other code.   XXX Not tested on SH3 yet.
2000-06-04 16:23:59 +00:00
thorpej
7a5ce477cb When allocating new PT pages during early bootstrap (i.e. before
pmap_init() has finished), make sure to zero them.
2000-06-02 17:46:37 +00:00
matt
33763f10cf Fix a missing cases of devpp -> booted_device, partp -> booted_parition 2000-06-01 17:42:59 +00:00
matt
9169d99f2a Don't pass booted_* to findroot/getdevice, access them via the globals.
Also, make findroot static.  This eliminates unneeded clearing of them
and make their use consistent among the ports.
2000-06-01 15:38:20 +00:00
matt
c9aff328d9 Make booted_device global (and booted_parition for consitency).
Eliminate it from header files and other extern definitions.
2000-06-01 00:49:49 +00:00
thorpej
e03e9e8086 Rather than starting init and creating kthreads by forking and then
doing a cpu_set_kpc(), just pass the entry point and argument all
the way down the fork path starting with fork1().  In order to
avoid special-casing the normal fork in every cpu_fork(), MI code
passes down child_return() and the child process pointer explicitly.

This fixes a race condition on multiprocessor systems; a CPU could
grab the newly created processes (which has been placed on a run queue)
before cpu_set_kpc() would be performed.
2000-05-28 05:48:59 +00:00
sommerfeld
40339b39f9 Reduce use of curproc in several places:
- Change ktrace interface to pass in the current process, rather than
p->p_tracep, since the various ktr* function need curproc anyway.

 - Add curproc as a parameter to mi_switch() since all callers had it
handy anyway.

 - Add a second proc argument for inferior() since callers all had
curproc handy.

Also, miscellaneous cleanups in ktrace:

 - ktrace now always uses file-based, rather than vnode-based I/O
(simplifies, increases type safety); eliminate KTRFLAG_FD & KTRFAC_FD.
Do non-blocking I/O, and yield a finite number of times when receiving
EWOULDBLOCK before giving up.

 - move code duplicated between sys_fktrace and sys_ktrace into ktrace_common.

 - simplify interface to ktrwrite()
2000-05-27 00:40:29 +00:00
thorpej
a7d0570e67 First sweep at scheduler state cleanup. Collect MI scheduler
state into global and per-CPU scheduler state:

	- Global state: sched_qs (run queues), sched_whichqs (bitmap
	  of non-empty run queues), sched_slpque (sleep queues).
	  NOTE: These may collectively move into a struct schedstate
	  at some point in the future.

	- Per-CPU state, struct schedstate_percpu: spc_runtime
	  (time process on this CPU started running), spc_flags
	  (replaces struct proc's p_schedflags), and
	  spc_curpriority (usrpri of processes on this CPU).

	- Every platform must now supply a struct cpu_info and
	  a curcpu() macro.  Simplify existing cpu_info declarations
	  where appropriate.

	- All references to per-CPU scheduler state now made through
	  curcpu().  NOTE: this will likely be adjusted in the future
	  after further changes to struct proc are made.

Tested on i386 and Alpha.  Changes are mostly mechanical, but apologies
in advance if it doesn't compile on a particular platform.
2000-05-26 21:19:19 +00:00
jhawk
8e44b27348 Rename the machine-specific stack trace printing functions
from db_stack_trace_cmd() to db_stack_trace_print(),
and add an additional argument, a function pointer for an
output routine (i.e. printf() or db_printf()).

Add db_stack_trace_cmd() in db_command.[ch], calling
db_stack_trace_print() with db_printf() as the printer.

Move count==-1 special handling from db_stack_trace_print() [nee
db_stack_trace_cmd()] to db_stack_trace_cmd() [nascent here].

Again, I'm unable to test compilation on all affected platforms,
so advance apologies for potential brokenness.
2000-05-26 03:34:24 +00:00
jhawk
f3528d725d Interface change: db_printsym() takes a third argument, pr, a function
pointer indicating how to print the symbol. This allows db_printsym()
to called in places where db_printf() is not an appropriate output
function.

While straightforward, apologies in advance if I've introduced any minor
syntax errors; I was unable to test compilation this on all the affected
platforms.
2000-05-25 19:57:30 +00:00
thorpej
1140468205 Use preempt(), not an open-coded equivalent (which won't be
equivalent for long).
2000-05-24 16:48:33 +00:00
msaitoh
a797322f08 supports single step! 2000-05-10 20:28:33 +00:00
hubertf
9f48bba3ae Add "install" target, so "make install" after building the kernel
does something useful.  The target can be redefined by putting a
install-kernel-${MACHINE_NAME} target that fits your needs into
/etc/mk.conf.
2000-05-09 00:56:21 +00:00
thorpej
6a33c86623 HAVE_GCC28 -> HAVE_EGCS, and make it match gcc 2.9 as well. Also,
make the use of -Wno-uninitialized explicit, don't rely on a compiler
hack to do it for us.
2000-05-09 00:32:19 +00:00
thorpej
855b79db92 Let each platform typedef the new __cpu_simple_lock_t, which should
be the most efficient type used for the atomic operations in the
simplelock structure, and should also be __volatile.
2000-05-02 04:41:04 +00:00
thorpej
f51470a514 Require that each each MACHINE/MACHINE_ARCH supply a lock.h. This file
contains the values __SIMPLELOCK_LOCKED and __SIMPLELOCK_UNLOCKED, which
replace the old SIMPLELOCK_LOCKED and SIMPLELOCK_UNLOCKED.  These files
are also required to supply inline functions __cpu_simple_lock(),
__cpu_simple_lock_try(), and __cpu_simple_unlock() if locking is to be
supported on that platform (i.e. if MULTIPROCESSOR is defined in the
_KERNEL case).  Change these functions to take an int * (&alp->lock_data)
rather than the struct simplelock * itself.

These changes make it possible for userland to use the locking primitives
by including <machine/lock.h>.
2000-04-29 03:31:45 +00:00
tsubai
1be338dabc GC VM_MBUF_SIZE. 2000-04-25 12:31:10 +00:00
tsubai
63fca4fecb Use P1SEG to map pool pages. 2000-04-25 12:17:06 +00:00
tsubai
88a555948c Sync with current i386 pmap.c. 2000-04-24 08:40:21 +00:00
msaitoh
e61941261f remove a debug log 2000-04-20 14:04:04 +00:00
msaitoh
25f1ebacc1 add a copyfault routine into the TLB miss handler 2000-04-20 14:02:41 +00:00
tsubai
8bd19349a1 Fill paa_busname field in pcmciabus_attach_args. 2000-04-20 11:51:27 +00:00
msaitoh
7e7033d239 Catch the breakpoint trap ("trapa #0xc3") and send SIGTRAP.
Now works breakpoint and continue!

TODO: single step
2000-04-13 23:00:42 +00:00
msaitoh
8796b43e1c remove sys_vtrace() 2000-04-13 15:54:27 +00:00
msaitoh
c750d5f42d - save/restore more registers in process_{read,write}_regs()
- return EINVAL in process_sstep (temporary)
2000-04-13 15:51:26 +00:00
msaitoh
9c13ab1d7c KNF 2000-04-13 15:45:11 +00:00
msaitoh
ca4ca0111c exports MACH and MACL registers, too. 2000-04-13 15:41:55 +00:00
msaitoh
9a41bed54e move the Interrput Priority Level (IPL_*) definitions into MD part. 2000-04-13 15:36:09 +00:00
chs
a6d33cc1f2 add a new function vn_marktext() for exec code to let others know
that the vnode is now being used as process text.
2000-04-11 04:37:47 +00:00
thorpej
d37f3bd4ee Use UVM_PGA_ZERO in pmap_alloc_ptp(). 2000-04-10 06:34:11 +00:00
jdolecek
cef3c93f82 Switch to MI ns_cksum.c - the MD ns_cksum.c is equivalent to it
(modulo some u_intX_t vs. u_char type usage). In particular, the
MD version didn't contain any MD code.
2000-04-06 13:37:49 +00:00
thorpej
2bc5adb20e Instead of checking vm_physmem[<physseg>].pgs to determine if
uvm_page_init() has completed, add a boolean uvm.page_init_done,
and test against that.  Use this same boolean (rather than
pmap_initialized) in pmap_growkernel() to determine if we are
being called via uvm_page_init() to grow the kernel address space.

This fixes a problem on some i386 configurations where pmap_init()
itself was needing to have the kernel page table grown, and since
pmap_initialized was not yet set to TRUE, pmap_growkernel() was
choosing the wrong code path.

Fix tested by Havard Eidnes.
2000-04-02 20:39:14 +00:00
minoura
78b105698a Move dl* function definitions to libc on ELF.
Based on the patch supplied by Takuya Shiozaki <tshiozak@astec.co.jp>.
See http://mail-index.netbsd.org/tech-userlevel/2000/02/23/0000.html.
2000-04-02 15:35:47 +00:00
msaitoh
35ba37f2f7 fix the sci[f]cninit() bugs to work both SCI and SCIF at the same time. 2000-03-27 16:24:08 +00:00
kleink
230876cf26 Merge parts of chs-ubc2 into the trunk:
* Remove the casts to vaddr_t from the round_page() and trunc_page() macros to
  make them type-generic, which is necessary i.e. to operate on file offsets
  without truncating them.
* In due course, cast pointer arguments to these macros to an appropriate
  integral type (paddr_t, vaddr_t).

Originally done by Chuck Silvers, updated by myself.
2000-03-26 20:42:21 +00:00
thorpej
7b918b4088 New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
  resource allocation.
- Insertion and removal of callouts is constant time, important as
  this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.
2000-03-23 06:40:33 +00:00
msaitoh
826aac6ff8 - Use macro
- RTCCNT is not 16000Hz but 16384Hz (not used)
- fix the bug in 16bit int <-> BCD conversion macro (SH4)
2000-03-20 20:44:32 +00:00
msaitoh
7052a2af38 Add the definitions of SH4's TPSC field of TCR register
(This field is not compatible with SH3's)
2000-03-20 20:36:58 +00:00
msaitoh
ff49b7006c move MMUCR register definitions into mmureg.h 2000-03-20 20:30:33 +00:00
tron
e86957458a Install "machineendian_machdep.h". 2000-03-17 22:36:31 +00:00
mycroft
9e21b6555a In the `MY THAT'S GROSS' department...
Eliminate the recursive include of machine/endian.h from sys/endian.h.
2000-03-17 00:09:18 +00:00
mycroft
02905321b2 Foolish consistency. Mainly, always use underscores and sys/endian.h. 2000-03-16 15:09:34 +00:00
kleink
ad7dbd825c Define ISO C99 (unsigned) long long (min, max) symbols. 2000-03-07 19:33:00 +00:00
msaitoh
6e7f2e9779 SH4! 2000-02-24 23:32:26 +00:00
msaitoh
da0ae51fcf variable start address of the main memory (now we can use
the area 2 as main memory with "options IOM_RAM_BEGIN=0x88000000")
2000-02-24 19:42:35 +00:00
msaitoh
7ae4a95c4d multiple interrputs!!! 2000-02-24 19:01:24 +00:00
msaitoh
3559e78ed2 include <machine/endian.h> 2000-02-24 17:19:57 +00:00
msaitoh
dddc24af60 G.C. 2000-02-24 17:18:30 +00:00
msaitoh
f51b1c6783 add RCSID and copyright 2000-02-24 17:10:16 +00:00
msaitoh
e2cc2d00d7 watchdog timer 2000-02-24 17:07:34 +00:00
msaitoh
0e12305a13 global variable declaration 2000-02-24 16:42:54 +00:00
msaitoh
e0c3daee1d remove PMAP_NEW 2000-02-23 21:14:12 +00:00
msaitoh
58369df4e9 Fix the bug which cause invalid slot exception under SH4.
This exception doesn't occurs under SH3
2000-02-22 02:17:05 +00:00
msaitoh
c02e68b1f5 calculate checksum correctly 2000-02-22 02:14:16 +00:00
msaitoh
c956cdcabe bugfixes:
o SCI accesses SCI registers (not SCIF) correctly
 o If there is serial inputs in boot time, it could hangup in interrupt routine
 o some cleanups(KNF)
2000-02-22 01:37:11 +00:00
thorpej
fd8c03cf44 Allow arch-specific code to specify in4_cksum() like it can specify
in_cksum().
2000-02-14 21:42:50 +00:00
thorpej
dded044fc2 Update for the NKMEMPAGES changes. 2000-02-11 19:25:12 +00:00
msaitoh
986d236119 remove COMPAT_NOMID stuff 2000-02-06 13:13:20 +00:00
kleink
36e6bc645e Improve namespace test macros a bit. 2000-02-05 14:04:36 +00:00
cgd
7d16ac338c add __BROKEN_CONFIG_UNIT_USAGE #define, becuase these ports do very
wrong things with device configuration data "cf_unit" information.
2000-02-05 00:13:22 +00:00
kleink
82464e46d6 Add a C99-style va_copy macro. 2000-02-03 16:16:06 +00:00
tsutsui
11c8f56d48 Revert STRIPPROG -> STRIP 2000-02-01 05:25:24 +00:00
tsutsui
b0fbaa33fb Remove obsoleted macros. 2000-01-26 09:44:10 +00:00
drochner
8eb798e603 define a "BUS_SPACE_MAP_PREFETCHABLE" flag which basically means that
device accesses are idempotent (but should not be cached by the CPU)
2000-01-25 22:13:17 +00:00
tron
04eb110431 Add "dependall" target for comfort. 2000-01-24 20:36:06 +00:00
sommerfeld
aa195e816f Fix PR9240: comment above cpu_fork() out of synch with reality on most ports.
(comment change only, but was wrong for more than just i386).
2000-01-20 22:18:54 +00:00
thorpej
a0397a2573 Move callout initialization to a single location; no need to duplicate
that code all over the place.
2000-01-19 20:05:30 +00:00
tsutsui
e61f177ab1 STRIP -> STRIPPROG 2000-01-19 16:29:54 +00:00
thorpej
4f27a98702 Use b_cylinder as defined in sys/buf.h 2000-01-18 19:48:02 +00:00
msaitoh
c330a893d5 - check whether tv_usec == 1000000, too.
- set the reload count of the timer unit 1 correctly
  (Timer unit counts from TCOR to 0 (i.e. the length of the counts equals
  to TCOR + 1)).
- use macros.
2000-01-17 21:54:32 +00:00
msaitoh
8cf5a56c3f add some bit definitions 2000-01-17 21:41:13 +00:00
kleink
6910891781 Add NAN constant glue for sh3. 2000-01-17 16:27:53 +00:00
msaitoh
150090f9b8 inittodr() and resettodr() supports SH4 2000-01-15 02:46:30 +00:00
msaitoh
5cb845afcd remove SH3_PHYS_TO_P1SEG macro 2000-01-14 21:02:40 +00:00
msaitoh
1e15a3117c use clock_subr.c 2000-01-14 19:41:36 +00:00
msaitoh
06c297195a in_cksum.c ->in_cksum.S 2000-01-14 19:20:32 +00:00
msaitoh
f485f2635c add SH3_{PHYS,P1SEG,P2SEG}_TO_{PHYS,P1SEG,P2SEG} macros 2000-01-14 19:09:35 +00:00
msaitoh
69fcc26071 write through bit (SH4) 2000-01-14 16:06:11 +00:00
msaitoh
2d4348b99d in_cksum.S (bi-endian) 2000-01-14 15:47:42 +00:00
msaitoh
80d920c3d0 block prototype definitions with _LOCORE (for .S) 2000-01-14 15:46:02 +00:00
msaitoh
ac8d6acaa7 add cpgreg.h and pfcreg.h for "make includes" 2000-01-14 13:58:06 +00:00
msaitoh
cf37b6ff3b KNF 2000-01-12 14:40:27 +00:00
msaitoh
08b1e4a63f enable cpu_coredump() 2000-01-07 12:01:00 +00:00
msaitoh
b3fa48ba9d implement send/recieve break signal routines 2000-01-07 10:50:14 +00:00
msaitoh
1020615169 use PSL_IMASK macro 2000-01-07 00:13:24 +00:00
msaitoh
518cfb0bde userret() if the user process will be killed.
Now the NetBSD/sh3 works very stable!
2000-01-03 02:55:25 +00:00
msaitoh
b75406e24f remove exec_coff.h 2000-01-02 13:40:55 +00:00
msaitoh
da3eeac505 EXEC_COFF cleanup 2000-01-02 13:39:49 +00:00
msaitoh
b682f09cbb fix missing SCI IRQ mask/unmask code. 1999-12-27 10:50:41 +00:00
msaitoh
1d5d46cad0 round_page(data_segment_size), too 1999-12-24 08:32:58 +00:00
msaitoh
05781b11af back to previous one (suggested by cgd) 1999-12-24 08:29:23 +00:00
msaitoh
8427734872 move sysctl definitions into ${MACHINE}/include/cpu.h 1999-12-21 22:19:16 +00:00
msaitoh
1e7bb23911 add some register definitions 1999-12-21 22:06:04 +00:00
msaitoh
79f94c37ab G.C. 1999-12-21 18:21:53 +00:00
msaitoh
45cbcdba34 round textsize only if the binary is demand-pagable
(for backward compatibility)
1999-12-17 08:25:35 +00:00
msaitoh
e7924755fa - round_page(ep_tsize). This fixes a bug which cause panic in pmap_enter_pv().
- DPRINTF cleanup.
1999-12-16 16:50:08 +00:00
msaitoh
650e62ebf5 demand paging for ZMAGIC SH COFF binary! 1999-12-09 08:33:15 +00:00
msaitoh
f7bd242b6f calculate microtime() correctly. 1999-12-08 20:39:45 +00:00
msaitoh
e7c433b9d5 fix copyinstr(9) bug (from Charles M. Hannum). 1999-12-08 17:12:21 +00:00
ragge
26e1b45757 clrnd()/clbase() discarding. 1999-12-05 11:56:30 +00:00
ragge
0513268399 CL* discarding. 1999-12-04 21:13:19 +00:00
fvdl
d116707af0 Add
prefix ../gnu/sys
cinclude "conf/files.softdep"
prefix

to all std.* files, so that soft dependencies can be activated using
"options SOFTDEP".
1999-11-15 19:00:25 +00:00
thorpej
1946167939 Update for pmap_enter() API change. No functional difference. 1999-11-13 00:30:26 +00:00
kleink
522cbf0248 Update to match new SVR4-style definition names in <sys/exec_elf.h>. 1999-10-25 13:55:06 +00:00
msaitoh
d478b71746 print a trap type in hexadecimal instead of decimal. 1999-10-21 22:50:53 +00:00
msaitoh
3c51010f6a - unset RS/CS flow control bit from default setting
- GC
1999-10-06 09:19:46 +00:00
msaitoh
2f74c366d0 Fix RWKREG register reset code in resettodr(). 1999-09-23 05:34:03 +00:00
tsubai
0afae6fc87 Move common parts of machdep.c to sh3_machdep.c. 1999-09-21 13:16:15 +00:00
thorpej
11cae42531 Centralize the declaration and clearing of `cold'. 1999-09-17 19:59:35 +00:00
msaitoh
adc175c443 check SCI(F)CONSOLE 1999-09-17 01:23:00 +00:00
msaitoh
f921a6e9c5 sync with tmureg.h 1999-09-16 21:17:46 +00:00
msaitoh
9211d6bed4 sync with sci*.h and tmureg.h 1999-09-16 21:17:26 +00:00
msaitoh
d9a70fd1dc cleanup 1999-09-16 21:15:36 +00:00
msaitoh
7977bd843d enclose tlbflush(), disable_intr() and enable_intr() with #ifder _KERNEL 1999-09-16 14:42:27 +00:00
msaitoh
224d34b5e1 remove sh3/include/mmeye.h 1999-09-16 13:32:24 +00:00
msaitoh
ffbd08b126 remove extra Id 1999-09-16 12:48:35 +00:00
msaitoh
814f6b8936 add NetBSD RCS ID 1999-09-16 12:48:06 +00:00
thorpej
3b01d1b872 Rename the machine-dependent autoconfiguration entry point `cpu_configure()',
and rename config_init() to configure() and call cpu_configure() from there.
1999-09-15 18:10:33 +00:00
tsubai
40905bd3ec Catch up with -current. 1999-09-14 10:22:34 +00:00
msaitoh
427928b3a1 add some comments. 1999-09-13 19:13:09 +00:00
msaitoh
ac3fe6d372 remove mainbus pseudo floppy drive 1999-09-13 16:26:17 +00:00
itojun
14971ca02a add local def for CXX. 1999-09-13 15:50:01 +00:00
itojun
65363da25e Merge in NetBSD/sh3 from cvs.kame.net repository.
Tree structure:
- sys/arch/sh3: sh3 generic code
	As commented, in-chip device drivers are put into sys/arch/sh3/dev.
- sys/arch/evbsh3: sh3 evaluation boards (pure sh3 CPU, no fancy external HW)
- sys/arch/mmeye: Brains mmEye, www.brains.co.jp
MI source code includes couple of #ifdef for sh3-coff support.
(sh3 uses coff or elf)

Needs some more improvements, especialy in sys/arch/sh3/conf/files.sh3,
to compile the tree (due to last minute tree structure change).
1999-09-13 10:30:21 +00:00