Home | History | Annotate | Download | only in arm32
History log of /src/sys/arch/arm/arm32/db_interface.c
RevisionDateAuthorComments
 1.66  20-Sep-2025  mrg make sure ddb_regp doesn't point to some stack variable when kdb_trap() returns

found by GCC 14.
 1.65  02-Aug-2023  skrll KNF
 1.64  26-Oct-2022  riastradh ddb/db_active.h: New home for extern db_active.

This can be included unconditionally, and db_active can then be
queried unconditionally; if DDB is not in the kernel, then db_active
is a constant zero. Reduces need for #include opt_ddb.h, #ifdef DDB.
 1.63  03-Dec-2020  skrll Provide and use a sev() macro for the sev instruction.

While here use the correct barrier to ensure completion of memory accesses
before a couple of the sev() calls.
 1.62  01-Dec-2020  rin Fix confusions related to encoding of instructions.

For __ARMEB__ in BE8 mode, instructions are encoded in little-endian.
Therefore, we need to swap bytes against these in native byte order.

In other cases, i.e., __ARMEL__ and __ARMEB__ in BE32 mode, instructions
are in native byte order, and we don't need to swap them.
 1.61  20-Jun-2020  skrll branches: 1.61.2;
KNF
 1.60  20-Jun-2020  skrll KNF #includes

Remove some unnecessary ones while I'm here.
 1.59  21-Jul-2019  rin Fix hand-crafted trap instruction in cpu_Debugger() for big endian.
 1.58  28-May-2018  chs branches: 1.58.2;
merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
- dtrace FBT probes can now be placed in kernel modules.
- ZFS now supports mmap().
 1.57  17-Jan-2018  skrll branches: 1.57.2;
G/C ARM32_NEW_VM_LAYOUT
 1.56  30-Jun-2017  skrll KNF. Same code before and after.
 1.55  30-Jun-2017  skrll typo in comment
 1.54  29-Oct-2014  skrll branches: 1.54.2;
Sprinkle #include "opt_multiprocessor.h"
 1.53  25-Oct-2014  skrll Remove katelib.h and references to it.

{Read,Write}{Word,Byte} macros are provided in the files that still use
them. Someone(tm) should convert them to bus_space(9)
 1.52  30-Mar-2014  skrll branches: 1.52.4;
Provide a DDB_REGS in the same way to others. Makes crash buildable.
 1.51  28-Mar-2014  matt Make ddb_registers per-cpu. All switching of CPUs (xxx doesn't work yet).
 1.50  15-Dec-2013  skrll Trailing whitespace.
 1.49  16-Feb-2012  christos branches: 1.49.2; 1.49.4;
move stuff between the two files, so db_interface contains the functions it
needs for userland programs to link.
 1.48  16-Jun-2010  jmcneill branches: 1.48.8; 1.48.12; 1.48.16;
PR port-arm/43299: Support added for igepv2/cortexa8/omap3530

Apply patch from PR, with build fixes. ok skrll, matt
 1.47  14-Mar-2009  dsl branches: 1.47.2; 1.47.4;
Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.46  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.45  26-Mar-2008  chris branches: 1.45.4; 1.45.12; 1.45.18; 1.45.22;
Add help text to arm machine specific ddb commands.

Part of fix for port-arm/38311.
 1.44  17-Oct-2007  garbled branches: 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  22-Sep-2007  martin Add a new option DDB_VERBOSE_HELP that adds online help to ddb.
From Adam Hamsik.
Minor modifications by me, all bugs are probably mine.
 1.42  22-Feb-2007  thorpej branches: 1.42.4; 1.42.12; 1.42.18; 1.42.20; 1.42.22; 1.42.24;
TRUE -> true, FALSE -> false
 1.41  06-Jan-2007  christos branches: 1.41.2;
Fix branch handling in ddb. From Bucky Katz.
 1.40  05-Apr-2006  uwe branches: 1.40.8;
Define ddb_regs in db_interface.c.
Change its definion in db_machdep.h into a declaration.
 1.39  24-Dec-2005  perry branches: 1.39.4; 1.39.6; 1.39.8; 1.39.10; 1.39.12;
bare asm -> __asm
 1.38  11-Dec-2005  christos merge ktrace-lwp.
 1.37  02-Jun-2005  uwe branches: 1.37.2;
Catch up with constification.
 1.36  02-Jun-2005  he Adapt to shadowing and qualifier-cast warnings.
 1.35  07-Aug-2004  rearnsha Don't overload the unknown instruction handling for the core onto CP0.
Instead, add a seventeenth 'co-processor' specifically for the core.
Add support for ARMv5 unknown instructions in the 'NV' space.
 1.34  26-Oct-2003  chris Fix up some unitialised variables.
 1.33  25-Aug-2003  mrg make it "static long nil;" as it's used as &nil in an array wanting long *'s.
makes GCC3 happy.
 1.32  15-Jul-2003  lukem __KERNEL_RCSID()
 1.31  09-Jul-2003  thorpej Make faulting in DDB continue back in the top-level command
loop properly.
 1.30  06-Jun-2003  scw branches: 1.30.2;
Modify db_{read,write}_bytes() to do a single 16- or 32-bit read/write if
'size' is 2 or 4 respectively.
This makes reading/writing hardware registers work as expected in all cases.
 1.29  21-May-2003  thorpej Remove #ifdefs supporting the old pmap, switching fully to the new.
 1.28  21-May-2003  bsh fix warning when KGDB is defined and DDB is not defined.
 1.27  03-May-2003  thorpej In db_write_bytes(), use kernel_text rather than KERNEL_TEXT_BASE.
 1.26  03-May-2003  thorpej Remove the non-ELF case in db_machine_init().
 1.25  29-Apr-2003  scw KERNEL_TEXT_BASE is not defined for ARM32_NEW_VM_LAYOUT.
 1.24  28-Apr-2003  briggs Add arm32 machine-specific remote kgdb support. Largely
from PR port-arm/15530 by bsh@, but with some updates from
me, including a fresh arm32/kgdb_machdep.c--ported from pc532.
 1.23  18-Apr-2003  scw Add the generic arm32 bits of the new pmap, contributed by Wasabi Systems.

Some features of the new pmap are:

- It allows L1 descriptor tables to be shared efficiently between
multiple processes. A typical "maxusers 32" kernel, where NPROC is set
to 532, requires 35 L1s. A "maxusers 2" kernel runs quite happily
with just 4 L1s. This completely solves the problem of running out
of contiguous physical memory for allocating new L1s at runtime on a
busy system.

- Much improved cache/TLB management "smarts". This change ripples
out to encompass the low-level context switch code, which is also
much smarter about when to flush the cache/TLB, and when not to.

- Faster allocation of L2 page tables and associated metadata thanks,
in part, to the pool_cache enhancements recently contributed to
NetBSD by Wasabi Systems.

- Faster VM space teardown due to accurate referenced tracking of L2
page tables.

- Better/faster cache-alias tracking.

The new pmap is enabled by adding options ARM32_PMAP_NEW to the kernel
config file, and making the necessary changes to the port-specific
initarm() function. Several ports have already been converted and will
be committed shortly.
 1.22  22-Aug-2002  thorpej * Add PTE_SYNC() and PTE_SYNC_RANGE() macros. These don't actually do
anything yet.
* Use PTE_SYNC() and PTE_SYNC_RANGE() in some obvious places, i.e.
where vtopte() is used.
 1.21  13-May-2002  matt branches: 1.21.2;
Nuke local extern label_t *db_recover; it's now in <ddb/db_extern.h>
 1.20  10-Apr-2002  thorpej vm_offset_t -> vaddr_t,paddr_t
 1.19  09-Apr-2002  thorpej Use abstract names for the protection and PTE type bits in
L1 and L2 descriptors. This will allow us to support different
PTE layouts that enable the use of extensions on different
processor models.
 1.18  05-Apr-2002  thorpej * Rewrite the 32-bit ARM pte.h based on the ARM architecture manual.
Significant cleanup, here, including better PTE bit names.
* Add XScale PTE extensions (ECC enable, write-allocate cache mode).
* Mechanical changes everywhere else to update for new pte.h. While
doing this, two bugs (as a result of typos) were fixed in

arm/arm32/bus_dma.c
evbarm/integrator/int_bus_dma.c
 1.17  25-Jan-2002  thorpej Overhaul of the ARM cache code. This is mostly a simplification
pass. Rather than providing a whole slew of cache operations that
aren't ever used, distill them down to some useful primitives:

icache_sync_all Synchronize I-cache
icache_sync_range Synchronize I-cache range

dcache_wbinv_all Write-back and Invalidate D-cache
dcache_wbinv_range Write-back and Invalidate D-cache range
dcache_inv_range Invalidate D-cache range
dcache_wb_range Write-back D-cache range

idcache_wbinv_all Write-back and Invalidate D-cache,
Invalidate I-cache
idcache_wbinv_range Write-back and Invalidate D-cache,
Invalidate I-cache range

Note: This does not yet include an overhaul of the actual asm files
that implement the primitives. Instead, we've provided a safe default
for each CPU type, and the individual CPU types can now be optimized
one at a time.
 1.16  17-Jan-2002  thorpej Add cpwait's after TLB operations.
 1.15  17-Jan-2002  thorpej Cleanup a little, and teach db_write_text() about section mappings.
 1.14  17-Jan-2002  thorpej * db_validate_address(): Use pmap_extract().
* db_read_bytes()/db_write_bytes(): Do comparisons against the
(unsigned) size_t correctly.
 1.13  05-Jan-2002  chris Make some of the arm32 files build with LOOSE_PROTOTYPES not set in the makefile. Turned up a few mismatched functions. Note that this isn't all of the arm32 files. Aim will be to get arm32 kernels built with LOOSE_PROTOTYPES not set.
 1.12  28-Nov-2001  thorpej Don't grovel interrupt-related info here; if a platform wants to
do that, let it do that in a way it can control.
 1.11  23-Nov-2001  thorpej Use <arm/undefined.h> instead of <machine/undefined.h>.
 1.10  23-Nov-2001  thorpej No need to pull in <machine/pte.h> directly.
 1.9  22-Nov-2001  thorpej Kill <machine/katelib.h>. Any place that still uses it should just
reference <arm/arm32/katelib.h> until such time as all use of this
file has been purged from the face of the earth.
 1.8  09-Nov-2001  thorpej branches: 1.8.2;
Add some rudimentary support for ELF symbols in DDB on the ARM ports.
On platforms which load the kernel sans symbols directly from firmware
(possibly in e.g. S-Record format), call ddb_init() with empty arguments,
so that it will search any compiled in SYMTAB_SPACE. On all other platforms,
if __ELF__, also call ddb_init() with empty arguments until ELF bootloaders
which pass symbol information are ready.
 1.7  28-Jul-2001  chris branches: 1.7.4;
A couple of tidy ups to pmap:
pmap_t -> struct pmap * in pmap.c and pmap.h
kernel_pmap -> pmap_kernel() everywhere.

Compiled and booted on riscpc and cats.
 1.6  24-Jun-2001  chs branches: 1.6.2;
remove "machine vmstat" command, since "show uvmexp" does the same thing.
 1.5  02-May-2001  bjh21 In an ELF kernel, don't try to find an a.out symbol table.
 1.4  13-Mar-2001  bjh21 Change the value of tf_pc in undefined-instruction handlers on arm32. It now
always points to the undefined instruction in question. It's up to the
handler to advance it to the next instruction if it wants execution to
continue there. This is how things have always worked on arm26.
 1.3  11-Mar-2001  bjh21 branches: 1.3.2;
Change undefined instruction handler to use a linked list for each
co-processor. This is necessary so we can have several handlers for
CP0 (used as a catch-all for non-CP instructions).

Handlers are now removed using remove_coproc_handler(), rather than by calling
install_coproc_handler() with a NULL handler.

Because install_coproc_handler() can now allocate memory, there's a version
for use at boot time that doesn't.
 1.2  04-Mar-2001  matt branches: 1.2.2;
Remove OFW hooks. Allow ports to add there own hooks via
ARM_EXTRA_DB_COMMANDS.
 1.1  04-Mar-2001  matt Move these from arm32/arm32
 1.2.2.2  21-Jun-2001  nathanw Catch up to -current.
 1.2.2.1  09-Apr-2001  nathanw Catch up with -current.
 1.3.2.3  27-Mar-2001  bouyer Sync with HEAD.
 1.3.2.2  12-Mar-2001  bouyer Sync with HEAD.
 1.3.2.1  11-Mar-2001  bouyer file db_interface.c was added on branch thorpej_scsipi on 2001-03-12 13:27:19 +0000
 1.6.2.5  06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.6.2.4  23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.6.2.3  11-Feb-2002  jdolecek Sync w/ -current.
 1.6.2.2  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.6.2.1  03-Aug-2001  lukem update to -current
 1.7.4.1  12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.8.2.9  27-Aug-2002  thorpej Sync with -current.
 1.8.2.8  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.8.2.7  20-Jun-2002  nathanw Catch up to -current.
 1.8.2.6  17-Apr-2002  nathanw Catch up to -current.
 1.8.2.5  28-Feb-2002  nathanw Catch up to -current.
 1.8.2.4  11-Jan-2002  nathanw More catchup.
 1.8.2.3  08-Jan-2002  nathanw Catch up to -current.
 1.8.2.2  15-Nov-2001  thorpej Machine-dependent kernel mods for scheduler activations on
32-bit ARM processors. Kernel boots multi-user on an XScale,
but upcalls not yet tested.
 1.8.2.1  09-Nov-2001  thorpej file db_interface.c was added on branch nathanw_sa on 2001-11-15 06:39:21 +0000
 1.21.2.1  30-Aug-2002  gehenna catch up with -current.
 1.30.2.5  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.30.2.4  21-Sep-2004  skrll Fix the sync with head I botched.
 1.30.2.3  18-Sep-2004  skrll Sync with HEAD.
 1.30.2.2  12-Aug-2004  skrll Sync with HEAD.
 1.30.2.1  03-Aug-2004  skrll Sync with HEAD
 1.37.2.3  27-Oct-2007  yamt sync with head.
 1.37.2.2  26-Feb-2007  yamt sync with head.
 1.37.2.1  21-Jun-2006  yamt sync with head.
 1.39.12.1  24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.39.10.1  19-Apr-2006  elad sync with head - hopefully this will work
 1.39.8.1  11-Apr-2006  yamt sync with head
 1.39.6.1  22-Apr-2006  simonb Sync with head.
 1.39.4.1  09-Sep-2006  rpaulo sync with head
 1.40.8.1  12-Jan-2007  ad Sync with head.
 1.41.2.1  27-Feb-2007  yamt - sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
 1.42.24.1  06-Nov-2007  matt sync with HEAD
 1.42.22.1  01-Jan-2008  chris Sync with HEAD.
 1.42.20.1  02-Oct-2007  joerg Sync with HEAD.
 1.42.18.1  06-Oct-2007  rjs Sync with HEAD.
 1.42.12.1  03-Oct-2007  garbled Sync with HEAD
 1.42.4.1  09-Oct-2007  ad Sync with head.
 1.44.16.1  03-Apr-2008  mjf Sync with HEAD.
 1.45.22.1  15-Feb-2014  matt Merge armv7 support from HEAD, specifically support for the BCM5301X
and BCM56340 evbarm kernels.
 1.45.18.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.45.12.1  28-Apr-2009  skrll Sync with HEAD.
 1.45.4.2  11-Aug-2010  yamt sync with head.
 1.45.4.1  04-May-2009  yamt sync with head.
 1.47.4.1  03-Jul-2010  rmind sync with head
 1.47.2.1  17-Aug-2010  uebayasi Sync with HEAD.
 1.48.16.1  28-Nov-2012  matt Merge improved arm support (especially Cortex) from HEAD
including OMAP and BCM53xx support.
 1.48.12.1  18-Feb-2012  mrg merge to -current.
 1.48.8.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.48.8.1  17-Apr-2012  yamt sync with head
 1.49.4.1  18-May-2014  rmind sync with head
 1.49.2.2  03-Dec-2017  jdolecek update from HEAD
 1.49.2.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.52.4.1  09-Nov-2014  martin Pull up following revision(s) (requested by skrll in ticket #188):
sys/arch/arm/include/arm32/pmap.h: revision 1.136
sys/arch/arm/include/armreg.h: revision 1.100
sys/arch/arm/cortex/gic.c: revision 1.11
sys/arch/arm/arm32/db_interface.c: revision 1.54
sys/arch/arm/include/armreg.h: revision 1.101
sys/arch/arm/cortex/gic.c: revision 1.12
sys/arch/arm/arm32/arm32_machdep.c: revision 1.107
sys/arch/arm/arm/cpufunc_asm_armv7.S: revision 1.19
sys/arch/arm/cortex/a9_mpsubr.S: revision 1.20
sys/arch/evbarm/conf/BPI: revision 1.5
sys/arch/arm/cortex/a9_mpsubr.S: revision 1.21
sys/arch/arm/arm32/pmap.c: revision 1.306
sys/arch/arm/arm32/db_machdep.c: revision 1.22
sys/arch/arm/arm32/arm32_tlb.c: revision 1.3
sys/arch/arm/arm/undefined.c: revision 1.55
sys/arch/arm/cortex/a9_mpsubr.S: revision 1.22
sys/arch/arm/arm32/pmap.c: revision 1.307
sys/arch/arm/arm32/arm32_tlb.c: revision 1.4
sys/arch/arm/cortex/a9_mpsubr.S: revision 1.23
sys/arch/arm/arm32/arm32_tlb.c: revision 1.5
sys/arch/evbarm/conf/BPI: revision 1.8
sys/arch/arm/cortex/a9_mpsubr.S: revision 1.24
sys/arch/arm/arm32/arm32_tlb.c: revision 1.6
sys/arch/arm/arm32/arm32_tlb.c: revision 1.7
sys/arch/evbarm/conf/CUBIETRUCK: revision 1.5
sys/arch/arm/pic/pic.c: revision 1.23
sys/arch/arm/pic/pic.c: revision 1.24
sys/arch/arm/pic/picvar.h: revision 1.11
sys/arch/arm/arm/cpufunc_asm_armv7.S: revision 1.20
sys/arch/arm/mainbus/cpu_mainbus.c: revision 1.16
sys/arch/arm/arm32/pmap.c: revision 1.298
sys/arch/arm/arm/cpufunc_asm_arm11.S: revision 1.17
sys/arch/arm/arm/cpufunc_asm_pj4b.S: revision 1.5
sys/arch/arm/arm32/pmap.c: revision 1.310
sys/arch/arm/arm32/pmap.c: revision 1.311
sys/arch/arm/arm32/arm32_kvminit.c: revision 1.32
sys/arch/arm/cortex/a9_mpsubr.S: revision 1.19
sys/arch/arm/arm32/arm32_boot.c: revision 1.10
sys/arch/arm/arm/ast.c: revision 1.25
sys/arch/arm/include/armreg.h: revision 1.98
sys/uvm/pmap/pmap_tlb.c: revision 1.10
sys/arch/arm/arm32/arm32_boot.c: revision 1.8
sys/arch/arm/arm32/arm32_boot.c: revision 1.9
sys/arch/arm/arm/arm_machdep.c: revision 1.43
Various ARM MP fixes.
 1.54.2.1  28-Aug-2017  skrll Sync with HEAD
 1.57.2.1  25-Jun-2018  pgoyette Sync with HEAD
 1.58.2.1  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.61.2.1  14-Dec-2020  thorpej Sync w/ HEAD.

RSS XML Feed