Home | History | Annotate | Download | only in include
History log of /src/sys/arch/x68k/include/cpu.h
RevisionDateAuthorComments
 1.67  20-Jan-2024  thorpej Largely unify the <machine/cpu.h> headers on the m68k platforms.
 1.66  19-Jan-2024  thorpej Switch the x68k port to use the same clockframe layout as the other
m68k ports.
 1.65  18-Jan-2024  thorpej Make the M68K_MMU_* defines real kernel options, available in opt_m68k_arch.h.
For 68030, 68040, and 68060, infer M68K_MMU_MOTOROLA. For 68010 and 68020, it
must be an explicit option (set in std.${MACHINE} or, in the case of hp300,
inferred from the specific model option).
 1.64  09-Jan-2024  thorpej Remove duplicated / slightly-tweaked loadustp() (load user segment table)
routines from all of the m68k ports using the shared pmap. Instead, in
pmap_init(), set up a function pointer to the appropriate mmu_load_urp*()
function in mmu_subr.s.
 1.63  07-Jan-2024  isaki TAB/space/indent cleanup.
 1.62  23-Nov-2019  ad cpu_need_resched():

- Remove all code that should be MI, leaving the bare minimum under arch/.
- Make the required actions very explicit.
- Pass in LWP pointer for convenience.
- When a trap is required on another CPU, have the IPI set it locally.
- Expunge cpu_did_resched().
 1.61  18-Feb-2019  thorpej Refactor the 68040 writeback() from each m68k port's trap handler into a
shared copy: m68040_writeback(). It is essentially a copy of the Atari
version, with some minor cosmetic tweaks and one small performance optimization
from the mvme68k port.

Tested by rjs@ on a Quadra 950. (Thanks!)
 1.60  22-Aug-2018  msaitoh - Cleanup for dynamic sysctl:
- Remove unused *_NAMES macros for sysctl.
- Remove unused *_MAXID for sysctls.
- Move CTL_MACHDEP sysctl definitions for m68k into m68k/include/cpu.h and
use them on all m68k machines.
 1.59  17-Dec-2016  flxd branches: 1.59.14; 1.59.16;
Fix typo "one the" and architecture where appropriate.
 1.58  31-Jul-2014  isaki branches: 1.58.4; 1.58.8;
Remove the variable not used anymore.
sync with x68k/pmap_bootstrap.c,v 1.21 (in 2001).
 1.57  19-Oct-2013  christos branches: 1.57.2;
make cpu_need_resched() macros consistent; __USE flags
 1.56  02-Feb-2012  tsutsui branches: 1.56.6; 1.56.10;
Always include <m68k/cpu.h> (i.e. outside #if defined(_KERNEL))
for crash(8) as amiga and sun3. There are _KERNEL protections in it.

Briefly tested by "build.sh -m news68k -U build".
Further possible botch will be fixed later.
 1.55  15-Nov-2011  tsutsui branches: 1.55.4;
Merge copy-and-pasted fpu_probe() function (to share it among more m68k ports).
Tested on TT030, Sun3/80, and X68030.
 1.54  16-May-2011  tsutsui branches: 1.54.4;
- merge and move pasted m68k MD setreg() functions into m68k/m68k_machdep.c
- move m68881_save() and m68881_restore() declarations into <m68k/m68k.h>

Briefly tested and no obvious breakage on atari, sun3, and x68k.
 1.53  12-May-2011  tsutsui Make intiobase and intiolimit unsigned for consistency.
 1.52  08-Feb-2011  rmind Remove clause 3 (UCB advertising clause) from the University of Utah
copyright. Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
 1.51  22-Dec-2010  matt branches: 1.51.2; 1.51.4;
Collect cpu_info and friends and move to m68k/include/cpu.h
Add a define __HAVE_CPU_DATA_FIRST which means that cpu_data is the first
member in struct cpu_info.
 1.50  06-Jun-2010  mrg fix PR 6724 - convert m68k options to defflag's. this means that
M680[12346] are now available from opt_m68k_arch.h. FPSP meantioned
in the PR has already been fixed, and i could not find any more.

i built these kernels to ensure i did not break their builds:

amiga: GENERIC DRACO
atari: HADES FALCON MILAN-PCIIDE
mac68k: GENERIC
sun2: GENERIC
sun3: GENERIC GENERIC3X
cesfic: attempted GENERIC, does not build due to lack of machine/bus.h
hp300: GENERIC
luna68k: GENERIC
mvme68k: GENERIC
news68k: GENERIC
next68k: GENERIC
x68k: GENERIC
 1.49  21-Oct-2009  rmind branches: 1.49.2; 1.49.4;
Remove uarea swap-out functionality:

- Addresses the issue described in PR/38828.
- Some simplification in threading and sleepq subsystems.
- Eliminates pmap_collect() and, as a side note, allows pmap optimisations.
- Eliminates XS_CTL_DATA_ONSTACK in scsipi code.
- Avoids few scans on LWP list and thus potentially long holds of proc_lock.
- Cuts ~1.5k lines of code. Reduces amd64 kernel size by ~4k.
- Removes __SWAP_BROKEN cases.

Tested on x86, mips, acorn32 (thanks <mpumford>) and partly tested on
acorn26 (thanks to <bjh21>).

Discussed on <tech-kern>, reviewed by <ad>.
 1.48  17-Jan-2009  isaki Purge x68k_config_found() to simplify consinit routine.
config_console() calls initialization of grf, ite, mfp
directly, instead of tracing special device tree with an
emulated 'struct device'.
 1.47  18-Dec-2008  isaki Sync with other m68k ports.
- Remove PHYS_IODEV, PHYS_INTIODEV. These are real copy of INTIOBASE.
- Define IIOV() (and IIOP()) and use it, rather than INTIO_ADDR().
 1.46  18-Dec-2008  isaki Move external decl. of intiobase: dev/intiovar.h -> include/cpu.h
Move definition of intiobase: x68k/pmap_bootstrap.c -> x68k/locore.s
These synchronize code with other m68k ports.
 1.45  27-Feb-2008  xtraeme branches: 1.45.4; 1.45.12;
Remove CTL_MACHDEP_NAMES, it's not used anywhere.

Ok by martin@.
 1.44  17-Oct-2007  garbled branches: 1.44.12; 1.44.16;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.43  04-Aug-2007  ad branches: 1.43.2;
Add ci_cpuid where it's missing.
 1.42  21-May-2007  tsutsui branches: 1.42.2; 1.42.4; 1.42.8;
Move declarations of m68k common functions
from <machine/cpu.h> to <m68k/m68k.h>.
While here, remove some obsolete function decls.
 1.41  20-May-2007  mhitch Add missing call to lwp_startup() in lwp_trampoline() (which was renamed
from proc_trampoline to match the other ports).

A DIAGNOSTIC kernel will now boot and run. LOCKDEBUG still doesn't work yet.
Also, my amiga no longer loses time.
 1.40  19-May-2007  isaki Use do { } while (0) to macro.
 1.39  19-May-2007  isaki Adapt to the merge of yamt-idlelwp branch.
tested on my X68030.
 1.38  04-Mar-2007  christos branches: 1.38.2; 1.38.4; 1.38.10;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.37  16-Feb-2007  ad branches: 1.37.2;
Remove spllowersoftclock() and CLKF_BASEPRI(), and always dispatch callouts
via a soft interrupt. In the near future, softclock will be run from process
context.
 1.36  09-Feb-2007  ad Merge newlock2 to head.
 1.35  11-Dec-2005  christos branches: 1.35.20;
merge ktrace-lwp.
 1.34  13-Jun-2005  he branches: 1.34.2;
Change the signature of badaddr() and badbaddr() from taking a caddr_t
to taking a volatile void*. This gets rid of a number of casts to make
this compile under -Wcast-qual.
Add some volatiles and consts in other places to make this build under
-Wcast-qual.
Also rename a few variables to make this build under -Wshadow.
Also get rid of duplicated declarations of badaddr() and badbaddr()
in machdep.c, they're already there from <machine/cpu.h>.
 1.33  18-Jan-2005  chs de-__P, remove register, ansify.
 1.32  26-Sep-2004  yamt branches: 1.32.4;
don't expose cpu_info to userland.
 1.31  22-Sep-2004  yamt move some per-cpu data definitions to MI place so that they can be modified
without touching all ports. discussed on tech-kern@.
 1.30  04-Jan-2004  jdolecek Rearrange process exit path to avoid need to free resources from different
process context ('reaper').

From within the exiting process context:
* deactivate pmap and free vmspace while we can still block
* introduce MD cpu_lwp_free() - this cleans all MD-specific context (such
as FPU state), and is the last potentially blocking operation;
all of cpu_wait(), and most of cpu_exit(), is now folded into cpu_lwp_free()
* process is now immediatelly marked as zombie and made available for pickup
by parent; the remaining last lwp continues the exit as fully detached
* MI (rather than MD) code bumps uvmexp.swtch, cpu_exit() is now same
for both 'process' and 'lwp' exit

uvm_lwp_exit() is modified to never block; the u-area memory is now
always just linked to the list of available u-areas. Introduce (blocking)
uvm_uarea_drain(), which is called to release the excessive u-area memory;
this is called by parent within wait4(), or by pagedaemon on memory shortage.
uvm_uarea_free() is now private function within uvm_glue.c.

MD process/lwp exit code now always calls lwp_exit2() immediatelly after
switching away from the exiting lwp.

g/c now unneeded routines and variables, including the reaper kernel thread
 1.29  07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.28  18-Jan-2003  thorpej branches: 1.28.2;
Merge the nathanw_sa branch.
 1.27  28-Oct-2002  chs untangle includes a bit:
don't include cpu.h in pmap.h, nor cacheops.h in cpu.h. instead,
include cpu.h and cacheops.h in just those .c files that need them.
 1.26  30-May-2001  mrg branches: 1.26.8;
use _KERNEL_OPT
 1.25  19-Dec-2000  scw branches: 1.25.2;
Unification of the m68k syscall() function.
 1.24  25-Aug-2000  thorpej 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.
 1.23  26-May-2000  thorpej 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.
 1.22  23-Apr-2000  minoura Do not include opt_m680x0 in LKM.
 1.21  18-Apr-2000  minoura defopt M680[2346]0.
 1.20  23-Sep-1999  minoura branches: 1.20.2;
Use m68k common cacheops.c.
 1.19  10-Aug-1999  thorpej Define cpu_number() as discussed on tech-smp.
 1.18  05-May-1999  minoura Use mvme68k-derived delay routine.
Now that we support various models, the old constant-loop delay routine
may cause problems.
 1.17  24-Mar-1999  minoura branches: 1.17.2; 1.17.4; 1.17.6;
Shut up gcc -Wall.
 1.16  16-Mar-1999  minoura Merged minoura_x68k_bus_h branch.
 1.15  26-Feb-1999  is synchronize types, and s/curproc/p/ in one forgotten place
 1.14  26-Feb-1999  is x68k specific part of fix for PR 6152
 1.13  13-Dec-1998  minoura branches: 1.13.2;
Splitted out the interrupt handling code to a separate file.
Disallow getting down the interrupt level by splXX.
 1.12  11-Nov-1998  thorpej 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.
 1.11  07-Oct-1998  thorpej Oops, back out a buglet I didn't intend to commit in the last change.
 1.10  06-Oct-1998  thorpej configure() prototype is in <sys/device.h>
 1.9  22-Aug-1998  minoura Eliminated vm_offset_t and vm_size_t.
 1.8  13-Feb-1998  scottr Avoid declaring the "astpending" and "want_resched" globals in cpu.h,
as this breaks C++ code that happens to indirectly include this header.
Both Matthias Scheler and I noticed this, independently.

This problem notably does not affect the atari and sun3/sun3x ports,
which have already implemented a similar solution.
 1.7  26-Oct-1997  is Make these compile after m68k/m68k.h 1.4->1.5.
 1.6  10-Oct-1997  oki Add prototypes.
 1.5  03-Feb-1997  oki branches: 1.5.8;
Remove #ifdef GENERIC ... #endif
 1.4  08-Jan-1997  oki Add fpu_probe prototype.
 1.3  11-Sep-1996  thorpej Use <m68k/cpu.h>.
 1.2  21-May-1996  oki Some cleanup.
- Add missing return-type of function.
- Add missing prototype.
- some gcc -Wall printf warning.
 1.1  05-May-1996  oki branches: 1.1.1;
Initial revision
 1.1.1.1  05-May-1996  oki NetBSD/x68k, by Masaru Oki.
 1.5.8.1  14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.13.2.1  14-Mar-1999  minoura Sync.
 1.17.6.1  30-Nov-1999  itojun bring in latest KAME (as of 19991130, KAME/NetBSD141) into kame branch
just for reference purposes.
This commit includes 1.4 -> 1.4.1 sync for kame branch.

The branch does not compile at all (due to the lack of ALTQ and some other
source code). Please do not try to modify the branch, this is just for
referenre purposes.

synchronization to latest KAME will take place on HEAD branch soon.
 1.17.4.1  21-Jun-1999  thorpej Sync w/ -current.
 1.17.2.1  24-Jun-1999  perry pullup 1.17->1.18 (minoura): Use mvme68k-derived delay() routine
 1.20.2.2  05-Jan-2001  bouyer Sync with HEAD
 1.20.2.1  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.
 1.25.2.1  21-Jun-2001  nathanw Catch up to -current.
 1.26.8.4  11-Nov-2002  nathanw Catch up to -current
 1.26.8.3  08-Dec-2001  thorpej Add a cpu_proc_fork(), called from uvm_proc_fork(), which takes care
of machine-dependent handling a fork() time (this is different from
forking the actual context in an LWP world). #define it away on
platforms which do not need it.

Problem noted by Gregory McGarry.
 1.26.8.2  18-Nov-2001  scw MD Scheduler Activation bits for X68k.
Compile-tested only.
 1.26.8.1  30-May-2001  scw file cpu.h was added on branch nathanw_sa on 2001-11-18 18:44:17 +0000
 1.28.2.7  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.28.2.6  24-Jan-2005  skrll Sync with HEAD.
 1.28.2.5  19-Oct-2004  skrll Sync with HEAD
 1.28.2.4  24-Sep-2004  skrll Sync with HEAD.
 1.28.2.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.28.2.2  18-Sep-2004  skrll Sync with HEAD.
 1.28.2.1  03-Aug-2004  skrll Sync with HEAD
 1.32.4.1  29-Apr-2005  kent sync with -current
 1.34.2.3  17-Mar-2008  yamt sync with head.
 1.34.2.2  03-Sep-2007  yamt sync with head.
 1.34.2.1  26-Feb-2007  yamt sync with head.
 1.35.20.1  06-Feb-2007  ad Update m68k pasteware.
 1.37.2.1  12-Mar-2007  rmind Sync with HEAD.
 1.38.10.2  03-Oct-2007  garbled Sync with HEAD
 1.38.10.1  22-May-2007  matt Update to HEAD.
 1.38.4.1  11-Jul-2007  mjf Sync with head.
 1.38.2.2  20-Aug-2007  ad Sync with HEAD.
 1.38.2.1  27-May-2007  ad Sync with head.
 1.42.8.1  04-Aug-2007  jmcneill Sync with HEAD.
 1.42.4.1  15-Aug-2007  skrll Sync with HEAD.
 1.42.2.1  07-Aug-2007  matt Sync with HEAD.
 1.43.2.2  23-Mar-2008  matt sync with HEAD
 1.43.2.1  06-Nov-2007  matt sync with HEAD
 1.44.16.2  17-Jan-2009  mjf Sync with HEAD.
 1.44.16.1  03-Apr-2008  mjf Sync with HEAD.
 1.44.12.1  24-Mar-2008  keiichi sync with head.
 1.45.12.1  19-Jan-2009  skrll Sync with HEAD.
 1.45.4.3  11-Aug-2010  yamt sync with head.
 1.45.4.2  11-Mar-2010  yamt sync with head
 1.45.4.1  04-May-2009  yamt sync with head.
 1.49.4.3  31-May-2011  rmind sync with head
 1.49.4.2  05-Mar-2011  rmind sync with head
 1.49.4.1  03-Jul-2010  rmind sync with head
 1.49.2.1  17-Aug-2010  uebayasi Sync with HEAD.
 1.51.4.1  17-Feb-2011  bouyer Sync with HEAD
 1.51.2.1  06-Jun-2011  jruoho Sync with HEAD.
 1.54.4.2  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.54.4.1  17-Apr-2012  yamt sync with head
 1.55.4.1  18-Feb-2012  mrg merge to -current.
 1.56.10.1  18-May-2014  rmind sync with head
 1.56.6.2  03-Dec-2017  jdolecek update from HEAD
 1.56.6.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.57.2.1  10-Aug-2014  tls Rebase.
 1.58.8.1  07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.58.4.1  05-Feb-2017  skrll Sync with HEAD
 1.59.16.2  08-Apr-2020  martin Merge changes from current as of 20200406
 1.59.16.1  10-Jun-2019  christos Sync with HEAD
 1.59.14.1  06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)

RSS XML Feed