Commit Graph

2560 Commits

Author SHA1 Message Date
thorpej 0e2f894851 Provide a CPU_IS_PRIMARY() macro in the MULTIPROCESSOR case. 2000-06-03 20:43:28 +00:00
pk 630ec72e5d Make sure to have the cache info before allocating the global cpu_info
virtual addresses.
2000-06-03 09:56:35 +00:00
pk aae0ef4cc1 In pmap_cpu_alloc(), allocate memory for the PTE tables in one sweep. 2000-06-02 10:43:59 +00:00
pk 65e4bcd9df Re-initialize `proc0.p_cpu' after allocating the global `cpu_info'
address for the boot cpu (XXX)
2000-06-02 08:12:29 +00:00
matt 168343c32d Make the ramdisk space the same as the ramdisk size being built in distrib 2000-05-31 17:35:59 +00:00
pk 08d1e4928a Initialize `ci_self' on all CPUs.
Check `cpuinfo' pointers in mp_pause_cpus() & mp_resume_cpus()
2000-05-31 12:26:15 +00:00
pk 504ed6e58b Move switchexit() declaration in here. 2000-05-31 12:05:04 +00:00
pk 0985cc7d7e Remove obsolete function declarations.
Move switchexit() to cpu.h
2000-05-31 12:04:29 +00:00
pk fca92e02ab Fix a couple of typos. 2000-05-31 11:23:21 +00:00
thorpej 8d5520dccf - In the MULTIPROCESSOR case, initialize p_cpu before a process is
marked SONPROC.
- Fix a bug where all cpu_info structures except for the boot CPUs
  would exist at both a CPU-local VA (CPUINFO_VA) and a gloal VA;
  The boot CPU's existed only a CPUINFO_VA.
- Add a self-reference pointer to the cpu_info that references the
  global address in the MULTIPROCESSOR case.  Just allow it to reference
  the `local' VA in the single-processor case, as CPUINFO_VA is global
  enough when there's only one processor to care about.  Change curcpu()
  to return the global address.
2000-05-31 05:28:26 +00:00
cjs a9a7dd7904 Fix typo in DEBUG code. 2000-05-30 03:26:34 +00:00
pk ee396c032f Remove IOMMU page table allocation from pmap_bootstrap() and all the
hacks surrounding it.
2000-05-29 22:23:34 +00:00
pk ce1fb71efc Use uvm_pglistalloc() to allocate memory for the I/O PTEs; modelled after
a similar change by Art Grabowski in Openbsd.
2000-05-29 20:41:10 +00:00
pk 7da3d45dfc Cleanup iommu_attach(). 2000-05-28 20:55:54 +00:00
pk 57b382f034 Add a few comments. 2000-05-28 20:54:42 +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
matt 22519583f3 Add tadpole specific devices. 2000-05-27 20:56:51 +00:00
mason 972014e5a8 Make compile after scheduler state cleanup. 2000-05-27 11:44:54 +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
thorpej 8964c35eca Introduce a new process state distinct from SRUN called SONPROC
which indicates that the process is actually running on a
processor.  Test against SONPROC as appropriate rather than
combinations of SRUN and curproc.  Update all context switch code
to properly set SONPROC when the process becomes the current
process on the CPU.
2000-05-26 00:36:42 +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
pk 1273031c4d Simplify the bus_dma(9) implementation:
- the `alignment' and `boundary' arguments in bus_dmamem_alloc() only
  serve as hints on how to break up a DMA transaction into chunks
  when necessary; it is not necessary on sparc DVMA hardware.

- exclusively use the VM page size (i.e. PAGE_SIZE et.al.) when computing
  resource allocations.

- remember the size of DVMA resource allocations in the private `_ds_sgsize'
  field in a dma segment descriptor.
2000-05-23 11:39:57 +00:00
pk 8c39bf5d24 MicroSPARC 1 cache issues:
- mark as CPUFLG_CACHE_MANDATORY to avoid cache inconsistencies in
  pmap_{zero,copy}_page().
- compute caching alias bits correctly
- add experimental optimisation in ms1_cache_flush().
2000-05-22 22:03:32 +00:00
mrg 296eaaa36d add two new CPU_ISXXX versions: CPU_ISSUN4U, CPU_ISSUN4MOR4U 2000-05-22 02:35:23 +00:00
eeh 3cee90e0e1 Need to provide a consdev to the cons_attach_input call now. 2000-05-21 14:36:15 +00:00
thorpej 071aed40ac A foolish consistency; most parts of the kernel use bp->b_data, so
change these from bp->b_un.b_addr to bp->b_data, as well.  This also
allows us more flexibility to experiment with other data buffer types
hung off of struct buf.
2000-05-19 18:54:22 +00:00
eeh 424619ca1a Fix the sparc64 console.
Unlike the other Sun machines, UltraSPARCs can have consoles run on different
chips than zs, so we need to support them.  So, here we go:

	Add a new PROM console driver with a major number and everything.
	This is the default driver if nothing else attaches.  It does not
	use the keyboard driver since the PROM translates keystrokes itself.
	(Unfortunately it also swallows L1-A).

	Have the keyboard driver take over the console when it attaches on a
	serial port.  When a serial port detects a keyboard and attaches the
	keyboard driver, it needs to provide a set of consdev vectors.  They
	keyboard driver will use those to send I/O to the keyboard and mouse.
2000-05-19 05:26:16 +00:00
pk 7caaf84b68 bus_dmamem_alloc: ensure alignment is always at least the page size. 2000-05-18 10:10:55 +00:00
pk 817862e208 vmapbuf: should not map the kernel address uncacheable. 2000-05-17 14:37:59 +00:00
thorpej 463931b3ba Nuke dk_establish() from orbit except from those ports which still use
it to determine the boot device: mvme68k, pc532, macppc, ofppc.  Those
platforms should be changed to use device_register().  In the mean time,
those ports defined __BROKEN_DK_ESTABLISH.
2000-05-16 05:45:44 +00:00
pk bde258dc12 bus_dmamem_alloc: round-up `alignment' to a be a multiple of the page size. 2000-05-10 14:27:51 +00:00
pk fbd2523c70 * Fix thinko in offset computations.
* Add DIAGNOSTIC checks.
2000-05-10 11:17:50 +00:00
pk 1bf775b965 Conform bus_dmamem_{alloc,map} usage to bus_dma(9) specs. 2000-05-09 22:42:08 +00:00
pk 2d12c9e33b The bus_dma(9) implementation now allocates DVMA addresses in
bus_dmamap_load_*() routines only. Note that DMA memory buffers
allocated with bus_dmamem_alloc() _must_ be loaded by bus_dmamap_load_raw().
2000-05-09 22:39:35 +00:00
pk 6411be9c63 Include <sparc/sparc/asm.h>, per PR#10082 2000-05-09 20:29:28 +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
augustss 3a6e3a4670 Add (sometimes commented out) MIIVERBOSE option. 2000-05-08 13:49:44 +00:00
mycroft a7fb64072e Fix the RCS tag format. Duh. 2000-05-08 03:11:06 +00:00
mycroft f8e0411615 Make the audioamd assembler code compile again. 2000-05-08 03:09:54 +00:00
mycroft f5bd37be57 Make the SPARC audioamd driver at least *compile*. Well, the C code, that is.
*sigh*
2000-05-08 02:44:31 +00:00
hannken 0b2854eb6c Fix for lint during build of libc. 2000-05-05 20:12:00 +00:00
augustss e991ee6035 Use correct file name for amd7930. 2000-05-05 14:19:25 +00:00
pk f622dc8618 Define some more bits in the MXCC control register. 2000-05-05 11:07:15 +00:00
pk c49e7076d3 Simplify pmap_page_protect(); modelled after a similar change by
Art Grabowski in Openbsd.
2000-05-02 13:06:27 +00:00
pk d46e0d77c0 Remove unused code: getptesw4m(),setptesw4m() 2000-05-02 10:35:06 +00:00
augustss 361f2141f7 Adapt to new am7930 driver. PR 10033 from Gregory McGarry. 2000-05-02 06:35:12 +00:00