Home | History | Annotate | Download | only in include
History log of /src/sys/arch/amiga/include/cpu.h
RevisionDateAuthorComments
 1.88  20-Jan-2024  thorpej Largely unify the <machine/cpu.h> headers on the m68k platforms.
 1.87  19-Jan-2024  thorpej Consistently use "intr_depth" as the name of the interrupt depth counter
on m68k platforms.
 1.86  19-Jan-2024  thorpej Switch the amiga port to use the same clockframe layout as the other
m68k ports.
 1.85  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.84  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.83  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.82  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.81  17-Dec-2016  flxd branches: 1.81.14; 1.81.16;
Fix typo "one the" and architecture where appropriate.
 1.80  19-Oct-2013  christos branches: 1.80.6; 1.80.10;
make cpu_need_resched() macros consistent; __USE flags
 1.79  16-May-2011  tsutsui branches: 1.79.4; 1.79.14; 1.79.18;
- 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.78  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.77  13-Jan-2011  phx branches: 1.77.2; 1.77.4;
Recognize Amiga 600 model.
Patch submited by Radoslaw Kujawa.
 1.76  22-Dec-2010  matt 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.75  09-Feb-2010  phx branches: 1.75.2;
Moved the macros amiga_cpu_sync() and amiga_membarrier() from amiga/device.h
to the MD include/cpu.h.
Also make sure that grf_cvreg.h includes cpu.h as it is needed by Xamiga
in xsrc/xfree/xc/programs/Xserver/hw/netbsd/amiga/s3/amigaCV.h.
 1.74  23-Nov-2009  rmind branches: 1.74.2;
Use lwp_getpcb() on m68k ports, clean from struct user usage.
 1.73  21-Oct-2009  rmind 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.72  19-May-2009  phx Removed old Amiga-specific "sicallback" software interrupts and replaced
them by MI softints. Approved by "is".
 1.71  14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.70  27-Feb-2008  xtraeme branches: 1.70.4; 1.70.12; 1.70.18;
Remove CTL_MACHDEP_NAMES, it's not used anywhere.

Ok by martin@.
 1.69  06-Jan-2008  mhitch branches: 1.69.2; 1.69.6;
Add timecounter support and borrow counter-based delay from i386.
From joerg; testing and final tweaks by me.
 1.68  17-Oct-2007  garbled branches: 1.68.2; 1.68.8;
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.67  04-Aug-2007  ad branches: 1.67.2;
Add ci_cpuid where it's missing.
 1.66  21-May-2007  tsutsui branches: 1.66.2; 1.66.4; 1.66.8;
Move declarations of m68k common functions
from <machine/cpu.h> to <m68k/m68k.h>.
While here, remove some obsolete function decls.
 1.65  20-May-2007  mhitch Forgot cpu.h for amiga - rename proc_trampoline()->lwp_trampoline().
 1.64  18-May-2007  mhitch Amiga changes for idlelwp.
 1.63  04-Mar-2007  christos branches: 1.63.2; 1.63.4; 1.63.10;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.62  16-Feb-2007  ad branches: 1.62.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.61  09-Feb-2007  ad Merge newlock2 to head.
 1.60  11-Dec-2005  christos branches: 1.60.20;
merge ktrace-lwp.
 1.59  26-Sep-2004  yamt branches: 1.59.12;
don't expose cpu_info to userland.
 1.58  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.57  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.56  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.55  17-Jan-2003  thorpej branches: 1.55.2;
Merge the nathanw_sa branch.
 1.54  25-Apr-2002  aymeric o replace definitions by declarations in header files
o put definitions where due
o cleanup some types (u_int -> vaddr_t's for example)
o minor other cleanup
 1.53  07-Nov-2001  aymeric branches: 1.53.2;
introduce an interrupt_depth variable which counts how nested we are into
interrupts.
This allows hardclock() to account for the time spent in interrrupts, and
as a side-effect, top(1), systat(1) and others will no more report 0% of
interrupt activity.

mvme68k does that already.
 1.52  30-May-2001  mrg branches: 1.52.2; 1.52.6;
use _KERNEL_OPT
 1.51  19-Dec-2000  scw branches: 1.51.2;
Unification of the m68k syscall() function.
 1.50  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.49  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.48  14-Oct-1999  is branches: 1.48.2;
Remove now superfluous prototype definitions (of the m68k cache operations).
 1.47  10-Aug-1999  thorpej branches: 1.47.2;
Define cpu_number() as discussed on tech-smp.
 1.46  26-Feb-1999  is synchronize types, and s/curproc/p/ in one forgotten place
 1.45  25-Feb-1999  is mac68k part of pr 6152 fix, and missing bits for the others
 1.44  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.43  07-Oct-1998  thorpej Oops, back out a buglet I didn't intend to commit in the last change.
 1.42  06-Oct-1998  thorpej configure() prototype is in <sys/device.h>
 1.41  05-Sep-1998  is Define is_draco() inlined.
Corresponds to removal of this function in autoconf.c 1.61.
 1.40  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.39  26-Oct-1997  is Make these compile after m68k/m68k.h 1.4->1.5.
 1.38  09-Apr-1997  thorpej regdump() is prototyped in <m68k/cpu.h> now.
 1.37  31-Jan-1997  mhitch "options GENERIC" is obsolete, don't need the prototype for setconf() anymore.
 1.36  11-Sep-1996  thorpej Use <m68k/cpu.h>.
 1.35  19-May-1996  is Some more Prototypes needed for DraCo support.
 1.34  16-May-1996  is Only declare setconf() #ifdef GENERIC.
 1.33  16-May-1996  is add DCIA prototype.
 1.32  09-May-1996  is First part of M68060 and DraCo support.

* for the M68060 part: store buffer and branch target cache aren't
enabled yet (this needs cleanup of lots of locore.s code which is a
maze of little passages, all a little different) (and it wasn't yet
tested in an accellerated Amiga, only in the DraCo).

I've included a workaround for 2 of the CPU bugs in chips with Masks
1F43G and earlier, but didn't bother to deal with the can of worms
in the [0-3]D11W chips. Be sure to get "68060 rev. 1" or more
reported at kernel startup time, or at least mention it (or the mask
revision, if available) when reporting problems.

* for the DraCo: only machines with a CIA timer.

I assigned machine id 32000+nn (0x7Dnn), where n is the machine
readable Quicklogic custom chip revision (also printed at boot
time). "Guaranteed to work" up to rev. 3, newer DraCo's aren't
guaranteed to have any CIA (we don't have a driver for the new timer
yet).

Supported are:

- MF-II keyboards on the native interface and A3000 keyboards via
the CIA.
- builtin SCSI interface (yet another instance of siop)
- CIA timer.
- Zorro II devices which don't do DMA (don't get mapped to Zorro II
address space in the DraCo)
- "local bus" devices which are autoconfigured by the boot rom
(should be all); only an Altais driver is there (looks like a Retina Z3)

Not yet supported are:

- native timer of newer machines.
- Real Time Clock.
- serial, parallel + floppy on the SuperIO chip (that is also: no mouse)

XXX You need an enhanced boot loader, which will committed in a few days.

XXX std.draco should and will go away.
 1.31  27-Apr-1996  veego Add a __noreturn__ attribute for doboot
 1.30  23-Apr-1996  veego The prototyp for cpu_set_kpc is now in sys/systm.h
 1.29  21-Apr-1996  veego - Cleanup for -Wall and -Wstrict-prototypes
 1.28  30-Mar-1996  is Typo squished.
 1.27  26-Mar-1996  is Yet more MC68060 bits.
 1.26  15-Mar-1996  is AMIGA_68060 flag in cpu.h and genassym.c.
 1.25  21-Dec-1995  mycroft Remove deprecated cpu_setstack().
 1.24  18-Aug-1995  chopps SCSI disconnects: siop from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
and sbic from "Eduardo E. Horvath eeh@btr.com" <eeh@btr.btr.com>

Other cleanup (remove cpu040) and enabling IVS A500 support
from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
 1.23  28-Jun-1995  cgd remove unused cpu_exec() definitions. moved "broken swap" markers, for
ports that still need it, to types.h.
 1.22  16-May-1995  chopps PS_STRINGS in A2. Add fputype, remove cpuspeed. switch to new coredump
 1.21  12-May-1995  chopps enable swapping of process
 1.20  11-May-1995  chopps remove double mapping of kernel stack. created cpu_set_kpc()
 1.19  05-May-1995  cgd define BROKEN_SWAP and/or cpu_swapout as appropriate.
 1.18  22-Apr-1995  christos - added sunos_machdep.c for sun3, atari, amiga and mac68k.
- changed machdep.c and trap.c to use struct emul.
- remove ep_setup references.
- added struct emul to all emulations.
 1.17  28-Mar-1995  jtc KERNEL -> _KERNEL
 1.16  12-Feb-1995  chopps Many changes from osymh@gemini.oscs.montana.edu (Michael L. Hitch)
Now use amiga HW for soft interrupts, non-contig options (2 or many chunks),
interrupt handler lists, 4066 ethernet, 1291 scsi, option to defer level 6
interrupts to level 4 (deal with icky built-in serial port)
 1.15  26-Oct-1994  cgd new RCS ID format.
 1.14  04-Jun-1994  chopps started out cleaning up amiga_init.c ended up touching alot of files.
 1.13  25-May-1994  chopps update to work with new m68k frame and recent vm changes.
 1.12  09-May-1994  chopps update for recent sig changes and fix clock.c and ite.c
 1.11  08-May-1994  chopps resistance is futile, you will be assimilated.
amiga goes: config.new *and* /sys/scsi.
clock code coerced into a single .c file adding an accurate usec delay().
disklabel.c updated to DTRT, code to write RDB's to be added soon.
sbic (old scsi) converted over to new scsi and config this covers about
90% of users. Other drivers soon.
 1.10  04-May-1994  chopps update to match current proc flags.
 1.9  10-Apr-1994  chopps also conform to standard style
 1.8  10-Apr-1994  chopps protect against multiple inclusion (and be consitent)
 1.7  11-Feb-1994  chopps Add missing Id's
 1.6  03-Feb-1994  chopps swap ps and pc to match m68k:struct frame.
 1.5  26-Jan-1994  mw Updated headers from current amiga branch.
 1.4  30-Oct-1993  mw new tree for amiga, replacing the bogous previous one.
SunOS support works for a lot of executables now (static and dynamic).
 1.3  02-Sep-1993  mw new source release integrated from amiga-release.
 1.2  01-Aug-1993  mycroft Add RCS identifiers (this time on the correct side of the branch), and
incorporate recent changes in netbsd-0-9 branch.
 1.1  05-Jul-1993  mw branches: 1.1.1;
Initial revision
 1.1.1.2  02-Sep-1993  mw Update of arch/amiga tree, includes
- realtime clock support for a2k and a3k
- scsi drivers for a2091 and gvp-II controllers in a2k
- working ethernet driver for a2065/ameristar lance-controllers
 1.1.1.1  05-Jul-1993  mw sys/arch/amiga tree. This is the machdep part required to get the kernel
up on an A3000. There are still (very) few changes required outside the
arch/amiga tree, so you can't recompile the kernel yet. Support for
third party SCSI controllers for the A2000 is on its way. The kernel is
fully functional (except for a missing ethernet-driver ...). This
tree is based on my version #390.
 1.47.2.1  27-Dec-1999  wrstuden Pull up to last week's -current.
 1.48.2.2  05-Jan-2001  bouyer Sync with HEAD
 1.48.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.

I updated the amiga SCSI drivers, but completely untested yet (may not even
compile)
 1.51.2.1  21-Jun-2001  nathanw Catch up to -current.
 1.52.6.1  12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.52.2.2  23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.52.2.1  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.53.2.6  03-Dec-2002  gmcgarry Use cpu_proc_fork().
 1.53.2.5  20-Jun-2002  nathanw Catch up to -current.
 1.53.2.4  08-Jan-2002  nathanw Catch up to -current.
 1.53.2.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.53.2.2  17-Nov-2001  scw SA bits for Amiga.
Compile-tested only.
 1.53.2.1  07-Nov-2001  scw file cpu.h was added on branch nathanw_sa on 2001-11-17 21:59:09 +0000
 1.55.2.5  19-Oct-2004  skrll Sync with HEAD
 1.55.2.4  24-Sep-2004  skrll Sync with HEAD.
 1.55.2.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.55.2.2  18-Sep-2004  skrll Sync with HEAD.
 1.55.2.1  03-Aug-2004  skrll Sync with HEAD
 1.59.12.4  17-Mar-2008  yamt sync with head.
 1.59.12.3  21-Jan-2008  yamt sync with head
 1.59.12.2  03-Sep-2007  yamt sync with head.
 1.59.12.1  26-Feb-2007  yamt sync with head.
 1.60.20.1  06-Feb-2007  ad Make amiga & mac68k compile.
 1.62.2.1  12-Mar-2007  rmind Sync with HEAD.
 1.63.10.2  03-Oct-2007  garbled Sync with HEAD
 1.63.10.1  22-May-2007  matt Update to HEAD.
 1.63.4.1  11-Jul-2007  mjf Sync with head.
 1.63.2.2  20-Aug-2007  ad Sync with HEAD.
 1.63.2.1  27-May-2007  ad Sync with head.
 1.66.8.1  04-Aug-2007  jmcneill Sync with HEAD.
 1.66.4.1  15-Aug-2007  skrll Sync with HEAD.
 1.66.2.1  07-Aug-2007  matt Sync with HEAD.
 1.67.2.3  23-Mar-2008  matt sync with HEAD
 1.67.2.2  09-Jan-2008  matt sync with HEAD
 1.67.2.1  06-Nov-2007  matt sync with HEAD
 1.68.8.1  08-Jan-2008  bouyer Sync with HEAD
 1.68.2.1  18-Feb-2008  mjf Sync with HEAD.
 1.69.6.1  03-Apr-2008  mjf Sync with HEAD.
 1.69.2.1  24-Mar-2008  keiichi sync with head.
 1.70.18.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.70.12.1  28-Apr-2009  skrll Sync with HEAD.
 1.70.4.3  11-Mar-2010  yamt sync with head
 1.70.4.2  20-Jun-2009  yamt sync with head
 1.70.4.1  04-May-2009  yamt sync with head.
 1.74.2.1  30-Apr-2010  uebayasi Sync with HEAD.
 1.75.2.2  31-May-2011  rmind sync with head
 1.75.2.1  05-Mar-2011  rmind sync with head
 1.77.4.1  17-Feb-2011  bouyer Sync with HEAD
 1.77.2.1  06-Jun-2011  jruoho Sync with HEAD.
 1.79.18.1  18-May-2014  rmind sync with head
 1.79.14.2  03-Dec-2017  jdolecek update from HEAD
 1.79.14.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.79.4.1  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.80.10.1  07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.80.6.1  05-Feb-2017  skrll Sync with HEAD
 1.81.16.2  08-Apr-2020  martin Merge changes from current as of 20200406
 1.81.16.1  10-Jun-2019  christos Sync with HEAD
 1.81.14.1  06-Sep-2018  pgoyette Sync with HEAD

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

RSS XML Feed