Commit Graph

688 Commits

Author SHA1 Message Date
thorpej 0bf91362b9 Add cpu_counter() for rnd(4), using the rpcc insn. 2000-06-08 02:19:20 +00:00
simonb e59356ecdd In __cpu_simple_lock_try(), use "return (v0 != 0);" instead of
"return (v0);" where v0 is an unsigned long and the function return
type is int.  Stops lint warnings when this file is included.

Fix from Jason Thorpe.
2000-06-07 01:49:13 +00:00
thorpej 2668e3b213 Switch to the new `evcnt' mechanism for counting interrupts. Maintain
a per-CPU interrupt counter for clock, device, and interprocessor
interrupts.
2000-06-05 21:47:10 +00:00
cgd cffb580806 Implement the more flexiable `evcnt' interface as discussed (briefly) on
tech-kern and now documented in evcnt(9).
2000-06-04 19:14:14 +00:00
thorpej 70dc4d8718 Un-__P'ify kernel prototypes. 2000-06-04 05:23:18 +00:00
thorpej df4a5a7f43 Increment an interrupt depth counter in non-clock interrupt cases
so that we can get time spent in interrupt statistics.
2000-06-04 03:40:03 +00:00
thorpej cd423732b8 - Clean up clock interrupt code a bit, and provide a CPU_IS_PRIMARY()
macro in the MULTIPROCESSOR case (hardclock() wants it).
- Implement __GENERIC_SOFT_INTERRUPTS, and redefine the legacy
  software interrupts in terms of it.  Garbage-collect setsoftserial().
2000-06-03 20:47:36 +00:00
thorpej 392948ced8 Add EV57 and EV67 processor variants.
cvs: ----------------------------------------------------------------------
2000-06-03 14:12:28 +00:00
thorpej 79744e1563 Add a global patchable variable to enable debugging printfs in the
code that finds the boot device.
2000-06-01 17:12:38 +00:00
thorpej 5114577ab0 ISA DMA bounce buffer code, needed for a couple of SGMAP-less
systems, support for which will be hitting the tree soon.
2000-06-01 03:55:45 +00:00
thorpej 1cf70c169f Rearrange things a little so we can deal with systypes that aren't
densely packed.
2000-06-01 03:41:23 +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
cgd 47449a63d2 kill __P in these files. (I had to look at them anyway with an eye for
adding some protos... and adding them with __P seems wrong, but mixing
__P and not __P in the same file seems wrong too, so...)
2000-06-01 00:04:50 +00:00
thorpej 370a47ecac Add a few systypes. 2000-05-31 18:29:17 +00:00
thorpej 0d866249d4 - In the MULTIPROCESSOR case, initialize p_cpu before a process is
marked SONPROC.
- Always make curproc, fpcurproc, astpending, and want_resched per-CPU
  variables in struct cpu_info.  Restructure code accordingly, and trim
  a few instructions from a few spots in various places in locore.
2000-05-31 05:14:26 +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
thorpej f6cea17c36 Rename the atomic operations to have generic machine-independent
names, and define __HAVE_ATOMIC_OPERATIONS to indicate their
existence.
2000-05-23 05:12:53 +00:00
thorpej 09e72ae7e2 Remove the adjustment of VM_PHYS_SIZE for `large memory machines'. The
only adjustment that was really necessary was for VM_KMEM_SIZE, and that
is no longer necessary because there is now generic auto-sizing for
kmem_map.
2000-05-22 17:13:53 +00:00
thorpej 26f56b9cab Only use __builtin_va_alist_t if using GCC 2.96 or later. Fixes
pkg/10080, from Matthias Scheler.
2000-05-12 23:49:11 +00:00
thorpej c52b8eabae Make stdarg/varargs work with GCC 2.96. 2000-05-10 17:53:45 +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 dc8f3d3b3f Oops, install <machine/lock.h> on these systems, too. 2000-04-29 03:45:42 +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
drochner 13c9f8d398 implement bus_space_vaddr() 2000-04-17 17:24:48 +00:00
simonb 856c6ff149 Remove duplicate CTL_MACHDEP definitions (duplicated in <alpha/cpu.h>). 2000-04-10 06:04:28 +00:00
chs 64bb56dcc8 add decls for fd driver. 2000-04-10 01:19:13 +00:00
thorpej 55287d7159 Print any architecture extensions present on the primary CPU. 2000-04-03 01:47:28 +00:00
thorpej dbcb4cee48 Fix a typo in a previous revision, and add bit names for amask bits for
use with bitmask_snprintf().
2000-04-03 01:10:17 +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
simonb 0edd529101 Extern declaration of cputype. 2000-03-29 03:50:40 +00:00
simonb d7a08fd8c5 Don't declare a variable in the 'struct platform' declaration - we declare
an extern for 'struct platform platform' further down this file anyway,
and this would have declared a 'platform' variable in any userland code
including this file.
2000-03-29 02:59:18 +00:00
nisimura 99806742c0 Remove local implementation switching to accelerated MI sfb.c. 2000-03-26 05:52:17 +00:00
thorpej 800e276128 Fix INTRCNT_DEC_550_IRQ_LEN. From Nathan Williams. 2000-03-21 02:17:11 +00:00
thorpej 3c8d09cc56 Update the amask bits. 2000-03-20 02:19:44 +00:00
thorpej ac93a75106 Point back to the alpha_shared_intr in the intrhand structure. This
allows platform-specific code to access the `intr_private' data via
the intrhand structure.
2000-03-19 01:46:18 +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
drochner aa1de89bdf explicitely #include <sys/systm.h> #if BUS_SPACE_DEBUG to get a printf()
prototype
2000-03-15 16:44:48 +00:00
soren 95054da1a1 Fix doubled 'the's in comments. 2000-03-13 23:52:25 +00:00
kleink a9ebf7bb8c Define ISO C99 (unsigned) long long (min, max) symbols. 2000-03-07 19:31:49 +00:00
thorpej 23c5667cfe Use ANSI-style function declarations for the various inline functions
here.  Addresses port-alpha/9056.
2000-03-05 18:46:14 +00:00
thorpej 908f6bc4cd Infrastructure for lazy istream sync in the pmap module:
- Add a bitmask for the CPUs which need an isync before this pmap returns
  to userspace on that CPU.
- Define PMAP_USERRET(), a utility macro for userret() to use to process
  the deferred isync, and call it as appropriate in userret().
2000-03-01 02:22:03 +00:00
thorpej fac7fc369f Put machine check info in cpu_info in the multiprocessor case, and
just have one statically allocate machine check info structure in the
single processor config case.
2000-02-29 22:19:53 +00:00
mycroft 76a60b98d3 Install pio.h. 2000-02-26 22:15:40 +00:00
thorpej 198dbed79d Pull in <sys/types.h> for the benefit of those things which include
<machine/sysarch.h> but don't pull in <sys/types.h>.
2000-02-26 20:12:56 +00:00
thorpej 0958e8149a x86-style PIO ops for USERLAND ONLY! Requires -lalpha. 2000-02-26 19:00:51 +00:00
thorpej df88882d80 - Add a bus space method for getting the translation for a window.
- Add sysarch methods for "get bus window count", "get bus window",
  and "pci conf read/write".

These are a hack, but they're what's necessary in order to make
XFree86 work in its current state.
2000-02-26 18:53:10 +00:00
thorpej 3dacaa322d Protect a few things from userland with _KERNEL. 2000-02-25 01:16:41 +00:00
thorpej de974ff82d Add an internal bus space method alpha_bus_space_translate(), which
provides a method to translate an address on an I/O bus into a sysBus
address, along with acccess method information.
2000-02-25 00:45:04 +00:00
thorpej dded044fc2 Update for the NKMEMPAGES changes. 2000-02-11 19:25:12 +00:00
thorpej 52a2804a5c Add a new function call to the ISA DMA API: isa_dmamaxsize(), which returns
the maximum transfer size for the specified DMA channel.  Make all clients
of ISA DMA use this call to determine their maximum transfer size.
2000-02-07 22:07:27 +00:00
thorpej 0c4f8a876b Implement an internal DMA map flag which prevents coalescing of
adjacent DMA segments.
2000-02-06 01:23:30 +00:00
kleink 36e6bc645e Improve namespace test macros a bit. 2000-02-05 14:04:36 +00:00
cgd 253b179629 clean up (group, sort) __HAVE_* defines 2000-02-05 00:07:30 +00:00
kleink 82464e46d6 Add a C99-style va_copy macro. 2000-02-03 16:16:06 +00:00
danw f77befbc84 #define __HAVE_DEVICE_REGISTER on ports that have it, and check for
that, rather than a list of architecture defines, in config_attach
2000-02-01 04:01:19 +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
kleink 693059feda const -> __const and include <sys/cdefs.h> earlier; fixes PR lib/9052
by Takahiro Kambe.
2000-01-04 14:20:05 +00:00
kleink 11e6c54cfc C99: Define a NAN macro in <math.h> which evaulates to a constant expression of
a single-precision quiet NaN; only to be defined on platforms that do support
this value.
1999-12-23 10:15:05 +00:00
thorpej 81f44f09a5 - Remove a misguided attempt to use procs as idle contexts for secondary
processors.  Instead, allocate separate idle PCBs for them (including
  the primary -- don't use proc0's for its idle context).
- Use SysValue to store the cpu_info for each processor.
1999-12-16 20:17:22 +00:00
thorpej fd6f6e85b2 Slight changes so that bounce buffers can be implemented for the Jensen. 1999-12-08 23:40:35 +00:00
ragge 0513268399 CL* discarding. 1999-12-04 21:13:19 +00:00
thorpej 08d1d1b378 Actually, the 2100_A500 has 64 interrupts, not 16. 1999-12-04 00:22:54 +00:00
lukem a63bfb3c6a add atomic.h (missed by thorpej; approved by thorpej) 1999-12-04 00:18:15 +00:00
thorpej 5d0a62da53 Remove now-obsolete atomic operations. 1999-12-03 01:13:17 +00:00
thorpej 2a97466824 Rewrite the atomic locking primitives using in-line assembly. 1999-12-03 01:11:34 +00:00
thorpej 9f7d189f05 Inline most of the remaining PALcode calls. 1999-12-02 22:08:04 +00:00
thorpej 0a2ea99c42 Inline the BWX instructions. 1999-12-02 19:41:39 +00:00
thorpej 4106b60175 Move atomic operations into <machine/atomic.h>, and make them in-line
assembly, rather than function calls.

...except alpha_atomic_testset_l(), which will go away completely once
I commit the new <machine/lock.h>.
1999-12-02 01:09:11 +00:00
thorpej c258dfae2f After reading the GCC `documentation' a little more, improve the inline
__asm() statements added previously for PALcode operations.
1999-12-01 18:23:11 +00:00
thorpej 89ae0bf93c Inline several things from pal.s:
- alpha_rpcc(), alpha_mb(), alpha_wmb() -- these are instructions, and
  we win by inlining them: rpcc is generally used for profiling, and
  the memory barriers really should execute as quickly as possible with
  minimal side-effects (like additional loads/stores required to call the
  functions!)
- alpha_pal_imb(), alpha_pal_rdps(), alpha_pal_swpipl(), alpha_pal_tbi(),
  alpha_pal_whami() -- these are PALcode ops.  We must specify some register
  clobbers for these.

We have a very decent size savings as a result.  My test system:
text    data    bss     dec     hex     filename
2671724 235848  377016  3284588 321e6c  /netbsd.bak
2617708 235736  377016  3230460 314afc  /netbsd

Most of this comes from fewer register saves/restores around spl*() calls
(now that alpha_pal_rdps() and alpha_pal_swpipl() are inlined).

Note that alpha_pal_rdps() and alpha_pal_swpipl() remain in pal.s to
maintain binary compatibility with LKMs that may use spl*() functions.
1999-11-30 00:42:46 +00:00
thorpej df2cf70865 - Fix a botch in the IPI bitmasks (they were right-shifted by 1), and
add an IPI which causes the target CPU to perform AST processing when
  it returns to userspace.
- Add a way to get/set a private pointer in the shared interrupt header.
1999-11-29 19:58:39 +00:00
thorpej 94552ad5d6 - Use alpha_atomic_{add,sub}_q() to update the pmap statistics. We now no
longer need to lock the kernel pmap in pmap_kenter_pa() and pmap_kremove().
- Since locking the kernel pmap in interrupt context is no longer required,
  don't go to splimp() when locking the kernel pmap.
- Implement a new pmap_remove() function, not yet enabled by default.  It
  is structured like pmap_protect, and should be *much* faster.  This was
  actually written quite some time ago, but never committed because it
  didn't work properly.  Given the recent bugfix to pmap_protect(), "duh,
  of course it didn't work properly before...".  It seems to work fine now
  (have done several builds and run the UVM regression tests using the new
  code), but it is currently run-time optional so that some performance
  measurements can be easily run against the old and new code.
1999-11-28 19:53:11 +00:00
thorpej 1710fad449 Implement atomic addition and subtraction on quadwords. 1999-11-28 19:47:13 +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
thorpej 11cae42531 Centralize the declaration and clearing of `cold'. 1999-09-17 19:59:35 +00:00
ross f468c5f199 This is required by libsa/loadfile.c. 1999-09-10 07:33:57 +00:00
simonb 3c185af5fd Include <sys/endian.h> after defining whether where are little- or
big-endian.  i386, pc532 and vax still include <machine/byte_swap.h>
and define macros for the {n,h}to{h,n}*() functions.  mips also
defines some endian-independent assembly-code aliases for unaligned
memory accesses.
1999-08-21 05:53:50 +00:00
simonb 06a92524c2 Include <sys/bswap.h> for function prototypes. i386, pc532 and vax
still include <machine/byte_swap.h> and define macros for some of
the bswap*() functions.
1999-08-21 05:39:51 +00:00
thorpej 95755c54bb Pull in <machine/alpha_cpu.h>. 1999-08-16 06:24:07 +00:00
thorpej f06d918d30 Protect userland from the vast majority of this file. 1999-08-15 18:32:51 +00:00
thorpej 6be04b7f5c Move cpu_info and related info into <machine/cpu.h>, and implement the
other MP API components discussed on tech-smp.
1999-08-10 23:35:43 +00:00
thorpej 28fb7c1eb8 Define cpu_number() as discussed on tech-smp. 1999-08-10 21:08:05 +00:00
thorpej b701be7c86 Use atomic operations to manipulate the SSIR, and fix a problem introduced
with the spllowersoftclock() changes where more interrupts than necessary
were blocked while software interrupts were being processed.
1999-08-10 18:53:03 +00:00
thorpej eb20bbc780 Change the semantics of splsoftclock() to be like other spl*() functions,
that is priority is rasied.  Add a new spllowersoftclock() to provide the
atomic drop-to-softclock semantics that the old splsoftclock() provided,
and update calls accordingly.

This fixes a problem with using the "rnd" pseudo-device from within
interrupt context to extract random data (e.g. from within the softnet
interrupt) where doing so would incorrectly unblock interrupts (causing
all sorts of lossage).

XXX 4 platforms do not have priority-raising capability: newsmips, sparc,
XXX sparc64, and VAX.  This platforms still have this bug until their
XXX spl*() functions are fixed.
1999-08-05 18:08:08 +00:00
thorpej c1ee8f0a8c Prepend `cpu_' to the machine-dependent atomic locking primitivies. 1999-07-27 21:45:39 +00:00
ross a8000e244c New signature for console_restart(). 1999-07-11 22:39:21 +00:00
ross cf1ca54803 Minor Tsunami-related changes. 1999-06-29 07:22:25 +00:00
ross 10f1f2d81f Prototype dot_conv(), new routine in machdep.c that formats an alpha
long like this: e081.8000.8000.0004
1999-06-29 07:18:23 +00:00
cgd 7c02d93c04 nuke current definitions provided by __BUS_SPACE_COMPAT_OLDDEFS.
I'll do what I can to make new ones soon.  8-)
1999-06-18 04:49:24 +00:00
thorpej 5dec34efed The kernel pmap can be accessed (and locked!) while in an interrupt
context, so we must block interrupts which may cause memory allocation
before asserting the kernel pmap's lock.  Put this all in PMAP_LOCK()
and PMAP_UNLOCK() macros to make it easier.
1999-05-24 20:11:58 +00:00
thorpej c1eb28c237 Make the list of all pmaps LRU-ordered, and update a comment regarding
locking.
1999-05-23 22:37:02 +00:00
thorpej 2102d5a17e Save ourselves some work in some pv list traversal functions; keep a pointer
to the PTE that maps the page in the pv_entry so that we don't have to
compute it from the pmap/va.
1999-05-23 17:49:07 +00:00
thorpej 66324de865 Use the pool allocator for pv_entry structures. Set a (patchable/config'able)
low water mark on the pool, so we have some chance of crawling along in
extreme memory shortages.
1999-05-21 23:07:59 +00:00
christos c596c324e3 Define __builtin_*() for lint 1999-05-03 16:30:31 +00:00
ross c5a82dd848 * New MI man page for fp{set,get}{round,sticky,mask}(3).
* Implement fpgetsticky() for alpha.
* Direct fpsetsticky() and fp{get,set}mask() into alpha kernel via sysarch(2).
* Define new sysarch(2) stub for above and install and distribute sysarch.h
for alpha.  (The fpcr IS user mode r/w, but for reasons beyond the scope
of a commit message kernel calls are needed.) And much kernel Magick is
required before these do anything, but this way programs compiled under
1.4 will DTRT on future snapshots and releases.
1999-04-30 00:58:30 +00:00
ross 0847df9065 #ifdef _KERNEL, define the machine FPCR bits and a rounding mode macro 1999-04-29 02:55:50 +00:00
cgd 6f2f5becb6 Alpha ECOFF object type definitions 1999-04-27 02:32:33 +00:00
ross f868468aaa Never used, and work-in-progress uses a different header. 1999-04-25 20:15:06 +00:00
thorpej f7b0fea081 After reviewing the Green Book, BPT traps do indeed leave the PC pointing
to the instruction _after_ the `call_pal bpt' instruction.
1999-04-20 21:30:15 +00:00
thorpej 375b3fa699 Prototype alpha_debug(), and add some definitions for KGDB. 1999-04-20 21:23:56 +00:00
thorpej 62d09f4f93 Move the inclusion of <machine/bus.h> to within a _KERNEL section. 1999-04-20 21:23:09 +00:00
drochner 7694cc18a5 wsconsio.h is gone 1999-04-17 13:00:04 +00:00
ross 74de38f9a9 Really say goodbye to old wscons. 1999-04-16 07:24:13 +00:00
thorpej 9a4a0a3c81 DEC_KN300 no longer uses PROM console. 1999-04-15 22:15:38 +00:00
thorpej e8e6061642 Slight braino in previous. 1999-04-14 23:55:35 +00:00
thorpej 25a0e78bf3 Add macros to decode the `turboslot' member of the Console Terminal Block. 1999-04-14 23:28:31 +00:00
thorpej e468d4c8d9 Fix a bug in TBI optimization uncovered by the "access_type" changes. Thanks
to Bernd Ernesti for providing crash dumps to Charles Hannum who tracked
it down.
1999-04-09 00:38:10 +00:00
cgd 7a2f0695dd clean up slightly, do a little #define trick to make checksumming
the boot block a little easier/more 'clean', and provide a macro to
checksum the boot block.
1999-04-05 02:45:47 +00:00
cgd 5d472dba93 define 'struct boot_block' which is the alpha (SRM) boot block 1999-04-02 07:32:33 +00:00
thorpej 567cda0537 Don't bother allocating mb_map on these systems. Mbuf clusters are
allocated from a pool, and the MIPS and Alpha use KSEG to map pool
pages.  So, mb_map wasn't actually being used.  Saves around 4MB of
kernel virtual address space in a typical configuration.

Garbage-collect the related VM_MBUF_SIZE constant.
1999-03-26 00:15:04 +00:00
drochner 76fa1751fe Add a macro to check for sufficient pointer alignment in bus.h context,
"BUS_SPACE_ALIGNED_POINTER()".
Equal to the param.h "ALIGNED_POINTER()" normally, but obeys additional
requirements of the bus_space_xxx_n() macros. (BUS_SPACE_DEBUG)
1999-03-23 21:29:03 +00:00
thorpej a77ccfe460 Garbage-collect. 1999-03-20 01:40:25 +00:00
cgd 10af862bf7 move isa/isa_machdep.h to include/isa_machdep.h. (can't do it via
repository copy because alpha already had an include/isa_machdep.h in
the attic.)
1999-03-19 05:04:42 +00:00
cgd 8e85aac1ce move pci/pci_machdep.h to include/pci_machdep.h. (can't do it via
repository copy because alpha already had an include/pci_machdep.h in
the attic.)
1999-03-19 03:40:46 +00:00
cgd 0d0fd78b4e Moved from arch/alpha/isa/isapnp_machdep.h,v 1999-03-19 03:14:05 +00:00
cgd e962a59308 move tc/tc_machdep.h to include/tc_machdep.h. (can't do it via
repository copy because alpha already had an include/tc_machdep.h in
the attic.)
1999-03-19 03:12:31 +00:00
cgd 88590a9cd1 move eisa/eisa_machdep.h to include/eisa_machdep.h. (can't do it via
repository copy because alpha already had an include/eisa_machdep.h in
the attic.)
1999-03-19 02:59:49 +00:00
drochner 597bc445b1 add ST_DEC_6600, clean up some comments 1999-03-17 18:58:51 +00:00
ross 0325be06dd New file, included if present for ${MACHINE_ARCH} by bsd.kmod.mk. 1999-03-10 06:41:48 +00:00
mjacob 7c785b8a35 Well, sizeof needs to be printed with a %lu- I guess not many people build
debug kernels!
1999-03-04 02:16:56 +00:00
thorpej 4cdbd84b63 First-cut at multiprocessor TLB shootdown. This simple implementation can
probably be improved somewhat, but an attempt to be efficient has been
made.

Note: TLB shootdowns are NOT YET ENABLED.
1999-02-24 19:22:16 +00:00
thorpej 911465b54c Restructure the IPI code a little, allowing multiple IPIs to be sent at
once.  Add a way to broadcast an IPI to all processors (except the sender,
obviously).  Add an IPI for TLB shootdown.
1999-02-24 19:17:09 +00:00
thorpej 76e4555f2c Now that we have the kthread mechanism, massively clean up the way
additional processors are spun up on multiprocessor Alpha systems.
Now, each processor gets its own idle thread (the primary processor
uses proc0).  This idle thread is used in switch_exit(), rather than
explicitly referencing proc0.

Also, make `curproc', `fpcurproc', and `curpcb' per-cpu values.  This
required some data structure rearrangement; cpu info is now statically
allocated in the BSS, rather than via malloc(), and cpu_softc is gone.
(Modeled somewhat after NetBSD/sparc's multiprocessor info structures.)
1999-02-23 03:20:00 +00:00
thorpej 390864a7a5 Define a macro which has human readable strings corresponding to PGU_*
constants.
1999-02-04 19:48:21 +00:00
mycroft 897a8a7f29 Mark [hn]to[nh][ls]() with __const__, so they are subject to CSE. 1999-01-24 12:55:01 +00:00
ross c79856181a NetBSD RCS id. 1999-01-18 20:36:22 +00:00
ross 7346c0043b FreeBSD's fpu.h. 1999-01-18 20:33:23 +00:00
chuck 3a1fcc746e MNN is now the only option possible 1999-01-16 20:04:22 +00:00
bouyer dc306354b0 Move the bswap functions from libutil to libc (this bups the
minor of libc and the major of libutil). For little-endian architectures
merge the bnswap() assembly versions with nto* and hton* using symbols
aliasing. Use symbol renaming for the bswap function in this case to avoid
namespace pollution.
Declare bswap* in machine/bswap.h, not machine/endian.h. For little-endian
machines, common code for inline macros go in machine/byte_swap.h
Sync libkern with libc.
Adjust #include in kernel sources for machine/bswap.h.
1999-01-15 13:31:15 +00:00
thorpej a6f7e0c05a Implement WARN_REFERENCES(). 1998-12-02 00:58:42 +00:00
ross 8470625657 New module to hold the alpha-specific prototypes that don't need to be
exported to the MI kernel. Almost everything here was formerly in cpu.h.
Optionally, this module could in the future be used to #include anything
that is always needed by arch/alpha modules.
1998-11-19 01:57:56 +00:00
ross 19a4c3110c Rip out 70 lines of (all of) the port-alpha-specific decls and prototypes.
They should not be visible to the MI kernel and the MI kernel shouldn't
depend on this junk.  Most of it moves to new module <machine/alpha.h>.

Leave badaddr() here, though, because it's used so widely.
1998-11-19 01:51:40 +00:00
ross e2e3ee52ae Nuke the giant ugly-as-sin per-platform INTRNAMES masterpiece.
I just cannot add one more platform without getting sick.
Instead, we do just one table for all platforms. More-or-less,
it was only the A12 that even named it's individual interrupts anyway.

Also, prototype set_iointr() here. It's a slightly odd place, but 10*
better than the old place it was, and this file is included by exactly
the perfect set of .c files for set_iointr() visibility.
1998-11-19 01:48:04 +00:00
ross a68dbb068a Stop including <machine/alpha_cpu.h>; we already export <machine/cpu.h>. 1998-11-19 01:42:37 +00:00
ross da8b1017f4 "extern struct rpb *hwrpb" belongs here (duhhh) 1998-11-19 01:41:36 +00:00
thorpej 49c62c4336 Changes to support fork_kthread():
- cpu_set_kpc() now takes void *arg third argument, passed to the
  entry point.
- cpu_fork() allows parent to be non-curproc iff parent is proc0.
  When forking non-curproc, assume its state has already been saved.
- Adjust various pieces of machine-dependent code to account of all of this.
1998-11-11 06:41:23 +00:00
chs 61458d7dfa LOCKDEBUG enhancements for non-MP:
keep a list of locked locks.
use this to print where the lock was locked
when we either go to sleep with a lock held
or try to free a locked lock.
1998-11-04 06:19:55 +00:00
ross 8447dd624c 1. STANDALONE -> _STANDALONE
2. Key raw prom interfaces defes on ENABLEPROM
3. Define the prom "ioctl" magtape functions.
1998-10-15 00:47:28 +00:00
kleink cee25f5a9c Since libc is not ready for enabling weak symbol support yet, disable the
WEAK_ALIAS() macro for now (like cdefs.h).
1998-10-13 11:39:26 +00:00
thorpej b38544d99e Oops, back out a buglet I didn't intend to commit in the last change. 1998-10-07 18:29:26 +00:00
thorpej 2038eb830c Split hwrpb_restart_setup(), putting the code that initializes the vtpb
and primary hwpcb into hwrpb_primary_init().  Call the latter before
performing autoconfiguration().
1998-10-06 21:10:46 +00:00
thorpej d681cf055a configure() prototype is in <sys/device.h> 1998-10-06 20:50:15 +00:00
christos c0f54daf70 Add em_alpha_exp 1998-10-03 18:17:14 +00:00
erh b0367216c1 Macros to call a linux syscall. 1998-10-01 16:19:59 +00:00
thorpej 69d81d8df1 Prototype cpu_halt_secondary(). 1998-09-29 07:07:36 +00:00
thorpej 2c50ec242f Add basic interprocessor interrupt sending and receiving code. Current
IPI functions: HALT, IMB, TBIA, TBIAP.

XXX HALT is not yet implemented, it's just a stub.
1998-09-26 00:03:51 +00:00
thorpej e2aa38459c Implement atomic quadword load-and-latch. 1998-09-25 23:59:42 +00:00
thorpej 01c75223d7 Minor style tweaks. 1998-09-25 22:06:33 +00:00
thorpej 57e656b2ec The processor unique value in the PCB is used as a backup kernel stack
pointer when booting secondary CPUs.  Add an alias for it.
1998-09-25 03:21:31 +00:00
thorpej fcb0203141 First-cut at code to spin up secondary processors on a multiprocessor
Alpha system, conditional on MULTIPROCESSOR.

NOTE: This does not yet work completely.  The secondary CPU begins the
boot process, but never makes it into the cpu spinup trampoline.  This
is merely a snapshot of a work-in-progress.
1998-09-24 23:28:17 +00:00
thorpej 3cde5f5817 Machine-dependent spin lock operations for Alpha, included if MULTIPROCESSOR
is specified.
1998-09-24 22:32:35 +00:00
thorpej 91a031471d Implement atomic test-and-set for longwords (32-bit). 1998-09-24 22:22:07 +00:00
thorpej 1b04ff4897 Make prom_enter() and prom_leave() public. 1998-09-24 21:18:13 +00:00
thorpej 7df5ebc392 "Gee, there was already a function to do that." 1998-09-23 22:02:21 +00:00
thorpej 53d42701b5 Implement a function to recompute the HWRPB checksum. 1998-09-23 21:51:04 +00:00
thorpej 5fa16c668b Define the inter-console communication buffer portion of the per-cpu
info structure.
1998-09-22 08:16:51 +00:00
thorpej 402a9210a2 Implement quadword atomic test-and-set. 1998-09-22 05:56:52 +00:00
thorpej e10cc7910d Add some support for multiple processors to the pmap module. Still left
to do: TLB shootdown code, but that will be much easier to write once
the code to spin up the additional CPUs is working.
1998-09-22 03:58:10 +00:00
matt ad921921e4 Add softserial to the alpha port. This significantly improved PPP
throughput on com ports.
1998-09-21 00:33:16 +00:00
thorpej 3eaeeb5357 Add definitions for the maximum allowable `whami' procssor ID and the
maximum number of processors we'll allow (64, assuming procssor IDs start
at 0).
1998-09-20 18:28:50 +00:00
thorpej a4a356f9a6 Need 83 longs for a jmp_buf now. 1998-09-14 06:07:29 +00:00
thorpej 3ddf828326 Make signal delivery work again. 1998-09-13 01:51:29 +00:00
cgd 5fa7eee1ff don't define __BUS_SPACE_COMPAT_OLDDEFS by default. As stated in
bus_space(9), if drivers want it (they shouldn't; easy to convert) they
can define it right before including bus.h.  There's been a release since
the interfaces were (slightly) changed, and no code in the source tree
uses the old interfaces as far as I can tell.
1998-08-30 23:40:14 +00:00
thorpej d5df55112a vm_offset_t -> {paddr_t,vaddr_t}, vm_size_t -> vsize_t 1998-08-14 16:50:00 +00:00
thorpej 97e83f6e0b Change the "vm_offset_t"s to "u_long"s for now; eventually, we can make
them vaddr_t and paddr_t, as appropriate (after scouring the RPB docs
to know which are phys and virt addresses).
1998-08-14 16:46:09 +00:00
eeh a2dd74ed79 Merge paddr_t changes into the main branch. 1998-08-13 02:10:37 +00:00
kleink 546365a27e _POSIX_SOURCE -> _POSIX_C_SOURCE 1998-08-06 11:25:04 +00:00
thorpej bf8f319d0e Remove some lint. 1998-08-01 21:12:32 +00:00
thorpej 528dab6808 Implement alpha_shared_intr_disestablish(). Simply removes the handler
fromthe list, allowing the caller to manipulate the sharing type,
if appropriate.
1998-08-01 18:52:36 +00:00
mycroft a24dbc8065 (Always) (practice) (safe) (macro expansion). 1998-07-31 15:07:41 +00:00
thorpej f948e430bb Provide a hook for bypassing space accounting, needed to support ISA PnP
for now.
1998-07-31 04:37:02 +00:00
mycroft da2e61d160 Delint. 1998-07-27 13:55:32 +00:00
thorpej 2385ee5eca Provide PMAP_{,UN}MAP_POOLPAGE(). 1998-07-24 20:32:07 +00:00
is 6054d626f9 Switching dev/ic/lpt.c to use spllpt() instead of spltty(). It doesn't use
tty structures, and on some machines (namely the DraCo internal lpt, and some
multi-i/o boards for Amigas and DraCos), tying spltty to the pretty high printer
interupt level would hurt serial performance.

On all affected ports but Amiga, spllpt() has been defined in machine/intr.h
to be spltty(), thus preserving old behaviour. Portmasters are encouraged to
change is, if they feel something else is better (e.g., one of its own were
possible).
1998-07-18 21:27:25 +00:00
ross d58ad29b6c Kill the old extern mchkinfo pointer and prototype cpu_mchkinfo().
This file has been collecting prototypes and other things used in the MD
code...that's bad...because this is exported to the MI kernel.
1998-07-13 19:10:14 +00:00
mjacob 6b092524ea stale beer- place structure in right file 1998-07-08 17:20:42 +00:00
thorpej a8d2213784 Define a macro that returns the mask of PALcode PTE bits that we care
about when determining if a TBI is necessary (i.e. the PALcode bits minus
the FOx bits, since we always track those).
1998-07-08 17:19:46 +00:00
thorpej 0792d7f3db Define a shorthand macro that represents the mask of PTE bits that the
PALcode cares about.
1998-07-08 16:48:49 +00:00
thorpej 3f776dfbe2 Cosmetic change. 1998-07-08 16:46:51 +00:00
thorpej 1ea93eea1c Define one page free list, and put all pages on it. 1998-07-08 04:35:23 +00:00
mjacob 35ffe8edb3 Add machine check type definitions. Structure the expected/received
machine check items.
1998-07-08 00:39:02 +00:00
mjacob dfe345a444 common logout structure definitions, or a start thereof 1998-07-08 00:36:18 +00:00
thorpej de83dce0de On second thought, call that like the rest of the shared intr functions. 1998-07-07 22:24:38 +00:00
thorpej 443d238f70 Define a macro to test if a shared interrupt should be disabled after
a stray has occurred.
1998-07-07 21:37:11 +00:00
thorpej 02b767eee5 Take a stab at EB66 support. An EB66 is basically an EB64+ with a
21066 LCA instead of a 21064 + APECS.
1998-06-27 10:10:51 +00:00
ross e5e9adb326 Note ST_DEC_1000 as PCI/EISA. 1998-06-26 21:55:38 +00:00
ross e31a396c68 Add AlphaServer 1000 interrupts. 1998-06-26 21:55:09 +00:00
ross 92aafa4a46 Identify ST_DEC_1000A as PCI/EISA.
New macros:

	LOCATE_PCS(struct rpb *hwrpb, int cpu_number)
	PCS_PROC_MAJORTYPE(struct pcs *)
	PCS_PROC_MINORTYPE(struct pcs *)

Define LOCATE_PCS() to map (hwrpb, cpu_number) -> Per-Cpu-Slot structure.

Replace the PCS_PROC_{MAJOR,MINOR}{,SHIFT} stuff with macros that simply
return the major and minor cpu type codes.
1998-06-24 01:20:43 +00:00
ross f1cc92f606 Add dec_1000a interrupts. 1998-06-24 01:14:55 +00:00
kleink 1fbd0b3749 GC the unused `physadr' type, which was not able to hold a complete physical
address on 2 architectures anyhow.  Also, move the definition of the `label_t'
type inside _KERNEL protection, since it is specific to the in-kernel
setjmp()/longjmp() implementations.
1998-06-14 20:09:22 +00:00
cgd 651b44e211 Rework the way kernel include files are installed. In the new method,
as with user-land programs, include files are installed by each directory
in the tree that has includes to install.  (This allows more flexibility
as to what gets installed, makes 'partial installs' easier, and gives us
more options as to which machines' includes get installed at any given
time.)  The old SYS_INCLUDES={symlinks,copies} behaviours are _both_
still supported, though at least one bug in the 'symlinks' case is
fixed by this change.  Include files can't be build before installation,
so directories that have includes as targets (e.g. dev/pci) have to move
those targets into a different Makefile.
1998-06-12 23:22:30 +00:00
thorpej 3af0f95d24 Define a macro to test PG_EXEC. 1998-06-11 05:10:41 +00:00
thorpej 55207ad8b4 Define a software PTE bit to track VM_PROT_EXEC. 1998-06-11 05:09:47 +00:00
thorpej f5cd6a7736 Add debugging support to the bus_space macros. If BUS_SPACE_DEBUG (or DEBUG)
is defined, the bus_space macros will check to ensure that the bus address
and the target buffer (if applicable) are aligned properly for the size
of the type being used.  If they are not, a message will be displayed on
the console.

Strict alignment is required by the Alpha architecture, and a trap will
occur of unaligned access is performed.  These changes will aid debugging
of broken device drivers.
1998-06-08 03:42:19 +00:00
thorpej 1733ad8dc5 Clean up a little, and add a `powerdown' hook in the platform structure. 1998-06-06 20:18:50 +00:00
thorpej a1c151d56b Add system variation for Miata 1.5. 1998-06-05 18:18:37 +00:00
thorpej cbaedc8675 Support for the Digital Personal Workstation [456]xx, a.k.a. Miata (systype
DEC_550).  Mostly cloned from the EB164 systype, with some modifications
from myself, and a few more from Andrew Gellatin.
1998-06-05 02:13:41 +00:00
thorpej 44605ba506 Define a bunch more system variations. 1998-06-03 23:07:38 +00:00
thorpej d6041754c2 Allow the DMA tag to specify a boundary contraint. If the device has a
more strict boundary, the map will use it, otherwise the map will inherit
the tag's, unless the tag's constraint is 0 (no boundary constraint).
1998-06-03 18:25:53 +00:00
kleink a97fc2f180 If any of _ANSI_SOURCE, _POSIX_C_SOURCE or _XOPEN_SOURCE are defined, don't
provide any identifiers other than sig_atomic_t.
1998-05-25 20:59:01 +00:00
thorpej 085b73d2db Add "SCSIID" and "SCSIFAST" environment variables present on the
DEC 3000 systems.
1998-05-25 04:01:10 +00:00
thorpej a2f214a443 Add fine-grained locking, using a locking protocol modeled after the i386
UVM pmap's locking protocol, written by Chuck Cranor.  Not all of the
support for multiple processors is here yet, but the kernel does run
under moderate loads with LOCKDEBUG (all locking operations are no-ops
unless LOCKDEBUG is turned on).

This is by no means complete... there are still some possible snares
to take a look at.
1998-05-20 04:05:50 +00:00
thorpej ca819f2940 Argh, finish renaming Lev1map to kernel_lev1map. 1998-05-19 18:35:11 +00:00
thorpej ca12fa7ebe Make PT page reference counting more generic so it can be used for other
special use page types.
1998-05-19 02:04:28 +00:00
thorpej 8fdc16212f The Alpha architecture has a variable page size; don't hardwire the
number of PV entries per page at compile time.
1998-05-19 00:42:16 +00:00
thorpej b44dc2ecbf Make the page attribute manifest constant names have similar form to
page usage manifest constant names.
1998-05-19 00:29:03 +00:00
thorpej 180f140a85 Keep track of page usage inside the pmap (pvent, l{1,2,3}pt page, "normal"). 1998-05-19 00:20:21 +00:00
thorpej d19fbe1196 Garbage-collect the old confargs stuff that was used in the Early Days.
It isn't really appropriate anymore.  Replace it with a real mainbus
attach args structure.
1998-05-14 00:01:30 +00:00
thorpej 6a49b0a33e Clean up some historical artifacts. 1998-05-13 23:38:26 +00:00
thorpej 49aa171ab9 Add support for chaining DMA windows together, for falling back on
SGMAPs if a direct-mapped window fails.
1998-05-13 21:21:16 +00:00
thorpej 4665241bf8 Simplify the direct-mapped DMA case somewhat by adding a window base
member to the DMA tag, and calling the direct-mapped back-ends directly,
rather than through chipset-specific front-ends which pass the window
base as an additional argument.
1998-05-07 20:09:37 +00:00
thorpej 1686aca01d Pull in opt_gateway.h as appropriate. 1998-04-29 23:11:00 +00:00
thorpej 371b1a7fb7 Define the DEC 550 Personal Workstation (Miata) systype. 1998-04-29 02:39:24 +00:00
thorpej a152517daa Add interrupt counter space for the DEC EB64+, and fix a misplaced
counter comment in the kn300 interrupt counters.
1998-04-29 00:34:06 +00:00
thorpej 30188853dc Increase the efficiency of pmap_l{2,3}pte() somewhat, by allowing the
caller to pass an optional 3rd argument, which is the previous level
PTE corresponding the virtual address.  If this argument is non-NULL,
the table walk otherwise necessary will be bypassed.
1998-04-27 19:07:03 +00:00
kleink a53c1863fe Provide definitions for intptr_t and uintptr_t, signed resp. unsigned integral
types large enough to hold any pointer.
1998-04-27 17:39:10 +00:00
drochner 7f77474219 Oops, forgot to delete. It's in dev/pci now. 1998-04-26 11:57:00 +00:00
mjacob a8d3df00ed oops- add missing include 1998-04-15 21:42:24 +00:00
drochner b9d78308c1 tell drivers that this port knows about the mi wscons stuff 1998-04-15 21:12:45 +00:00
mjacob 4fa71d82a5 add Alpha 4100 support 1998-04-15 00:46:57 +00:00
ross 2ce8cda3e5 Get rid of a /* in a comment. 1998-03-27 01:17:18 +00:00
thorpej 6111783e61 if NEW_SCC_DRIVER, 3000/300 and 3000/500 aren't PROM console candidates. 1998-03-26 02:53:21 +00:00
thorpej 456b3df281 Remove the Mach 3 pmap from the tree, replacing it with the contents of
pmap.old.<whatever>.  To see the history, look at the corresponding
pmap.old.<whatever> file.
1998-03-26 02:18:03 +00:00
thorpej e6cf334f5c Keep a few things that reference kernel variables out of the namespace.
Add a check to see if libkvm is using this file.
1998-03-25 00:44:34 +00:00
thorpej ea074f229a cdev_decl the "zs" device (which is really zstty). 1998-03-24 05:17:14 +00:00
thorpej ee83014c4d Initial mostly-working ioasic attachment for the MI 8530 SCC driver. It is
enough to use as a console on my DEC 3000/400 (connected to a VT-520
terminal).

XXX The MI SCC driver needs serious changes to handle platforms which
have muliple SCC attachments (e.g. the Alpha port, which has an ioasic
attachment for TurboChannel systems and a gbus attachment for TurboLaser
systems).

XXX The MI SCC driver also needs changes to deal with the wacky (to put
it mildly) way the chips are wired up on the ioasic (on both TC Alphas
and DECstations).  These are going to come along later.
1998-03-24 05:12:00 +00:00
thorpej fcfe2f1539 Implement a set of `atomic' (using load-locked and store-conditional)
operations.  Initial set includes:

alpha_atomic_setbits_q()	set bits in a quad
alpha_atomic_clearbits_q()	clear bits in a quad
1998-03-22 07:26:32 +00:00
thorpej a8d86e5a7c Replace PMAP_ASNGEN_INVALID with PMAP_ASN_RESERVED. 1998-03-22 05:39:50 +00:00
thorpej 63c73f94e3 Add a few more systypes. 1998-03-20 21:48:03 +00:00
thorpej b637a998f4 Add ASN housekeeping and a CPU mask to the pmap. 1998-03-18 19:39:23 +00:00
thorpej 961a955498 Move the "are we active" macros out of the header file. 1998-03-18 19:27:46 +00:00
thorpej 56e004c995 Pass the max ASN from the HWRPB to pmap_boostrap(). 1998-03-18 19:02:49 +00:00
thorpej 426d2953f5 Add a macro to test if PG_ASM (Address Space Match) is set in a PTE. 1998-03-18 19:00:15 +00:00
thorpej f8cff5ab23 Add a software PTE bit that indicates that a va -> pa mapping was entered
in the physical->virtual list.
1998-03-17 04:53:43 +00:00
thorpej 00452b441f Move PTE-related constants here, and make them not depend on a hard-coded
page size (i.e. use the one initialized from the HWRPB at boot time).

Do a bit of cleanup while here, rendering old inherited constants obsolete.
1998-03-12 07:29:21 +00:00
thorpej 4d8723232d Garbage-collect a bunch of constants that were inherited, but are no
longer necessary or make sense.
1998-03-12 07:28:07 +00:00
thorpej bd3c0e36cf Garbage-collect this a bit. 1998-03-12 06:47:11 +00:00
thorpej 152a4bfa60 Increase the maximum userspace address to 4TB. Leave the stack at 8G
for now, but make a note that we might want to move it down to 4G later.
1998-03-12 01:25:52 +00:00
thorpej e046925c3a Massive cleanup and partial rewrite of the NetBSD/alpha pmap module.
Major change is that page table page management has been completely
rewritten.  Page tables are now accessed via K0SEG (no more KVA space
wasted on user page tables), and a much larger user address space is
supported.

Many thanks to Chris Demetriou and Ross Harvey for helpful insight and
debugging assistance.
1998-03-12 01:24:52 +00:00
thorpej 900e1c90bd Nuke ALPHA_STSIZE and ALPHA_MAX_PTSIZE. Add macros to compute and operate
on segments mapped by L1 and L2 PTEs.
1998-03-12 01:21:21 +00:00
thorpej 78a173bada Define VPT_INDEX(), which computes the index into the Virtual Page Table
of the PTE that maps the specified virtual address.

Thanks to Chris Demetriou and Ross Harvey for clarifying the VPT.
1998-03-09 19:57:57 +00:00
thorpej cd7d081d02 Export a pointer to the Virtual Page Table. 1998-03-07 03:15:43 +00:00
thorpej f7d64ef778 Clean up a comment. 1998-03-07 03:15:06 +00:00
thorpej f55b280ffc Clean this up a bit. 1998-03-07 01:44:08 +00:00
thorpej 60d30d3838 Nuke kvtopte() and ptetokv(). 1998-03-07 01:10:05 +00:00
thorpej 58a7bd9288 Nuke the vatopa() macro. 1998-03-07 00:42:07 +00:00
thorpej 059d0c72de pmap_ste() -> pmap_l2pte(), pmap_pte() -> pmap_l3pte() 1998-03-06 23:41:01 +00:00