Home | History | Annotate | Download | only in include
History log of /src/sys/arch/sparc/include/cpu.h
RevisionDateAuthorComments
 1.111  13-Jul-2023  riastradh Break cycle by using `struct kmutex *' instead of `kmutex_t *'.

sys/sched.h included sys/mutex.h
which includes sys/intr.h
which includes machine/intr.h
which on cats includes arm/footbridge/footbridge_intr.h
which includes arm/cpu.h
which includes sys/cpu_data.h
which includes sys/sched.h

But there was never any real need for sys/mutex.h in sys/sched.h,
because it only uses pointers to the opaque struct kmutex. Cycle
broken by using `struct kmutex *' instead of pulling in sys/mutex.h
for the definition of kmutex_t.

Side effect: This revealed that sys/cpu_data.h needed sys/intr.h
(which was pulled in accidentally by sys/mutex.h via sys/sched.h) for
SOFTINT_COUNT. Also revealed some other machine/cpu.h header files
were missing includes of sys/mutex.h for kmutex_t.
 1.110  14-Aug-2021  ryo branches: 1.110.4;
Improved the performance of kernel profiling on MULTIPROCESSOR, and possible to get profiling data for each CPU.

In the current implementation, locks are acquired at the entrance of the mcount
internal function, so the higher the number of cores, the more lock conflict
occurs, making profiling performance in a MULTIPROCESSOR environment unusable
and slow. Profiling buffers has been changed to be reserved for each CPU,
improving profiling performance in MP by several to several dozen times.

- Eliminated cpu_simple_lock in mcount internal function, using per-CPU buffers.
- Add ci_gmon member to struct cpu_info of each MP arch.
- Add kern.profiling.percpu node in sysctl tree.
- Add new -c <cpuid> option to kgmon(8) to specify the cpuid, like openbsd.
For compatibility, if the -c option is not specified, the entire system can be
operated as before, and the -p option will get the total profiling data for
all CPUs.
 1.109  24-Jan-2021  mrg avoid using 'extern <func|data>;' inside a .c file, but instead
use header files and ensure definitions are not duplicated or
are technically (if not in codegen) wrong.
 1.108  16-May-2020  ad branches: 1.108.2;
PR port-sparc/55261: sparc still panics running ATF tests

Reinstate the cpu_info change and remove __HAVE_CPU_DATA_FIRST to fix
build failure.
 1.107  16-May-2020  ad Back out previous - it doesn't work.
 1.106  15-May-2020  ad PR port-sparc/55261: sparc still panics running ATF tests

Put cpu_data at the end of cpu_info to see how that modifies the symptom.
 1.105  10-Mar-2020  christos tuck curproc/curlwp under _KERNEL only (no _KMEMUSER)
 1.104  30-Dec-2019  ad PR port-sparc/54789: Sparc boot fails with "Trap 0x21 while interrupts disabled"

Remove assumption that cpu_info is smaller than 1kB.
 1.103  01-Dec-2019  ad Fix false sharing problems with cpu_info. Identified with tprof(8).
This was a very nice win in my tests on a 48 CPU box.

- Reorganise cpu_data slightly according to usage.
- Put cpu_onproc into struct cpu_info alongside ci_curlwp (now is ci_onproc).
- On x86, put some items in their own cache lines according to usage, like
the IPI bitmask and ci_want_resched.
 1.102  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.101  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.100  16-Jan-2018  mrg branches: 1.100.2; 1.100.4;
implement cpuctl identify for sparc and sparc64.

sparc:
- move enum vactype and struct cacheinfo into cpu.h
- move the cache flags from cpuinfo.flags into CACHEINFO.c_flags
(this allows the new cache_printf_backend() to see them.)
remove unused CPUFLG_CACHEIOMMUTABLES and CPUFLG_CACHEDVMA.
- align xmpsg to 64 bytes
- move cache_print() into cache_print.h so it can be shared with
cpuctl. it only depends upon a working printf().
- if found, store the CPU node's "name" into cpu_longname. this
changes the default output to show the local CPU not the
generic CPU family. eg:
cpu0 at mainbus0: mid 8: Ross,RT625 @ 90 MHz, on-chip FPU
vs the generic "RT620/625" previously shown.
- for each CPU export these things:
- name
- fpuname
- mid
- cloc
- freq
- psr impl and version
- mmu impl, version, and number of contexts
- cacheinfo structure (which changed for the first time ever
with this commit.)

sparc64:
- add a minimal "cacheinfo" structure to export the i/d/e-cache
size and linesize.
- store %ver, cpu node "name" and cacheinfo in cpu_info.
- set cpu_info ver, name and cacheinfo in cpu_attach(), and
export them via sysctl, as well as CPU ID and clock freq

cpuctl:
- add identifycpu_bind() that returns false on !x86 as their
identify routines do not need to run on a particular CPU to
obtain its information, and use it to avoid trying to set
affinity when not needed.
- add sparc and sparc64 cpu identify support using the newly
exported values.
 1.99  02-Dec-2017  macallan - return early in xcall() if the function is sparc_noop() instead of triggering
the IPI and then ignoring responses ( or lack thereof )
- write the .tag field last to avoid a race when polling for an incoming
IPI
- add event counters for IPIs being caught with the mutex not held, and for
messages that are already marked as completed
With this my SS20 made it through 48 hours of pkgsrc with MAKE_JOBS=3 and a
pair of SM81s.
Hypersparcs still crash but instead of craziness we get actual error messages,
apparently one CPU will occasionally do a watchdog reset, which according to
the manual is caused by catching a trap with traps disabled. Now to figure
out how that can even happen...
 1.98  16-Jun-2017  jdolecek dumpconf(void) long doesn't exist, remove the prototype

PR kern/39714 by Henning Petersen
 1.97  10-Dec-2016  mrg branches: 1.97.8;
rearrange slightly to enable crash(8) to build.
 1.96  10-Dec-2016  mrg move struct cpu_info and xpmsg into <machine/cpu.h> from
<sparc/sparc/cpuvar.h>. this enables them for crash(8)
and this seems more natural to me anyway.
 1.95  19-Oct-2013  christos branches: 1.95.6; 1.95.10;
make cpu_need_resched() macros consistent; __USE flags
 1.94  01-May-2012  martin branches: 1.94.2; 1.94.4;
On unaligned access, provide the data address to the signal handler, instead
of the faulting instructions address.
 1.93  19-Feb-2012  rmind Remove COMPAT_SA / KERN_SA. Welcome to 6.99.3!
Approved by core@.
 1.92  30-Jul-2011  martin branches: 1.92.2; 1.92.6;
Get rid of #ifdef __sparc__ in uvm code - as noted by cgd back 1996,
now that we have __HAVE_CPU_VMSPACE_EXEC/cpu_vmspace_exec().
 1.91  24-Jan-2011  martin Provide LWP_PC
 1.90  13-Jan-2011  mrg branches: 1.90.2; 1.90.4;
introduce a hack to workaround the savefpstate IPI get's NULL
struct fpstate *.

add a new entry point ipi_savefpstate() that is used for this IPI
instead of the plain ipi_savefpstate(). check for %o0 being NULL,
and if so, just return.

add event counters for the savefpstate IPI, and another one for
when it detects the NULL problem.

make the cpu_info struct xmpsg be aligned to a single cache line.

with this change applied (and another minor change in testing) my
SS20 with dual SM75's has survived for 17 hours on build.sh -j5,
and has reported 7 NULL savefps. (the minor change seems to have
a significant effect at reducing this number, but more testing is
needed for it.)


XXX: this is horrible and we really need to find the real problem
XXX: but this should let people use sparc smp again, and fixes
XXX: for the real problem can be tested by seeing if any of the
XXX: savefp IPI null counter becomes non-zero.
 1.89  03-Jan-2010  mrg branches: 1.89.4;
add an explicit "bool mpsafe" to intr_establish(). only set it to true
for the sun4m timer/counter interrupts. this gets lev10/14 working again
on SMP systems, where those interrupts started taking the kernel lock and
hanging...
 1.88  03-Jan-2010  mrg add two new members to struct intrhand: ih_realfun and ih_realarg, and
use them to take the kernel lock around non-IPL_VM interrupts, using
a intr_biglock_wrapper() function ike x86 does.
 1.87  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.86  29-May-2009  mrg fix up cpu_setfunc() as noted by uwe:

- don't call lwp_startup for cpu_setfunc() users
- introduce lwp_setfunc_trampoline instead
- no need to set the "new" lwp for setfunc
 1.85  27-May-2009  mrg avoid a local variable in a do {} while (0) macro.
 1.84  27-Feb-2008  xtraeme branches: 1.84.4; 1.84.14; 1.84.22;
Remove CTL_MACHDEP_NAMES, it's not used anywhere.

Ok by martin@.
 1.83  03-Dec-2007  ad branches: 1.83.10; 1.83.14;
Interrupt handling changes, in discussion since February:

- Reduce available SPL levels for hardware devices to none, vm, sched, high.
- Acquire kernel_lock only for interrupts at IPL_VM.
- Implement threaded soft interrupts.
 1.82  17-Oct-2007  garbled branches: 1.82.2;
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.81  17-May-2007  yamt branches: 1.81.8; 1.81.10;
merge yamt-idlelwp branch. asked by core@. some ports still needs work.

from doc/BRANCHES:

idle lwp, and some changes depending on it.

1. separate context switching and thread scheduling.
(cf. gmcgarry_ctxsw)
2. implement idle lwp.
3. clean up related MD/MI interfaces.
4. make scheduler(s) modular.
 1.80  04-Mar-2007  christos branches: 1.80.2; 1.80.4; 1.80.10;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.79  16-Feb-2007  ad branches: 1.79.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.78  09-Feb-2007  ad Merge newlock2 to head.
 1.77  11-Dec-2005  christos branches: 1.77.20;
merge ktrace-lwp.
 1.76  27-Oct-2005  uwe We need to init p_md.md_flags on fork, so implement cpu_proc_fork().
 1.75  26-Oct-2005  uwe Add missing extern to make the definition of softnet_cookie into a declaration.
 1.74  26-Oct-2005  uwe Cosmetic. Kill __P. Remove few remaining paramter names in
prototypes. CONSTCOND in while (0). Move wcopy/wzero declarations
with the rest of machdep.c. Add some blank lines for readability.
 1.73  25-Sep-2005  uwe branches: 1.73.2;
G/c msiiep_swap_endian, it's no longer used now that we run without
byteswapping in the PCIC.
 1.72  16-Jun-2005  briggs branches: 1.72.2;
Rename 'ncpus' to 'sparc_ncpus' to avoid shadow warnings in m.i. code.
Also sprinkle an __UNVOLATILE() for sparc.
n.b. sparc64 'cpus' should probably be renamed to 'cpu_info_list' to
match i386 et al.
 1.71  03-Jun-2005  martin Rename ncpu to ncpus (as other ports call it), to avoid shadow warnings.
Sprinkle some const.
 1.69  03-Jun-2005  martin Rename ncpu to ncpus (as other ports call it), to avoid shadow warnings.
Sprinkle some const.
 1.68  02-May-2004  pk The cpu_exit() detour is no longer necessary.
 1.67  17-Apr-2004  pk Remove the cache_flush() trampoline; it's no longer directly cross-called.
Instead, implement the MP parts in terms of cross-callable vcache_flush_range()
function.
 1.66  04-Jan-2004  jdolecek branches: 1.66.2;
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.65  08-Nov-2003  tsutsui #if defined(_KERNEL_OPT) is enough, #if !defined(_LKM) isn't needed
in that case. Pointed out by mrg.
 1.64  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.63  22-Jan-2003  pk branches: 1.63.2;
Add functions to set & get the interrupt target CPU.
 1.62  18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.61  16-Jan-2003  pk Rename the current mp_{pause,resume}_cpus() => mp_{pause,resume}_cpus_ddb().
Implement mp_pause_cpus/mp_resume_cpus on top of the PROM services.
 1.60  14-Jan-2003  pk Add CLKF_LOPRI() macro that allows a (timer) interrupt handler to determine
whether it is interrupting code running at a given IPL level.
 1.59  12-Jan-2003  pk schedcpu() has been fixed; now we can notify another CPU about a pending
reschedule request.
 1.58  12-Jan-2003  pk Remove needless indirection from the curproc() macro.
 1.57  10-Jan-2003  pk Replace `want_resched' and `want_ast' globals by per-CPU variables.
 1.56  06-Jan-2003  pk Move schedintr() to clock.c and initialise schedhz in initclocks(), so
these are available to all timer implementations.
 1.55  03-Jan-2003  mrg remove dead extern fpproc/foundfpu declarations.
 1.54  10-Dec-2002  pk * intr_establish() now takes an optional `fast trap' routine argument.
* also remove __P().
 1.53  09-Dec-2002  pk setsoftint() is no longer used.
 1.52  06-Dec-2002  pk Pass the `device class interrupt level' on to intr_establish() and use to
raise the ipl in the interrupt handlers to the appropriate level. This avoids
interrupt handler interference if one of the devices actually interrupts at
a lower hardware level than the maximum level assined to a device class.

Based on code from Art Grabowski in openbsd.
 1.51  28-Nov-2002  pk Not all sun4m platforms have version 8 sparc CPUs. So go out to the PROM
and get the CPU architecture version from the PROM cpu node `sparc-version'
property.
 1.50  26-Nov-2002  pk Add `machdep.cpu_arch' sysctl to determine the CPU architecture version.
Currrently, cpu types `sun4' and `sun4c' produce version 7, all others
version 8.
 1.49  03-Feb-2002  darrenr * add machdep.booted_device and machdep.boot_args (both fetched from
appropriate PROM variables).
* return "netbsd" for machdep.booted_kernel if the PROM doesn't return us a
kernel name.
 1.48  11-Dec-2001  uwe Export msiiep_swap_endian(onoff) from msiiep.c to turn on/off
automagic endian swapping performed by PCI controller. Need it in
several places where we want to enter PROM repl.
 1.47  04-Dec-2001  darrenr defopt "options SUN4*", put #define for each of SUN4, SUN4C, SUN4M and SUN4U
into opt_arch_sparc.h and include this wherever they are used.
 1.46  12-Nov-2001  pk Remove redundant declarations.
 1.45  27-Sep-2001  mrg branches: 1.45.2; 1.45.4;
implement generic soft interrupts as described in softintr(9). convert
the network, clock & serial softint's to use them.
 1.44  14-Jun-2001  thorpej branches: 1.44.2; 1.44.4;
Don't need to prototype child_return() here, it's in <sys/proc.h>.
 1.43  15-Mar-2001  mrg sprinkle KERNEL_LOCK() and KERNEL_PROC_LOCK() where they're missing. add
SYSCALL_DEBUG support to trap.c.
 1.42  21-Jan-2001  christos branches: 1.42.2;
fix bit rot so that MP kernel compiles s/cpu_no/ci_cpuid/
 1.41  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.40  05-Jun-2000  thorpej Fix typo. kern/10291.
 1.39  03-Jun-2000  thorpej Provide a CPU_IS_PRIMARY() macro in the MULTIPROCESSOR case.
 1.38  31-May-2000  pk Move switchexit() declaration in here.
 1.37  31-May-2000  thorpej - 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.
 1.36  26-May-2000  thorpej branches: 1.36.2;
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.35  16-Dec-1999  thorpej Provide cpu_boot_secondary_cpus().
 1.34  04-Oct-1999  pk branches: 1.34.2; 1.34.8;
Implement sysctl `machdep.booted_kernel'.
 1.33  10-Aug-1999  thorpej Define cpu_number() as discussed on tech-smp.
 1.32  19-Jan-1999  pk Add SIR_SERIAL soft interrupt source.
 1.31  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.30  13-Oct-1998  pk CLKF_INTR() needs to have a MULTIPROCESSOR version.
 1.29  05-Oct-1998  thorpej cpu_set_kpc() prototype is already in <sys/systm.h>.
 1.28  26-Sep-1998  pk mp_{pause,resume,halt}_cpu() prototypes.
 1.27  23-Aug-1998  pk Nuke obsolete prototype.
 1.26  21-Aug-1998  pk iommu_{enter,remove} moved to iommuvar.h
 1.25  22-Nov-1997  tv eliminate declarations of global data in <sparc/cpu.h> and declare in
source files, reducing global symblol replication in .o kernel files
 1.24  15-Mar-1997  pk Add fix_align() and emulinstr() prototypes.
 1.23  06-Nov-1996  cgd Fix an inconsistency that came in with Lite: setrq() was renamed to
setrunqueue(), but remrq() was never renamed. Rename remrq() to
remrunqueue().
 1.22  05-Sep-1996  thorpej Make the SPARC kernel compile again after recent tty cdevsw changes.
 1.21  31-Mar-1996  pk Move autoconf subroutine prototypes to autoconf.h
Deal with sun4m `software interrupts'.
 1.20  15-Mar-1996  christos Fix prototypes for the latest kpc changes.
 1.19  14-Mar-1996  christos Add missing prototypes and fix the fp struct for svr4.
 1.18  14-Mar-1996  pk Remove cpu_set_init_frame().
 1.17  28-Jun-1995  cgd remove unused cpu_exec() definitions. moved "broken swap" markers, for
ports that still need it, to types.h.
 1.16  19-May-1995  pk cpu_swapout() not needed after all.
 1.15  08-May-1995  pk Start swapping.
 1.14  05-May-1995  cgd define BROKEN_SWAP and/or cpu_swapout as appropriate.
 1.13  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.12  28-Mar-1995  jtc KERNEL -> _KERNEL
 1.11  25-Nov-1994  deraadt prototype wcopy/wzero
 1.10  20-Nov-1994  deraadt copyright/Id cleanup
 1.9  26-Oct-1994  deraadt vme interrupt support
 1.8  27-Sep-1994  deraadt USPAGE
 1.7  19-May-1994  deraadt liten
 1.6  05-May-1994  deraadt profiling and clock stuff
 1.5  05-May-1994  deraadt flags foo
 1.4  22-Mar-1994  deraadt move defn of trapvec to cpu.h
 1.3  01-Feb-1994  deraadt sparc runs in current today
 1.2  11-Oct-1993  deraadt stdarg.h, varargs.h, psl.h, autoconf.h: posted patches from torek
cpu.h: cpu_adjstack() won't work well in the NetBSD execve - need a
different model, stub enablertclock() for now..
exec.h: a netbsd-type exec.h file (ie. empty)
param.h: add MID_MACHINE
pmap.h: delete kernel_pmap hack - it doesn't work for us, + two proto's
vmparam.h: VM_MIN_ADDRESS = 0!
 1.1  02-Oct-1993  deraadt Chris Torek's sparc port. Missing lots of things.
 1.34.8.1  27-Dec-1999  wrstuden Pull up to last week's -current.
 1.34.2.3  27-Mar-2001  bouyer Sync with HEAD.
 1.34.2.2  11-Feb-2001  bouyer Sync with HEAD.
 1.34.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.36.2.1  22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.42.2.2  21-Jun-2001  nathanw Catch up to -current.
 1.42.2.1  09-Apr-2001  nathanw Catch up with -current.
 1.44.4.1  01-Oct-2001  fvdl Catch up with -current.
 1.44.2.2  11-Feb-2002  jdolecek Sync w/ -current.
 1.44.2.1  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.45.4.12  17-Jan-2003  thorpej Sync with HEAD.
 1.45.4.11  15-Jan-2003  thorpej Sync with HEAD.
 1.45.4.10  06-Jan-2003  martin Catch up to -current.
 1.45.4.9  03-Jan-2003  thorpej Pass exit2 or lwp_exit2 to switchexit(), as is suggested in comments,
and eliminate switchlwpexit().
 1.45.4.8  03-Jan-2003  thorpej Sync with HEAD (again).
 1.45.4.7  11-Dec-2002  thorpej Sync with HEAD.
 1.45.4.6  24-Jun-2002  nathanw Curproc->curlwp renaming.

Change uses of "curproc->l_proc" back to "curproc", which is more like the
original use. Bare uses of "curproc" are now "curlwp".

"curproc" is now #defined in proc.h as ((curlwp) ? (curlwp)->l_proc) : NULL)
so that it is always safe to reference curproc (*de*referencing curproc
is another story, but that's always been true).
 1.45.4.5  28-Feb-2002  nathanw Catch up to -current.
 1.45.4.4  08-Jan-2002  nathanw Catch up to -current.
 1.45.4.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.45.4.2  20-Nov-2001  pk Adjust prototypes for SA support.
 1.45.4.1  27-Sep-2001  pk file cpu.h was added on branch nathanw_sa on 2001-11-20 16:20:50 +0000
 1.45.2.1  12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.63.2.4  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.63.2.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.63.2.2  18-Sep-2004  skrll Sync with HEAD.
 1.63.2.1  03-Aug-2004  skrll Sync with HEAD
 1.66.2.1  24-Apr-2004  jdc Pull up revision 1.67 (requested by pk in ticket #179)

Many fixes for issues with sparc multi-processor support (includes
fixes to make HyperSPARC MP work).
 1.72.2.5  17-Mar-2008  yamt sync with head.
 1.72.2.4  07-Dec-2007  yamt sync with head
 1.72.2.3  03-Sep-2007  yamt sync with head.
 1.72.2.2  26-Feb-2007  yamt sync with head.
 1.72.2.1  21-Jun-2006  yamt sync with head.
 1.73.2.1  02-Nov-2005  yamt sync with head.
 1.77.20.2  12-Jan-2007  ad sparc MD changes.
 1.77.20.1  11-Jan-2007  ad Checkpoint work in progress.
 1.79.2.2  28-Apr-2007  mrg port yamt-idlelwp to sparc. this does not work yet, but others have
asked that i commit this work-in-progress.

currently kernel threads end up running with PSR_S missing from %psr
and end up failing to dump a user corefile.
 1.79.2.1  12-Mar-2007  rmind Sync with HEAD.
 1.80.10.1  22-May-2007  matt Update to HEAD.
 1.80.4.1  11-Jul-2007  mjf Sync with head.
 1.80.2.2  03-Dec-2007  ad Sync with HEAD.
 1.80.2.1  27-May-2007  ad Sync with head.
 1.81.10.3  23-Mar-2008  matt sync with HEAD
 1.81.10.2  09-Jan-2008  matt sync with HEAD
 1.81.10.1  06-Nov-2007  matt sync with HEAD
 1.81.8.1  09-Dec-2007  jmcneill Sync with HEAD.
 1.82.2.1  08-Dec-2007  mjf Sync with HEAD.
 1.83.14.1  03-Apr-2008  mjf Sync with HEAD.
 1.83.10.1  24-Mar-2008  keiichi sync with head.
 1.84.22.1  21-Apr-2010  matt sync to netbsd-5
 1.84.14.2  08-Mar-2011  riz Apply patches (requested by mrg in ticket #1564):
sys/arch/sparc/dev/zs.c: patch
sys/arch/sparc/include/cpu.h: patch
sys/arch/sparc/include/z8530var.h: patch
sys/arch/sparc/sparc/cpu.c: patch
sys/arch/sparc/sparc/cpuvar.h: patch
sys/arch/sparc/sparc/db_interface.c: patch
sys/arch/sparc/sparc/genassym.cf: patch
sys/arch/sparc/sparc/intr.c: patch
sys/arch/sparc/sparc/locore.s: patch
sys/arch/sparc/sparc/machdep.c: patch
sys/arch/sparc/sparc/timer.c: patch
sys/arch/sparc/sparc/timer_sun4m.c: patch
sys/arch/sparc/sparc/timervar.h: patch
sys/arch/sparc/sparc/trap.c: patch
sys/arch/sparc/sparc/vm_machdep.c: patch

- fix a panic in savefpstate. idea, and code suggestions from uwe
- convert xpmsg_lock to IPL_SCHED. the old spl/simple_lock code ran at
splsched(), and this significantly helps with stability under load when
running with multiple active CPUs
- in strayintr() don't print about stray zs inters in MP case
- fix a deadlock in xcall()
- consolidate the interrupt evcnt(9) into a full set of per-IPL per-CPU
soft/hard counters
- fix xcall() failure messages in some cases
- addd new ddb command "mach xcall"
- use schedintr() (not schedintr_4m()) on MP or single CPU configurations
- call hardclock() the same way on cpu0 in MP and !MP cases
- request the appropriate stack space for nmi_sun4m, in particular,
make sure we have space for %g2...%g5. now entering ddb via eg,
serial break no longer causes cpu1 to fault.
- give memfault_sun*() some entry points that both gdb and ddb will find.
from tsutsui:
- fix panic in interrupt handlers in zs
 1.84.14.1  09-Jan-2010  snj Pull up following revision(s) (requested by mrg in ticket #1223):
sys/arch/sparc/include/cpu.h: revision 1.86
sys/arch/sparc/sparc/locore.s: revision 1.246
sys/arch/sparc/sparc/vm_machdep.c: revision 1.100
fix up cpu_setfunc() as noted by uwe:
- don't call lwp_startup for cpu_setfunc() users
- introduce lwp_setfunc_trampoline instead
- no need to set the "new" lwp for setfunc
 1.84.4.2  11-Mar-2010  yamt sync with head
 1.84.4.1  20-Jun-2009  yamt sync with head
 1.89.4.1  05-Mar-2011  rmind sync with head
 1.90.4.1  08-Feb-2011  bouyer Sync with HEAD
 1.90.2.1  06-Jun-2011  jruoho Sync with HEAD.
 1.92.6.2  02-Jun-2012  mrg sync to latest -current.
 1.92.6.1  24-Feb-2012  mrg sync to -current.
 1.92.2.3  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.92.2.2  23-May-2012  yamt sync with head.
 1.92.2.1  17-Apr-2012  yamt sync with head
 1.94.4.1  18-May-2014  rmind sync with head
 1.94.2.2  03-Dec-2017  jdolecek update from HEAD
 1.94.2.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.95.10.1  07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.95.6.2  28-Aug-2017  skrll Sync with HEAD
 1.95.6.1  05-Feb-2017  skrll Sync with HEAD
 1.97.8.1  08-Dec-2017  msaitoh Pull up following revision(s) (requested by macallan in ticket #429):
sys/arch/sparc/sparc/cpu.c: revision 1.250
sys/arch/sparc/include/cpu.h: revision 1.99
sys/arch/sparc/sparc/intr.c: revision 1.119
- return early in xcall() if the function is sparc_noop() instead of triggering
the IPI and then ignoring responses ( or lack thereof )
- write the .tag field last to avoid a race when polling for an incoming
IPI
- add event counters for IPIs being caught with the mutex not held, and for
messages that are already marked as completed
With this my SS20 made it through 48 hours of pkgsrc with MAKE_JOBS=3 and a
pair of SM81s.
Hypersparcs still crash but instead of craziness we get actual error messages,
apparently one CPU will occasionally do a watchdog reset, which according to
the manual is caused by catching a trap with traps disabled. Now to figure
out how that can even happen...
 1.100.4.2  08-Apr-2020  martin Merge changes from current as of 20200406
 1.100.4.1  10-Jun-2019  christos Sync with HEAD
 1.100.2.1  06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)
 1.108.2.1  03-Apr-2021  thorpej Sync with HEAD.
 1.110.4.1  09-Aug-2023  martin Pull up following revision(s) (requested by maya in ticket #316):

sys/arch/m68k/include/mutex.h: revision 1.13
sys/arch/arm/include/cpu.h: revision 1.125
sys/arch/sun68k/include/intr.h: revision 1.21
sys/arch/arm/include/mutex.h: revision 1.28
sys/sys/rwlock.h: revision 1.18
sys/arch/powerpc/include/mutex.h: revision 1.7
sys/arch/arm/include/mutex.h: revision 1.29
sys/arch/powerpc/include/mutex.h: revision 1.8
sys/uvm/uvm_param.h: revision 1.42
sys/sys/ksem.h: revision 1.16
sys/arch/x86/include/mutex.h: revision 1.10
sys/sys/proc.h: revision 1.372
sys/sys/ksem.h: revision 1.17
sys/arch/ia64/include/mutex.h: revision 1.8
sys/arch/evbarm/include/intr.h: revision 1.29
sys/sys/lua.h: revision 1.9
sys/arch/next68k/include/intr.h: revision 1.23
sys/arch/ia64/include/mutex.h: revision 1.9
sys/arch/hp300/include/intr.h: revision 1.35
sys/arch/hp300/include/intr.h: revision 1.36
sys/arch/sparc/include/cpu.h: revision 1.111
sys/arch/hppa/include/mutex.h: revision 1.16
sys/arch/vax/include/intr.h: revision 1.31
sys/arch/hppa/include/mutex.h: revision 1.17
sys/arch/news68k/include/intr.h: revision 1.28
sys/arch/hppa/include/mutex.h: revision 1.18
sys/arch/hppa/include/intr.h: revision 1.3
sys/arch/hppa/include/mutex.h: revision 1.19
sys/arch/hppa/include/intr.h: revision 1.4
sys/sys/sched.h: revision 1.92
sys/opencrypto/cryptodev.h: revision 1.51
sys/arch/vax/include/mutex.h: revision 1.20
sys/arch/sparc64/include/mutex.h: revision 1.10
sys/arch/ia64/include/sapicvar.h: revision 1.2
sys/arch/riscv/include/mutex.h: revision 1.5
sys/arch/amiga/dev/grfabs_cc.c: revision 1.39
sys/external/bsd/drm2/include/linux/idr.h: revision 1.11
sys/arch/riscv/include/mutex.h: revision 1.6
sys/ddb/files.ddb: revision 1.16
sys/arch/mac68k/include/intr.h: revision 1.32
share/man/man4/ddb.4: revision 1.203
sys/ddb/db_command.c: revision 1.183
sys/arch/mips/include/mutex.h: revision 1.10
sys/ddb/db_command.c: revision 1.184
sys/arch/x68k/include/intr.h: revision 1.22
sys/arch/sparc/include/psl.h: revision 1.51
sys/arch/or1k/include/mutex.h: revision 1.4
sys/arch/mips/include/mutex.h: revision 1.11
sys/arch/arm/xscale/pxa2x0_intr.h: revision 1.16
sys/arch/sparc64/include/cpu.h: revision 1.134
sys/arch/sparc/include/psl.h: revision 1.52
sys/arch/or1k/include/mutex.h: revision 1.5
sys/arch/mvme68k/include/intr.h: revision 1.22
sys/arch/luna68k/include/intr.h: revision 1.16
external/cddl/osnet/sys/sys/kcondvar.h: revision 1.6
sys/arch/sparc/include/mutex.h: revision 1.12
sys/arch/sparc/include/mutex.h: revision 1.13
sys/arch/usermode/include/mutex.h: revision 1.5
sys/arch/usermode/include/mutex.h: revision 1.6
sys/kern/kern_core.c: revision 1.38
usr.sbin/crash/Makefile: revision 1.49
sys/arch/amiga/include/intr.h: revision 1.23
sys/arch/alpha/include/mutex.h: revision 1.12
sys/arch/alpha/include/mutex.h: revision 1.13
sys/arch/evbarm/lubbock/sacc_obio.c: revision 1.16
sys/ddb/ddb.h: revision 1.6
sys/arch/sparc64/include/mutex.h: revision 1.8
sys/arch/sh3/include/mutex.h: revision 1.12
sys/arch/evbarm/lubbock/sacc_obio.c: revision 1.17
sys/ddb/db_syncobj.c: revision 1.1
sys/arch/vax/include/mutex.h: revision 1.18
sys/arch/sparc64/include/psl.h: revision 1.63
sys/arch/sparc64/include/mutex.h: revision 1.9
sys/arch/sh3/include/mutex.h: revision 1.13
sys/arch/evbarm/lubbock/obio.c: revision 1.13
sys/arch/atari/include/intr.h: revision 1.23
sys/ddb/db_syncobj.c: revision 1.2
sys/arch/vax/include/mutex.h: revision 1.19
sys/arch/evbarm/g42xxeb/obio.c: revision 1.14
sys/arch/evbarm/g42xxeb/obio.c: revision 1.15
sys/arch/cesfic/include/intr.h: revision 1.14
sys/ddb/db_syncobj.h: revision 1.1
sys/arch/x86/include/cpu.h: revision 1.134
sys/arch/evbarm/g42xxeb/obio.c: revision 1.16
sys/arch/cesfic/include/intr.h: revision 1.15
sys/arch/arm/xscale/pxa2x0_intr.c: revision 1.26
sys/sys/cpu_data.h: revision 1.54
sys/arch/m68k/include/mutex.h: revision 1.12
sys/arch/ia64/acpi/madt.c: revision 1.6

sys/rwlock.h: Make this more self-contained for bool.

machine/mutex.h: Sprinkle includes so this can be used by crash(8).

ddb: New `show all tstiles' command.
Shows who's waiting for which locks and what the owner is up to.

Include psl.h for ipl_cookie_t if __MUTEX_PRIVATE

sys: Rip <sys/resourcevar.h> out of <uvm/uvm_param.h>.

And thus out of <sys/param.h>, which is exceedingly overused and
fragile and delenda est.

Should fix (some) issues with the recent inclusion of machine/lock.h
in various machine/mutex.h files.

arm/mutex.h: Need machine/intr.h, machine/lock.h.

For ipl_cookie_t and __cpu_simple_lock_t.
evbarm/intr.h: Define ipl_cookie_t before including ARM_INTR_IMPL.

Otherwise arm/mutex.h doesn't work, due to a cyclic dependency which
should really be fixed.
opencrypto/cryptodev.h: Fix includes.
- Move sys/condvar.h under #ifdef _KERNEL.
- Add some other necessary includes and forward declarations.
- Sort.

hp300/intr.h: Fix missing includes.
linux/idr.h: Need <sys/mutex.h> for kmutex_t.
amiga/intr.h: Don't define spl*() functions if !_KERNEL.

This is used by crash(8) now, and what's important is ipl_cookie_t.
cesfic/intr.h: Expose ipl_cookie_t to userland for crash(8).
cesfic/intr.h: Expose ipl_cookie_t to userland only with _KMEMUSER.

Probably not necessary but let's be a little more cautious about
this.

atari/intr.h: Expose ipl_cookie_t with _KMEMUSER for crash(8).

arm/cpu.h: Need sys/param.h for COHERENCY_UNIT.

Nix machine/param.h -- not meant to be used directly, pulled in by
sys/param.h.

Move the definition of ipl_cookie_t out of the kernel-only sections,
some _KMEMUSER applications need it.

ddb: Cast pointer to uintptr_t first before db_expr_t.

hppa/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

luna68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

mvme68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

news68k/intr.h: Fix includes. Put some definitions under _KERNEL.

next68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

sys/ksem.h: Hack around fstat(8) abuse of _KERNEL.

sun68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

vax/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).

x68k/intr.h: Put functions under _KERNEL so crash(8) can use this.

Make ipl_cookie_t visible for _KMEMUSER userland applications.

fix editor mishap in previous

Explicitly include <sys/mutex.h> for kmutex_t.

Replace kmutex_t * (which may be undefined here) with struct kmutex *,
suggested by Taylor.

hp300/intr.h: Put most of this under #ifdef _KERNEL.
Only ipl_cookie_t really needs to be exposed now, for crash(8).

mac68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).
Make inclusion of sys/intr.h explicit for spl*.

fix hppa and vax builds.

machine/lock.h isn't necessary for __cpu_simple_lock_t, it's in
sys/types.h. avoids cpu_data.h vs sched.h include order issues.

move the hppa ipl_t typedef with the moved usage of it.
machine/mutex.h: Sprinkle sys/types.h, omit machine/lock.h.

Turns out machine/lock.h is not needed for __cpu_simple_lock_t, which
always comes from sys/types.h. And, really, sys/types.h (or at least
sys/stdint.h) is needed for uintN_t and uintptr_t.

ddb: Cast pointer to uintptr_t, then to db_expr_t.
Avoids warnings about conversion between pointer and integer of
different size on some architectures.

re-fix hppa builds.

this file uses __cpu_simple_lock(), not just the underlying type,
so it does need machine/lock.h.

Break cycle by using `struct kmutex *' instead of `kmutex_t *'.
sys/sched.h included sys/mutex.h
which includes sys/intr.h
which includes machine/intr.h
which on cats includes arm/footbridge/footbridge_intr.h
which includes arm/cpu.h
which includes sys/cpu_data.h
which includes sys/sched.h

But there was never any real need for sys/mutex.h in sys/sched.h,
because it only uses pointers to the opaque struct kmutex. Cycle
broken by using `struct kmutex *' instead of pulling in sys/mutex.h
for the definition of kmutex_t.

Side effect: This revealed that sys/cpu_data.h needed sys/intr.h
(which was pulled in accidentally by sys/mutex.h via sys/sched.h) for
SOFTINT_COUNT. Also revealed some other machine/cpu.h header files
were missing includes of sys/mutex.h for kmutex_t.

ia64: Need sys/types.h for u_int, vaddr_t; sys/mutex.h for kmutex_t.

explicitly include no longer implicitly included sys/mutex.h.

arm/xscale: Use sys/bitops.h fls32 - 1 instead of 31 - __builtin_clz.
Sidesteps namespace collision with `#define bits ...' in net/zlib.c.

complete the previous - there were two calls to find_first_bit() to fix.

arm/xscale: Missed a spot with previous find_first_bit commit.

evbarm/g42xxeb: Fix off-by-one in previous.

The original find_first_bit(x) was 31 - __builtin_clz((uint32_t)x),
which is equivalent to fls32(x) - 1, not to fls32(x).

Note that fls32 is 1-based and returns 0 for x=0.

RSS XML Feed